@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;600;700;800&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

/* Garde globale : l'attribut [hidden] doit toujours masquer, meme quand une classe
   pose display:flex (sinon .chest-btn / .chest-rewards restent visibles a tort). */
[hidden] { display: none !important; }

:root {
  --bg-0: #17151f;
  --bg-1: #241f33;
  --bg-2: #2d2740;
  --neon-pink: #ff5da2;
  --neon-cyan: #2b2bff;
  --neon-violet: #5a5aff;
  --gold: #ffd23f;
  --green: #16c08a;
  --red: #ff5da2;
  --text: #fbf2dd;
  --text-dim: #b9b3c9;
  --card-bg: #241f33;
  --card-border: #fbf2dd;
  --shadow-neon: 4px 4px 0 #000;
  --safe-area-bottom: env(safe-area-inset-bottom, 0);
  --accent-1: #2b2bff;
  --accent-2: #ff5da2;
  --accent-3: #ffd23f;
  --board-bg-1: #241f33;
  --board-bg-2: #17151f;
}

body[data-theme="retro"] {
  --bg-0: #17151f;
  --bg-1: #241f33;
  --neon-pink: #ff7b00;
  --neon-cyan: #16c08a;
  --neon-violet: #ff7b00;
  --gold: #ffd23f;
  --accent-1: #ff7b00;
  --accent-2: #16c08a;
  --accent-3: #ffd23f;
  --shadow-neon: 4px 4px 0 #000;
  --board-bg-1: #241f33;
  --board-bg-2: #17151f;
}

body[data-theme="vinyl"] {
  --bg-0: #17151f;
  --bg-1: #241f33;
  --neon-pink: #ff5da2;
  --neon-cyan: #ffd23f;
  --neon-violet: #ff5da2;
  --gold: #ffd23f;
  --accent-1: #ffd23f;
  --accent-2: #ff5da2;
  --accent-3: #ffd23f;
  --shadow-neon: 4px 4px 0 #000;
  --board-bg-1: #241f33;
  --board-bg-2: #17151f;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font-family: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--bg-0);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 12px 16px calc(12px + var(--safe-area-bottom));
  gap: 12px;
}

/* HUD */
.hud {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  box-shadow: 2px 2px 0 #000;
  transition: transform 0.15s ease;
}
.hud-chip:active { transform: scale(0.96); }
.hud-chip .chip-icon {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: var(--neon-cyan);
}
#streak-btn .chip-icon { color: var(--gold); }

.xp-track {
  flex: 1;
  height: 8px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid var(--card-border);
}
.xp-fill {
  height: 100%;
  width: 0%;
  background: var(--neon-pink);
  transition: width 0.6s cubic-bezier(.2,.9,.2,1);
}

/* SCREENS */
.screen {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  animation: fadeIn 0.25s ease;
}
.screen.is-active { display: flex; }
.screen--modal.is-active {
  position: absolute;
  inset: 0;
  background: rgba(23, 21, 31, 0.92);
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* HOME */
.screen--home {
  align-items: stretch;
  justify-content: flex-start;
  padding-top: 4px;
  gap: 12px;
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: 8px;
}
.screen--home::-webkit-scrollbar { display: none; }
.screen--home > * { flex-shrink: 0; }
.screen--home .logo-wrap { align-self: center; }
.logo-wrap {
  position: relative;
  text-align: center;
  margin-top: 12px;
}
.logo-glow {
  position: absolute;
  inset: -40px;
  background: transparent;
  z-index: -1;
}
.logo {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1px;
  margin: 0;
  color: #2b2bff;
}
.logo span {
  display: block;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  margin-top: 2px;
}
.tagline {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.home-cards {
  width: 100%;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}
.card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-neon);
}
.card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--neon-cyan);
  text-transform: uppercase;
}
.card-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 18px;
  font-weight: 800;
  margin-top: 4px;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.card-meta .dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-dim);
}
.card--collection { text-align: center; }
.card-stats {
  display: flex;
  justify-content: space-around;
  gap: 18px;
  margin-top: 6px;
}
.card-stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.card-stats strong {
  font-size: 22px;
  color: var(--gold);
}
.card-stats span {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* CTA buttons */
.cta {
  width: 100%;
  padding: 16px 20px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s;
}
.cta:active { transform: scale(0.97); }
.cta:disabled { opacity: 0.4; pointer-events: none; }

.cta--primary {
  background: var(--accent-1);
  color: var(--text);
  border: 2px solid var(--card-border);
  box-shadow: var(--shadow-neon);
}
.cta--secondary {
  background: var(--accent-2);
  color: var(--text);
  border: 2px solid var(--card-border);
  box-shadow: var(--shadow-neon);
}
.cta--ghost {
  background: transparent;
  color: var(--text-dim);
  border: 2px solid var(--card-border);
  font-weight: 600;
}

/* GAME SCREEN */
.screen--game {
  gap: 8px;
  position: relative;
}

.challenge-banner {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 8px 12px 10px;
  box-shadow: 2px 2px 0 #000;
}
.challenge-cat {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--accent-3);
}
.challenge-text {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 16px;
  font-weight: 800;
  margin-top: 1px;
}
.challenge-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1.3;
}
.game-top {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 8px;
}
.game-stat {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 2px 2px 0 #000;
}
.game-stat-label {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.game-stat-value {
  font-size: 18px;
  font-weight: 800;
  margin-top: 2px;
}
.game-stat--score .game-stat-value {
  font-size: 22px;
  color: var(--gold);
}

.board-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#board {
  width: 100%;
  max-height: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  background: #1a1626;
  border: 2px solid var(--card-border);
  display: block;
  touch-action: none;
}

.reward-toast {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: var(--accent-2);
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--card-border);
  box-shadow: var(--shadow-neon);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
}
.reward-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* Toast colore par type de gain */
.reward-toast.type-jackpot {
  background: var(--gold);
  color: #17151f;
  font-size: 15px;
}
.reward-toast.type-hint  { background: var(--accent-1); }
.reward-toast.type-mult  { background: var(--neon-pink); }
.reward-toast.type-extra { background: var(--green); color:#04240f; }

/* Pulse des compteurs (score / multi) */
@keyframes zdr-pop { 0%{transform:scale(1);} 40%{transform:scale(1.3);} 100%{transform:scale(1);} }
.game-stat-value.pulse      { animation: zdr-pop 0.4s ease-out; }
.game-stat-value.pulse-gold { animation: zdr-pop 0.5s ease-out; color: var(--gold); }

/* Burst lumineux quand un disque atterrit dans une case */
.slot-burst {
  position: absolute; bottom: 6%;
  width: 34px; height: 34px; margin-left: -17px;
  border-radius: 50%;
  background: var(--neon-pink);
  pointer-events: none; z-index: 3;
  animation: zdr-burst 0.55s ease-out forwards;
}
.slot-burst.jackpot {
  width: 48px; height: 48px; margin-left: -24px;
  background: var(--gold);
}
@keyframes zdr-burst {
  0%   { opacity: 0; transform: scale(0.3); }
  25%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.7); }
}

/* ZONE PICKER */
.zone-picker {
  flex-shrink: 0;
}
.zone-picker-label {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-align: center;
}
.zone-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.zone-btn {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 2px 2px 0 #000;
  transition: transform 0.12s ease, border-color 0.2s, background 0.2s;
}
.zone-btn:active { transform: scale(0.96); }
.zone-btn .zone-emoji {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--neon-cyan);
}
.zone-btn--center .zone-emoji { color: var(--neon-pink); }
.zone-btn small {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
}
.zone-btn:hover, .zone-btn.is-armed {
  border-color: var(--neon-pink);
  background: var(--bg-2);
}

.zone-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* HINT POOL */
.hint-pool {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 8px 12px;
  flex-shrink: 0;
  max-height: 84px;
  overflow-y: auto;
  box-shadow: 2px 2px 0 #000;
}
.hint-pool-title {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.hint-pool-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.hint-empty {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}
.hint-chip {
  background: var(--bg-2);
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  animation: chipPop 0.3s cubic-bezier(.2,.9,.4,1.4);
}
.hint-chip--rare {
  background: var(--bg-2);
  border-color: var(--gold);
  color: var(--gold);
}
@keyframes chipPop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* TRANSITION OVERLAY */
.transition-overlay {
  position: absolute;
  inset: 0;
  background: rgba(23, 21, 31, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  animation: fadeIn 0.25s ease;
  border-radius: 16px;
}
.transition-overlay[hidden] { display: none; }
.transition-card {
  text-align: center;
  padding: 24px 32px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 18px;
  box-shadow: var(--shadow-neon);
  animation: bounceIn 0.45s cubic-bezier(.2,.9,.4,1.4);
  max-width: 84%;
}
.transition-step {
  font-size: 11px;
  letter-spacing: 2.5px;
  font-weight: 800;
  color: var(--accent-3);
  text-transform: uppercase;
}
.transition-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 26px;
  font-weight: 800;
  margin-top: 4px;
  color: var(--accent-1);
}
.transition-sub {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* QUESTION SCREEN */
.screen--question {
  align-items: center;
  justify-content: center;
}
.question-hint-count {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-3);
  background: var(--bg-2);
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  margin-bottom: 10px;
}
.question-card {
  width: 100%;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-neon);
}
.question-cat {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--neon-cyan);
  background: var(--bg-2);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}
.question-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 20px;
  font-weight: 800;
  margin: 12px 0 14px;
  line-height: 1.25;
}
.question-hints {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.question-hints li {
  background: var(--bg-2);
  border-left: 3px solid var(--neon-cyan);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.question-hints li.rare { border-left-color: var(--gold); }
.question-hints .no-hints {
  border-left-color: var(--text-dim);
  color: var(--text-dim);
  font-style: italic;
}

.question-options {
  display: grid;
  gap: 8px;
}
.option-btn {
  background: var(--bg-2);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 2px 2px 0 #000;
  transition: transform 0.12s, border-color 0.2s, background 0.2s;
}
.option-btn:active { transform: scale(0.98); }
.option-btn:hover { border-color: var(--neon-pink); }
.option-btn.is-correct {
  background: var(--green);
  border-color: var(--green);
  color: #04240f;
}
.option-btn.is-wrong {
  background: var(--red);
  border-color: var(--red);
}
.option-btn:disabled { pointer-events: none; }

.question-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
}
.question-foot strong { color: var(--text); }

/* RESULT SCREEN */
.screen--result {
  align-items: center;
  justify-content: center;
}
.result-card {
  width: 100%;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 20px;
  padding: 22px 18px;
  text-align: center;
  box-shadow: var(--shadow-neon);
}
.result-emoji {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--gold);
  animation: bounceIn 0.5s cubic-bezier(.2,.9,.4,1.4);
}
@keyframes bounceIn {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
#result-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 24px;
  margin: 4px 0 6px;
  font-weight: 800;
}
.result-answer {
  color: var(--text-dim);
  margin: 0 0 16px;
  font-size: 14px;
}
.result-answer strong { color: var(--neon-cyan); }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.result-grid > div {
  background: var(--bg-2);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 8px;
}
.result-grid span {
  display: block;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.result-grid strong {
  font-size: 22px;
  display: block;
  margin-top: 2px;
  color: var(--gold);
}

.result-card-flash {
  background: var(--card-bg);
  border: 2px solid var(--neon-pink);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-neon);
  animation: flashPulse 1.4s ease-in-out infinite;
}
@keyframes flashPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}
.flash-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--neon-pink);
  font-weight: 800;
}
.flash-name {
  font-size: 18px;
  font-weight: 900;
  margin-top: 4px;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

/* MODAL */
.modal {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 18px;
  padding: 22px;
  max-width: 400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-neon);
}
.modal h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 800;
}
.modal h3 {
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 18px 0 8px;
}
.howto-lead {
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 14px;
  color: var(--text);
}
.howto-lead strong { color: var(--accent-1); }
.howto-lead em { color: var(--accent-3); font-style: normal; }
.howto {
  padding-left: 20px;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  line-height: 1.45;
}
.howto strong { color: var(--accent-1); }
.howto em { color: var(--accent-3); font-style: normal; }

.collection-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}
.collection-stats > div {
  background: var(--bg-2);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
}
.collection-stats strong {
  display: block;
  font-size: 22px;
  color: var(--gold);
}
.collection-stats span {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.col-card {
  aspect-ratio: 2 / 3;
  background: var(--bg-2);
  border: 2px solid var(--card-border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 6px;
  position: relative;
  overflow: hidden;
}
.col-card.locked {
  color: var(--text-dim);
  font-style: italic;
}
.col-card.unlocked {
  background: var(--gold);
  border-color: var(--gold);
  color: #17151f;
  box-shadow: 2px 2px 0 #000;
}
.col-card .badge {
  position: absolute;
  top: 4px; right: 4px;
  font-size: 9px;
  background: rgba(0,0,0,0.5);
  border-radius: 999px;
  padding: 2px 6px;
}

/* MODE PICKER */
.mode-picker {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px;
  margin: 0 -4px;
}
.mode-picker::-webkit-scrollbar { display: none; }
.mode-pill {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  white-space: nowrap;
  transition: transform 0.1s, background 0.2s, color 0.2s, border-color 0.2s;
}
.mode-pill:active { transform: scale(0.96); }
.mode-pill.is-active {
  background: var(--accent-1);
  color: var(--text);
  border-color: var(--card-border);
  box-shadow: var(--shadow-neon);
}

/* QUESTS */
.quests {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow-neon);
}
.quests-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
}
.quests-count {
  color: var(--accent-3);
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}
.quests-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}
.quest-item .quest-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: transparent;
}
.quest-item.done .quest-check {
  background: var(--green);
  border-color: var(--green);
  color: #06210f;
}
.quest-item.done {
  color: var(--text-dim);
  text-decoration: line-through;
  text-decoration-color: rgba(251,242,221,0.3);
}
.quest-progress {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--accent-3);
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: 999px;
}
.quest-item.done .quest-progress {
  background: var(--bg-2);
  color: var(--green);
}
.quest-text {
  flex: 1;
  line-height: 1.3;
}

.chest-btn {
  margin-top: 10px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--gold);
  color: #17151f;
  border: 2px solid var(--card-border);
  box-shadow: var(--shadow-neon);
  text-align: left;
  animation: chestPulse 1.6s ease-in-out infinite;
  transition: transform 0.1s;
}
.chest-btn:active { transform: scale(0.98); }
@keyframes chestPulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.02); }
}
.chest-icon {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--gold);
  background: rgba(0,0,0,0.7);
  padding: 6px 8px;
  border-radius: 8px;
}
.chest-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.chest-text strong { font-size: 14px; }
.chest-text small { font-size: 11px; color: #4a3d10; }
.chest-cta {
  font-size: 12px;
  font-weight: 900;
  color: #17151f;
  letter-spacing: 1px;
}

/* THEME PICKER */
.theme-picker {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow-neon);
}
.theme-picker-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 6px;
}
.theme-picker-row {
  display: flex;
  gap: 8px;
}
.theme-tile {
  flex: 1;
  padding: 10px 8px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 2px solid var(--card-border);
  text-align: center;
  position: relative;
  transition: transform 0.12s, border-color 0.2s;
}
.theme-tile:active { transform: scale(0.96); }
.theme-tile .theme-swatch {
  height: 28px;
  border-radius: 8px;
  margin-bottom: 6px;
  border: 2px solid var(--card-border);
}
.theme-tile[data-theme="neon"]  .theme-swatch { background: #ff5da2; }
.theme-tile[data-theme="retro"] .theme-swatch { background: #ff7b00; }
.theme-tile[data-theme="vinyl"] .theme-swatch { background: #ffd23f; }
.theme-tile-name {
  font-size: 12px;
  font-weight: 800;
}
.theme-tile small {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}
.theme-tile.is-active {
  border-color: var(--accent-1);
  box-shadow: var(--shadow-neon);
}
.theme-tile.is-locked {
  opacity: 0.55;
}
.theme-tile.is-locked::after {
  content: "L" attr(data-min-level);
  position: absolute;
  top: 4px; right: 4px;
  font-size: 9px;
  font-weight: 800;
  background: rgba(0,0,0,0.6);
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* RESULT QUESTS */
.result-quests {
  background: var(--bg-2);
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
  text-align: left;
}
.result-quests-title {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 6px;
}
.result-quests-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.result-quests-list li {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}
.result-quests-list li.done {
  color: var(--green);
}
.result-quests-list li.justdone {
  animation: questFlash 0.8s ease;
}
@keyframes questFlash {
  0%   { background: var(--green); }
  100% { background: transparent; }
}

/* CHEST MODAL */
.modal--chest {
  text-align: center;
  background: var(--card-bg);
}
.chest-stage {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 8px;
}
.chest-3d {
  position: relative;
  width: 140px;
  height: 110px;
  animation: chestIdle 2.4s ease-in-out infinite;
}
@keyframes chestIdle {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-6px); }
}
.chest-3d.is-shaking {
  animation: chestShake 0.4s linear infinite;
}
@keyframes chestShake {
  0%   { transform: translate(0,0)   rotate(0); }
  25%  { transform: translate(-3px,1px) rotate(-2deg); }
  50%  { transform: translate(3px,-1px) rotate(2deg); }
  75%  { transform: translate(-2px,2px) rotate(-1deg); }
  100% { transform: translate(2px,-2px) rotate(1deg); }
}
.chest-body {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 70px;
  background: #a87238;
  border-radius: 8px;
  border: 2px solid #2a1808;
}
.chest-body::before {
  content: "";
  position: absolute;
  inset: 14px 8px;
  border: 2px solid #ffd23f;
  border-radius: 4px;
  opacity: 0.7;
}
.chest-lid {
  position: absolute;
  top: 0;
  left: 0; right: 0;
  height: 50px;
  background: #8b5a2b;
  border-radius: 8px 8px 4px 4px;
  border: 2px solid #2a1808;
  transform-origin: bottom center;
  transition: transform 0.6s cubic-bezier(.5,-0.4,.4,1.6);
  z-index: 2;
}
.chest-lid::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 16px;
  background: var(--gold);
  border: 2px solid #2a1808;
  border-radius: 4px;
}
.chest-3d.is-open .chest-lid {
  transform: rotateX(-110deg);
}
.chest-glow {
  position: absolute;
  inset: -30px;
  background: transparent;
  opacity: 0;
  transition: opacity 0.4s;
  z-index: 1;
}
.chest-3d.is-open .chest-glow { opacity: 1; }
.chest-rays {
  position: absolute;
  inset: -50px;
  background: transparent;
  opacity: 0;
  z-index: 0;
  animation: rayspin 6s linear infinite;
}
.chest-3d.is-open .chest-rays { opacity: 0.6; }
@keyframes rayspin {
  to { transform: rotate(360deg); }
}

.chest-sub {
  color: var(--text-dim);
  margin: 0 0 12px;
  font-size: 13px;
}
.chest-rewards {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.chest-rewards li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 2px solid var(--gold);
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  animation: rewardSlide 0.4s ease both;
}
.chest-rewards li:nth-child(2) { animation-delay: 0.1s; }
.chest-rewards li:nth-child(3) { animation-delay: 0.2s; }
@keyframes rewardSlide {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}
.reward-tag {
  background: var(--gold);
  color: #2a1808;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

/* small screens */
@media (max-height: 700px) {
  .logo { font-size: 36px; }
  .logo span { font-size: 13px; }
  .hint-pool { max-height: 64px; }
}
@media (max-height: 760px) {
  .quests-list { gap: 6px; }
  .theme-tile .theme-swatch { height: 22px; }
}
