/* Flag emojis: Windows has none and prints letters instead (🇧🇷 → "BR").
   This font only covers flag characters (unicode-range), so it is downloaded only
   when a flag is displayed. Twemoji art © Twitter, CC-BY 4.0 — see fonts/LICENSE-TwemojiCountryFlags.md */
@font-face {
  font-family: "Twemoji Country Flags";
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  src: url(/fonts/TwemojiCountryFlags.woff2) format("woff2");
  font-display: swap;
}

/* Space Grotesk (variable, weight axis 300–700), self-hosted — SIL Open Font License, see fonts/OFL-SpaceGrotesk.txt */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url(/fonts/space-grotesk-latin-ext-wght-normal.woff2) format("woff2-variations"), url(/fonts/space-grotesk-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url(/fonts/space-grotesk-latin-wght-normal.woff2) format("woff2-variations"), url(/fonts/space-grotesk-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0d0a24;
  --bg-2: rgba(255, 255, 255, .07);
  --card: rgba(255, 255, 255, .08);
  --card-2: rgba(255, 255, 255, .14);
  --line: rgba(255, 255, 255, .18);
  --text: #f7f5ff;
  --muted: #c4bce8;
  --accent: #ffb938;
  --accent-ink: #2b1d00;
  --primary: #7c5cff;
  --primary-2: #6746f2;
  --good: #2ecc8f;
  --bad: #ff5d73;
  --radius: 20px;
  --blur: blur(10px) saturate(150%);
  --shadow: 0 8px 32px rgba(8, 4, 30, .45), inset 0 1px 0 rgba(255, 255, 255, .15);
  --choice-1: #ff5d73;
  --choice-2: #3fa9f5;
  --choice-3: #ffb938;
  --choice-4: #2ecc8f;
  --choice-5: #b16cff;
  --choice-6: #ff8a3d;
  --font: "Twemoji Country Flags", "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-wght: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* The gradient lives on <html> so the fixed particle canvas (z-index -1) paints above it. */
html { background: linear-gradient(135deg, #0d0a24 0%, #1c1150 45%, #0f2a4a 100%) fixed #0d0a24; min-height: 100%; }
body {
  font-family: var(--font);
  font-optical-sizing: auto;
  background: transparent;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}
a { color: var(--accent); }

/* ---- background: particles + soft colour blobs behind the glass ---- */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.blob { position: fixed; border-radius: 50%; filter: blur(80px); opacity: .45; z-index: -2; pointer-events: none; animation: float 22s ease-in-out infinite alternate; }
.blob.b1 { width: 420px; height: 420px; background: #7c5cff; top: -120px; left: -100px; }
.blob.b2 { width: 360px; height: 360px; background: #ff5d9e; bottom: -120px; right: -80px; animation-delay: -7s; }
.blob.b3 { width: 300px; height: 300px; background: #ffb938; top: 40%; left: 55%; opacity: .25; animation-delay: -14s; }
@keyframes float { to { transform: translate(60px, -40px) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.02em; }

/* ---- Space Grotesk variable: the weight axis (300–700) is animated ---- */
.btn, .nav a, .pill, .theme-btn, .tabs button, .choice, .star, .kw, .chip, .badge, .list a.li-link strong {
  transition-property: font-weight, transform, background, opacity, filter, outline-color, color, border-color;
  transition-duration: .25s;
  transition-timing-function: var(--ease-wght);
}
.btn { font-weight: 600; }
.btn:hover:not(:disabled) { font-weight: 700; }
.nav a { font-weight: 500; }
.nav a:hover, .nav a.active { font-weight: 700; }
.pill, .tabs button { font-weight: 500; }
.pill:hover, .pill.active, .tabs button:hover, .tabs button.active { font-weight: 700; }
.theme-btn { font-weight: 500; }
.theme-btn:hover:not(:disabled), .theme-btn.active { font-weight: 700; }
.choice { font-weight: 600; }
.choice:hover:not(:disabled), .choice.selected, .choice.correct { font-weight: 700; }
.choice.dim { font-weight: 300; }
.list li:hover a.li-link strong { font-weight: 700; }
.theme-card .tc-name { font-weight: 600; transition: font-weight .3s var(--ease-wght); }
.theme-card:hover .tc-name { font-weight: 700; }

/* Letter-by-letter weight wave (text split into spans by JS, --i = index). */
.wave { display: inline-block; }
.wave .w { display: inline-block; white-space: nowrap; }
.wave .ch { display: inline-block; animation: wght-wave 2.8s var(--ease-wght) infinite; animation-delay: calc(var(--i) * 70ms); }
.wave.once .ch { animation: wght-in .9s var(--ease-wght) both; animation-delay: calc(var(--i) * 40ms); }
@keyframes wght-wave {
  0%, 100% { font-weight: 700; }
  50% { font-weight: 300; }
}
@keyframes wght-in {
  from { font-weight: 300; opacity: 0; transform: translateY(.25em); }
  60% { font-weight: 700; opacity: 1; transform: none; }
  to { font-weight: 600; }
}
/* Hovering the brand replays a quick wave. */
.wave-hover .ch { display: inline-block; transition: font-weight .3s var(--ease-wght); transition-delay: calc(var(--i) * 25ms); font-weight: 600; }
.brand:hover .wave-hover .ch { font-weight: 300; }

/* Breathing weight: room code, big numbers. */
.breathe { animation: wght-breathe 3.2s ease-in-out infinite; }
@keyframes wght-breathe { 0%, 100% { font-weight: 700; } 50% { font-weight: 400; } }

/* Pop: goes thin to heavy with a small bounce (verdicts, revealed answers). */
.pop { animation: wght-pop .7s var(--ease-wght) both; }
@keyframes wght-pop {
  0% { font-weight: 300; transform: scale(.92); opacity: 0; }
  55% { font-weight: 700; transform: scale(1.06); opacity: 1; }
  100% { font-weight: 700; transform: none; }
}
.urgent { animation: wght-urgent .5s ease-in-out infinite alternate; color: var(--bad); }
@keyframes wght-urgent { from { font-weight: 400; } to { font-weight: 700; } }

@media (prefers-reduced-motion: reduce) {
  .wave .ch, .wave.once .ch, .breathe, .pop, .urgent { animation: none; }
}

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; position: sticky; top: 0; z-index: 10;
  background: rgba(13, 10, 36, .35); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; font-size: 1.25rem; text-decoration: none; color: var(--text); letter-spacing: -.02em; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-logo { width: 32px; height: 32px; transition: transform .3s; filter: drop-shadow(0 2px 6px rgba(111, 217, 74, .45)); }
.brand:hover .brand-logo { transform: rotate(-12deg) scale(1.1); }

/* 3D emojis (Fluent) drawn in place of the text ones */
img.fe { height: 1.2em; width: 1.2em; vertical-align: -0.22em; margin: 0 .04em; display: inline-block; object-fit: contain; }
.q-media .emoji img.fe { height: 1.15em; width: 1.15em; margin: 0 .06em; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .35)); }

/* Big logo on the sign-in screen: icon + name, like the header */
.hero-logo { display: inline-flex; align-items: center; gap: 16px; }
.hero-logo img { width: 1.25em; height: 1.25em; filter: drop-shadow(0 4px 14px rgba(111, 217, 74, .45)); }
.userbox { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .95rem; }

.container { max-width: 1000px; margin: 0 auto; padding: 24px 16px 60px; }

.card {
  background: linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.card h2, .card h3 { margin-top: 0; }
.stack > * + * { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.hidden { display: none !important; }

.btn {
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 12px; padding: 11px 18px; cursor: pointer; font-weight: 700;
  background: linear-gradient(135deg, #8f74ff, var(--primary-2)); color: #fff; box-shadow: 0 4px 18px rgba(124, 92, 255, .35); transition: transform .08s, background .15s, opacity .15s;
}
.btn:hover { filter: brightness(1.1); }
a.btn { display: inline-block; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.accent { background: linear-gradient(135deg, #ffd06b, var(--accent)); color: var(--accent-ink); box-shadow: 0 4px 22px rgba(255, 185, 56, .35); }
.btn.ghost { background: var(--bg-2); border: 1px solid var(--line); color: var(--text); box-shadow: none; backdrop-filter: blur(8px); }
.btn.ghost:hover { background: var(--card-2); }
.btn.good { background: var(--good); color: #002a1a; box-shadow: none; }
.btn.bad { background: linear-gradient(135deg, #ff7a8c, var(--bad)); box-shadow: 0 4px 18px rgba(255, 93, 115, .3); }
.btn.big { padding: 15px 26px; font-size: 1.1rem; }
.btn.sm { padding: 6px 12px; font-size: .88rem; border-radius: 10px; }
.btn.block { width: 100%; }

label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .08); outline: none; backdrop-filter: blur(6px);
}
input::placeholder { color: rgba(255, 255, 255, .45); }
select option { background: #1c1150; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124, 92, 255, .3); }
.field + .field { margin-top: 12px; }
/* Side by side in a grid, the grid gap handles spacing: no extra top margin. */
.grid-2 > .field + .field, .grid-name-emoji > .field + .field { margin-top: 0; }
.grid-name-emoji { display: grid; grid-template-columns: 1fr 110px; gap: 16px; }
.grid-name-emoji input#te-emoji { text-align: center; font-size: 1.3rem; padding: 8px; }
.error { color: var(--bad); font-weight: 600; min-height: 1.2em; }

.tabs { display: flex; gap: 6px; background: var(--bg-2); padding: 5px; border-radius: 12px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; cursor: pointer; font-weight: 700; color: var(--muted); }
.tabs button.active { background: var(--card-2); color: var(--text); }

.hero { text-align: center; margin: 20px 0 30px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0 0 8px; letter-spacing: -.03em; line-height: 1.05; }
.auth-card { max-width: 420px; margin: 0 auto; }

.code-input { text-transform: uppercase; letter-spacing: .3em; font-weight: 700; text-align: center; font-size: 1.3rem; }
.room-code {
  text-shadow: 0 0 24px rgba(255, 185, 56, .55);
  font-size: clamp(2.2rem, 8vw, 3.6rem); font-weight: 700; letter-spacing: .22em; color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg-2); }
.list li + li { margin-top: 8px; }
.list a.li-link { display: flex; flex: 1; justify-content: space-between; gap: 10px; color: inherit; text-decoration: none; }
.list li:has(a.li-link):hover { background: var(--card-2); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--card-2); font-size: .85rem; font-weight: 600; }
.chip.good { background: rgba(46, 204, 143, .18); color: var(--good); }
.chip.bad { background: rgba(255, 93, 115, .16); color: var(--bad); }
.chip.accent { background: rgba(255, 185, 56, .18); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; }
.dot.off { background: #777; }

.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.theme-btn {
  border: 1px solid var(--line); background: var(--bg-2); border-radius: 14px; transition: background .15s, border-color .15s, transform .1s; padding: 12px 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; text-align: center;
}
.theme-btn .e { font-size: 1.8rem; }
.theme-btn:hover:not(:disabled) { background: var(--card-2); transform: translateY(-2px); }
.theme-btn.active { border-color: var(--accent); background: rgba(255, 185, 56, .16); box-shadow: 0 0 0 1px var(--accent), 0 4px 20px rgba(255, 185, 56, .25); }
.theme-btn:disabled { cursor: default; }

.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; font-weight: 600; cursor: pointer; margin: 0; }
.check input { accent-color: var(--accent); }

/* ---- game ---- */
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.timer { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.timer > div { height: 100%; background: linear-gradient(90deg, var(--good), var(--accent), var(--bad)); background-size: 300% 100%; transition: width .25s linear; }
.q-prompt { font-size: clamp(1.3rem, 3.4vw, 1.9rem); font-weight: 600; margin: 0 0 16px; letter-spacing: -.01em; }
.q-media { text-align: center; margin: 10px 0 20px; }
.q-media .emoji { font-size: clamp(3rem, 12vw, 5.5rem); line-height: 1.2; word-break: break-word; }
.q-media img:not(.fe) { max-width: 100%; max-height: 360px; border-radius: 14px; box-shadow: var(--shadow); }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.choice {
  border: 0; border-radius: 14px; padding: 18px 16px; font-size: 1.05rem; cursor: pointer; color: #fff;
  text-align: left; display: flex; align-items: center; gap: 12px; min-height: 70px;
  border: 1px solid rgba(255, 255, 255, .25); box-shadow: 0 6px 20px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .3); transition: transform .08s, opacity .15s, outline .15s;
  outline: 4px solid transparent; outline-offset: 2px;
}
.choice .letter { background: rgba(0, 0, 0, .2); border-radius: 8px; padding: 2px 9px; }
.choice:nth-child(1) { background: var(--choice-1); }
.choice:nth-child(2) { background: var(--choice-2); }
.choice:nth-child(3) { background: var(--choice-3); color: var(--accent-ink); }
.choice:nth-child(4) { background: var(--choice-4); color: #002a1a; }
.choice:nth-child(5) { background: var(--choice-5); }
.choice:nth-child(6) { background: var(--choice-6); }
.choice:hover:not(:disabled) { transform: translateY(-2px); }
.choice.selected { outline-color: #fff; }
.choice.dim { opacity: .35; }
.choice.correct { outline-color: var(--good); opacity: 1; }
.choice:disabled { cursor: default; }
.vf .choice:nth-child(1) { background: var(--choice-4); color: #002a1a; }
.vf .choice:nth-child(2) { background: var(--choice-1); color: #fff; }

.answer-box { display: flex; gap: 10px; }

.peer-answers .list li.ok { box-shadow: inset 3px 0 0 var(--good); }
.peer-answers .list li.ko { box-shadow: inset 3px 0 0 var(--bad); }
.peer-text { min-width: 0; overflow-wrap: anywhere; }
.peer-answer { font-weight: 600; }

.music-ctl { display: inline-flex; align-items: center; gap: 6px; }
.music-ctl input[type=range] { width: 90px; accent-color: var(--accent); }
.music-preview { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.music-preview audio { height: 36px; max-width: 100%; }
.ufo { position: fixed; left: 0; top: 0; z-index: 101; pointer-events: none; will-change: transform; }
.ufo img { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35)); }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }

/* ---- ordering questions ---- */
.ord-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ord-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05)); border: 1px solid var(--line);
  user-select: none; -webkit-user-select: none; transition: transform .12s, box-shadow .12s, background .12s;
}
#ord-list .ord-item { cursor: grab; }
.ord-item.dragging { cursor: grabbing; transform: scale(1.02); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); background: rgba(124, 92, 255, .35); border-color: var(--primary); z-index: 2; position: relative; }
.ord-handle { font-size: 1.4rem; color: var(--muted); touch-action: none; padding: 4px 2px; cursor: grab; }
.ord-num { flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.ord-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; pointer-events: none; }
.ord-text { flex: 1; font-weight: 600; }
.ord-item.img-only img { width: 128px; height: 128px; }
@media (max-width: 600px) { .ord-item.img-only img { width: 96px; height: 96px; } }
.ord-btns { display: flex; gap: 4px; margin-left: auto; }
.ord-list.solution .ord-num { background: var(--good); color: #002a1a; }
.ord-edit-row { display: flex; align-items: center; gap: 8px; }
.ord-edit-row input[type=text] { flex: 1; }
.ord-edit-num { width: 1.6rem; text-align: center; font-weight: 700; color: var(--accent); }
.ord-edit-img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.answer-box input { font-size: 1.15rem; }

.answer-reveal { background: rgba(46, 204, 143, .12); border: 1px solid rgba(46, 204, 143, .4); border-radius: 14px; padding: 14px 16px; }
.answer-reveal .big { font-size: 1.4rem; font-weight: 700; color: var(--good); }
.verdict-me { font-size: 1.3rem; font-weight: 700; text-align: center; padding: 10px; border-radius: 12px; }
.verdict-me.good { background: rgba(46, 204, 143, .15); color: var(--good); }
.verdict-me.bad { background: rgba(255, 93, 115, .14); color: var(--bad); }

.host-panel { border: 1px solid rgba(255, 185, 56, .45); background: linear-gradient(135deg, rgba(255, 185, 56, .14), rgba(255, 255, 255, .04)); }
.host-badge { color: var(--accent); font-weight: 700; }

.toggle { display: inline-flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.toggle button { border: 0; padding: 7px 12px; background: var(--bg-2); cursor: pointer; font-weight: 700; color: var(--muted); }
.toggle button.on-good { background: var(--good); color: #002a1a; }
.toggle button.on-bad { background: var(--bad); color: #fff; }

.scoreboard li .pos { width: 2em; font-weight: 700; color: var(--muted); }
.scoreboard li .name { flex: 1; font-weight: 700; }
.scoreboard li .pts { font-weight: 700; color: var(--accent); }
.scoreboard li.me { outline: 2px solid var(--primary); }

.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 20px 0; }
.podium .step { text-align: center; width: 110px; }
.podium .block { border-radius: 12px 12px 0 0; background: var(--card-2); display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; font-size: 1.8rem; font-weight: 700; }
.podium .p1 .block { height: 130px; background: linear-gradient(var(--accent), #d98f00); color: var(--accent-ink); }
.podium .p2 .block { height: 95px; background: linear-gradient(#cfd6e6, #8e98ad); color: #222; }
.podium .p3 .block { height: 70px; background: linear-gradient(#e0a26a, #a86632); color: #2a1300; }
.podium .who { font-weight: 700; word-break: break-word; }

table.history { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.history th, table.history td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.history th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: rgba(30, 20, 70, .6); border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100% - 32px); font-weight: 600; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { border-color: var(--bad); }

/* ---- navigation ---- */
.nav { display: flex; gap: 4px; flex: 1; justify-content: center; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 700; padding: 8px 12px; border-radius: 10px; white-space: nowrap; font-size: .95rem; }
.nav a:hover { color: var(--text); background: var(--bg-2); }
.nav a.active { color: var(--text); background: var(--card-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }
.nav-badge { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .75rem; margin-left: 2px; }
.me-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .12em; font-weight: 700; }
.section-title { font-size: 1.15rem; margin: 26px 0 12px; }

/* ---- avatars ---- */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; vertical-align: middle; border: 2px solid rgba(255, 255, 255, .35); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.avatar.initials { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.chip .avatar { border-width: 1px; }
.profile-avatar { display: flex; justify-content: center; }
.podium .avatar { margin: 0 auto 6px; display: block; }
.podium .avatar.initials { display: flex; }

/* ---- badges / keywords / pills ---- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--bg-2); border: 1px solid var(--line); }
.diff-facile { color: #6ff0b8; border-color: rgba(46, 204, 143, .45); }
.diff-moyen { color: #ffcb6b; border-color: rgba(255, 185, 56, .45); }
.diff-difficile { color: #ff8c9c; border-color: rgba(255, 93, 115, .45); }
.st-pending { color: #ffcb6b; }
.st-approved { color: #6ff0b8; }
.st-rejected { color: #ff8c9c; }
.source { font-size: .78rem; color: var(--muted); line-height: 1.4; }
.source a { color: #b9d8ff; }
.card > .source { border-top: 1px solid var(--line); padding-top: 10px; }
.anecdote { margin: 8px 0 0; padding: 8px 12px; border-radius: 12px; background: rgba(111, 217, 74, .1); border-left: 3px solid #6fd94a; }
.anecdote strong { color: #9ef07a; }
.levels { display: inline-flex; gap: 8px; font-size: .8rem; font-weight: 700; }
.kws { display: flex; flex-wrap: wrap; gap: 6px; }
.kw { font-size: .78rem; color: #b9d8ff; background: rgba(63, 169, 245, .14); padding: 2px 8px; border-radius: 8px; }
.pill { border: 1px solid var(--line); background: var(--bg-2); color: var(--text); border-radius: 999px; padding: 7px 14px; font-weight: 700; cursor: pointer; }
.pill.active { background: rgba(255, 185, 56, .18); border-color: var(--accent); color: var(--accent); }
.review-note { background: rgba(255, 93, 115, .1); border-left: 3px solid var(--bad); padding: 8px 12px; border-radius: 8px; margin: 10px 0 0; }
.import-note { border-left: 3px solid var(--good); margin-bottom: 16px; }
.import-note ul { margin: 6px 0 0; padding-left: 18px; }

/* ---- quiz catalog ---- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.theme-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04)); border: 1px solid var(--line);
  box-shadow: var(--shadow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transition: transform .15s;
}
.theme-card:hover { transform: translateY(-3px); }
.tc-emoji { font-size: 2.4rem; line-height: 1; }
.tc-name { margin: 0; font-size: 1.15rem; }
.tc-author { color: var(--muted); font-size: .88rem; margin-top: -4px; }
.tc-desc { margin: 0; }
.tc-foot { margin-top: auto; padding-top: 6px; }
.star { position: absolute; top: 12px; right: 12px; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1; }
.star.on { color: var(--accent); text-shadow: 0 0 12px rgba(255, 185, 56, .6); }
.star:hover { transform: scale(1.15); }

/* ---- lobby picker ---- */
.choice-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(255, 185, 56, .1); border: 1px solid rgba(255, 185, 56, .4); }
.picker { margin-top: 10px; }
.picker summary { cursor: pointer; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.picker > * + * { margin-top: 10px; }
.picker-title { font-weight: 700; font-size: .9rem; color: var(--muted); }
.picker-scroll { max-height: 360px; overflow-y: auto; padding-right: 4px; }
.theme-btn .tb-name { line-height: 1.2; }
.theme-btn .tb-author { font-size: .72rem; color: var(--muted); font-weight: 600; }
.theme-btn .tb-diff { font-size: .7rem; }

/* ---- editor ---- */
.q-list { padding-left: 22px; margin: 0; }
.q-list li { padding: 10px 12px; border-radius: 12px; background: var(--bg-2); margin-bottom: 8px; display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.q-list li .q-media { margin: 6px 0; text-align: left; }
.q-thumb { display: block; max-width: 160px; max-height: 110px; border-radius: 10px; margin: 6px 0; object-fit: cover; }
.img-preview { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.img-preview img { max-width: 220px; max-height: 160px; border-radius: 12px; box-shadow: var(--shadow); }
.card-inset { padding: 14px; border-radius: 14px; background: var(--bg-2); border: 1px dashed var(--line); }
.add-q summary { cursor: pointer; font-weight: 700; margin-bottom: 12px; }

/* ---- stats ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { text-align: center; padding: 16px 10px; border-radius: 16px; background: linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04));
  border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.tile-emoji { font-size: 1.5rem; }
.tile-value { font-size: 2.1rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; transition: font-weight .3s var(--ease-wght); }
.tile .tile-value { font-weight: 400; }
.tile:hover .tile-value { font-weight: 700; }
.tile-label { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* ---- admin ---- */
.qv-list { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 12px; }
.qv-prompt { font-size: 1.1rem; }
.qv-choices { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.qv-choices li { padding: 6px 10px; border-radius: 10px; background: var(--bg-2); }
.qv-choices li.good { background: rgba(46, 204, 143, .18); color: var(--good); font-weight: 700; }
.qv-item .q-media { text-align: left; }
.admin-tabs { flex-wrap: wrap; }
tr.banned td { opacity: .6; }
.invite-card { border-color: rgba(255, 185, 56, .5); }

/* ---- notifications ---- */
.notices { position: fixed; top: 76px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100% - 32px)); }
.notice { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 16px; background: rgba(40, 26, 90, .75);
  border: 1px solid rgba(255, 185, 56, .5); box-shadow: var(--shadow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  animation: pop .25s ease-out; }
@keyframes pop { from { transform: translateY(-10px); opacity: 0; } }

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; }
  .nav { order: 3; flex-basis: 100%; justify-content: flex-start; }
}

@media (max-width: 600px) {
  .container { padding: 16px 12px 50px; }
  .card { padding: 16px; }
  .answer-box { flex-direction: column; }
  .podium .step { width: 90px; }
  .topbar { padding: 10px 12px; }
  .q-list { padding-left: 16px; }
  .q-list li { flex-direction: column; }
  .q-list li > .row { align-self: flex-end; flex-wrap: nowrap; }
  .brand { font-size: 1.05rem; }
  .userbox .who { display: none; }
}
