:root {
  --bg: #0d0e12;
  --bg-2: #14161c;
  --card: #181a21;
  --card-2: #20232c;
  --ink: #f2f4f8;
  --muted: #959cad;
  --line: #2c303b;
  --accent: #4d96ff;
  --accent-ink: #0d0e12;
  --accent-soft: rgba(77, 150, 255, 0.14);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;

  --c-pronoun: #ff9f45;
  --c-tense: #6bcb77;
  --c-verb: #4d96ff;
  --c-super: #c77dff;
}

body.theme-verbs    { --accent: var(--c-verb);    --accent-soft: rgba(77, 150, 255, 0.14); }
body.theme-pronouns { --accent: var(--c-pronoun); --accent-soft: rgba(255, 159, 69, 0.14); }
body.theme-tenses   { --accent: var(--c-tense);   --accent-soft: rgba(107, 203, 119, 0.14); }
body.theme-super    { --accent: var(--c-super);   --accent-soft: rgba(199, 125, 255, 0.14); }

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background:
    radial-gradient(1200px 600px at 50% -200px, var(--accent-soft), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, .display { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; }
a { color: inherit; }
button { font-family: inherit; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Header ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 0;
}
.back {
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.back:hover { color: var(--ink); border-color: var(--muted); }

.toggles { display: flex; gap: 8px; }
.icon-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn[aria-pressed="false"] { opacity: 0.4; }

.page-title {
  text-align: center;
  margin: 12px 16px 0;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.1;
  color: var(--ink);
}
.page-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  border-radius: 4px;
  background: var(--accent);
  margin: 12px auto 0;
}
.page-sub {
  text-align: center;
  margin: 10px 16px 8px;
  color: var(--muted);
}

/* ---------- Single spinner layout ---------- */
.spinner-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
@media (max-width: 820px) {
  .spinner-wrap { grid-template-columns: 1fr; gap: 16px; }
}

.wheel-box {
  position: relative;
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  aspect-ratio: 1;
}
.wheel-box canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  filter: drop-shadow(0 14px 34px rgba(0, 0, 0, 0.55));
}
.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 30px solid var(--ink);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6));
  z-index: 2;
}

.side { display: flex; flex-direction: column; gap: 14px; }

.result {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.result.pop {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pop 0.45s ease;
}
@keyframes pop {
  0% { transform: scale(0.95); }
  60% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.result-fr {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: clamp(38px, 7vw, 62px);
  line-height: 1.05;
  color: var(--accent);
  word-break: break-word;
}
.result-en { color: var(--muted); font-size: 17px; }
.result-hint { color: var(--muted); }
.say-btn {
  margin-top: 6px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.say-btn:hover { border-color: var(--accent); }

.spin-btn {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
  padding: 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  box-shadow: 0 8px 24px var(--accent-soft), inset 0 -3px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.08s, filter 0.15s;
}
.spin-btn:hover { filter: brightness(1.08); }
.spin-btn:active { transform: translateY(2px) scale(0.99); }
.spin-btn:disabled { opacity: 0.55; cursor: default; filter: none; }
.kbd-hint { text-align: center; color: var(--muted); font-size: 13px; margin-top: -6px; }

/* ---------- Normal / Elimination switch ---------- */
.mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.seg {
  display: inline-flex;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--card-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
.seg .short { display: none; }
.mode-status {
  font-size: 13px;
  color: var(--muted);
  min-height: 1.4em;
  text-align: center;
}
.mode-status button {
  border: none;
  background: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 0 2px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Choose items panel ---------- */
.choose {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2px 16px;
}
.choose summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
}
.choose summary::-webkit-details-marker { display: none; }
.choose summary::after { content: "▾"; color: var(--muted); }
.choose[open] summary::after { content: "▴"; }
.choose-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.choose-actions button {
  border: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 14px;
  max-height: 260px;
  overflow-y: auto;
}
.chip {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

/* ---------- Home page ---------- */
.home-hero { text-align: center; padding: 56px 16px 8px; }
.home-hero h1 { font-size: clamp(40px, 9vw, 72px); margin: 0; line-height: 1; }
.home-hero h1 .bleu { color: #4d96ff; }
.home-hero h1 .rouge { color: #ff6b6b; }
.home-hero p { color: var(--muted); margin: 14px 0 0; font-size: 18px; }

.game-grid {
  max-width: 1000px;
  margin: 20px auto 56px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.game-card {
  position: relative;
  display: block;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}
.game-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--c);
}
.game-card:hover { transform: translateY(-3px); border-color: var(--c); }
.game-card .emoji { font-size: 34px; }
.game-card h2 { margin: 10px 0 4px; color: var(--ink); font-size: 24px; }
.game-card p { margin: 0; color: var(--muted); font-size: 15px; }
.section-label {
  max-width: 1000px;
  margin: 24px auto 0;
  padding: 0 16px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
}

/* ---------- La super roue (multi-spinner) ---------- */
.multi { max-width: 1100px; margin: 0 auto; padding: 16px; }
.multi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 2.5vw, 28px);
}
.multi-col { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.multi-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: clamp(10px, 2.2vw, 12px);
  color: var(--muted);
}
.multi-wheel { width: 100%; }
.multi-wheel .wheel-box { max-width: 340px; }
.multi .pointer {
  border-left-width: clamp(7px, 1.6vw, 13px);
  border-right-width: clamp(7px, 1.6vw, 13px);
  border-top-width: clamp(13px, 3vw, 24px);
  top: -4px;
}
.multi-pick {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: clamp(16px, 3.6vw, 30px);
  color: var(--muted);
  text-align: center;
  line-height: 1.15;
  min-height: 1.2em;
  word-break: break-word;
}
.c-pronoun .multi-pick.set { color: var(--c-pronoun); }
.c-tense .multi-pick.set { color: var(--c-tense); }
.c-verb .multi-pick.set { color: var(--c-verb); }
.multi-pick.pop { animation: pop 0.45s ease; }

.multi-controls {
  max-width: 560px;
  margin: 20px auto 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.answer {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.answer.pop { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pop 0.45s ease; }
.q-line { font-family: var(--display); font-size: clamp(20px, 4.5vw, 28px); letter-spacing: -0.01em; }
.q-line b { font-weight: 700; }
.q-line b:nth-child(1) { color: var(--c-pronoun); }
.q-line b:nth-child(2) { color: var(--c-tense); }
.q-line b:nth-child(3) { color: var(--c-verb); }
.q-help { color: var(--muted); font-size: 14px; }
.reveal-btn {
  margin-top: 4px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  padding: 9px 22px;
  border-radius: 999px;
  cursor: pointer;
}
.reveal-btn:hover { background: var(--accent); color: var(--accent-ink); }
.answer-text {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: clamp(30px, 6.5vw, 48px);
  color: var(--accent);
  line-height: 1.1;
  animation: pop 0.45s ease;
}
.answer-note { color: var(--muted); font-weight: 600; }

.multi-settings {
  max-width: 1000px;
  margin: 28px auto 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

/* the three per-wheel mode switches get tight on phones */
@media (max-width: 560px) {
  .multi-col .seg button { font-size: 11px; padding: 4px 7px; }
  .multi-col .seg .long { display: none; }
  .multi-col .seg .short { display: inline; }
  .multi-col .mode-status { font-size: 11px; }
}
