/* ═══════════════════════════════════════════════════════
   TERRAFORGE — PIXEL LAND RACE
   Dark fantasy gaming theme
   ═══════════════════════════════════════════════════════ */

:root {
  /* Backgrounds — deep space navy per brand */
  --bg:         #040919;
  --surface:    #07101f;
  --panel:      #0a1428;
  --panel-2:    #0e1a32;
  --panel-3:    #12213c;

  /* Borders */
  --border:     #1a2848;
  --border-2:   #263660;

  /* Brand orange — "FORGE" color */
  --orange:      #f5820a;
  --orange-dim:  rgba(245, 130, 10, 0.14);
  --orange-glow: rgba(245, 130, 10, 0.5);
  --orange-dark: #7a3e00;

  /* Cyan — social / live accents */
  --cyan:        #00d4ff;
  --cyan-dim:    rgba(0, 212, 255, 0.1);
  --cyan-glow:   rgba(0, 212, 255, 0.45);

  /* Green — nature / wins */
  --green:       #3fd470;
  --green-dim:   rgba(63, 212, 112, 0.1);
  --green-glow:  rgba(63, 212, 112, 0.4);

  /* Purple — complete & unlock */
  --purple:      #9c5fde;
  --purple-dim:  rgba(156, 95, 222, 0.14);
  --purple-glow: rgba(156, 95, 222, 0.45);

  --red:         #ff4747;
  --red-dim:     rgba(255, 71, 71, 0.12);

  /* Text */
  --ink:         #dfe8f4;
  --ink-2:       #9aafc8;
  --muted:       #435070;
  --muted-2:     #2c3a54;

  /* Scene */
  --sky-top:    #020715;
  --sky-mid:    #040e28;
  --ground-top: #0a1e14;
  --ground-bot: #060e0a;
  --grass:      #1a5428;
  --earth:      #1e1208;

  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }

html { height: 100%; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

/* ─── scanlines overlay ────────────────────────────────── */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.06) 3px,
    rgba(0, 0, 0, 0.06) 4px
  );
}

/* ─── typography ────────────────────────────────────────── */
.hud-logo-wrap {
  display: flex;
  align-items: center;
}

.hud-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
  /* crop the navy background so logo blends into the dark panel */
  mix-blend-mode: lighten;
  filter: drop-shadow(0 0 12px rgba(245,130,10,0.35));
}

.brand-tagline {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.38rem;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  margin-top: 6px;
  line-height: 1.8;
}

.tag-cyan   { color: var(--cyan); }
.tag-orange { color: var(--orange); }

.panel-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-transform: uppercase;
}

button, input { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ─── layout ─────────────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  min-height: 100vh;
  padding: 16px;
}

.world-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* ─── HUD bar ─────────────────────────────────────────────── */
.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--orange-dark);
  border-radius: 6px;
  box-shadow:
    0 0 0 1px var(--border-2),
    0 8px 32px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.hud-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.season-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: var(--cyan);
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.hud-player {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.hud-avatar {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  background: var(--panel-3);
  border: 2px solid rgba(245,130,10,0.5);
  box-shadow: 0 0 14px var(--orange-dim), inset 0 0 8px rgba(0,0,0,0.4);
  display: grid;
  place-items: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: var(--orange);
  letter-spacing: 0;
  flex-shrink: 0;
  overflow: hidden;
}
.hud-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: auto;
}

.hud-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 160px;
}

.hud-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--ink);
  letter-spacing: 0.04em;
}

.xp-bar-wrap {
  height: 6px;
  background: var(--panel-3);
  border: 1px solid var(--border-2);
  border-radius: 2px;
  overflow: hidden;
}

.xp-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--orange-dark), var(--orange));
  box-shadow: 0 0 8px var(--orange-glow);
  border-radius: 2px;
  transition: width 600ms cubic-bezier(.4,0,.2,1);
}

.xp-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ─── completion banner ───────────────────────────────────── */
.completion-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(12, 6, 28, 0.95);
  border: 2px solid var(--purple);
  border-radius: 6px;
  box-shadow:
    0 0 0 1px rgba(156,95,222,0.3),
    0 0 40px var(--purple-dim),
    inset 0 0 20px rgba(156,95,222,0.05);
  animation: bannerIn 500ms cubic-bezier(.18,.89,.32,1.28);
}

.banner-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.banner-crown {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px var(--orange-glow));
  animation: float 3s ease-in-out infinite;
}

.banner-title {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.65rem;
  color: var(--purple);
  letter-spacing: 0.06em;
  text-shadow: 0 0 16px var(--purple-glow);
}

.banner-sub {
  margin-top: 5px;
  font-size: 0.82rem;
  color: var(--ink-2);
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  color: var(--ink-2);
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: background 150ms;
}
.icon-btn:hover { background: rgba(255,255,255,0.14); }

/* ─── pixel world scene ────────────────────────────────────── */
.pixel-scene {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-height: 52vh;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: linear-gradient(180deg,
    var(--sky-top) 0%,
    var(--sky-mid) 55%,
    var(--ground-top) 55%,
    var(--ground-bot) 100%
  );
  image-rendering: pixelated;
  box-shadow:
    0 0 0 1px var(--border-2),
    0 0 60px rgba(0, 0, 0, 0.6),
    inset 0 0 80px rgba(0, 0, 0, 0.3);
}

.stars-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 55%;
  pointer-events: none;
}

.scene-moon {
  position: absolute;
  top: 10%;
  right: 9%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffde8, #f5e8a0);
  box-shadow:
    0 0 0 3px rgba(255,253,200,0.08),
    0 0 30px rgba(255,253,200,0.25),
    0 0 80px rgba(255,253,200,0.12);
  image-rendering: pixelated;
}

/* pixel-art mountain silhouette */
.scene-horizon {
  position: absolute;
  bottom: 44%;
  left: 0;
  right: 0;
  height: 110px;
  background: #060d18;
  clip-path: polygon(
    0%   100%,
    0%    68%,
    5%    45%,
    10%   62%,
    17%   28%,
    23%   52%,
    30%   18%,
    37%   44%,
    43%   12%,
    50%   38%,
    57%   22%,
    63%   46%,
    70%   30%,
    77%   56%,
    84%   35%,
    90%   55%,
    95%   40%,
    100%  58%,
    100%  100%
  );
  opacity: 0.9;
}

.scene-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 46%;
  background: linear-gradient(180deg, var(--ground-top), var(--ground-bot));
  display: flex;
  align-items: flex-start;
  padding-top: 20px;
}

/* ─── land grid ────────────────────────────────────────────── */
.land-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(54px, 1fr));
  gap: 8px;
  width: min(920px, calc(100% - 28px));
  margin: 0 auto;
  padding: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 4px;
}

.tile {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  border: 2px solid rgba(0,0,0,0.5);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.04) 25%, transparent 25% 50%,
      rgba(0,0,0,0.08) 50% 75%, transparent 75%),
    var(--earth);
  background-size: 14px 14px;
  box-shadow: inset -4px -4px 8px rgba(0,0,0,0.35);
  image-rendering: pixelated;
  transition: border-color 300ms;
}

.tile-missing-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.55rem;
  font-family: 'Press Start 2P', monospace;
  color: var(--muted-2);
  padding: 4px;
  line-height: 1.4;
  pointer-events: none;
}

.tile.filled {
  border-color: rgba(57,232,135,0.3);
  background: linear-gradient(180deg, #1e5e30 0%, #0f3018 100%);
  animation: tileForge 560ms cubic-bezier(.18,.89,.32,1.28);
}

.tile.filled::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 3px;
  box-shadow: inset 0 0 12px var(--green-dim);
  pointer-events: none;
}

.sprite {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: 88%;
  height: 88%;
  object-fit: contain;
  object-position: center bottom;
  transform: translateX(-50%);
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,0.25));
}

.sprite.foundation, .sprite.bridge { width: 96%; height: 56%; }
.sprite.river { width: 74%; height: 96%; }
.sprite.tree, .sprite.castle, .sprite.windmill { height: 94%; }

/* ─── inventory panel ─────────────────────────────────────── */
.inventory-panel {
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--border-2), inset 0 1px 0 rgba(255,255,255,0.03);
}

.inv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.inv-count {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.42rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.trait-slots {
  display: grid;
  grid-template-columns: repeat(7, minmax(0,1fr));
  gap: 8px;
}

.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  transition: border-color 300ms, box-shadow 300ms;
}

.slot.filled {
  border-color: rgba(57,232,135,0.35);
  box-shadow: 0 0 10px var(--green-dim), inset 0 0 8px rgba(57,232,135,0.04);
  color: var(--ink);
}

.slot-num {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: var(--muted-2);
}

.slot-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
  opacity: 0.9;
}

.slot-label {
  font-size: 0.65rem;
  line-height: 1.2;
  color: var(--ink-2);
}

.slot-count {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.36rem;
  color: var(--green);
}

/* ─── game cards ──────────────────────────────────────────── */
.game-card {
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow:
    0 0 0 1px var(--border-2),
    0 8px 24px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-hint {
  margin-top: 8px;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ─── status badges ────────────────────────────────────────── */
.status-badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.38rem;
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid;
  letter-spacing: 0.06em;
}
.status-badge[data-status="offline"] {
  color: var(--muted);
  border-color: var(--muted-2);
  background: rgba(0,0,0,0.3);
}
.status-badge[data-status="online"] {
  color: var(--green);
  border-color: rgba(57,232,135,0.4);
  background: var(--green-dim);
  box-shadow: 0 0 8px var(--green-dim);
}

.live-badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.38rem;
  color: var(--green);
  letter-spacing: 0.06em;
  animation: livePulse 2s ease-in-out infinite;
}

.eligible-badge {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.38rem;
  color: var(--purple);
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px var(--purple-glow);
}

/* ─── auth card ────────────────────────────────────────────── */
.auth-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
}

.auth-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}

/* ─── task card ────────────────────────────────────────────── */
.task-live-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-2);
  flex-shrink: 0;
  transition: background 300ms, box-shadow 300ms;
}
.live-dot.active {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-dim), 0 0 14px var(--green-glow);
  animation: dotPulse 2s ease-in-out infinite;
}

.task-prompt {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 14px;
}

.task-meter-wrap { display: flex; flex-direction: column; gap: 6px; }

.task-meter-bar {
  height: 8px;
  background: var(--panel-3);
  border: 1px solid var(--border-2);
  border-radius: 2px;
  overflow: hidden;
}

.task-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a5c36, var(--green));
  box-shadow: 0 0 10px var(--green-glow);
  border-radius: 2px;
  transition: width 600ms ease;
}

.task-meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
}

.task-status-pill {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.36rem;
  color: var(--cyan);
  letter-spacing: 0.05em;
}

/* ─── submit card ──────────────────────────────────────────── */
.submit-card { display: flex; flex-direction: column; gap: 0; }
.submit-card .panel-title { margin-bottom: 12px; }

.input-group { margin-bottom: 10px; }

.game-input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 200ms, box-shadow 200ms;
}

.game-input::placeholder { color: var(--muted); }

.game-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan-dim), 0 0 12px var(--cyan-dim);
}

/* ─── buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms, box-shadow 200ms, opacity 200ms;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--orange);
  color: #1a1200;
  box-shadow: 0 4px 0 var(--orange-dark), 0 0 20px var(--orange-dim);
}
.btn-primary:hover {
  box-shadow: 0 4px 0 var(--orange-dark), 0 0 30px var(--orange-glow);
}
.btn-primary:active {
  box-shadow: 0 1px 0 var(--orange-dark);
  transform: translateY(2px) scale(0.98);
}

.btn-ghost {
  background: var(--panel-3);
  color: var(--ink-2);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-dim);
}

.btn-danger-ghost {
  background: transparent;
  color: #e05555;
  border: 1px solid rgba(224,85,85,0.35);
}
.btn-danger-ghost:hover {
  background: rgba(224,85,85,0.1);
  border-color: #e05555;
  box-shadow: 0 0 10px rgba(224,85,85,0.2);
}

.btn-forge {
  width: 100%;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  padding: 14px 16px;
  box-shadow: 0 4px 0 var(--orange-dark), 0 0 30px var(--orange-dim);
}

.forge-hint { margin-top: 10px; }

/* ─── reward card ──────────────────────────────────────────── */
.reward-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.reward-icon-box {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
}

.reward-placeholder {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.2rem;
  color: var(--muted);
}

.reward-icon-box img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  image-rendering: pixelated;
}

.reward-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}

.reward-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ─── leaderboard ──────────────────────────────────────────── */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  padding: 0;
}

.lb-empty {
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.lb-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 200ms;
}

.lb-row:hover { border-color: var(--border-2); }

.lb-rank {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: var(--muted);
  text-align: center;
}

.lb-rank.top { color: var(--orange); text-shadow: 0 0 8px var(--orange-glow); }

.lb-username {
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.lb-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

.lb-score {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.42rem;
  color: var(--green);
  letter-spacing: 0.05em;
  text-align: right;
}

.lb-score.complete {
  color: var(--purple);
  text-shadow: 0 0 8px var(--purple-glow);
}

/* ─── wallet card ──────────────────────────────────────────── */
.wallet-card .input-group { margin-bottom: 10px; }

/* ─── toast ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  right: 18px;
  bottom: 20px;
  z-index: 1000;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border-2);
  border-left: 3px solid var(--cyan);
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.86rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  animation: toastIn 250ms cubic-bezier(.18,.89,.32,1.28);
}

.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }

/* ─── trait reveal overlay ────────────────────────────────── */
.reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: rgba(7, 9, 15, 0.88);
  backdrop-filter: blur(6px);
  animation: fadeIn 200ms ease;
}

.reveal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 48px;
  background: var(--panel);
  border: 2px solid var(--orange);
  border-radius: 8px;
  box-shadow:
    0 0 0 2px var(--panel),
    0 0 0 4px var(--orange-dark),
    0 0 80px var(--orange-dim),
    0 32px 80px rgba(0,0,0,0.8);
  text-align: center;
  animation: revealPop 500ms cubic-bezier(.18,.89,.32,1.28);
}

.reveal-eyebrow {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--cyan);
  letter-spacing: 0.12em;
}

.reveal-sprite-wrap {
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 12px;
}

.reveal-sprite-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  animation: floatBig 2s ease-in-out infinite;
}

.reveal-trait-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.85rem;
  color: var(--orange);
  letter-spacing: 0.06em;
  text-shadow: 0 0 20px var(--orange-glow);
}

.reveal-reason {
  font-size: 0.82rem;
  color: var(--ink-2);
  max-width: 280px;
  line-height: 1.5;
}

/* ─── confetti canvas ─────────────────────────────────────── */
.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 400;
  pointer-events: none;
}

/* ─── animations ──────────────────────────────────────────── */
@keyframes tileForge {
  0%   { transform: scale(0.7); filter: brightness(2.5) saturate(2); opacity: 0.4; }
  60%  { transform: scale(1.08); filter: brightness(1.4); }
  100% { transform: scale(1); filter: brightness(1); opacity: 1; }
}

@keyframes bannerIn {
  0%   { transform: translateY(-12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes toastIn {
  0%   { transform: translateX(20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes revealPop {
  0%   { transform: scale(0.7); opacity: 0; }
  70%  { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

@keyframes floatBig {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-6px) scale(1.04); }
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--green-dim), 0 0 14px var(--green-glow); }
  50%       { box-shadow: 0 0 0 6px var(--green-dim), 0 0 24px var(--green-glow); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px) rotate(-0.5deg); }
  40%       { transform: translateX(6px) rotate(0.5deg); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(3px); }
}

.shake { animation: shake 480ms ease; }

/* ─── no quest banner ─────────────────────────────────────── */
.no-quest-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  text-align: center;
}
.no-quest-icon {
  font-size: 2rem;
  opacity: 0.25;
}
.no-quest-text {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.no-quest-sub {
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.7;
}

/* ─── responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .shell { grid-template-columns: minmax(0, 1fr) 320px; }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .control-panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
  .leaderboard-card, .wallet-card {
    grid-column: 1 / -1;
  }
  .trait-slots {
    grid-template-columns: repeat(7, minmax(0,1fr));
  }
}

@media (max-width: 640px) {
  .shell { padding: 10px; gap: 10px; }
  .hud-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .game-title { font-size: 1rem; }
  .land-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .trait-slots { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .control-panel { grid-template-columns: 1fr; }
  .reveal-card { padding: 28px 24px; }
}
