
/* ====== Design System (CSS variables) ====== */
:root {
  --bg: #0b0c0f;
  --surface: #13151a;
  --text: #e6e7ea;
  --muted: #a9adba;
  --primary: #7c5cff;
  --primary-weak: rgba(124, 92, 255, 0.15);
  --danger: #ef4444;
  --ring: rgba(124, 92, 255, 0.6);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
/* ====== Thème clair forcé ====== */
[data-theme="light"] {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #111216;
  --muted: #555a66;
  --primary: #6b46ff;
  --primary-weak: rgba(107,70,255,.12);
  --ring: rgba(107,70,255,.5);
  --shadow: 0 10px 30px rgba(0,0,0,.08);
}

/* ====== Thème sombre forcé ====== */
[data-theme="dark"] {
  --bg: #0b0c0f;
  --surface: #13151a;
  --text: #e6e7ea;
  --muted: #a9adba;
  --primary: #7c5cff;
  --primary-weak: rgba(124,92,255,.15);
  --ring: rgba(124,92,255,.6);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

[data-theme="auto"] {
  color-scheme: light dark;
}
@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --text: #111216;
    --muted: #555a66;
    --primary: #6b46ff;
    --primary-weak: rgba(107, 70, 255, 0.12);
    --ring: rgba(107, 70, 255, 0.5);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  }
}
[data-theme="light"] {
  color-scheme: light;
}
[data-theme="dark"] {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100svh;
  overflow: hidden;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu,
    "Helvetica Neue", "Noto Sans", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(
      1000px 600px at 80% -10%,
      var(--primary-weak),
      transparent 60%
    ),
    var(--bg);
  color: var(--text);
}
.wrap {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem clamp(0.8rem, 2vw, 1.2rem);
  backdrop-filter: saturate(140%) blur(8px);
}
.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
}
.muted {
  color: var(--muted);
  font-size: 0.95rem;
}
.toolbar {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
button {
  appearance: none;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.08s ease, border-color 0.2s ease,
    background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}
button:hover {
  transform: translateY(-1px);
}
button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}
.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}

.card {
  width: 90rem;
  height: 50rem; 
  margin: 0 auto;
  padding: clamp(0.9rem, 2vw, 1.4rem);
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 0.6rem;
}
.title {
  margin: 0;
}
.subtitle {
  margin: 0;
}

.choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.2rem 0 0.4rem;
}
.choice {
  font-size: clamp(1rem, 2.4vw, 1.1rem);
  display: grid;
  place-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.8rem;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(0, 0, 0, 0.08)
  );
}
.choice .emoji {
  font-size: clamp(1.6rem, 5vw, 2rem);
  line-height: 1;
}
.choice[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.duel {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto minmax(100px, 1fr);
  align-items: center;
  justify-items: center;
  gap: clamp(1.2rem, 4vw, 2.4rem);
  margin: .3rem 0 .5rem;
  text-align: center;
}

.duel .emoji.big {
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  line-height: 1;
  transition: transform .3s ease, opacity .3s ease;
}

.duel .label {
  display: block;
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: .2rem;
}

.duel .emoji.big.pop {
  transform: scale(1.3);
  opacity: 1;
  animation: popIn 0.35s ease;
  padding: 2rem;
}
.vs {
  font-weight: 700;
  opacity: 0.7;
}
@keyframes popIn {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }
  100% {
    transform: scale(1.3);
    opacity: 1;
  }
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
  margin: 0.2rem 0 0.4rem;
}
.score {
  padding: 0.3rem 0.5rem;
  height: 7rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(0, 0, 0, 0.08)
  );
  line-height: 1.3;
}
.score b {
  font-size: clamp(1rem, 3.2vw, 1.3rem);
}
.result {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 48px;
  border-radius: 12px;
  padding: 0.5rem 0.7rem;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(0, 0, 0, 0.08)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.result.reveal {
  animation: pop 0.35s ease;
}
@keyframes pop {
  from {
    transform: scale(0.98);
    opacity: 0.6;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.bottom-meta {
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}
.row {
  display: flex;
}

footer {
  text-align: center;
  padding: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 560px) {
  .choices {
    grid-template-columns: 1fr;
  }
  .card {
    width: min(94vw, 720px);
  }
}
.card {
  width: min(92vw, 72rem);                 
  height: clamp(38rem, calc(100svh - 8rem), 50rem);
  margin: 0 auto;
  padding: clamp(0.9rem, 2vw, 1.4rem);
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.06);
  display: grid;
  grid-template-rows: auto auto auto auto 1fr; 
  gap: 0.6rem;
  overflow: hidden;                        
}

.score {
  padding: 0.3rem 0.5rem;
  min-height: clamp(3.2rem, 9vw, 5.2rem);  
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.08));
  line-height: 1.3;
}
.score b { font-size: clamp(1rem, 3.2vw, 1.3rem); }

.duel {
  display: grid;
  grid-template-columns: minmax(120px,1fr) auto minmax(120px,1fr);
  align-items: center;
  justify-items: center;
  gap: clamp(1.2rem, 4vw, 2.4rem);
  margin: .3rem 0 .5rem;
  text-align: center;
}
.duel .emoji.big { font-size: clamp(2.2rem, 6vw, 3.4rem); }

@media (max-width: 700px) {
  .card {
    width: min(94vw, 48rem);
    height: clamp(36rem, calc(100svh - 7rem), 48rem);
  }
  .choices { grid-template-columns: 1fr; }
  .duel { grid-template-columns: 1fr auto 1fr; gap: clamp(1rem, 6vw, 1.6rem); }
  .duel .emoji.big { font-size: clamp(2rem, 10vw, 2.6rem); }
  .score { min-height: clamp(3rem, 12vw, 4.6rem); }
}