@import url('./base.css');

/* Salons NatiPlay : un socle commun, une couleur néon par univers (--accent), posée par body[data-game]. */
:root { --accent: #f2c45a; --accent-ink: #06121a; --s1: #ff5a47; --s2: #ffd166; }
body[data-game="quiz"] { --accent: #38d6f5; --accent-ink: #031a22; }
body[data-game="duel"] { --accent: #ff5a47; --accent-ink: #220604; }
body[data-game="undercover"] { --accent: #a883ff; --accent-ink: #12082a; }

html { -webkit-tap-highlight-color: transparent; }
body {
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 100% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 65%),
    radial-gradient(700px 500px at -10% 110%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
body::before { /* trame fine façon écran d'arcade */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.5;
  background-image: radial-gradient(rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000, transparent 70%);
}
button, input, select, textarea { font: inherit; color: inherit; }
.center { text-align: center; }
.hidden, [hidden] { display: none !important; }

/* ---------- Boutons ---------- */
.btn-accent {
  color: var(--accent-ink); background: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, #fff 35%, var(--accent)) inset, 0 12px 30px -12px var(--accent);
}
.btn-accent:hover { box-shadow: 0 0 0 1px #fff8 inset, 0 16px 40px -10px var(--accent); transform: translateY(-1px); }
.btn-danger { color: #fff; background: #d6453a; }
.btn.wide { width: 100%; }
.btn:not(.btn-sm):not(.btn-lg) { padding: 12px 20px; min-height: 46px; }
.btn-lg { white-space: normal; text-align: center; }
.btn-lg { min-height: 54px; }

/* ---------- Barre du haut ---------- */
.sbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 12px max(16px, calc((100vw - 1180px) / 2));
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(7, 7, 8, 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.game-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 0.82rem; letter-spacing: 0.02em; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.gc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.sbar > * { min-width: 0; }
.sbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.code-chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 7px 12px; border-radius: 10px; border: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); background: transparent; cursor: pointer; font-size: 0.85rem; }
.code-chip b { font-family: var(--font-display); letter-spacing: 0.12em; color: var(--accent); }

.app { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 28px 16px 120px; }

/* ---------- Éléments communs ---------- */
.panel { background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015)); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { font-size: 1rem; }
.kicker { margin: 0 0 10px; color: var(--accent); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.kicker.center { text-align: center; }
.lead { color: #d6d2c8; font-size: 1.06rem; margin: 14px 0 0; }
.notice { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); font-size: 0.92rem; margin: 12px 0; }
.notice.warn { border-color: #f59e0b66; background: #f59e0b14; color: #fde3b0; }
.form-error { min-height: 1.2em; margin: 10px 0; color: #ff9d92; font-weight: 600; font-size: 0.92rem; }
.link-quiet { display: block; margin-top: 18px; text-align: center; color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.link-quiet:hover { color: var(--text); }
.stack { display: grid; gap: 12px; margin-top: 22px; }
.spinner { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.av { --c: #888; flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; font-weight: 800; font-family: var(--font-display); font-size: 0.95rem; color: #0b0b0d; background: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent), 0 6px 16px -8px var(--c); }
.av.xs { width: 26px; height: 26px; border-radius: 9px; font-size: 0.72rem; }
.av.lg { width: 64px; height: 64px; border-radius: 20px; font-size: 1.5rem; }
.av.empty { background: transparent; color: var(--muted); border: 1.5px dashed var(--line); box-shadow: none; }
.tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.host { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.tag.ok { color: #86efac; border-color: #4ade8055; }
.tag.warn { color: #fcd34d; border-color: #f59e0b55; }

/* Mega-titre : « Quiz » énorme, « Nati » posé au-dessus */
.mega { position: relative; font-size: clamp(3.4rem, 11vw, 7.2rem); font-weight: 800; line-height: 0.9; letter-spacing: -0.04em; color: var(--accent); text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent); padding-top: 0.42em; }
.mega.small { font-size: clamp(2.6rem, 9vw, 4.2rem); }
.mega-sub { position: absolute; left: 0.06em; top: 0; font-size: 0.3em; letter-spacing: 0.32em; color: var(--text); text-shadow: none; font-weight: 700; }

/* ---------- Création ---------- */
.create { display: grid; grid-template-columns: 1fr 1.05fr; gap: 40px; align-items: start; }
.rules { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.rules li { display: flex; gap: 14px; align-items: flex-start; }
.rules .rn { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; font-family: var(--font-display); font-weight: 800; color: var(--accent-ink); background: var(--accent); }
.rules b { display: block; }
.rules p { margin: 2px 0 0; color: var(--muted); font-size: 0.93rem; }
.rules.compact { margin-top: 14px; }
.code-join { margin-top: 30px; padding: 16px; border-radius: 18px; border: 1px dashed var(--line); }
.code-join label { display: block; font-weight: 700; margin-bottom: 10px; font-size: 0.93rem; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: #0b0b0e; font-family: var(--font-display); letter-spacing: 0.3em; font-size: 1.1rem; text-transform: uppercase; }
.code-row input:focus { outline: none; border-color: var(--accent); }
.create-form h2 { font-size: 1.25rem; margin-bottom: 18px; }

.fld { display: block; border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.fld legend, .fld .lbl { display: block; padding: 0; margin-bottom: 9px; font-weight: 700; font-size: 0.9rem; }
.fld > input:not(.switch), .clue-form input, .chat-form input {
  width: 100%; height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: #0b0b0e; font-size: 1rem;
}
.fld > input:not(.switch):focus, .clue-form input:focus, .chat-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.hint { display: block; margin-top: 6px; color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { flex: 1 1 auto; min-width: 56px; min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); font-weight: 700; cursor: pointer; transition: 0.15s; }
.seg button[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); cursor: pointer; }
.switch { appearance: none; flex: none; width: 50px; height: 30px; border-radius: 999px; background: #2a2a31; position: relative; cursor: pointer; transition: 0.2s; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: 0.2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.cat { display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); text-align: left; cursor: pointer; transition: 0.15s; }
.cat span { font-size: 1.15rem; }
.cat b { font-size: 0.84rem; line-height: 1.2; }
.cat[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 14px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); text-align: left; cursor: pointer; transition: 0.15s; }
.tile small { color: var(--muted); font-size: 0.78rem; line-height: 1.3; }
.tile-ico { display: block; width: 44px; height: 44px; color: var(--accent); }
.tile-ico svg { width: 100%; height: 100%; }
.tile[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: 0 0 0 1px var(--accent) inset, 0 16px 30px -18px var(--accent); }
.ad-rule { margin: 6px 0 4px; padding: 14px 16px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); font-size: 0.9rem; }
.ad-rule p { margin: 0; }
.ad-rule.free { border-color: var(--line); background: rgba(255,255,255,0.025); }

/* ---------- Invitation / salon disparu ---------- */
.invite-screen { display: grid; place-items: center; min-height: 60vh; }
.invite-card { width: min(520px, 100%); padding: 30px; }
.invite-card h1:not(.mega) { font-size: 1.6rem; }
.facts { list-style: none; padding: 0; margin: 22px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.facts li { padding: 12px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); text-align: center; }
.facts b { display: block; font-family: var(--font-display); font-size: 1rem; color: var(--accent); }
.facts span { font-size: 0.74rem; color: var(--muted); }
.invite-card .btn { margin-top: 6px; }
.gone { text-align: center; }
.gone-ico { width: 70px; height: 70px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 22px; font-family: var(--font-display); font-size: 2rem; color: var(--accent); border: 2px dashed color-mix(in srgb, var(--accent) 50%, transparent); }
.gone-games { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- Salle d'attente ---------- */
.lobby { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: start; }
.lobby-col { display: grid; gap: 20px; min-width: 0; }
.invite-box { text-align: center; padding: 26px 20px; background: radial-gradient(420px 200px at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), rgba(255,255,255,0.02); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.code-tiles { display: flex; justify-content: center; gap: clamp(5px, 1.6vw, 10px); margin: 6px 0 14px; }
.code-tiles span {
  display: grid; place-items: center; width: clamp(42px, 11vw, 62px); aspect-ratio: 0.82; border-radius: 14px;
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.4rem, 5vw, 2.1rem); color: var(--accent);
  background: #0b0b0e; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 6%, transparent), inset 0 -6px 0 rgba(0,0,0,0.4);
  animation: tileIn 0.5s cubic-bezier(.2,.9,.3,1.3) backwards; animation-delay: calc(var(--i) * 60ms);
}
@keyframes tileIn { from { transform: translateY(14px) scale(0.8); opacity: 0; } }
.invite-url { margin: 0 0 16px; color: var(--muted); font-size: 0.88rem; word-break: break-all; }
.invite-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plist li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,0.025); border: 1px solid var(--line); animation: pop 0.35s ease backwards; min-width: 0; }
.plist li.off { opacity: 0.55; }
.plist li.ghost { border-style: dashed; background: transparent; animation: none; }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } }
.pname { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname em { color: var(--muted); font-style: normal; font-weight: 500; }
.pmeta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.kick { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.kick:hover { color: #ff9d92; border-color: #ff9d9266; }
.count { font-family: var(--font-display); font-size: 0.9rem; color: var(--accent); }
.sum { margin: 0; display: grid; gap: 10px; }
.sum div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sum div:last-child { border: 0; padding: 0; }
.sum dt { color: var(--muted); font-size: 0.88rem; }
.sum dd { margin: 0; font-weight: 700; text-align: right; font-size: 0.92rem; }
.mini-hero { display: flex; gap: 14px; align-items: center; padding: 14px; margin-bottom: 14px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.mini-hero b { display: block; font-family: var(--font-display); }
.mini-hero small { color: var(--muted); }
.rules-box summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; }
.rules-box summary::after { content: '+'; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.rules-box[open] summary::after { content: '–'; }
.actionbar {
  grid-column: 1 / -1; position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; padding-bottom: max(14px, env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0; background: rgba(12, 12, 15, 0.92); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -20px 40px -20px #000;
}
.status { margin: 0; color: #d6d2c8; }
.status.small { font-size: 0.88rem; }

/* ---------- Discussion ---------- */
.chat { display: flex; flex-direction: column; background: rgba(255,255,255,0.025); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-head h2 { font-size: 1rem; }
.chat-close { display: none; border: 0; background: transparent; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }
.chat-list { list-style: none; margin: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; height: 230px; overflow-y: auto; overscroll-behavior: contain; }
.chat-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; }
.chat-list li b { font-size: 0.8rem; }
.chat-list li p { margin: 1px 0 0; word-break: break-word; }
.chat-list li.sys { justify-content: center; color: var(--muted); font-size: 0.78rem; font-style: italic; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input { height: 44px; }
.chat.floating { position: fixed; z-index: 40; right: 16px; bottom: 16px; width: min(380px, calc(100vw - 32px)); background: #111115; box-shadow: 0 30px 60px -20px #000; transform: translateY(20px); opacity: 0; pointer-events: none; transition: 0.2s; }
.chat.floating.open { transform: none; opacity: 1; pointer-events: auto; }
.chat.floating .chat-close { display: block; }
.chat-fab { position: fixed; z-index: 35; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: 54px; height: 54px; border-radius: 18px; border: 1px solid var(--line); background: #15151a; color: var(--text); cursor: pointer; display: grid; place-items: center; box-shadow: 0 14px 30px -12px #000; }
.chat-fab .badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-size: 0.72rem; font-weight: 800; background: var(--accent); color: var(--accent-ink); }

/* ---------- Comptes à rebours ---------- */
.ring { --p: 1; position: relative; flex: none; width: 64px; height: 64px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring-bg { stroke: rgba(255,255,255,0.08); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--p)); }
.ring .t-num { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; }
.ring.urgent .ring-fg { stroke: #ff5a47; }
.ring.urgent .t-num { color: #ff8f84; animation: beat 1s infinite; }
.ring.done .t-num { color: var(--accent); }
.ring.sm { width: 44px; height: 44px; }
.ring.sm .t-num { font-size: 0.9rem; }
@keyframes beat { 50% { transform: scale(1.15); } }

/* ---------- NatiQuiz ---------- */
.q-countdown { text-align: center; padding: 10vh 0; }
.cd-num { font-family: var(--font-display); font-weight: 800; font-size: clamp(6rem, 30vw, 12rem); line-height: 1; color: var(--accent); text-shadow: 0 0 60px var(--accent); animation: beat 1s infinite; }
.quiz { max-width: 900px; margin: 0 auto; }
.q-top { display: flex; align-items: center; gap: 18px; }
.q-prog { flex: 1; }
.q-prog span { font-size: 0.86rem; color: var(--muted); }
.q-prog b { color: var(--text); font-family: var(--font-display); }
.bar { height: 6px; margin-top: 8px; border-radius: 999px; background: rgba(255,255,255,0.07); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.6s ease; box-shadow: 0 0 12px var(--accent); }
.q-cat { margin: 24px 0 8px; color: var(--accent); font-weight: 800; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; }
.q-text { font-size: clamp(1.45rem, 4.2vw, 2.4rem); line-height: 1.18; font-weight: 700; margin-bottom: 26px; animation: rise 0.45s ease; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ans {
  --a: #38d6f5; position: relative; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 16px;
  border-radius: 20px; border: 1px solid color-mix(in srgb, var(--a) 40%, transparent); text-align: left; cursor: pointer;
  background: linear-gradient(135deg, color-mix(in srgb, var(--a) 16%, #0d0d10), #0d0d10 70%);
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.3s, border-color 0.2s; animation: rise 0.4s ease backwards;
}
.ans.a0 { --a: #38d6f5; } .ans.a1 { --a: #ff6fb5; animation-delay: 50ms; } .ans.a2 { --a: #ffc04a; animation-delay: 100ms; } .ans.a3 { --a: #7cf08c; animation-delay: 150ms; }
.ans:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px var(--a); border-color: var(--a); }
.ans:active:not(:disabled) { transform: scale(0.98); }
.ans:disabled { cursor: default; }
.al { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--a); color: #06060a; font-family: var(--font-display); font-weight: 800; }
.at { flex: 1; font-weight: 700; font-size: 1.04rem; line-height: 1.25; }
.ad { flex: none; font-size: 0.74rem; color: var(--muted); font-weight: 700; }
.ans.picked { border-color: #fff; box-shadow: 0 0 0 2px #fff inset; }
.ans.right { border-color: #4ade80; background: linear-gradient(135deg, #4ade8033, #0d0d10 80%); box-shadow: 0 0 0 2px #4ade80 inset, 0 0 30px -10px #4ade80; animation: none; }
.ans.right .al { background: #4ade80; }
.ans.wrong { border-color: #ff5a47; background: linear-gradient(135deg, #ff5a4733, #0d0d10 80%); animation: shake 0.4s; }
.ans.wrong .al { background: #ff5a47; }
.ans.dim { opacity: 0.38; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.q-status { min-height: 1.6em; margin: 18px 0; text-align: center; color: var(--muted); font-weight: 600; }
.q-status.big { font-family: var(--font-display); font-size: 1.3rem; color: var(--text); animation: rise 0.35s ease; }
.q-status.ok { color: #86efac; } .q-status.ko { color: #ff9d92; }
.qboard { list-style: none; margin: 0 auto; padding: 0; max-width: 520px; display: grid; gap: 6px; }
.qboard li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); }
.qboard li.me { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.qboard .rk { width: 20px; font-family: var(--font-display); font-size: 0.8rem; color: var(--muted); }
.qboard .nm { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qboard .delta { color: #86efac; font-weight: 800; font-size: 0.8rem; animation: rise 0.4s ease; }
.qboard b { font-family: var(--font-display); font-size: 0.9rem; }

/* ---------- Résultats ---------- */
.results { max-width: 760px; margin: 0 auto; }
.res-title { text-align: center; font-size: clamp(2rem, 7vw, 3.6rem); font-weight: 800; margin: 4px 0 24px; animation: rise 0.5s ease; }
.res-title.won { color: var(--accent); text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 55%, transparent); }
.results > .kicker { text-align: center; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; margin: 0 auto 24px; max-width: 520px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.pod b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod > span:not(.av) { color: var(--muted); font-size: 0.84rem; font-weight: 700; }
.pod-bar { width: 100%; display: grid; place-items: start center; padding-top: 10px; border-radius: 16px 16px 4px 4px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 35%, transparent), transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-bottom: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; animation: grow 0.7s cubic-bezier(.2,.8,.2,1) backwards; transform-origin: bottom; }
.p1 .pod-bar { height: 130px; } .p2 .pod-bar { height: 92px; animation-delay: 0.15s; } .p3 .pod-bar { height: 66px; animation-delay: 0.3s; }
.p1 .av { width: 76px; height: 76px; }
@keyframes grow { from { transform: scaleY(0); } }
.rank-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.rank-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.78rem; padding: 0 8px 10px; }
.rank-table td { padding: 10px 8px; border-top: 1px solid var(--line); }
.rank-table tr.me td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.rank-table .num { text-align: right; }
.cellp { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; }
.endbar { display: grid; gap: 12px; justify-items: center; margin: 26px 0 10px; }
.endbar > .btn { min-width: min(320px, 100%); }
.endbar-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ---------- NatiDuel ---------- */
.duel { max-width: 620px; margin: 0 auto; }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 16px; }
.vs { font-family: var(--font-display); font-weight: 800; color: var(--muted); font-size: 0.9rem; }
.side { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,0.025); transition: 0.25s; min-width: 0; }
.side.s2 { flex-direction: row-reverse; text-align: right; }
.side div { min-width: 0; }
.side b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92rem; }
.side b em { font-style: normal; color: var(--muted); font-weight: 500; }
.side small { color: var(--muted); font-size: 0.74rem; }
.side.turn.s1 { border-color: var(--s1); box-shadow: 0 0 0 1px var(--s1) inset, 0 10px 30px -14px var(--s1); }
.side.turn.s2 { border-color: var(--s2); box-shadow: 0 0 0 1px var(--s2) inset, 0 10px 30px -14px var(--s2); }
.side.off { opacity: 0.5; }
.token { flex: none; width: 14px; height: 14px; border-radius: 50%; margin-left: auto; }
.side.s2 .token { margin: 0 auto 0 0; }
.t1 { --t: var(--s1); } .t2 { --t: var(--s2); }
.token { background: var(--t); box-shadow: 0 0 10px var(--t); }
.turn-msg { text-align: center; font-family: var(--font-display); font-size: 1.1rem; color: var(--muted); margin: 0 0 16px; }
.turn-msg.mine { color: var(--text); animation: beat 1.6s infinite; }

.c4 { position: relative; margin: 0 auto; width: min(100%, 520px, calc((100dvh - 290px) * 7 / 6)); }
.c4-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(4px, 1.5vw, 9px); padding: clamp(6px, 2vw, 14px); border-radius: 22px; background: linear-gradient(180deg, #1c2a6b, #121b4a); box-shadow: inset 0 -8px 0 #0b1236, 0 30px 60px -30px #1c2a6b; }
.c4-cell { aspect-ratio: 1; border-radius: 50%; background: #06070d; box-shadow: inset 0 4px 8px #000a; position: relative; }
.disc { position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--t) 60%, #fff), var(--t) 55%, color-mix(in srgb, var(--t) 70%, #000)); box-shadow: inset 0 -4px 0 #0004; }
.disc.drop { animation: drop 0.45s cubic-bezier(.55,0,.8,.4) backwards, bounce 0.25s 0.45s ease-out; }
@keyframes drop { from { transform: translateY(calc(var(--fall) * -112%)); } }
@keyframes bounce { 50% { transform: translateY(-6%); } }
.disc.win { animation: winPulse 0.9s ease-in-out infinite; box-shadow: 0 0 0 3px #fff, 0 0 24px var(--t); }
@keyframes winPulse { 50% { transform: scale(0.88); } }
.c4-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: clamp(4px, 1.5vw, 9px); padding: 0 clamp(6px, 2vw, 14px); }
.c4-cols button { border: 0; background: transparent; cursor: pointer; position: relative; border-radius: 14px; }
.c4-cols button:hover:not(:disabled) { background: rgba(255,255,255,0.06); }
.c4-cols button:disabled { cursor: not-allowed; }
.c4-cols .ghost { position: absolute; left: 12%; right: 12%; top: -14%; aspect-ratio: 1; border-radius: 50%; background: var(--t); opacity: 0; transition: 0.15s; }
.c4-cols button:hover:not(:disabled) .ghost { opacity: 0.7; }
.c4.live .c4-grid { box-shadow: inset 0 -8px 0 #0b1236, 0 0 0 2px var(--accent), 0 30px 60px -30px var(--accent); }

.ttt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(100%, 420px, calc(100dvh - 300px)); margin: 0 auto; }
.ttt-cell { aspect-ratio: 1; border-radius: 22px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); cursor: pointer; padding: 18%; transition: 0.15s; }
.ttt.live .ttt-cell:not(:disabled):hover { background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: var(--accent); }
.ttt-cell:disabled { cursor: default; }
.ttt-cell.win { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); }
.mk svg { width: 100%; height: 100%; fill: none; stroke-width: 6; stroke-linecap: round; }
.mk.x svg { stroke: var(--s1); filter: drop-shadow(0 0 8px var(--s1)); }
.mk.o svg { stroke: var(--s2); filter: drop-shadow(0 0 8px var(--s2)); }
.fresh .mk path, .fresh .mk circle { stroke-dasharray: 1; animation: draw 0.4s ease-out backwards; }
@keyframes draw { from { stroke-dashoffset: 1; } }

.rps-score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; text-align: center; }
.rps-score > b { font-family: var(--font-display); font-size: 2.4rem; }
.rps-score small { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 6px; }
.pips { display: inline-flex; gap: 6px; }
.pips i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); }
.pips i.on { background: var(--t); border-color: var(--t); box-shadow: 0 0 10px var(--t); }
.rps-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.rps-pick button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 8px; border-radius: 22px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); cursor: pointer; transition: 0.15s; }
.rps-pick span { font-size: clamp(2.6rem, 11vw, 3.6rem); line-height: 1; }
.rps-pick button:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 16px 30px -18px var(--accent); }
.rps-pick button.picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.rps-wait { text-align: center; color: #d6d2c8; margin: 22px 0 6px; }
.rps-reveal { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 18px 0; padding: 18px; border-radius: 22px; border: 1px solid var(--line); background: rgba(255,255,255,0.025); }
.rps-reveal.won { border-color: #4ade8066; } .rps-reveal.lost { border-color: #ff5a4766; }
.hand { text-align: center; }
.hand span { display: block; font-size: 3.4rem; line-height: 1.1; }
.hand small { color: var(--muted); font-size: 0.78rem; }
.rps-reveal.fresh .hand.you span { animation: punchL 0.6s ease; }
.rps-reveal.fresh .hand.opp span { animation: punchR 0.6s ease; }
@keyframes punchL { 0%, 60% { transform: translateY(-14px) rotate(-12deg); } 30% { transform: translateY(6px); } }
@keyframes punchR { 0%, 60% { transform: translateY(-14px) rotate(12deg); } 30% { transform: translateY(6px); } }
.rps-res { font-family: var(--font-display); font-size: 0.95rem; text-align: center; }
.rps-reveal.won .rps-res { color: #86efac; } .rps-reveal.lost .rps-res { color: #ff9d92; }

/* ---------- NatiUndercover ---------- */
.uc { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; }
.uc-main, .uc-side { min-width: 0; display: grid; gap: 16px; }
.uc-title { font-size: clamp(1.4rem, 4.5vw, 2.1rem); }
.uc-reveal { text-align: center; display: grid; gap: 18px; justify-items: center; padding-top: 2vh; }
.word-card {
  position: relative; width: min(100%, 420px); aspect-ratio: 1.6; border-radius: 26px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent) 0 12px, transparent 12px 24px), #0e0b16;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; overflow: hidden; padding: 0;
  box-shadow: 0 30px 60px -30px var(--accent);
}
.word-card:not(.big) { aspect-ratio: auto; min-height: 92px; border-radius: 18px; width: 100%; }
.word-card > span { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px; transition: opacity 0.15s, transform 0.2s; }
.wc-front b { font-size: 1rem; }
.wc-front small, .wc-back small { color: var(--muted); font-size: 0.78rem; }
.wc-eye { font-size: 1.6rem; color: var(--accent); }
.wc-back { opacity: 0; transform: scale(0.94); background: #0e0b16; }
.wc-word { font-family: var(--font-display); font-size: clamp(1.6rem, 7vw, 2.6rem); color: var(--accent); text-shadow: 0 0 30px color-mix(in srgb, var(--accent) 60%, transparent); text-align: center; overflow-wrap: anywhere; }
.word-card:not(.big) .wc-word { font-size: 1.4rem; }
.word-card.show .wc-back { opacity: 1; transform: none; }
.word-card.show .wc-front { opacity: 0; }
.word-card.spect { display: grid; place-items: center; padding: 16px; color: var(--muted); cursor: default; aspect-ratio: auto; min-height: 80px; }
.uc-turn, .uc-result { padding: 22px; border-radius: 22px; border: 1px solid var(--line); background: rgba(255,255,255,0.025); }
.uc-turn.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 20px 50px -30px var(--accent); }
.uc-turn-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.uc-turn-head > div:not(.ring) { flex: 1; min-width: 0; }
.clue-form { display: flex; gap: 8px; }
.clue-form input { flex: 1; min-width: 0; }
.clues .clue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.clue-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,0.02); }
.clue-list li.speaking { background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: 0 0 0 1px var(--accent) inset; }
.clue-list li.out { opacity: 0.4; text-decoration: line-through; }
.clue-list .nm { width: 34%; min-width: 0; font-weight: 700; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clue-list .nm em { font-style: normal; color: var(--muted); font-weight: 500; }
.clue-list .cl { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.clue { padding: 3px 9px; border-radius: 8px; background: rgba(255,255,255,0.06); font-size: 0.84rem; font-weight: 600; }
.clue:empty { display: none; }
.clue.skip { color: var(--muted); }
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.vote-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); cursor: pointer; transition: 0.15s; min-width: 0; }
.vote-card b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.vote-card small { color: var(--muted); font-size: 0.72rem; }
.vote-card.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: 0 0 0 1px var(--accent) inset; }
.vote-card:disabled { cursor: default; }
.uc-result { text-align: center; display: grid; gap: 14px; justify-items: center; }
.elim { display: grid; gap: 10px; justify-items: center; animation: rise 0.5s ease; }
.elim-role { margin: 0; font-size: 1.1rem; }
.role-civil b, .tag.role-civil { color: #86efac; }
.role-undercover b, .tag.role-undercover { color: #ff9d92; }
.role-white b, .tag.role-white { color: #f5f5f5; }
.tally { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tally li { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,0.05); font-size: 0.86rem; }
.words-reveal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.wr { padding: 18px; border-radius: 20px; text-align: center; border: 1px solid var(--line); }
.wr small { display: block; color: var(--muted); font-size: 0.78rem; }
.wr b { font-family: var(--font-display); font-size: 1.4rem; }
.wr.civil b { color: #86efac; } .wr.under b { color: #ff9d92; }
.roles-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.roles-list li { display: flex; align-items: center; gap: 10px; }
.roles-list .nm { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roles-list li.win .nm { color: var(--accent); }

/* ---------- Fenêtres, notifications ---------- */
.modal { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 22px; background: #111115; color: var(--text); }
.modal::backdrop { background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }
.modal form { padding: 24px; }
.modal h2 { font-size: 1.2rem; margin-bottom: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.toasts { position: fixed; z-index: 60; left: 50%; top: 76px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 14px; background: #1b1b21; border: 1px solid var(--line); font-weight: 600; font-size: 0.92rem; text-align: center; box-shadow: 0 20px 40px -20px #000; animation: rise 0.25s ease; transition: 0.4s; }
.toast.warn { border-color: #f59e0b66; }
.toast.out { opacity: 0; transform: translateY(-8px); }
.net-banner { position: fixed; z-index: 70; left: 0; right: 0; top: 0; padding: 10px; text-align: center; font-weight: 700; font-size: 0.88rem; background: #b45309; color: #fff; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 80; }
.ad-wide { min-height: 90px; max-width: 728px; margin: 28px auto 0; position: relative; z-index: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .create, .lobby, .uc { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .create { gap: 26px; }
  .uc-side { order: 2; }
}
@media (max-width: 640px) {
  .app { padding: 18px 14px 110px; }
  .sbar { gap: 8px; padding-left: 14px; padding-right: 14px; }
  .wordmark { display: none; }
  .game-chip { font-size: 0.76rem; padding: 5px 10px; }
  .code-chip .muted { display: none; }
  body.in-room .game-chip { display: none; }
  .sbar .btn-sm { padding: 8px 14px; }
  .panel { padding: 18px; border-radius: 20px; }
  .answers { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .ans { min-height: 62px; padding: 10px 12px; border-radius: 16px; }
  .al { width: 34px; height: 34px; }
  .q-text { margin-bottom: 18px; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tile { flex-direction: row; align-items: center; gap: 12px; padding: 12px; }
  .tile-ico { width: 36px; height: 36px; flex: none; }
  .tile small { display: block; }
  .facts { grid-template-columns: 1fr 1fr 1fr; }
  .facts b { font-size: 0.86rem; }
  .actionbar { margin: 0 -14px; border-radius: 20px 20px 0 0; padding: 12px 14px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .actionbar .btn { flex: 1 1 100%; }
  .chat-list { height: 190px; }
  .side { padding: 8px; gap: 8px; }
  .side .av { width: 32px; height: 32px; border-radius: 10px; font-size: 0.8rem; }
  .token { display: none; }
  .rps-pick button { padding: 16px 4px; }
  .rps-pick b { font-size: 0.82rem; }
  .ad-wide { min-height: 60px; max-width: 320px; }
  .chat-fab { bottom: max(14px, env(safe-area-inset-bottom)); right: 14px; }
  .chat.floating { right: 8px; left: 8px; width: auto; bottom: 8px; }
}
