/* ============================================================
   ZEAL SURVIVORS — style.css
   Palette: deep indigo bg, mascot red, gold, purple, teal.
   ============================================================ */
:root {
  --bg: #120e26;
  --bg-deep: #0b081a;
  --panel: #1c1638;
  --panel-2: #251d48;
  --red: #c8505f;
  --red-deep: #8e3a48;
  --white: #e8ecf2;
  --gold: #f2b64c;
  --gold-bright: #ffd36b;
  --purple: #6c4ce0;
  --purple-deep: #2a1b4e;
  --teal: #6fe0c8;
  --danger: #ff3355;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  font-family: 'Fredoka', system-ui, sans-serif;
  color: var(--white);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#game { position: fixed; inset: 0; display: block; }

.hidden { display: none !important; }

/* ── Screens ─────────────────────────────────────────── */
.screen {
  position: fixed; inset: 0;
  display: none;
  z-index: 20;
  background: radial-gradient(120% 100% at 50% 0%, #1d1540 0%, var(--bg-deep) 70%);
  overflow-y: auto;
}
.screen.active { display: flex; align-items: center; justify-content: center; }

/* ── Loading ─────────────────────────────────────────── */
.load-box { text-align: center; }
.load-title, .game-title {
  font-family: 'Luckiest Guy', 'Fredoka', cursive;
  font-size: clamp(42px, 8vw, 84px);
  line-height: 0.9;
  color: var(--red);
  text-shadow: 0 4px 0 #5a2230, 0 8px 24px rgba(200, 80, 95, 0.45);
  letter-spacing: 2px;
}
.load-title span, .game-title span {
  display: block;
  color: var(--gold);
  text-shadow: 0 4px 0 #7a5a1a, 0 8px 24px rgba(242, 182, 76, 0.4);
  font-size: 0.62em;
  letter-spacing: 8px;
}
.load-bar {
  width: min(420px, 70vw); height: 14px;
  margin: 28px auto 12px;
  background: var(--purple-deep);
  border-radius: 8px;
  border: 2px solid #3d2a6e;
  overflow: hidden;
}
#load-fill {
  width: 0%; height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  border-radius: 6px;
  transition: width 0.2s;
}
.load-hint { opacity: 0.6; font-size: 14px; }

/* ── Menu ────────────────────────────────────────────── */
.menu-wrap {
  display: flex; gap: clamp(20px, 5vw, 80px);
  align-items: center; justify-content: center;
  flex-wrap: wrap;
  padding: 24px;
  width: 100%;
  max-width: 1100px;
}
.menu-left { text-align: center; }
#menu-hero {
  width: clamp(180px, 28vw, 320px);
  margin-top: 8px;
  filter: drop-shadow(0 12px 32px rgba(200, 80, 95, 0.35));
  animation: heroFloat 3.5s ease-in-out infinite;
}
@keyframes heroFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.season-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 14px;
  background: var(--purple-deep);
  border: 1px solid var(--purple);
  border-radius: 999px;
  font-size: 13px;
  color: #b8a8f0;
}
.menu-identity { margin-top: 10px; font-size: 15px; opacity: 0.85; }
#menu-name { cursor: pointer; border-bottom: 1px dashed rgba(232,236,242,0.4); }
#menu-name:hover { color: var(--gold-bright); }
.badge {
  margin-left: 8px; padding: 2px 8px;
  font-size: 11px; border-radius: 999px;
  background: rgba(111, 224, 200, 0.15);
  color: var(--teal);
  border: 1px solid rgba(111, 224, 200, 0.4);
}
.badge-warn { background: rgba(255, 51, 85, 0.12); color: #ff8899; border-color: rgba(255, 51, 85, 0.4); }

.menu-right { display: flex; flex-direction: column; gap: 14px; min-width: min(380px, 90vw); }
.gold-pill {
  align-self: flex-end;
  padding: 8px 18px;
  background: linear-gradient(180deg, #2a2150, var(--purple-deep));
  border: 1px solid #4d3a8e;
  border-radius: 999px;
  font-weight: 600;
  color: var(--gold-bright);
  font-size: 18px;
}
.gold-pill.small { font-size: 14px; padding: 5px 14px; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  font-family: 'Fredoka', sans-serif;
  font-size: 17px; font-weight: 600;
  padding: 13px 22px;
  border: none; border-radius: var(--radius);
  cursor: pointer;
  color: var(--white);
  background: var(--panel-2);
  border: 2px solid #3d2f6e;
  transition: transform 0.08s, filter 0.12s, box-shadow 0.12s;
  position: relative;
}
.btn:hover { filter: brightness(1.18); transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-play {
  font-size: 24px;
  padding: 18px 32px;
  background: linear-gradient(180deg, #e0606f, var(--red-deep));
  border: 2px solid #ff8896;
  box-shadow: 0 6px 0 #5a2230, 0 10px 28px rgba(200, 80, 95, 0.4);
  text-shadow: 0 2px 0 rgba(0,0,0,0.3);
}
.btn-play:hover { box-shadow: 0 8px 0 #5a2230, 0 14px 36px rgba(200, 80, 95, 0.55); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright), #c98a2a);
  border-color: #ffe3a0;
  color: #4a3208;
  text-shadow: none;
  box-shadow: 0 5px 0 #7a5a1a;
}
.btn-ghost { background: transparent; border: 2px solid #3d2f6e; }
.btn-danger { background: linear-gradient(180deg, #d04055, #8e2a3a); border-color: #ff7788; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; filter: grayscale(0.5); }

.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-daily { grid-column: 1 / -1; border-color: #4d6e3a; background: linear-gradient(180deg, #1f3318, #16240f); }
.btn-daily.claimed { opacity: 0.65; border-color: #3d2f6e; background: var(--panel-2); }
.btn-nav { font-size: 16px; text-align: left; }
.dot {
  position: absolute; top: 8px; right: 10px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

.menu-foot { text-align: center; opacity: 0.55; font-size: 13px; margin-top: 6px; }
.foot-link { color: var(--teal); text-decoration: none; }
.foot-sep { margin: 0 8px; }

/* ── Panel (sub-screens) ─────────────────────────────── */
.panel {
  width: min(860px, 96vw);
  max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 2px solid #352a66;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--panel-2);
  border-bottom: 2px solid #352a66;
}
.panel-head h2 { flex: 1; font-size: 22px; letter-spacing: 1px; }
.panel-body { padding: 18px; overflow-y: auto; }

/* cards shared by armory / characters / pass */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card {
  background: var(--panel-2);
  border: 2px solid #3d2f6e;
  border-radius: var(--radius);
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.15s, transform 0.1s;
}
.card:hover { border-color: var(--purple); }
.card .card-head { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.card .card-icon { font-size: 26px; }
.card .card-desc { font-size: 13.5px; opacity: 0.75; flex: 1; line-height: 1.35; }
.card .rank-pips { display: flex; gap: 4px; }
.pip { width: 16px; height: 8px; border-radius: 4px; background: #352a66; }
.pip.on { background: var(--gold); box-shadow: 0 0 6px rgba(242,182,76,0.6); }
.card .btn { padding: 9px 14px; font-size: 15px; }

.char-card { text-align: center; align-items: center; }
.char-card img { width: 110px; height: 110px; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.4)); }
.char-card.locked img { filter: grayscale(1) brightness(0.5); }
.char-card.selected { border-color: var(--gold); box-shadow: 0 0 18px rgba(242,182,76,0.25); }
.char-title { font-size: 12px; color: var(--gold); letter-spacing: 1px; text-transform: uppercase; }

/* ── Coin icon (image — the 🪙 emoji is missing on Win10) ── */
.coin-ico { width: 18px; height: 18px; vertical-align: -3px; }
.coin-ico.big { width: 26px; height: 26px; vertical-align: -6px; }

/* ── Battle pass ─────────────────────────────────────── */
.pass-header {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #241b4d, #1a1438);
  border: 1px solid #3d2f6e;
  border-radius: var(--radius);
}
.pass-tier-big {
  font-family: 'Luckiest Guy', cursive;
  font-size: 40px; line-height: 1;
  color: var(--gold);
  text-shadow: 0 3px 0 #7a5a1a;
}
.pass-progress { flex: 1; min-width: 220px; }
.pass-bar { height: 16px; background: var(--purple-deep); border-radius: 8px; overflow: hidden; border: 1px solid #4d3a8e; }
#pass-fill { height: 100%; background: linear-gradient(90deg, var(--purple), var(--teal)); transition: width 0.4s; }

/* aligned tier columns: tier number / free cell / premium cell */
.pass-legend { display: flex; gap: 16px; font-size: 12px; letter-spacing: 1px; opacity: .75; margin: 4px 2px 6px; }
.pass-legend .lg-free::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--teal); margin-right: 6px; }
.pass-legend .lg-prem::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--gold); margin-right: 6px; }
.pass-board {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 14px;
  scroll-snap-type: x proximity;
}
.pass-board::-webkit-scrollbar { height: 8px; }
.pass-board::-webkit-scrollbar-track { background: var(--purple-deep); border-radius: 4px; }
.pass-board::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 4px; }
.pass-col { min-width: 104px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; }
.pass-col .pcol-num {
  text-align: center; font-weight: 700; font-size: 13px;
  color: #8f84c8; padding: 2px 0;
  border-radius: 8px;
}
.pass-col.current .pcol-num { background: var(--purple); color: #fff; }
.pass-cell {
  height: 92px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 2px solid #332a5e;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; font-size: 12px; text-align: center;
  padding: 6px 4px;
  position: relative;
}
.pass-cell .pc-icon { font-size: 24px; line-height: 1.1; }
.pass-cell .pc-label { opacity: .85; line-height: 1.15; }
.pass-cell.free { border-top: 3px solid rgba(111,224,200,0.55); }
.pass-cell.prem { border-top: 3px solid rgba(242,182,76,0.55); }
.pass-cell.empty { opacity: 0.25; border-style: dashed; }
.pass-cell.locked { opacity: 0.55; }
.pass-cell.locked .pc-state { opacity: .7; }
.pass-cell.claimable {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(242,182,76,0.35);
  cursor: pointer;
  animation: pulse 1.4s infinite;
  opacity: 1;
}
.pass-cell.claimed { opacity: 0.5; }
.pass-cell.claimed::after {
  content: '✓'; position: absolute; top: 4px; right: 7px;
  color: var(--teal); font-weight: 700;
}
.pass-cell .pc-state { font-size: 10px; letter-spacing: 1px; opacity: .55; text-transform: uppercase; }
.premium-banner {
  background: linear-gradient(135deg, #2a2150, #4d2a6e);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.premium-banner .pb-text { flex: 1; min-width: 200px; }
.premium-banner h3 { color: var(--gold-bright); margin-bottom: 4px; }

/* ── Daily sign-in scene ─────────────────────────────── */
.daily-hero {
  text-align: center;
  padding: 10px 0 4px;
}
.daily-hero .dh-icon { font-size: 54px; filter: drop-shadow(0 6px 18px rgba(111,224,200,0.35)); }
.daily-hero h3 { font-size: 22px; margin: 6px 0 4px; }
.daily-hero .dh-sub { font-size: 13.5px; opacity: .7; max-width: 460px; margin: 0 auto; line-height: 1.45; }
.daily-streak-row {
  display: flex; gap: 6px; justify-content: center;
  margin: 16px 0;
}
.streak-day {
  width: 44px; padding: 8px 0 6px;
  border-radius: 10px;
  background: var(--panel-2);
  border: 2px solid #332a5e;
  text-align: center; font-size: 11px;
}
.streak-day .sd-flame { font-size: 17px; }
.streak-day.lit { border-color: #ff8c3a; background: linear-gradient(180deg, #3a2a1e, #261a12); }
.streak-day.today { border-color: var(--teal); box-shadow: 0 0 12px rgba(111,224,200,0.3); }
.daily-reward-card {
  display: flex; gap: 18px; justify-content: center; align-items: center;
  background: linear-gradient(135deg, #1e2a1c, #16240f);
  border: 2px solid #4d6e3a;
  border-radius: var(--radius);
  padding: 14px 22px;
  margin: 0 auto 16px;
  width: fit-content;
  font-size: 17px; font-weight: 600;
}
.daily-cta { display: block; margin: 0 auto; min-width: 260px; }
.daily-note { text-align: center; font-size: 12px; opacity: .5; margin-top: 12px; }

/* ── Leaderboard ─────────────────────────────────────── */
.board-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.board-tab {
  padding: 8px 18px; border-radius: 999px;
  background: var(--panel-2); border: 2px solid #3d2f6e;
  cursor: pointer; font-weight: 600; font-size: 14px;
}
.board-tab.on { background: var(--purple); border-color: #9a82ff; }
.board-countdown { font-size: 13px; opacity: 0.7; margin-bottom: 10px; }
.board-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px;
  border-radius: 10px;
  margin-bottom: 5px;
  background: var(--panel-2);
  font-size: 15px;
}
.board-row.me { border: 2px solid var(--teal); background: rgba(111,224,200,0.08); }
.board-row .b-rank { width: 44px; font-weight: 700; color: var(--gold); }
.board-row .b-rank.top1 { font-size: 20px; }
.board-row .b-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row .b-name .premium-star { color: var(--gold-bright); }
.board-row .b-char { font-size: 12px; opacity: 0.6; width: 70px; }
.board-row .b-score { font-weight: 700; }
.board-empty { text-align: center; opacity: 0.6; padding: 30px; }

/* ── Quests ──────────────────────────────────────────── */
.quest-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel-2);
  border: 2px solid #3d2f6e;
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 10px;
}
.quest-row .q-desc { flex: 1; }
.quest-row .q-reward { font-size: 13px; color: var(--gold); white-space: nowrap; }
.quest-row.done { border-color: var(--teal); }
.quest-row.claimed { opacity: 0.45; }

/* ── HUD ─────────────────────────────────────────────── */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.hud-top {
  position: absolute; top: max(10px, env(safe-area-inset-top)); left: 0; right: 0;
  display: flex; justify-content: center; gap: 26px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.hud-time { font-size: 30px; font-weight: 700; letter-spacing: 2px; }
.hud-score, .hud-gold { font-size: 17px; align-self: center; }
.mult { color: var(--teal); font-size: 13px; }
.xp-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 7px;
  background: rgba(42,27,78,0.8);
}
#xp-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--teal), #9adcff); transition: width 0.15s; }
#hud-level {
  position: absolute; top: 10px; left: 12px;
  font-size: 14px; font-weight: 700;
  color: var(--teal);
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.hp-wrap {
  position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%);
  width: min(300px, 60vw);
  text-align: center;
}
.hp-bar { height: 14px; background: rgba(0,0,0,0.55); border-radius: 8px; border: 1px solid rgba(255,255,255,0.18); overflow: hidden; }
#hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff5a6e, #ff8896); transition: width 0.12s; border-radius: 7px; }
#hud-kills { font-size: 13px; opacity: 0.85; text-shadow: 0 2px 4px #000; }
#hud-weapons {
  position: absolute; top: 46px; left: 12px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 18px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
#hud-weapons .w-slot { opacity: 0.9; }
#hud-weapons .w-evo { filter: drop-shadow(0 0 6px var(--gold)); }
#boss-bar {
  position: absolute; top: 72px; left: 50%; transform: translateX(-50%);
  width: min(520px, 86vw);
  text-align: center;
}
#boss-name { font-weight: 700; color: #ff8896; text-shadow: 0 2px 6px #000; margin-bottom: 4px; letter-spacing: 1px; }
.boss-hp { height: 12px; background: rgba(0,0,0,0.6); border: 1px solid #ff5a6e; border-radius: 7px; overflow: hidden; }
#boss-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff3355, #ff8896); transition: width 0.2s; }
.btn-pause {
  position: absolute; top: max(10px, env(safe-area-inset-top)); right: 12px;
  pointer-events: auto;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.25);
  background: rgba(28,22,56,0.7);
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
}
.btn-dash {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom)); right: 22px;
  pointer-events: auto;
  width: 74px; height: 74px;
  border-radius: 50%;
  border: 3px solid rgba(154,220,255,0.6);
  background: rgba(28,22,56,0.75);
  color: var(--white);
  font-size: 30px;
  cursor: pointer;
  display: none; /* shown on touch devices via JS */
  transition: filter 0.1s;
}
.btn-dash.cooling { filter: grayscale(1) brightness(0.6); }
.btn-dash:active { transform: scale(0.93); }
.dash-hint {
  position: absolute;
  bottom: max(50px, env(safe-area-inset-bottom)); right: 16px;
  font-size: 11.5px; opacity: 0.45;
  text-shadow: 0 2px 4px #000;
  letter-spacing: 1px;
}
@media (pointer: coarse) { .dash-hint { display: none; } }

/* ── Modals ──────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11,8,26,0.78);
  backdrop-filter: blur(3px);
  padding: 16px;
}
.draft-box, .pause-box, .results-box {
  background: var(--panel);
  border: 2px solid #4d3a8e;
  border-radius: 22px;
  padding: 26px;
  width: min(720px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: popIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn { from { transform: scale(0.85); opacity: 0; } }
.draft-title {
  font-family: 'Luckiest Guy', cursive;
  color: var(--gold);
  font-size: 36px;
  text-shadow: 0 3px 0 #7a5a1a;
  margin-bottom: 18px;
  letter-spacing: 2px;
}
#draft-cards { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.draft-card {
  flex: 1; min-width: 170px; max-width: 215px;
  background: var(--panel-2);
  border: 2px solid #4d3a8e;
  border-radius: var(--radius);
  padding: 18px 14px;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}
.draft-card:hover {
  transform: translateY(-5px) scale(1.03);
  border-color: var(--gold);
  box-shadow: 0 10px 30px rgba(242,182,76,0.25);
}
.draft-card .d-icon { font-size: 42px; margin-bottom: 8px; }
.draft-card .d-name { font-weight: 700; font-size: 17px; margin-bottom: 6px; }
.draft-card .d-desc { font-size: 13px; opacity: 0.75; line-height: 1.35; }
.draft-card .d-new {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  background: var(--red); color: #fff;
  padding: 2px 8px; border-radius: 999px;
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.draft-card.banish-mode:hover { border-color: var(--danger); box-shadow: 0 10px 30px rgba(255,51,85,0.3); }
.draft-actions { margin-top: 18px; display: flex; gap: 10px; justify-content: center; }
.draft-hint { margin-top: 10px; color: var(--danger); font-size: 14px; }

.pause-box h2, #results-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 34px; letter-spacing: 2px;
  margin-bottom: 14px;
}
#pause-loadout { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; font-size: 15px; }
#pause-loadout .lo-item { background: var(--panel-2); padding: 6px 12px; border-radius: 10px; border: 1px solid #3d2f6e; }
.pause-box .btn { display: block; width: 100%; margin-top: 10px; }

#results-title.victory { color: var(--gold); text-shadow: 0 3px 0 #7a5a1a; }
#results-title.defeat { color: var(--red); text-shadow: 0 3px 0 #5a2230; }
.results-taunt { opacity: 0.7; font-style: italic; margin-bottom: 10px; }
.results-score { font-size: 44px; font-weight: 700; color: var(--gold-bright); text-shadow: 0 3px 12px rgba(242,182,76,0.4); }
.results-rank { min-height: 24px; color: var(--teal); font-weight: 600; margin: 6px 0 14px; }
.results-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px; margin-bottom: 14px;
}
.results-grid .r-stat { background: var(--panel-2); border-radius: 10px; padding: 10px 6px; }
.results-grid .r-stat .r-val { font-size: 20px; font-weight: 700; }
.results-grid .r-stat .r-label { font-size: 11.5px; opacity: 0.6; text-transform: uppercase; letter-spacing: 1px; }
#results-earnings { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
#results-earnings .earn {
  background: rgba(242,182,76,0.1);
  border: 1px solid rgba(242,182,76,0.4);
  color: var(--gold-bright);
  border-radius: 999px; padding: 6px 16px;
  font-weight: 600; font-size: 15px;
}
#results-quests .quest-done {
  color: var(--teal); font-size: 14px; margin: 3px 0;
}
.results-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }

/* ── Banner & toasts ─────────────────────────────────── */
#banner {
  position: fixed; top: 18%; left: 50%; transform: translateX(-50%);
  z-index: 25;
  text-align: center;
  pointer-events: none;
  animation: bannerIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bannerIn { from { transform: translate(-50%, -30px) scale(0.7); opacity: 0; } }
#banner .banner-big {
  font-family: 'Luckiest Guy', cursive;
  font-size: clamp(28px, 6vw, 52px);
  color: var(--danger);
  text-shadow: 0 4px 0 #5a1020, 0 8px 30px rgba(255,51,85,0.5);
  letter-spacing: 3px;
}
#banner .banner-sub { font-size: 16px; opacity: 0.85; text-shadow: 0 2px 6px #000; }
#banner.gold .banner-big { color: var(--gold); text-shadow: 0 4px 0 #7a5a1a, 0 8px 30px rgba(242,182,76,0.5); }

#toasts {
  position: fixed; bottom: 80px; right: 14px; z-index: 40;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--panel);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 280px;
}
.toast.teal { border-color: var(--teal); }
@keyframes toastIn { from { transform: translateX(60px); opacity: 0; } }

#touch-hint {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  z-index: 15; pointer-events: none;
  background: rgba(28,22,56,0.85);
  padding: 8px 18px; border-radius: 999px;
  font-size: 14px; opacity: 0.9;
  border: 1px solid #4d3a8e;
}

/* settings rows */
.set-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 4px;
  border-bottom: 1px solid #2a2150;
  font-size: 16px;
}
.set-row label { flex: 1; }
.set-row input[type="range"] { width: 160px; accent-color: var(--purple); }
.set-row input[type="text"] {
  background: var(--panel-2); border: 2px solid #3d2f6e;
  border-radius: 8px; color: var(--white);
  padding: 8px 12px; font-family: inherit; font-size: 15px;
  width: 200px;
}
.switch { width: 50px; height: 28px; background: #352a66; border-radius: 999px; position: relative; cursor: pointer; transition: background 0.15s; }
.switch.on { background: var(--teal); }
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; transition: left 0.15s;
}
.switch.on::after { left: 25px; }

/* mobile tweaks */
@media (max-width: 700px) {
  .menu-wrap { flex-direction: column; gap: 12px; padding-bottom: 50px; }
  #menu-hero { width: 150px; }
  .game-title { font-size: 38px; }
  .hud-time { font-size: 22px; }
  .draft-card { min-width: 130px; }
  .panel { max-height: 96vh; }
}

/* ── Loading screen key art ──────────────────────────── */
/* Full-bleed artwork behind the loader; the .has-art class is added
   by the <img> onload, so a missing/failed file leaves the original
   centered title box untouched. */
#load-art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 36% center; /* favor Ego when portrait crops the sides */
  opacity: 0;
  transition: opacity 0.5s;
}
#screen-loading.has-art #load-art { opacity: 1; }
#screen-loading.has-art { align-items: flex-end; }
#screen-loading.has-art .load-box {
  position: relative;
  margin-bottom: calc(6vh + env(safe-area-inset-bottom, 0px));
  padding: 16px 28px 14px;
  background: rgba(11, 8, 26, 0.62);
  border: 2px solid rgba(108, 76, 224, 0.35);
  border-radius: 18px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
/* logo rides the top-left of the art, like the key-art mock */
.load-title-art { display: none; }
#screen-loading.has-art .load-box .load-title { display: none; }
#screen-loading.has-art .load-title-art {
  display: block;
  position: absolute;
  top: calc(18px + env(safe-area-inset-top, 0px));
  left: 24px;
  text-align: left;
  font-size: clamp(30px, 4.5vw, 54px);
}
#screen-loading.has-art .load-title-art span { letter-spacing: 5px; }
#screen-loading.has-art .load-bar { margin-top: 4px; }

/* ── Ronin profile / wallet identity ────────────────── */
.wallet-profile-card {
  width: 100%; min-height: 66px;
  display: grid; grid-template-columns: 38px 1fr auto 12px;
  align-items: center; gap: 11px;
  padding: 10px 12px;
  color: var(--white); text-align: left;
  font-family: inherit;
  background: linear-gradient(135deg, rgba(56,119,248,.18), rgba(37,29,72,.92));
  border: 1px solid rgba(96,145,255,.42);
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .12s, border-color .12s, filter .12s;
}
.wallet-profile-card:hover { transform: translateY(-2px); filter: brightness(1.12); border-color: #78a5ff; }
.wallet-profile-card:active { transform: translateY(0) scale(.99); }
.wallet-profile-card.mismatch,
.wallet-profile-card.reconnect { border-color: rgba(242,182,76,.65); background: linear-gradient(135deg, rgba(242,182,76,.13), rgba(37,29,72,.94)); }
.wallet-profile-logo { width: 38px; height: 38px; object-fit: contain; border-radius: 10px; }
.wallet-profile-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wallet-profile-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wallet-profile-meta { color: rgba(232,236,242,.62); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wallet-profile-state {
  padding: 4px 7px; border-radius: 999px;
  color: #9ebcff; background: rgba(56,119,248,.15);
  border: 1px solid rgba(96,145,255,.35);
  font-size: 9px; font-weight: 700; letter-spacing: .8px;
}
.wallet-profile-card.connected .wallet-profile-state { color: var(--teal); background: rgba(111,224,200,.12); border-color: rgba(111,224,200,.35); }
.wallet-profile-card.mismatch .wallet-profile-state,
.wallet-profile-card.reconnect .wallet-profile-state { color: var(--gold-bright); background: rgba(242,182,76,.12); border-color: rgba(242,182,76,.35); }
.wallet-profile-arrow { font-size: 25px; opacity: .55; line-height: 1; }

.profile-hero {
  display: grid; grid-template-columns: 126px 1fr; gap: 20px; align-items: center;
  padding: 20px;
  background: radial-gradient(circle at 8% 25%, rgba(200,80,95,.23), transparent 42%), linear-gradient(135deg, #251d48, #17122f);
  border: 1px solid #46367d; border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
.profile-hero.connected { border-color: rgba(111,224,200,.48); }
.profile-hero.mismatch,
.profile-hero.reconnect { border-color: rgba(242,182,76,.55); }
.profile-avatar-wrap {
  width: 126px; height: 126px; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(circle at 50% 35%, rgba(200,80,95,.3), rgba(42,27,78,.6));
  border: 2px solid rgba(255,255,255,.08); border-radius: 50%;
}
.profile-avatar { width: 118px; max-height: 124px; object-fit: contain; object-position: bottom; }
.profile-status {
  display: inline-flex; width: fit-content;
  margin-bottom: 5px; padding: 3px 8px;
  color: var(--teal); background: rgba(111,224,200,.1);
  border: 1px solid rgba(111,224,200,.3); border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
}
.profile-hero.guest .profile-status { color: #a99adb; background: rgba(108,76,224,.12); border-color: rgba(108,76,224,.35); }
.profile-hero.mismatch .profile-status,
.profile-hero.reconnect .profile-status { color: var(--gold-bright); background: rgba(242,182,76,.1); border-color: rgba(242,182,76,.3); }
.profile-hero h3 { font-size: 25px; margin-bottom: 2px; }
.profile-address { color: #9ebcff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.profile-hero p { margin-top: 9px; color: rgba(232,236,242,.66); font-size: 13.5px; line-height: 1.45; }
.profile-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.profile-stat-grid > div {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px; text-align: center;
  background: var(--panel-2); border: 1px solid #3d2f6e; border-radius: 12px;
}
.profile-stat-grid span { color: rgba(232,236,242,.55); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.profile-stat-grid b { color: var(--gold-bright); font-size: 18px; }
.profile-sync-note {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 12px; padding: 12px 14px;
  background: rgba(111,224,200,.07); border: 1px solid rgba(111,224,200,.18); border-radius: 12px;
}
.profile-sync-note b { color: var(--teal); font-size: 14px; }
.profile-sync-note span { color: rgba(232,236,242,.58); font-size: 12.5px; text-align: right; }
.profile-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.btn-wallet-primary { background: linear-gradient(180deg, #4f87ff, #285bc7); border-color: #81aaff; box-shadow: 0 5px 0 #173575; }
.profile-busy { min-height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 9px; }
.profile-busy p { max-width: 390px; color: rgba(232,236,242,.58); font-size: 13px; }
.profile-spinner {
  width: 46px; height: 46px; margin-bottom: 8px;
  border: 4px solid rgba(96,145,255,.2); border-top-color: #6091ff; border-radius: 50%;
  animation: profileSpin .8s linear infinite;
}
@keyframes profileSpin { to { transform: rotate(360deg); } }

@media (max-width: 700px) {
  #screen-menu.active { align-items: flex-start; }
  #screen-menu .menu-wrap { padding-top: max(20px, env(safe-area-inset-top, 0px)); }
  .wallet-profile-card { min-height: 58px; grid-template-columns: 34px 1fr auto 10px; }
  .wallet-profile-logo { width: 34px; height: 34px; }
  .profile-hero { grid-template-columns: 82px 1fr; gap: 13px; padding: 14px; }
  .profile-avatar-wrap { width: 82px; height: 82px; }
  .profile-avatar { width: 78px; max-height: 82px; }
  .profile-hero h3 { font-size: 20px; }
  .profile-address { font-size: 10px; }
  .profile-stat-grid { grid-template-columns: 1fr 1fr; }
  .profile-sync-note { align-items: flex-start; flex-direction: column; }
  .profile-sync-note span { text-align: left; }
  .profile-actions { flex-direction: column; }
  .profile-actions .btn { width: 100%; }
}
