body {
  margin: 0;
  font-family: sans-serif;
  background:
    linear-gradient(180deg, rgba(4, 9, 16, 0.9) 0%, rgba(5, 11, 21, 0.92) 100%);
  color: #e8f0ff;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 10, 18, 0.84) 0%, rgba(7, 14, 27, 0.88) 100%),
    radial-gradient(circle at top, rgba(35, 76, 133, 0.14), transparent 34%),
    url("/images/faterix-bg-v2.png") center center / cover no-repeat;
  opacity: 1;
  z-index: -2;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 12, 22, 0.08) 0%, rgba(6, 12, 22, 0.22) 100%);
  z-index: -1;
  pointer-events: none;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
}

.narrow {
  max-width: 720px;
}

.card {
  background: rgba(11, 20, 36, 0.92);
  border: 1px solid rgba(110, 156, 219, 0.18);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  padding: 16px;
  margin: 16px 0;
  border-radius: 14px;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status-badge.online {
  color: #9cffc8;
  background: rgba(34, 161, 89, 0.16);
  border: 1px solid rgba(73, 255, 155, 0.36);
  text-shadow: 0 0 10px rgba(73, 255, 155, 0.28);
}

.status-badge.offline {
  color: #ff9f9f;
  background: rgba(161, 34, 34, 0.16);
  border: 1px solid rgba(255, 97, 97, 0.36);
}

.status-divider {
  color: rgba(155, 177, 208, 0.55);
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.live-dino-panel {
  position: relative;
  width: 500px;
  min-width: 500px;
  max-width: 500px;
  height: 350px;
  min-height: 350px;
  max-height: 350px;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(11, 22, 40, 0.96) 0%, rgba(8, 17, 31, 0.94) 100%);
  border: 1px solid rgba(110, 156, 219, 0.18);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  overflow: hidden;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
}

.live-dino-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 15, 28, 0.7) 0%, rgba(7, 15, 28, 0.88) 100%),
    var(--species-art, none) center center / cover no-repeat;
  opacity: 1;
  pointer-events: none;
  z-index: 0;
}

.live-dino-panel > * {
  position: relative;
  z-index: 1;
}

.live-dino-panel.hidden {
  display: none;
}

.live-dino-content {
  min-width: 0;
  display: grid;
  gap: 14px;
  align-content: start;
}

.live-dino-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.live-dino-head > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.live-dino-species {
  font-size: clamp(1rem, 1.45vw, 1.7rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #eef5ff;
  text-transform: uppercase;
  line-height: 1.03;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.live-dino-growth {
  margin-top: 1px;
  color: #9fb6d8;
  font-size: 1rem;
}

.live-dino-bars {
  display: grid;
  gap: 12px;
}

.live-dino-bar-block {
  display: grid;
  gap: 6px;
}

.live-dino-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 1rem;
  color: #c6d8f1;
}

.live-dino-bar-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
}

.live-dino-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 220ms ease;
}

.live-dino-bar-fill.health {
  background: linear-gradient(90deg, rgba(255, 94, 94, 0.92) 0%, rgba(255, 146, 110, 0.95) 100%);
}

.live-dino-bar-fill.stamina {
  background: linear-gradient(90deg, rgba(86, 189, 255, 0.9) 0%, rgba(133, 225, 255, 0.95) 100%);
}

.live-dino-bar-fill.hunger {
  background: linear-gradient(90deg, rgba(255, 182, 64, 0.9) 0%, rgba(255, 225, 130, 0.95) 100%);
}

.live-dino-bar-fill.thirst {
  background: linear-gradient(90deg, rgba(89, 204, 255, 0.9) 0%, rgba(90, 255, 216, 0.95) 100%);
}

.live-dino-macros {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.live-dino-macros-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 0;
  flex: 0 0 auto;
  max-width: 46%;
}

.macro-ring-card {
  display: flex;
  justify-content: center;
}

.macro-ring {
  --macro-angle: 0deg;
  --macro-color: rgba(124, 179, 255, 0.92);
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(10, 20, 35, 1) 58%, transparent 59%),
    conic-gradient(var(--macro-color) 0deg, var(--macro-color) var(--macro-angle), rgba(255,255,255,0.08) var(--macro-angle), rgba(255,255,255,0.08) 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.live-dino-macro-buy {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.live-dino-macro-buy:hover,
.live-dino-macro-buy:focus-visible {
  transform: translateY(-2px) scale(1.04);
  filter: brightness(1.08);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.1),
    0 0 18px color-mix(in srgb, var(--macro-color) 32%, transparent);
}

.live-dino-macro-buy:focus-visible {
  outline: 2px solid rgba(255, 230, 168, 0.75);
  outline-offset: 2px;
}

.macro-ring-inner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(8, 18, 33, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  text-align: center;
}

.macro-ring-name {
  font-size: 1rem;
  line-height: 1;
  color: #bffcff;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  text-shadow:
    0 0 6px rgba(95, 244, 255, 0.85),
    0 0 14px rgba(95, 244, 255, 0.45);
}

.macro-ring-value {
  margin-top: 1px;
  font-size: 0.9rem;
  color: #eef5ff;
  font-weight: 700;
}

.top-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.top-nav-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  --live-dino-indent: 46px;
}

.top-nav-main,
.top-nav-secondary {
  justify-content: flex-end;
}

.top-nav-secondary {
  width: 100%;
  justify-content: space-between;
  align-items: flex-start;
}

.top-nav-secondary-left,
.top-nav-secondary-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
}

.top-nav-secondary-left {
  margin-left: var(--live-dino-indent, 46px);
  align-items: flex-start;
}

.top-nav-secondary-right {
  justify-content: flex-end;
  align-items: flex-start;
}

.top-nav-stack {
  gap: 6px;
}

.live-dino-status-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.live-dino-status-dot.online {
  background: #2ee181;
  box-shadow: 0 0 0 3px rgba(46, 225, 129, 0.16), 0 0 14px rgba(46, 225, 129, 0.28);
}

.live-dino-status-dot.offline {
  background: #ff5877;
  box-shadow: 0 0 0 3px rgba(255, 88, 119, 0.14), 0 0 14px rgba(255, 88, 119, 0.22);
}

.active-admins-panel {
  width: min(360px, calc(100vw - 80px));
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(110, 156, 219, 0.22);
  background: linear-gradient(180deg, rgba(9, 21, 39, 0.98) 0%, rgba(7, 15, 29, 0.96) 100%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
  z-index: 20;
}

.active-admins-panel.hidden {
  display: none;
}

.active-admins-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.active-admins-panel-head strong {
  font-size: 0.88rem;
  color: #eef5ff;
}

.active-admins-list {
  display: grid;
  gap: 8px;
}

.active-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(13, 27, 48, 0.82);
  border: 1px solid rgba(110, 156, 219, 0.12);
}

.active-admin-name {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #eef5ff;
  font-weight: 700;
  min-width: 0;
}

.active-admin-name-text {
  min-width: 0;
  white-space: nowrap;
}

.active-admin-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.active-admin-dot.online {
  background: #2ee181;
  box-shadow: 0 0 0 3px rgba(46, 225, 129, 0.16), 0 0 14px rgba(46, 225, 129, 0.28);
}

.active-admin-dot.offline {
  background: #ff5877;
  box-shadow: 0 0 0 3px rgba(255, 88, 119, 0.14), 0 0 14px rgba(255, 88, 119, 0.22);
}

.active-admin-state {
  color: #c9d8ef;
  font-size: 0.76rem;
  font-weight: 600;
}

.active-admin-meters {
  display: grid;
  gap: 5px;
}

.active-admin-meter-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.68rem;
  color: #a8bddc;
}

.active-admin-meter-track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.active-admin-meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(89, 173, 255, 0.78) 0%, rgba(135, 220, 180, 0.88) 100%);
}

.active-admin-empty {
  padding: 18px 14px;
  border-radius: 12px;
  text-align: center;
  color: #97aed1;
  background: rgba(13, 27, 48, 0.62);
  border: 1px dashed rgba(110, 156, 219, 0.18);
}

header.row.between {
  align-items: flex-start;
  gap: 18px;
}

header.row.between > div:first-child {
  flex: 0 0 250px;
  min-width: 220px;
}

@media (max-width: 1220px) {
  .live-dino-panel {
    max-width: 310px;
  }
}

h1 {
  margin: 0 0 14px;
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.wrap {
  flex-wrap: wrap;
}

.between {
  justify-content: space-between;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

.casino-card {
  background:
    linear-gradient(180deg, rgba(28, 31, 36, 0.78) 0%, rgba(12, 14, 18, 0.88) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat;
  border: 1px solid rgba(198, 145, 72, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 219, 164, 0.08),
    0 18px 50px rgba(0, 0, 0, 0.34);
}

.casino-subtitle {
  margin-top: 6px;
}

.casino-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.casino-balance-plaque {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  color: #ffe0a2;
  font-weight: 700;
  background:
    linear-gradient(180deg, rgba(41, 44, 50, 0.92) 0%, rgba(16, 18, 22, 0.96) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat;
  border: 1px solid rgba(203, 154, 85, 0.44);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.casino-game-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin: 30px auto;
  max-width: 800px;
}

.casino-game-btn {
  width: 220px;
  padding: 25px;
  border-radius: 15px;
  cursor: pointer;
  text-align: center;
  color: #eadfcf;
  background:
    linear-gradient(145deg, rgba(40, 43, 49, 0.98), rgba(15, 17, 21, 0.98)),
    url("/images/nest-wood-texture.png") center center / cover no-repeat;
  border: 2px solid rgba(255, 215, 126, 0.52);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
}

.casino-game-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 34px rgba(255, 195, 81, 0.22);
  border-color: rgba(255, 167, 59, 0.8);
}

.casino-game-icon {
  font-size: 3em;
  margin-bottom: 10px;
}

.casino-game-name {
  font-size: 1.3em;
  font-weight: bold;
  color: #ffd78d;
  margin-bottom: 8px;
}

.casino-game-desc {
  font-size: 0.85em;
  color: #b9aa90;
}

.casino-game-container.hidden {
  display: none;
}

.back-to-casino-btn {
  background: transparent;
  border: 1px solid rgba(255, 215, 126, 0.7);
  color: #ffd78d;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 20px;
  font-size: 0.9em;
}

.back-to-casino-btn:hover {
  background: rgba(255, 215, 0, 0.08);
}

.casino-machine-shell {
  display: flex;
  justify-content: center;
}

.casino-machine {
  width: min(100%, 860px);
  padding: 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 189, 79, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(31, 34, 39, 0.98) 0%, rgba(11, 13, 17, 0.98) 100%);
  border: 2px solid rgba(206, 154, 81, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(255, 221, 164, 0.06),
    0 28px 60px rgba(0, 0, 0, 0.36);
}

.casino-machine-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}

.casino-machine-title {
  font-size: 1.7rem;
  font-weight: 900;
  color: #ffdd9b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.casino-machine-subtitle {
  color: rgba(255, 215, 143, 0.7);
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.slot-reels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 20px 0 24px;
}

.slot-window {
  height: 174px;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(10, 12, 15, 0.98) 0%, rgba(22, 25, 30, 0.98) 100%);
  border: 2px solid rgba(206, 154, 81, 0.56);
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 170, 0.05),
    inset 0 14px 20px rgba(255, 196, 94, 0.05),
    0 14px 28px rgba(0, 0, 0, 0.28);
  position: relative;
}

.slot-window::before,
.slot-window::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 24px;
  z-index: 2;
  pointer-events: none;
}

.slot-window::before {
  top: 0;
  background: linear-gradient(180deg, rgba(11, 6, 3, 0.96) 0%, rgba(11, 6, 3, 0) 100%);
}

.slot-window::after {
  bottom: 0;
  background: linear-gradient(180deg, rgba(11, 6, 3, 0) 0%, rgba(11, 6, 3, 0.96) 100%);
}

.reel {
  display: grid;
  gap: 10px;
  padding: 10px;
  transition: transform 0.3s ease-out;
  will-change: transform;
}

.reel.spinning {
  animation: reelSpin 0.25s linear infinite;
}

.reel-symbol {
  min-height: 154px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(42, 45, 50, 0.82) 0%, rgba(16, 18, 22, 0.88) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat;
  border: 1px solid rgba(209, 156, 83, 0.22);
}

.reel-symbol img {
  width: 94px;
  height: 94px;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.34));
}

.reel-symbol span {
  color: #f4e2bf;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.casino-controls {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.casino-bet-label {
  display: grid;
  gap: 6px;
  color: #f0ddbb;
  font-weight: 700;
}

#betAmount {
  width: 180px;
  margin: 0;
}

.casino-payouts {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.casino-payouts > div {
  padding: 8px 12px;
  border-radius: 999px;
  color: #ecd7b1;
  background: rgba(34, 37, 42, 0.68);
  border: 1px solid rgba(202, 150, 80, 0.24);
  font-size: 0.9rem;
}

.spin-result {
  margin-top: 18px;
  min-height: 28px;
  text-align: center;
  color: #e9d3ae;
  font-size: 1rem;
  font-weight: 700;
}

.spin-result.win {
  color: #ffd975;
  text-shadow: 0 0 18px rgba(255, 214, 84, 0.35);
}

.spin-result.loss {
  color: #ffb1a5;
}

.win-glow {
  animation: winPulse 0.6s ease-in-out 3;
}

@keyframes reelSpin {
  0% { transform: translateY(0); }
  100% { transform: translateY(-164px); }
}

@keyframes winPulse {
  0% { box-shadow: inset 0 0 0 1px rgba(255, 221, 164, 0.06), 0 28px 60px rgba(0, 0, 0, 0.36); }
  50% { box-shadow: inset 0 0 0 1px rgba(255, 221, 164, 0.14), 0 0 40px rgba(255, 204, 82, 0.34), 0 28px 60px rgba(0, 0, 0, 0.36); }
  100% { box-shadow: inset 0 0 0 1px rgba(255, 221, 164, 0.06), 0 28px 60px rgba(0, 0, 0, 0.36); }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.chat-wall {
  margin-top: 14px;
  min-height: 420px;
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(10, 19, 34, 0.98) 0%, rgba(7, 14, 27, 0.95) 100%);
  border: 1px solid rgba(110, 156, 219, 0.15);
}

.chat-empty {
  color: #9bb1d0;
  text-align: center;
  padding: 28px 16px;
}

.chat-message {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(16, 30, 53, 0.88);
  border: 1px solid rgba(110, 156, 219, 0.16);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
}

.chat-message.own {
  background: rgba(16, 47, 77, 0.92);
  border-color: rgba(88, 177, 255, 0.28);
}

.chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.chat-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-name {
  color: #eef5ff;
}

.chat-role {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.chat-role.member {
  color: #cfe0ff;
  background: rgba(110, 156, 219, 0.16);
  border: 1px solid rgba(110, 156, 219, 0.24);
}

.chat-role.admin {
  color: #ffe49a;
  background: rgba(191, 140, 20, 0.24);
  border: 1px solid rgba(255, 214, 110, 0.34);
}

.chat-time {
  color: #8ea7cb;
  font-size: 0.82rem;
  white-space: nowrap;
}

.chat-text {
  color: #e8f0ff;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-form {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(10, 19, 34, 0.85);
  border: 1px solid rgba(110, 156, 219, 0.15);
}

.chat-form textarea {
  max-width: none;
  min-height: 88px;
  resize: vertical;
}

.chat-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  background: rgba(7, 15, 28, 0.9);
}

th, td {
  border: 1px solid rgba(116, 145, 182, 0.16);
  padding: 8px;
  text-align: left;
}

th {
  background: rgba(22, 39, 69, 0.95);
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #12345f 0%, #0d2748 100%);
  color: #eef5ff;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  border-radius: 10px;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button:hover, .button:hover {
  background: linear-gradient(180deg, #17457f 0%, #12345f 100%);
}

.top-nav button {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(110, 156, 219, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-size: 0.96rem;
}

.button.disabled,
.button[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

input, select {
  width: 100%;
  max-width: 420px;
  padding: 8px;
  margin: 4px 0 12px;
  border: 1px solid rgba(116, 145, 182, 0.3);
  background: #091423;
  color: #eef5ff;
  border-radius: 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 14px;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  max-width: none;
  margin: 0;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(5, 10, 19, 0.95);
  border: 1px solid rgba(116, 145, 182, 0.18);
  padding: 12px;
  color: #c8dcff;
  border-radius: 10px;
}

#map-box {
  min-height: 120px;
  border: 1px dashed rgba(116, 145, 182, 0.35);
  padding: 12px;
  border-radius: 12px;
  background: rgba(7, 15, 28, 0.72);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.map-canvas-shell {
  background: rgba(7, 15, 28, 0.86);
  border: 1px solid rgba(110, 156, 219, 0.18);
  border-radius: 16px;
  padding: 12px;
}

.map-toolbar {
  margin-bottom: 10px;
}

#heatmapCanvas {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 1 / 1;
  display: block;
  border-radius: 12px;
  background: #040a12;
}

.map-legend {
  margin: 0;
}

.calibration-output {
  margin-top: 14px;
  min-height: 220px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

.legend-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  box-shadow: 0 0 18px currentColor;
  flex: 0 0 auto;
}

.legend-dot.red {
  background: rgba(255, 72, 72, 0.95);
  color: rgba(255, 72, 72, 0.95);
}

.legend-dot.green {
  background: rgba(76, 255, 133, 0.95);
  color: rgba(76, 255, 133, 0.95);
}

.legend-dot.blue {
  background: rgba(77, 163, 255, 0.95);
  color: rgba(77, 163, 255, 0.95);
}

.legend-dot.white {
  background: rgba(255, 255, 255, 0.95);
  color: rgba(255, 255, 255, 0.95);
}

.legend-gps-dot {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.legend-gps-dot::before,
.legend-gps-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
}

.legend-gps-dot::before {
  transform: scale(1.75);
  opacity: 0.22;
}

.legend-gps-dot::after {
  inset: 4px;
  background: rgba(255, 235, 235, 0.95);
  box-shadow: 0 0 8px rgba(255, 235, 235, 0.45);
}

.legend-gps-dot.you {
  background: rgba(255, 44, 44, 0.95);
  box-shadow: 0 0 16px rgba(255, 44, 44, 0.5);
}

.legend-gps-dot.you::before {
  background: rgba(255, 44, 44, 0.35);
}

.legend-gps-dot.group {
  background: rgba(92, 255, 146, 0.55);
  box-shadow: 0 0 12px rgba(92, 255, 146, 0.2);
}

.legend-gps-dot.group::before {
  background: rgba(92, 255, 146, 0.18);
}

.gps-preview {
  opacity: 0.62;
}

.gps-preview em {
  color: #8ebf97;
  font-style: normal;
}

a {
  color: #9ec5ff;
}

.muted {
  color: #9bb1d0;
}

.coin-line {
  margin: 6px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.coin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.12em;
  background: center / contain no-repeat url("/images/coin-icon.svg");
  filter: drop-shadow(0 1px 2px rgba(12, 12, 16, 0.45));
}

.coin-icon::before {
  content: none;
}

.coin-icon::after {
  content: none;
}

.bone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.12em;
}

.bone-icon::before {
  content: "\01F9B4";
  font-size: 1em;
  line-height: 1;
}

#coinDisplay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(164, 124, 20, 0.18);
  border: 1px solid rgba(255, 209, 92, 0.28);
  color: #ffe38f;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(255, 214, 102, 0.2);
}

#boneDisplay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(126, 101, 67, 0.18);
  border: 1px solid rgba(219, 191, 152, 0.25);
  color: #e8d7bd;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(214, 194, 160, 0.14);
}

.currency-divider {
  color: rgba(155, 177, 208, 0.45);
}

.admin-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(116, 145, 182, 0.16);
}

.hidden {
  display: none !important;
}

.storage-header {
  align-items: flex-start;
}

.storage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.storage-card {
  position: relative;
  background: rgba(16, 28, 49, 0.95);
  border: 1px solid rgba(110, 156, 219, 0.22);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  isolation: isolate;
}

.storage-card.tier-common,
.market-card.tier-common {
  border-width: 3px;
  border-color: rgba(192, 198, 210, 0.46);
  box-shadow:
    inset 0 0 0 1px rgba(235, 239, 247, 0.05),
    0 0 0 1px rgba(192, 198, 210, 0.16),
    0 0 14px rgba(192, 198, 210, 0.16);
}

.storage-card.tier-uncommon,
.market-card.tier-uncommon {
  border-width: 3px;
  border-color: rgba(92, 205, 116, 0.56);
  box-shadow:
    inset 0 0 0 1px rgba(214, 255, 222, 0.05),
    0 0 0 1px rgba(92, 205, 116, 0.18),
    0 0 16px rgba(92, 205, 116, 0.18);
}

.storage-card.tier-rare,
.market-card.tier-rare {
  border-width: 3px;
  border-color: rgba(78, 146, 255, 0.6);
  box-shadow:
    inset 0 0 0 1px rgba(215, 230, 255, 0.05),
    0 0 0 1px rgba(78, 146, 255, 0.2),
    0 0 18px rgba(78, 146, 255, 0.22);
}

.storage-card.tier-epic,
.market-card.tier-epic {
  border-width: 4px;
  border-color: rgba(176, 93, 255, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(208, 164, 255, 0.08),
    0 0 0 1px rgba(176, 93, 255, 0.18),
    0 0 24px rgba(176, 93, 255, 0.26);
}

.storage-card.tier-legendary,
.market-card.tier-legendary {
  border-width: 4px;
  border-color: rgba(245, 188, 74, 0.8);
  box-shadow:
    inset 0 0 0 1px rgba(255, 232, 170, 0.1),
    0 0 0 1px rgba(245, 188, 74, 0.2),
    0 0 26px rgba(245, 188, 74, 0.3);
}

.storage-card.tier-artifact,
.market-card.tier-artifact {
  border-width: 4px;
  border-color: rgba(242, 83, 83, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 205, 205, 0.12),
    0 0 0 1px rgba(242, 83, 83, 0.26),
    0 0 30px rgba(242, 83, 83, 0.34);
}

.storage-card.has-species-art::before,
.market-card.has-species-art::before,
.store-card.has-species-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 18, 33, 0.22), rgba(11, 18, 33, 0.62)),
    var(--species-art) center center / 100% 100% no-repeat;
  opacity: 0.3;
  filter: saturate(1) contrast(1.03);
  pointer-events: none;
  z-index: -1;
}

.storage-card.invalid {
  border-color: rgba(214, 91, 91, 0.45);
}

.storage-card h3 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.storage-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.storage-slot,
.storage-age {
  color: #9bb1d0;
  font-size: 0.92rem;
}

.storage-dino-age {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  margin: 10px 0 6px;
  padding: 7px 12px;
  width: fit-content;
  max-width: max-content;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(14, 9, 6, 0.16) 0%, rgba(14, 9, 6, 0.28) 100%),
    url("/images/age-badge-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(66, 47, 29, 0.96) 0%, rgba(30, 20, 13, 0.97) 100%);
  border: 1px solid rgba(181, 136, 81, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 154, 0.04),
    0 10px 24px rgba(0, 0, 0, 0.18);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.92),
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 6px rgba(0, 0, 0, 0.42);
}

.dino-nametag-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
  margin: 10px 0 6px;
  max-width: 100%;
}

.dino-nametag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  width: fit-content;
  max-width: 100%;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(14, 9, 6, 0.1) 0%, rgba(14, 9, 6, 0.22) 100%),
    url("/images/nametag-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(39, 28, 19, 0.98) 0%, rgba(18, 12, 8, 0.98) 100%);
  border: 1px solid rgba(173, 173, 173, 0.35);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.04),
    0 14px 32px rgba(0, 0, 0, 0.24);
  position: relative;
  overflow: hidden;
}

.dino-nametag span {
  color: #f7f7f7;
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  word-break: break-word;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.95),
    0 2px 4px rgba(0, 0, 0, 0.75);
}

.legendary-age-icon {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(245, 188, 74, 0.58);
  box-shadow:
    0 0 18px rgba(245, 188, 74, 0.38),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  background: rgba(15, 10, 6, 0.74);
}

.artifact-age-icon {
  border-color: rgba(242, 83, 83, 0.62);
  box-shadow:
    0 0 18px rgba(242, 83, 83, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.epic-age-icon {
  border-color: rgba(176, 93, 255, 0.62);
  box-shadow:
    0 0 18px rgba(176, 93, 255, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.storage-nametag,
.market-nametag {
  width: fit-content;
}

.tier-common {
  border-color: rgba(192, 198, 210, 0.48);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 0 0 1px rgba(182, 190, 205, 0.14),
    0 0 14px rgba(192, 198, 210, 0.14);
}

.tier-uncommon {
  border-color: rgba(92, 205, 116, 0.54);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 0 0 1px rgba(92, 205, 116, 0.16),
    0 0 16px rgba(92, 205, 116, 0.24);
}

.tier-rare {
  border-color: rgba(78, 146, 255, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 0 0 1px rgba(78, 146, 255, 0.16),
    0 0 16px rgba(78, 146, 255, 0.24);
}

.tier-epic {
  border-color: rgba(176, 93, 255, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 0 0 1px rgba(176, 93, 255, 0.22),
    0 0 22px rgba(176, 93, 255, 0.42),
    0 0 34px rgba(112, 39, 193, 0.24);
}

.tier-legendary {
  border-color: rgba(245, 188, 74, 0.64);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.04),
    0 0 0 1px rgba(245, 188, 74, 0.22),
    0 0 24px rgba(245, 188, 74, 0.46),
    0 0 38px rgba(186, 122, 21, 0.28);
}

.tier-artifact {
  border-color: rgba(242, 83, 83, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.05),
    0 0 0 1px rgba(242, 83, 83, 0.26),
    0 0 28px rgba(242, 83, 83, 0.54),
    0 0 44px rgba(143, 17, 17, 0.34);
}

.dino-nametag.tier-epic::before,
.dino-nametag.tier-legendary::before,
.dino-nametag.tier-artifact::before,
.storage-dino-age.tier-epic::before,
.storage-dino-age.tier-legendary::before,
.storage-dino-age.tier-artifact::before,
.market-age-badge.tier-epic::before,
.market-age-badge.tier-legendary::before,
.market-age-badge.tier-artifact::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.9;
}

.dino-nametag.tier-epic::before,
.storage-dino-age.tier-epic::before,
.market-age-badge.tier-epic::before {
  border: 1px solid rgba(210, 162, 255, 0.34);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
}

.dino-nametag.tier-legendary::before,
.storage-dino-age.tier-legendary::before,
.market-age-badge.tier-legendary::before {
  border: 1px solid rgba(255, 224, 140, 0.42);
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 14px), 0 14px);
  box-shadow: inset 0 0 16px rgba(255, 205, 96, 0.14);
}

.dino-nametag.tier-artifact::before,
.storage-dino-age.tier-artifact::before,
.market-age-badge.tier-artifact::before {
  border: 1px solid rgba(255, 164, 164, 0.46);
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
  box-shadow: inset 0 0 18px rgba(255, 75, 75, 0.16);
}

.dino-nametag.tier-epic::after,
.dino-nametag.tier-legendary::after,
.dino-nametag.tier-artifact::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 5px;
  height: 2px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.9;
}

.dino-nametag.tier-epic::after {
  background: linear-gradient(90deg, transparent, rgba(212, 155, 255, 0.74), transparent);
}

.dino-nametag.tier-legendary::after {
  background: linear-gradient(90deg, transparent, rgba(255, 220, 120, 0.86), transparent);
}

.dino-nametag.tier-artifact::after {
  background: linear-gradient(90deg, transparent, rgba(255, 118, 118, 0.88), transparent);
}

.storage-flags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.storage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.storage-badge.prime {
  color: #ffe49a;
  background: rgba(191, 140, 20, 0.24);
  border: 1px solid rgba(255, 214, 110, 0.34);
}

.storage-badge.standard {
  color: #cfe0ff;
  background: rgba(110, 156, 219, 0.16);
  border: 1px solid rgba(110, 156, 219, 0.24);
}

.storage-badge.mutations {
  color: #8fe8ff;
  background: rgba(27, 98, 122, 0.22);
  border: 1px solid rgba(89, 197, 230, 0.28);
}

.storage-mutation-badge {
  position: relative;
  cursor: help;
}

.storage-mutation-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  min-width: 180px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(14, 9, 6, 0.12) 0%, rgba(14, 9, 6, 0.24) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(53, 37, 23, 0.98) 0%, rgba(22, 15, 10, 0.99) 100%);
  border: 1px solid rgba(181, 136, 81, 0.28);
  color: #f1e0c0;
  font-size: 0.76rem;
  line-height: 1.4;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 25;
  pointer-events: none;
  white-space: normal;
}

.storage-mutation-tooltip-line {
  display: block;
}

.storage-mutation-badge:hover .storage-mutation-tooltip,
.storage-mutation-badge:focus .storage-mutation-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.storage-badge.market-active {
  color: #ffd98b;
  background: rgba(175, 111, 17, 0.24);
  border: 1px solid rgba(255, 194, 92, 0.34);
}

.storage-badge.market-expired {
  color: #ffb7b7;
  background: rgba(140, 44, 44, 0.24);
  border: 1px solid rgba(255, 119, 119, 0.34);
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.store-subnav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 14px;
}

.store-subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(110, 156, 219, 0.22);
  background: rgba(16, 28, 49, 0.88);
  color: #dbe8f9;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.store-subnav-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(145, 185, 238, 0.4);
}

.store-subnav-btn.active {
  background: linear-gradient(180deg, rgba(28, 70, 128, 0.96), rgba(18, 48, 92, 0.96));
  border-color: rgba(145, 185, 238, 0.55);
  box-shadow: 0 10px 24px rgba(10, 28, 54, 0.28);
}

.store-subnav-icon {
  font-size: 1.05rem;
}

.macro-subnav-icon {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  align-items: center;
  min-width: 44px;
  padding: 4px 6px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(90, 59, 29, 0.9) 0%, rgba(48, 29, 14, 0.92) 100%);
  border: 1px solid rgba(202, 160, 99, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(255, 228, 178, 0.06),
    0 4px 10px rgba(0, 0, 0, 0.12);
}

.macro-subnav-icon span {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  height: 20px;
  border-radius: 6px;
  background: rgba(30, 18, 10, 0.48);
  border: 1px solid rgba(214, 176, 112, 0.14);
  color: #f6dfb5;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 0 6px rgba(255, 214, 133, 0.16),
    0 1px 0 rgba(35, 20, 8, 0.7);
}

.store-mode-panel.hidden {
  display: none;
}

.store-mode-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.store-mode-header h3 {
  margin: 0 0 6px;
}

.coin-store-subnav {
  margin-top: 16px;
  margin-bottom: 14px;
}

.coin-store-panel {
  margin-top: 0;
}

.coin-utility-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.macro-pack-store-card .featured-nametag-icon {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 239, 186, 0.18) 0%, rgba(255, 239, 186, 0) 42%),
    linear-gradient(180deg, rgba(102, 68, 31, 0.98) 0%, rgba(55, 34, 16, 0.98) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 233, 193, 0.12),
    inset 0 14px 20px rgba(255, 213, 128, 0.08),
    0 12px 26px rgba(0, 0, 0, 0.18);
}

.macro-pack-store-card .featured-nametag-icon::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 13px;
  border: 1px solid rgba(255, 219, 156, 0.14);
  pointer-events: none;
}

.macro-pack-glyphs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  align-items: center;
}

.macro-pack-glyphs span {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 28px;
  border-radius: 10px;
  background: rgba(29, 18, 10, 0.52);
  border: 1px solid rgba(214, 176, 112, 0.2);
  color: #f6dfb5;
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 0 8px rgba(255, 214, 133, 0.18),
    0 1px 0 rgba(35, 20, 8, 0.75);
}

.store-card {
  position: relative;
  background: rgba(16, 28, 49, 0.95);
  border: 1px solid rgba(110, 156, 219, 0.22);
  border-radius: 16px;
  padding: 16px;
  overflow: hidden;
  isolation: isolate;
}

.nametag-store-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.featured-nametag-card {
  min-height: 260px;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(49, 32, 17, 0.96) 0%, rgba(24, 16, 10, 0.97) 100%);
  border-color: rgba(193, 147, 88, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(244, 213, 152, 0.08),
    0 20px 42px rgba(0, 0, 0, 0.24);
}

.featured-nametag-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.featured-nametag-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  color: #f5ddb5;
  background:
    linear-gradient(180deg, rgba(118, 78, 37, 0.98) 0%, rgba(73, 45, 20, 0.98) 100%);
  border: 1px solid rgba(189, 145, 87, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 233, 193, 0.1);
}

.featured-nametag-subtitle {
  margin: 4px 0 0;
  color: #d8c2a0;
}

.featured-nametag-price {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(126, 101, 67, 0.18);
  border: 1px solid rgba(219, 191, 152, 0.25);
  color: #f1e0c0;
  font-weight: 800;
}

.featured-nametag-button {
  align-self: flex-start;
  background: linear-gradient(180deg, rgba(118, 78, 37, 0.98) 0%, rgba(73, 45, 20, 0.98) 100%);
  border-color: rgba(189, 145, 87, 0.4);
  color: #f7e5c5;
}

.nametag-store-card h3,
.nametag-store-card h4 {
  margin: 0;
}

.nametag-button {
  background: linear-gradient(180deg, rgba(118, 78, 37, 0.98) 0%, rgba(73, 45, 20, 0.98) 100%);
  border-color: rgba(189, 145, 87, 0.4);
  color: #f7e5c5;
}

.store-card h3 {
  margin-top: 0;
}

.crate-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(110, 156, 219, 0.16);
}

.crate-section-standalone {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.crate-balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(126, 101, 67, 0.18);
  border: 1px solid rgba(219, 191, 152, 0.25);
  color: #e8d7bd;
  font-weight: 700;
}

.crate-layout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
  align-items: start;
}

.crate-card-shell,
.crate-tier-card {
  background: rgba(16, 28, 49, 0.95);
  border: 1px solid rgba(110, 156, 219, 0.22);
  border-radius: 16px;
  padding: 18px;
}

.crate-card-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  grid-template-areas:
    "heading heading"
    "crate tiers"
    "meta tiers"
    "feedback feedback";
  gap: 12px;
  min-width: 0;
}

.crate-tier-card-inline {
  grid-area: tiers;
  position: static;
  width: auto;
  padding: 10px 10px;
  background:
    linear-gradient(180deg, rgba(14, 9, 6, 0.12) 0%, rgba(14, 9, 6, 0.24) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(53, 37, 23, 0.96) 0%, rgba(22, 15, 10, 0.98) 100%);
  border: 1px solid rgba(181, 136, 81, 0.24);
  box-shadow:
    inset 0 0 0 1px rgba(255, 221, 157, 0.05),
    0 10px 24px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.crate-item-heading {
  grid-area: heading;
  margin-bottom: 0;
  max-width: 100%;
  min-width: 0;
}

.crate-item-heading h4 {
  margin: 0 0 6px;
}

.crate-item-heading p {
  margin: 0;
}

.crate-tier-card h4 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.crate-tier-list {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.crate-tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(14, 9, 6, 0.08) 0%, rgba(14, 9, 6, 0.16) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(66, 47, 29, 0.72) 0%, rgba(30, 20, 13, 0.82) 100%);
  border: 1px solid rgba(181, 136, 81, 0.16);
  font-size: 0.68rem;
  line-height: 1.28;
}

.crate-tier-info {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(14, 9, 6, 0.08) 0%, rgba(14, 9, 6, 0.14) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(103, 73, 43, 0.9) 0%, rgba(47, 31, 19, 0.94) 100%);
  border: 1px solid rgba(181, 136, 81, 0.24);
  color: #f1d39b;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: help;
  outline: none;
}

.crate-tier-tooltip {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 185px;
  padding: 9px 10px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(14, 9, 6, 0.12) 0%, rgba(14, 9, 6, 0.24) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(53, 37, 23, 0.98) 0%, rgba(22, 15, 10, 0.99) 100%);
  border: 1px solid rgba(181, 136, 81, 0.26);
  color: #f1e0c0;
  font-size: 0.76rem;
  line-height: 1.4;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 20;
  pointer-events: none;
}

.crate-tier-info:hover .crate-tier-tooltip,
.crate-tier-info:focus .crate-tier-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.crate-tier-common { color: #7ff18d; }
.crate-tier-uncommon { color: #6bb8ff; }
.crate-tier-rare { color: #c68cff; }
.crate-tier-legendary { color: #ffd36f; }

@media (max-width: 980px) {
  .crate-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .crate-card-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "heading"
      "tiers"
      "crate"
      "meta"
      "feedback";
  }

  .crate-tier-card-inline {
    width: auto;
    margin-bottom: 14px;
  }

  .crate-item-heading {
    max-width: 100%;
  }
}

.mystery-crate {
  grid-area: crate;
  position: relative;
  min-height: 220px;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 213, 123, 0.1), transparent 28%),
    radial-gradient(circle at 50% 72%, rgba(176, 71, 31, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(31, 20, 14, 0.98), rgba(12, 11, 17, 0.98));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 4px;
}

.mystery-crate.shaking {
  animation: crateShake 0.72s ease-in-out 2;
}

.crate-glow,
.crate-overlay,
.crate-name-reveal,
.crate-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.crate-glow {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.mystery-crate.tier-common .crate-glow { background: radial-gradient(circle, rgba(76, 175, 80, 0.32) 0%, rgba(76, 175, 80, 0.06) 35%, transparent 70%); }
.mystery-crate.tier-uncommon .crate-glow { background: radial-gradient(circle, rgba(33, 150, 243, 0.34) 0%, rgba(33, 150, 243, 0.08) 35%, transparent 70%); }
.mystery-crate.tier-rare .crate-glow { background: radial-gradient(circle, rgba(156, 39, 176, 0.34) 0%, rgba(156, 39, 176, 0.08) 35%, transparent 70%); }
.mystery-crate.tier-legendary .crate-glow { background: radial-gradient(circle, rgba(255, 178, 43, 0.45) 0%, rgba(217, 54, 54, 0.16) 38%, transparent 74%); }

.mystery-crate.animating .crate-glow,
.mystery-crate.revealed .crate-glow {
  opacity: 1;
}

.crate-overlay {
  background:
    linear-gradient(180deg, rgba(255, 205, 125, 0.04), rgba(0, 0, 0, 0.08)),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.12));
  transition: background 0.35s ease;
}

.mystery-crate.tier-legendary.revealed .crate-overlay {
  background: rgba(2, 3, 8, 0.26);
}

.crate-box {
  position: relative;
  width: 152px;
  height: 156px;
  perspective: 900px;
  z-index: 2;
  filter: drop-shadow(0 26px 36px rgba(0, 0, 0, 0.42));
}

.egg-nest {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 4px;
  height: 42px;
  z-index: 1;
  pointer-events: none;
}

.egg-nest::before {
  content: "";
  position: absolute;
  inset: 10px 10px 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 0%, rgba(245, 191, 104, 0.16), transparent 45%),
    linear-gradient(180deg, rgba(87, 51, 24, 0.98), rgba(45, 25, 12, 0.98));
  box-shadow:
    inset 0 8px 18px rgba(255, 210, 127, 0.08),
    0 10px 22px rgba(0, 0, 0, 0.28);
}

.egg-nest span {
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 76px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #8d5c2b 0%, #5f3818 100%);
  transform-origin: center center;
  opacity: 0.95;
}

.egg-nest span:nth-child(1) { transform: translateX(-50%) rotate(-18deg); }
.egg-nest span:nth-child(2) { transform: translateX(-50%) rotate(-8deg); width: 88px; }
.egg-nest span:nth-child(3) { transform: translateX(-50%) rotate(0deg); width: 96px; }
.egg-nest span:nth-child(4) { transform: translateX(-50%) rotate(9deg); width: 86px; }
.egg-nest span:nth-child(5) { transform: translateX(-50%) rotate(18deg); width: 76px; }
.egg-nest span:nth-child(6) { transform: translateX(-50%) rotate(28deg); width: 66px; }

.crate-lid {
  position: absolute;
  top: 10px;
  left: 20px;
  width: 112px;
  height: 88px;
  border-radius: 52% 52% 44% 44% / 74% 74% 26% 26%;
  background:
    radial-gradient(circle at 35% 24%, rgba(255,255,255,0.64), rgba(255,255,255,0.18) 18%, transparent 36%),
    linear-gradient(180deg, #dedbd5 0%, #c3beb6 50%, #979088 100%);
  border: 2px solid rgba(168, 164, 157, 0.95);
  transform-origin: top center;
  transition: transform 0.55s ease;
  box-shadow:
    inset 0 -8px 18px rgba(96, 92, 86, 0.22),
    inset 0 2px 0 rgba(255,255,255,0.44),
    0 14px 30px rgba(0, 0, 0, 0.2);
}

.crate-body {
  position: absolute;
  bottom: 18px;
  left: 12px;
  width: 128px;
  height: 116px;
  border-radius: 48% 48% 54% 54% / 26% 26% 74% 74%;
  background:
    radial-gradient(circle at 34% 14%, rgba(255,255,255,0.42), transparent 18%),
    linear-gradient(180deg, #d7d2ca 0%, #beb8b0 58%, #928c84 100%);
  border: 2px solid rgba(168, 164, 157, 0.95);
  box-shadow:
    inset 0 -12px 18px rgba(92, 86, 79, 0.2),
    inset 0 2px 0 rgba(255,255,255,0.4),
    0 18px 34px rgba(0, 0, 0, 0.22);
}

.crate-body::before,
.crate-body::after {
  display: none;
}

.crate-brand {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 32px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.crate-brand-text {
  position: relative;
  z-index: 2;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.26em;
  color: #242322;
  text-shadow: 0 1px 0 rgba(255,255,255,0.16);
  font-family: Georgia, "Times New Roman", serif;
}

.crate-brand-text::before {
  display: none;
}

.crate-brand-text::after {
  display: none;
}

.egg-cracks {
  position: absolute;
  left: 50%;
  width: 88px;
  height: 44px;
  transform: translateX(-50%);
  opacity: 0.7;
}

.egg-cracks-top {
  bottom: -1px;
}

.egg-cracks-bottom {
  top: -1px;
}

.egg-cracks span {
  position: absolute;
  width: 2px;
  background: rgba(71, 67, 62, 0.38);
  border-radius: 999px;
}

.egg-cracks span:nth-child(1) {
  left: 24px;
  top: 4px;
  height: 28px;
  transform: rotate(-22deg);
}

.egg-cracks span:nth-child(2) {
  left: 42px;
  top: 0;
  height: 34px;
  transform: rotate(8deg);
}

.egg-cracks span:nth-child(3) {
  left: 60px;
  top: 8px;
  height: 24px;
  transform: rotate(28deg);
}

.egg-shard {
  position: absolute;
  width: 66px;
  height: 54px;
  opacity: 0;
  border: 2px solid rgba(216, 211, 201, 0.95);
  background:
    radial-gradient(circle at 35% 26%, rgba(255,255,255,0.9), transparent 26%),
    linear-gradient(180deg, #fcfbf7 0%, #e7e1d7 58%, #cbc2b6 100%);
  box-shadow: inset 0 -8px 14px rgba(124, 117, 105, 0.18);
}

.egg-shard-left {
  left: 18px;
  top: 62px;
  border-radius: 58% 42% 50% 42% / 62% 38% 58% 42%;
}

.egg-shard-right {
  right: 18px;
  top: 62px;
  border-radius: 42% 58% 42% 50% / 38% 62% 42% 58%;
}

.egg-shard-bottom-left {
  left: 34px;
  bottom: 24px;
  width: 58px;
  height: 46px;
  border-radius: 48% 38% 58% 46% / 36% 34% 66% 64%;
}

.egg-shard-bottom-right {
  right: 34px;
  bottom: 24px;
  width: 58px;
  height: 46px;
  border-radius: 38% 48% 46% 58% / 34% 36% 64% 66%;
}

.mystery-crate.opening .crate-lid,
.mystery-crate.revealed .crate-lid {
  transform: translateY(-26px) rotate(-12deg) scale(1.02);
}

.mystery-crate.revealed .egg-shard-left {
  animation: eggShardLeftFly 0.9s ease forwards;
}

.mystery-crate.revealed .egg-shard-right {
  animation: eggShardRightFly 0.92s ease forwards;
}

.mystery-crate.revealed .egg-shard-bottom-left {
  animation: eggShardBottomLeftFly 0.95s ease forwards;
}

.mystery-crate.revealed .egg-shard-bottom-right {
  animation: eggShardBottomRightFly 0.98s ease forwards;
}

.crate-name-reveal {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 28px;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(18px) scale(0.88);
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 3;
  text-align: center;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.mystery-crate.revealed .crate-name-reveal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mystery-crate.tier-common .crate-name-reveal { color: #7ff18d; }
.mystery-crate.tier-uncommon .crate-name-reveal { color: #6bb8ff; }
.mystery-crate.tier-rare .crate-name-reveal { color: #c68cff; }
.mystery-crate.tier-legendary .crate-name-reveal { color: #ffd36f; }

.mystery-crate.tier-legendary.revealed .crate-name-reveal {
  animation: crateLegendaryFlash 1.15s ease 3;
}

.crate-sparkles {
  z-index: 3;
}

.crate-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
}

.crate-sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,236,180,0.95) 0%, rgba(255,140,61,0.86) 55%, rgba(255,91,91,0) 100%);
  opacity: 0;
}

.mystery-crate.tier-legendary.revealed .crate-sparkle {
  animation: crateSparkFly 1.15s ease forwards;
}

.crate-confetti-piece {
  position: absolute;
  top: 48%;
  left: 50%;
  width: 10px;
  height: 18px;
  border-radius: 3px;
  opacity: 0;
}

.mystery-crate.revealed .crate-confetti-piece {
  animation: crateConfettiBurst 1.9s cubic-bezier(.18,.73,.19,1) forwards;
}

.crate-meta {
  grid-area: meta;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}

#openCrateButton {
  align-self: stretch;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(247, 196, 103, 0.58);
  background:
    radial-gradient(circle at 50% 25%, rgba(255, 233, 180, 0.28), transparent 46%),
    linear-gradient(180deg, #a8531f 0%, #7e3315 54%, #5f220f 100%);
  color: #fff2d0;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 14px 28px rgba(109, 39, 18, 0.28);
}

#openCrateButton:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 18px 34px rgba(109, 39, 18, 0.34);
}

#openCrateButton:disabled {
  opacity: 0.72;
  filter: grayscale(0.08);
}

.crate-price {
  color: #ffe2aa;
  font-weight: 700;
  font-size: 0.92rem;
}

#crateResult {
  grid-area: feedback;
}

.crate-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.crate-reveal-overlay.hidden {
  display: none;
}

.crate-reveal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 214, 143, 0.14), transparent 30%),
    rgba(2, 6, 12, 0.86);
  backdrop-filter: blur(8px);
}

.crate-reveal-panel {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 32px));
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 211, 125, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(31, 21, 17, 0.97), rgba(12, 13, 21, 0.98));
  border: 1px solid rgba(199, 154, 85, 0.26);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.56);
}

.crate-reveal-crate {
  min-height: 420px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 214, 140, 0.14), transparent 28%),
    radial-gradient(circle at 50% 72%, rgba(175, 64, 28, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(29, 18, 15, 0.98), rgba(9, 10, 16, 0.98));
}

.crate-creature-frame {
  position: absolute;
  top: 62px;
  width: 210px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(18px) scale(0.88);
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  z-index: 2;
}

.crate-creature-left {
  left: 18px;
}

.crate-creature-right {
  right: 18px;
}

.crate-creature-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: saturate(1.06) brightness(0.96);
  mask-image: radial-gradient(circle at 50% 48%, rgba(0,0,0,1) 50%, rgba(0,0,0,0.8) 68%, transparent 100%);
  -webkit-mask-image: radial-gradient(circle at 50% 48%, rgba(0,0,0,1) 50%, rgba(0,0,0,0.8) 68%, transparent 100%);
}

.crate-creature-image.mirrored {
  transform: scaleX(-1);
}

.crate-reveal-crate.revealed .crate-creature-frame {
  animation: crateCreatureReveal 1.15s ease forwards, crateCreatureFloat 4.4s ease-in-out 1.15s infinite;
}

.crate-reveal-crate .crate-box {
  width: 250px;
  height: 220px;
  z-index: 4;
}

.crate-reveal-crate .crate-lid {
  top: 22px;
  left: 24px;
  width: 202px;
  height: 72px;
}

.crate-reveal-crate .crate-body {
  bottom: 20px;
  left: 18px;
  width: 214px;
  height: 142px;
}

.crate-reveal-crate .crate-name-reveal {
  padding: 322px 32px 0;
  align-items: flex-start;
  font-size: clamp(1.5rem, 2.8vw, 2.35rem);
  letter-spacing: 0.05em;
  line-height: 1.08;
  word-break: break-word;
  transform: translateY(28px) scale(0.72);
}

.crate-reveal-crate.revealed .crate-name-reveal {
  animation: crateNameBurst 0.85s cubic-bezier(.18,.91,.25,1.1) forwards;
}

.crate-reveal-meta {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin-top: 18px;
  text-align: center;
}

.crate-reveal-tier {
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c7d9f7;
  font-weight: 800;
}

.crate-reveal-summary {
  color: #d8e6f8;
  font-size: 1rem;
}

.crate-claim-button {
  min-width: 220px;
  padding: 16px 28px;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #08101d;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(180deg, #ffd67c, #ffb648);
  box-shadow: 0 16px 36px rgba(255, 188, 80, 0.35);
}

.crate-claim-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.crate-claim-button.hidden {
  display: none;
}

@keyframes crateLegendaryFlash {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.35); }
}

@keyframes crateShake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  10% { transform: translateX(-8px) rotate(-1.2deg); }
  20% { transform: translateX(10px) rotate(1deg); }
  30% { transform: translateX(-10px) rotate(-1.4deg); }
  40% { transform: translateX(9px) rotate(1.2deg); }
  50% { transform: translateX(-7px) rotate(-0.9deg); }
  60% { transform: translateX(8px) rotate(0.8deg); }
  70% { transform: translateX(-6px) rotate(-0.7deg); }
  80% { transform: translateX(5px) rotate(0.5deg); }
  90% { transform: translateX(-3px) rotate(-0.3deg); }
}

@keyframes crateSparkFly {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.2); opacity: 0; }
}

@keyframes eggShardLeftFly {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.9); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(-54px, -34px) rotate(-42deg) scale(1.02); }
}

@keyframes eggShardRightFly {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.9); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(54px, -38px) rotate(40deg) scale(1.02); }
}

@keyframes eggShardBottomLeftFly {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.92); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(-36px, 34px) rotate(-54deg) scale(1.02); }
}

@keyframes eggShardBottomRightFly {
  0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(0.92); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(38px, 30px) rotate(56deg) scale(1.02); }
}

@keyframes crateConfettiBurst {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) scale(0.35);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(1);
    opacity: 0;
  }
}

@keyframes crateNameBurst {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.72);
    filter: brightness(1);
  }
  55% {
    opacity: 1;
    transform: translateY(-10px) scale(1.12);
    filter: brightness(1.15);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes crateCreatureReveal {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.84);
    filter: blur(12px) drop-shadow(0 12px 22px rgba(0, 0, 0, 0.22));
  }
  55% {
    opacity: 0.92;
    transform: translateY(-6px) scale(1.02);
    filter: blur(0px) drop-shadow(0 20px 36px rgba(0, 0, 0, 0.38));
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px) drop-shadow(0 24px 42px rgba(0, 0, 0, 0.44));
  }
}

@keyframes crateCreatureFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.01);
  }
}

@media (max-width: 700px) {
  .crate-reveal-panel {
    padding: 18px;
  }

  .crate-reveal-crate {
    min-height: 360px;
  }

  .crate-reveal-crate .crate-box {
    transform: scale(0.9);
  }
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 8, 15, 0.72);
  z-index: 1000;
}

.modal-content {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: rgba(11, 20, 36, 0.98);
  border: 1px solid rgba(110, 156, 219, 0.24);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.48);
}

.mutation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.mutation-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(110, 156, 219, 0.18);
  background: rgba(7, 15, 28, 0.7);
}

.storage-growth-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.growth-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(110, 156, 219, 0.18);
}

.growth-fill {
  height: 100%;
  background: linear-gradient(90deg, #159957 0%, #38ef7d 100%);
}

.storage-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.storage-stats div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: rgba(7, 15, 28, 0.72);
  border-radius: 10px;
  padding: 8px 10px;
}

.storage-colors {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.storage-empty {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed rgba(110, 156, 219, 0.26);
  background: rgba(7, 15, 28, 0.72);
  color: #c8dcff;
}

.storage-feedback {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(7, 15, 28, 0.72);
  border: 1px solid rgba(110, 156, 219, 0.26);
  color: #dbe8ff;
}

.storage-feedback.error {
  border-color: rgba(214, 91, 91, 0.45);
  color: #ffd3d3;
}

.storage-feedback.success {
  border-color: rgba(60, 173, 113, 0.45);
  color: #d7ffe8;
}

.storage-info-note {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  max-width: 760px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(8, 17, 30, 0.62);
  border: 1px solid rgba(110, 156, 219, 0.16);
  color: rgba(216, 231, 255, 0.86);
  font-size: 0.84rem;
  line-height: 1.45;
}

.storage-info-note strong {
  color: #f6fbff;
  font-weight: 700;
}

.storage-info-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 999px;
  background: rgba(74, 137, 220, 0.18);
  border: 1px solid rgba(110, 156, 219, 0.22);
  color: #9fd0ff;
  font-size: 0.76rem;
  font-weight: 700;
}

.leaderboard-info-note {
  margin-top: 10px;
}

.coin-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ffe38f;
  font-weight: 700;
  white-space: nowrap;
}

.skin-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.skin-editor-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skin-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(16, 28, 49, 0.95);
  border: 1px solid rgba(110, 156, 219, 0.18);
}

.skin-label {
  min-width: 150px;
  color: #e0e0e0;
  font-weight: 700;
}

.skin-picker {
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.skin-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.skin-picker::-webkit-color-swatch {
  border: 2px solid rgba(110, 156, 219, 0.3);
  border-radius: 10px;
}

.skin-set-btn,
.skin-set-all {
  background: linear-gradient(180deg, #1f8a55 0%, #17653f 100%);
}

.skin-set-btn:hover,
.skin-set-all:hover {
  background: linear-gradient(180deg, #28a665 0%, #1b7b4c 100%);
}

.skin-hex {
  margin-left: auto;
  color: #95acd0;
  font-family: monospace;
  font-size: 0.92rem;
}

.skin-preview-card {
  background: rgba(10, 19, 34, 0.85);
  border: 1px solid rgba(110, 156, 219, 0.15);
  border-radius: 16px;
  padding: 16px;
}

.skin-preset-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skin-preset-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(16, 28, 49, 0.92);
  border: 1px solid rgba(110, 156, 219, 0.18);
}

.skin-preset-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.skin-preset-slot {
  flex: 0 0 auto;
  min-width: 54px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(25, 48, 84, 0.95);
  border: 1px solid rgba(110, 156, 219, 0.24);
  color: #dbe8ff;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.skin-preset-name {
  flex: 1 1 auto;
}

.skin-preset-swatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 20px;
  margin-bottom: 10px;
}

.skin-preset-empty {
  color: #8ea4c7;
  font-size: 0.84rem;
}

.skin-preset-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.skin-preset-actions button {
  min-width: 88px;
}

.skin-swatch-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(25, 48, 84, 0.95);
  border: 1px solid rgba(110, 156, 219, 0.24);
  color: #dbe8ff;
  font-size: 0.84rem;
}

.ai-class-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 14px;
  margin: 14px 0;
}

.ai-class-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(16, 28, 49, 0.95);
  border: 1px solid rgba(110, 156, 219, 0.18);
}

.ai-class-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ai-class-left input[type="checkbox"] {
  width: auto;
  max-width: none;
  margin: 0;
}

.ai-class-name {
  color: #eef5ff;
  font-weight: 700;
}

.ai-class-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.ai-class-badge.enabled {
  color: #9cffc8;
  background: rgba(34, 161, 89, 0.16);
  border: 1px solid rgba(73, 255, 155, 0.3);
}

.ai-class-badge.disabled {
  color: #ffb7b7;
  background: rgba(161, 34, 34, 0.16);
  border: 1px solid rgba(255, 97, 97, 0.3);
}

.danger {
  background: linear-gradient(180deg, #7f2430 0%, #591821 100%);
}

.danger:hover {
  background: linear-gradient(180deg, #9a2f3d 0%, #6e202b 100%);
}

.market-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.storage-slot-placeholder {
  justify-content: space-between;
  min-height: 100%;
  border-style: dashed;
  border-color: rgba(181, 136, 81, 0.28);
  background: rgba(29, 19, 13, 0.66);
}

.storage-slot-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(14, 9, 6, 0.14) 0%, rgba(14, 9, 6, 0.32) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat;
  opacity: 0.2;
  pointer-events: none;
  z-index: -1;
}

.storage-slot-placeholder-body {
  display: flex;
  flex: 1;
  min-height: 170px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 10px;
  color: var(--nest-text-soft);
}

.storage-slot-placeholder-body p {
  margin: 0;
  max-width: 220px;
  line-height: 1.45;
}

.storage-slot-placeholder-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(181, 136, 81, 0.34);
  background: rgba(54, 36, 23, 0.52);
  color: var(--nest-accent);
  font-size: 1.8rem;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .storage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .storage-grid,
  .store-grid,
  .market-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.leaderboards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.leaderboard-card {
  background: rgba(16, 28, 49, 0.95);
  border: 1px solid rgba(110, 156, 219, 0.22);
  border-radius: 16px;
  padding: 15px;
  min-width: 0;
}

.leaderboard-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.leaderboard-card h3 {
  margin: 0;
  color: #ffe49a;
  font-size: 1.02rem;
}

.leaderboard-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(14, 9, 6, 0.16) 0%, rgba(14, 9, 6, 0.28) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(66, 47, 29, 0.96) 0%, rgba(30, 20, 13, 0.97) 100%);
  border: 1px solid rgba(181, 136, 81, 0.32);
  padding: 3px;
  flex-shrink: 0;
}

.leaderboard-switch-btn {
  border: 0;
  background: transparent;
  color: #8fa6c8;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.leaderboard-switch-btn:hover {
  color: #eef5ff;
}

.leaderboard-switch-btn.active {
  background:
    linear-gradient(180deg, rgba(15, 11, 8, 0.08) 0%, rgba(15, 11, 8, 0.16) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(140, 102, 58, 0.98) 0%, rgba(82, 55, 31, 0.99) 100%);
  color: #fff1cf;
  box-shadow: 0 10px 22px rgba(46, 28, 12, 0.28);
}

.leaderboard-subtitle {
  margin-bottom: 12px;
  color: #8fa6c8;
  font-size: 0.86rem;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(14, 9, 6, 0.12) 0%, rgba(14, 9, 6, 0.24) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(60, 43, 28, 0.92) 0%, rgba(27, 19, 13, 0.94) 100%);
  border: 1px solid rgba(181, 136, 81, 0.18);
}

.leaderboard-rank {
  color: #ffe38f;
  font-size: 0.95rem;
  font-weight: 900;
}

.leaderboard-player {
  color: #eef5ff;
  font-weight: 700;
  font-size: 0.92rem;
  word-break: break-word;
}

.leaderboard-value {
  color: #b9d5ff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: right;
  font-size: 0.9rem;
}

.leaderboard-empty {
  color: #8fa6c8;
  padding: 14px 4px 4px;
}

.market-card {
  position: relative;
  background: rgba(16, 28, 49, 0.95);
  border: 1px solid rgba(110, 156, 219, 0.22);
  border-radius: 16px;
  padding: 72px 16px 16px;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.market-owner-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 28px);
  padding: 7px 12px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(14, 9, 6, 0.16) 0%, rgba(14, 9, 6, 0.28) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(66, 47, 29, 0.96) 0%, rgba(30, 20, 13, 0.97) 100%);
  border: 1px solid rgba(181, 136, 81, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 154, 0.04),
    0 10px 24px rgba(0, 0, 0, 0.18);
  color: #e4c48e;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-owner-badge span {
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-age-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 28px);
  padding: 7px 12px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(14, 9, 6, 0.16) 0%, rgba(14, 9, 6, 0.28) 100%),
    url("/images/age-badge-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(66, 47, 29, 0.96) 0%, rgba(30, 20, 13, 0.97) 100%);
  border: 1px solid rgba(181, 136, 81, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 154, 0.04),
    0 10px 24px rgba(0, 0, 0, 0.18);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.92),
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 6px rgba(0, 0, 0, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 154, 0.04),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

.market-age-badge span {
  color: #ffffff;
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.92),
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 6px rgba(0, 0, 0, 0.42);
}

.market-nametag {
  margin-bottom: 10px;
}

.market-card h3 {
  margin: 0 0 8px;
  color: #ffe49a;
}

.market-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffe38f;
}

.market-time {
  color: #9bb1d0;
}

.market-mutations {
  margin: 12px 0 14px;
  text-align: left;
}

.market-mutation-count {
  font-size: 0.9rem;
  font-weight: 700;
  color: #b7d4ff;
  margin-bottom: 8px;
}

.market-mutation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.market-mutation-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(25, 48, 84, 0.95);
  border: 1px solid rgba(110, 156, 219, 0.24);
  color: #dbe8ff;
  font-size: 0.82rem;
  line-height: 1.2;
}

.market-mutation-empty {
  color: #7f97bb;
  font-size: 0.88rem;
}

.market-buy-result {
  margin-top: 10px;
  min-height: 20px;
  color: #d7ffe8;
}

@media (max-width: 920px) {
  .skin-editor-grid {
    grid-template-columns: 1fr;
  }

  .skin-row {
    flex-wrap: wrap;
  }

  .skin-label {
    min-width: 100%;
  }

  .skin-hex {
    margin-left: 0;
  }
}

.prime-hint {
  margin-bottom: 18px;
}

.prime-note {
  margin: -6px 0 18px;
  color: #9bb1d0;
}

.prime-status-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(14, 27, 48, 0.94);
    border: 1px solid rgba(110, 156, 219, 0.2);
}

.prime-badge-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.prime-species-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prime-species {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prime-growth {
  color: #9bb1d0;
  font-size: 0.96rem;
}

.prime-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prime-badge.prime {
  color: #dfffe8;
  background: linear-gradient(180deg, rgba(36, 126, 79, 0.95) 0%, rgba(21, 82, 52, 0.95) 100%);
  border: 1px solid rgba(112, 255, 182, 0.35);
}

.prime-badge.frail {
  color: #d9dfec;
  background: rgba(78, 89, 112, 0.55);
  border: 1px solid rgba(146, 157, 179, 0.24);
}

.prime-badge.pending {
    color: #ffe6a1;
    background: rgba(155, 111, 24, 0.18);
    border: 1px solid rgba(255, 215, 122, 0.26);
}

.prime-badge.eligible {
    color: #ffe7a6;
    background: linear-gradient(180deg, rgba(173, 132, 38, 0.95) 0%, rgba(122, 90, 18, 0.95) 100%);
    border: 1px solid rgba(255, 217, 122, 0.36);
}

.prime-badge.progress {
    color: #cfe3ff;
    background: rgba(39, 88, 155, 0.24);
    border: 1px solid rgba(109, 171, 255, 0.28);
}

.prime-badge-help {
  max-width: 320px;
  text-align: right;
  color: #9bb1d0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.prime-progress {
  margin-top: 18px;
}

.prime-progress-text {
  margin-bottom: 8px;
  font-weight: 700;
  color: #dbe8ff;
}

.prime-progress-bar {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(7, 15, 28, 0.86);
  border: 1px solid rgba(110, 156, 219, 0.16);
}

.prime-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #c65050 0%, #d8aa47 50%, #36d17c 100%);
  transition: width 0.25s ease;
}

.prime-conditions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.condition-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(16, 28, 49, 0.95);
  border: 1px solid rgba(110, 156, 219, 0.18);
}

.condition-row.met {
  border-color: rgba(73, 255, 155, 0.26);
}

.condition-row.not-met {
  border-color: rgba(255, 110, 110, 0.18);
}

.condition-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
}

.condition-indicator.green {
  background: #42da7d;
}

.condition-indicator.red {
  background: #d85656;
}

.condition-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.condition-number {
  color: #8fe8ff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.condition-name {
  font-weight: 700;
  color: #eef5ff;
}

.condition-desc {
  color: #8fa6c8;
  font-size: 0.9rem;
}

.condition-check {
  font-size: 1.1rem;
  font-weight: 900;
  color: #7ff1a8;
}

.empty-state {
  color: #9bb1d0;
  padding: 12px 0;
}

@media (max-width: 980px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
}

/* Stone NEST theme override */
:root {
  --nest-stone-bg: #090909;
  --nest-stone-panel: rgba(22, 24, 28, 0.82);
  --nest-stone-panel-strong: rgba(14, 16, 20, 0.92);
  --nest-bronze: #caa16a;
  --nest-bronze-strong: #ebc489;
  --nest-bronze-dark: #4a4f59;
  --nest-text-soft: #c5c9d2;
  --nest-text-main: #eceff4;
  --nest-shadow: rgba(0, 0, 0, 0.45);
}

body {
  font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  background: #060708;
  color: var(--nest-text-main);
}

body::before {
  background:
    linear-gradient(180deg, rgba(7, 8, 10, 0.26) 0%, rgba(7, 8, 10, 0.5) 100%),
    url("/images/faterix-bg-v2.png") center top / cover no-repeat;
  opacity: 1;
}

body::after {
  background:
    linear-gradient(180deg, rgba(4, 5, 7, 0.08) 0%, rgba(4, 5, 7, 0.22) 100%);
}

.stone-theme-shell {
  max-width: 1540px;
  padding: 18px 18px 36px;
}

.hero-shell {
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.brand-panel {
  position: relative;
  width: 200px;
  min-width: 200px;
  padding: 16px 16px 18px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(10, 11, 14, 0.2) 0%, rgba(10, 11, 14, 0.34) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(38, 41, 46, 0.92) 0%, rgba(16, 18, 22, 0.95) 100%);
  border: 2px solid rgba(183, 138, 82, 0.66);
  box-shadow:
    inset 0 0 0 2px rgba(18, 20, 25, 0.88),
    inset 0 14px 22px rgba(255, 213, 139, 0.08),
    0 14px 32px rgba(0, 0, 0, 0.28);
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 218, 153, 0.14);
  pointer-events: none;
}

.brand-panel h1 {
  margin: 0 0 8px;
  color: #f0d5a8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.045em;
  text-shadow:
    0 1px 0 rgba(255, 231, 190, 0.28),
    0 4px 18px rgba(0, 0, 0, 0.3);
}

#session-line {
  margin: 0 0 10px;
  color: #f3dcc1;
  font-size: 0.92rem;
}

.coin-line {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

#coinDisplay,
#boneDisplay {
  width: fit-content;
  min-width: 118px;
  justify-content: flex-start;
  padding: 8px 14px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(17, 11, 8, 0.14) 0%, rgba(17, 11, 8, 0.24) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(91, 70, 43, 0.98) 0%, rgba(49, 34, 21, 0.95) 100%);
  border: 1px solid rgba(201, 157, 88, 0.52);
  box-shadow:
    inset 0 0 0 1px rgba(255, 221, 157, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.18);
  color: #f8df9e;
  text-shadow: none;
}

#boneDisplay {
  color: #efe3cf;
}

.currency-divider {
  display: none;
}

.top-nav-stack {
  flex: 1 1 auto;
  min-width: 0;
  gap: 10px;
  align-items: flex-end;
}

.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 132px;
  align-self: flex-end;
}

.mobile-nav-toggle-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.mobile-nav-panels {
  display: contents;
}

.top-nav {
  gap: 9px;
}

.top-nav-main,
.top-nav-secondary {
  flex-wrap: nowrap;
}

.top-nav-secondary {
  width: 100%;
  justify-content: space-between;
}

.top-nav-secondary-left,
.top-nav-secondary-right {
  gap: 10px;
}

.top-nav-secondary-left {
  margin-left: var(--live-dino-indent, 46px);
}

@media (max-width: 1180px) and (min-width: 769px) {
  .top-nav-stack {
    align-items: stretch;
    gap: 12px;
  }

  .top-nav-main {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .top-nav-secondary {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 12px;
  }

  .top-nav-secondary-left,
  .top-nav-secondary-right {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
  }

  .top-nav-secondary-left {
    margin-left: 0;
  }
}

button,
.button,
.top-nav button,
#logout-button,
#active-admins-toggle,
#live-dino-toggle {
  position: relative;
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 13px;
  border: 1px solid rgba(181, 137, 81, 0.62);
  background:
    linear-gradient(180deg, rgba(10, 11, 14, 0.16) 0%, rgba(10, 11, 14, 0.3) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(45, 48, 54, 0.94) 0%, rgba(18, 20, 24, 0.96) 100%);
  color: var(--nest-text-main);
  box-shadow:
    inset 0 0 0 1px rgba(255, 229, 172, 0.09),
    inset 0 10px 16px rgba(255, 219, 150, 0.05),
    0 10px 18px rgba(0, 0, 0, 0.18);
  font-weight: 700;
  letter-spacing: 0.01em;
}

button:hover,
.button:hover,
.top-nav button:hover,
#logout-button:hover,
#active-admins-toggle:hover,
#live-dino-toggle:hover {
  background:
    linear-gradient(180deg, rgba(10, 11, 14, 0.12) 0%, rgba(10, 11, 14, 0.24) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(56, 60, 68, 0.96) 0%, rgba(24, 27, 31, 0.98) 100%);
}

.top-nav button[data-tab="prime"],
.top-nav button[data-tab="skin"],
.top-nav button[data-tab="leaderboards"],
.top-nav button[data-tab="storage"],
.top-nav button[data-tab="store"],
.top-nav button[data-tab="market"],
.top-nav button[data-tab="map"],
.top-nav button[data-tab="killfeed"] {
  min-width: 118px;
  justify-content: center;
}

#live-dino-toggle {
  min-width: 108px;
}

#active-admins-toggle {
  min-width: 138px;
  background:
    linear-gradient(180deg, rgba(10, 11, 13, 0.1) 0%, rgba(10, 11, 13, 0.2) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(52, 63, 56, 0.96) 0%, rgba(22, 31, 27, 0.98) 100%);
  border-color: rgba(136, 212, 102, 0.52);
}

#active-admins-toggle:hover {
  background:
    linear-gradient(180deg, rgba(10, 11, 13, 0.08) 0%, rgba(10, 11, 13, 0.18) 100%),
    url("/images/nest-wood-texture.png") center center / cover no-repeat,
    linear-gradient(180deg, rgba(64, 79, 70, 0.98) 0%, rgba(29, 40, 35, 0.99) 100%);
}

.live-dino-panel,
.active-admins-panel {
  border-radius: 18px;
  border: 1px solid rgba(183, 138, 82, 0.42);
  background:
    linear-gradient(180deg, rgba(31, 34, 39, 0.98) 0%, rgba(11, 13, 17, 0.98) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 218, 154, 0.07),
    0 18px 36px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
}

.live-dino-panel::before {
  background:
    linear-gradient(180deg, rgba(12, 14, 18, 0.48) 0%, rgba(12, 14, 18, 0.88) 100%),
    var(--species-art, none) center center / cover no-repeat;
}

.live-dino-species,
.active-admins-panel-head strong,
.leaderboard-card h3,
.prime-species,
h2,
h3 {
  color: #f0d19c;
}

.status-plaque {
  width: min(1040px, calc(100% - 140px));
  margin: 14px auto 20px;
  padding: 11px 18px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(42, 45, 51, 0.92) 0%, rgba(17, 19, 23, 0.94) 100%);
  border: 1px solid rgba(177, 136, 82, 0.54);
  box-shadow:
    inset 0 0 0 1px rgba(255, 227, 176, 0.06),
    0 12px 24px rgba(0, 0, 0, 0.2);
  color: var(--nest-text-main);
}

.status-card strong {
  color: #e8d1ad;
}

.status-divider,
#server-since,
#server-name {
  color: #f3e2c6;
}

.status-badge.online {
  color: #c8ffd5;
  background: rgba(46, 124, 54, 0.32);
  border: 1px solid rgba(116, 229, 126, 0.38);
  text-shadow: none;
}

.status-badge.offline {
  color: #ffd1d1;
  background: rgba(129, 41, 41, 0.32);
  border: 1px solid rgba(255, 116, 116, 0.34);
}

.card,
.tab.card,
.chat-wall,
.chat-form,
.map-canvas-shell,
.leaderboard-card,
.condition-row,
.active-admin-row,
.storage-info-note,
.skin-row,
.store-card,
.dino-card,
.market-card,
.crate-card-shell,
.crate-reward-card,
.prime-status-box,
.prime-progress,
.admin-section {
  background:
    linear-gradient(180deg, rgba(30, 33, 38, 0.9) 0%, rgba(12, 14, 18, 0.92) 100%);
  border: 1px solid rgba(181, 136, 81, 0.24);
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 154, 0.04),
    0 18px 34px rgba(0, 0, 0, 0.2);
  color: var(--nest-text-main);
}

.tab.card {
  border-radius: 22px;
  padding: 20px;
  margin-top: 18px;
}

.muted,
.condition-desc,
.storage-subtitle,
.leaderboard-subtitle,
.prime-hint,
#session-line,
#restartSettingsResult,
#serverNameResult,
#coinResult,
#boneResult,
#aiClassResult {
  color: var(--nest-text-soft);
}

input,
select,
textarea {
  background: rgba(16, 18, 22, 0.88);
  color: #f3e5ca;
  border: 1px solid rgba(167, 124, 73, 0.36);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 224, 172, 0.03);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(233, 189, 115, 0.6);
  box-shadow: 0 0 0 3px rgba(220, 169, 94, 0.12);
}

.storage-grid,
.store-grid,
.market-grid,
.leaderboards-grid {
  gap: 18px;
}

.condition-row.met {
  border-color: rgba(104, 191, 113, 0.36);
}

.condition-row.not-met {
  border-color: rgba(190, 97, 85, 0.28);
}

.storage-info-note {
  border-radius: 16px;
  color: var(--nest-text-main);
}

.storage-info-icon {
  color: #f0c97f;
}

/* Final warm-theme overrides for legacy blue storage/store/market elements */
.storage-card,
.store-card,
.market-card,
.skin-preview-card,
.skin-preset-card {
  background:
    linear-gradient(180deg, rgba(30, 33, 38, 0.92) 0%, rgba(12, 14, 18, 0.94) 100%) !important;
  border-color: rgba(181, 136, 81, 0.28) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 220, 154, 0.04),
    0 18px 34px rgba(0, 0, 0, 0.2) !important;
}

.storage-card.tier-common,
.market-card.tier-common {
  border-width: 3px !important;
  border-color: rgba(192, 198, 210, 0.62) !important;
  box-shadow:
    inset 0 0 0 1px rgba(235, 239, 247, 0.05),
    0 0 0 1px rgba(192, 198, 210, 0.16),
    0 0 14px rgba(192, 198, 210, 0.16) !important;
}

.storage-card.tier-uncommon,
.market-card.tier-uncommon {
  border-width: 3px !important;
  border-color: rgba(92, 205, 116, 0.72) !important;
  box-shadow:
    inset 0 0 0 1px rgba(214, 255, 222, 0.05),
    0 0 0 1px rgba(92, 205, 116, 0.18),
    0 0 18px rgba(92, 205, 116, 0.22) !important;
}

.storage-card.tier-rare,
.market-card.tier-rare {
  border-width: 3px !important;
  border-color: rgba(78, 146, 255, 0.78) !important;
  box-shadow:
    inset 0 0 0 1px rgba(215, 230, 255, 0.05),
    0 0 0 1px rgba(78, 146, 255, 0.2),
    0 0 20px rgba(78, 146, 255, 0.28) !important;
}

.storage-card.tier-epic,
.market-card.tier-epic {
  border-width: 4px !important;
  border-color: rgba(176, 93, 255, 0.92) !important;
  box-shadow:
    inset 0 0 0 1px rgba(208, 164, 255, 0.08),
    0 0 0 1px rgba(176, 93, 255, 0.22),
    0 0 28px rgba(176, 93, 255, 0.34) !important;
}

.storage-card.tier-legendary,
.market-card.tier-legendary {
  border-width: 4px !important;
  border-color: rgba(245, 188, 74, 0.98) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 232, 170, 0.1),
    0 0 0 1px rgba(245, 188, 74, 0.22),
    0 0 30px rgba(245, 188, 74, 0.4) !important;
}

.storage-card.tier-artifact,
.market-card.tier-artifact {
  border-width: 4px !important;
  border-color: rgba(255, 88, 88, 0.98) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 205, 205, 0.12),
    0 0 0 1px rgba(242, 83, 83, 0.28),
    0 0 34px rgba(242, 83, 83, 0.44) !important;
}

.market-age-badge.tier-common,
.market-age-badge.tier-uncommon,
.market-age-badge.tier-rare,
.market-age-badge.tier-epic,
.market-age-badge.tier-legendary,
.market-age-badge.tier-artifact {
  box-shadow: inherit;
}

.market-age-badge.tier-common {
  border-color: rgba(192, 198, 210, 0.48);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 0 0 1px rgba(182, 190, 205, 0.14),
    0 0 14px rgba(192, 198, 210, 0.14) !important;
}

.market-age-badge.tier-uncommon {
  border-color: rgba(92, 205, 116, 0.54);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 0 0 1px rgba(92, 205, 116, 0.16),
    0 0 16px rgba(92, 205, 116, 0.24) !important;
}

.market-age-badge.tier-rare {
  border-color: rgba(78, 146, 255, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 0 0 1px rgba(78, 146, 255, 0.16),
    0 0 16px rgba(78, 146, 255, 0.24) !important;
}

.market-age-badge.tier-epic {
  border-color: rgba(176, 93, 255, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.03),
    0 0 0 1px rgba(176, 93, 255, 0.22),
    0 0 22px rgba(176, 93, 255, 0.42),
    0 0 34px rgba(112, 39, 193, 0.24) !important;
}

.market-age-badge.tier-legendary {
  border-color: rgba(245, 188, 74, 0.64);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.04),
    0 0 0 1px rgba(245, 188, 74, 0.22),
    0 0 24px rgba(245, 188, 74, 0.46),
    0 0 38px rgba(186, 122, 21, 0.28) !important;
}

.market-age-badge.tier-artifact {
  border-color: rgba(242, 83, 83, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.05),
    0 0 0 1px rgba(242, 83, 83, 0.26),
    0 0 28px rgba(242, 83, 83, 0.54),
    0 0 44px rgba(143, 17, 17, 0.34) !important;
}

.storage-card.has-species-art::before,
.market-card.has-species-art::before,
.store-card.has-species-art::before {
  background:
    linear-gradient(180deg, rgba(31, 20, 14, 0.24), rgba(12, 9, 7, 0.66)),
    var(--species-art) center center / 100% 100% no-repeat !important;
  opacity: 0.38;
  filter: saturate(0.92) contrast(1.02) brightness(0.86);
}

.storage-slot,
.storage-age,
.market-time,
.market-mutation-empty,
.skin-hex {
  color: var(--nest-text-soft) !important;
}

.storage-badge.standard {
  color: #f1dcc0;
  background: rgba(115, 87, 57, 0.26);
  border: 1px solid rgba(196, 153, 102, 0.26);
}

.storage-badge.mutations,
.market-mutation-chip {
  color: #f4e4c8;
  background: rgba(101, 73, 45, 0.52) !important;
  border: 1px solid rgba(182, 137, 80, 0.24) !important;
}

.storage-badge.market-active {
  color: #ffdb95;
  background: rgba(149, 92, 20, 0.28);
  border: 1px solid rgba(228, 172, 93, 0.32);
}

.storage-badge.market-expired {
  color: #ffc3b3;
  background: rgba(120, 48, 36, 0.34);
  border: 1px solid rgba(211, 107, 88, 0.28);
}

.storage-stats div,
.storage-empty,
.storage-feedback,
.storage-growth-track,
.market-mutations,
.skin-preset-card input,
.skin-preset-card .button,
.store-subnav-btn {
  background: rgba(20, 22, 27, 0.74) !important;
  border-color: rgba(153, 114, 69, 0.24) !important;
}

.store-subnav-btn {
  color: var(--nest-text-main);
}

.store-subnav-btn:hover {
  border-color: rgba(220, 173, 109, 0.4) !important;
}

.store-subnav-btn.active {
  background:
    linear-gradient(180deg, rgba(124, 88, 49, 0.96), rgba(77, 51, 28, 0.96)) !important;
  border-color: rgba(229, 188, 121, 0.48) !important;
  box-shadow: 0 10px 24px rgba(46, 24, 8, 0.3) !important;
}

.market-mutation-count {
  color: #e6c88e;
}

.storage-colors,
.store-card .muted,
.market-buy-result {
  color: var(--nest-text-soft);
}

.legend-item,
.chat-message,
th,
td,
table,
pre {
  color: var(--nest-text-main);
}

table,
pre,
#map-box {
  background:
    linear-gradient(180deg, rgba(24, 27, 32, 0.92) 0%, rgba(12, 14, 18, 0.94) 100%);
  border-color: rgba(167, 124, 73, 0.24);
}

a {
  color: #f4cf8e;
}

@media (max-width: 768px) {
  .stone-theme-shell {
    padding: 14px;
  }

  .hero-shell {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-panel {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
  }

  .top-nav-stack {
    align-items: stretch;
    width: 100%;
    gap: 12px;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-self: flex-start;
  }

.mobile-nav-panels {
    display: none;
    width: 100%;
    padding: 12px;
    border-radius: 18px;
    background:
      linear-gradient(180deg, rgba(30, 33, 38, 0.94) 0%, rgba(12, 14, 18, 0.96) 100%);
    border: 1px solid rgba(181, 136, 81, 0.26);
    box-shadow:
      inset 0 0 0 1px rgba(255, 220, 154, 0.04),
      0 18px 34px rgba(0, 0, 0, 0.2);
  }

  .top-nav-stack.mobile-open .mobile-nav-panels {
    display: block;
  }

  .top-nav-main,
  .top-nav-secondary,
  .top-nav-secondary-left,
  .top-nav-secondary-right {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .top-nav-main,
  .top-nav-secondary-left,
  .top-nav-secondary-right {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .top-nav-secondary {
    gap: 12px;
  }

  .top-nav-secondary-left {
    margin-left: 0;
  }

  .top-nav-main > button,
  .top-nav-secondary-left > button,
  .top-nav-secondary-right > button {
    width: 100%;
    min-width: 0;
  }

  .live-dino-panel,
  .active-admins-panel {
    position: static;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 8px;
  }

  .active-admins-panel {
    margin-left: 0;
  }

  .status-plaque {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 12px;
  }

  .brand-panel {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
  }

  .brand-panel h1 {
    font-size: 1.75rem;
  }

  .top-nav-main,
  .top-nav-secondary-left,
  .top-nav-secondary-right {
    grid-template-columns: 1fr;
  }

  .status-plaque {
    border-radius: 22px;
  }
}
