/* USAP — Le Défi Moscato : charte alignée sur usap.fr (bleu marine, rouge, jaune, bleu ciel ; Montserrat) */
@font-face { font-family: 'Montserrat'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/fonts/montserrat-latin-wght-normal.woff2) format('woff2'); }

:root {
  --bg: #0d1628; --bg-2: #101c33; --surface: #16233f; --surface-2: #1d2d50; --surface-3: #243659;
  --line: rgba(255, 255, 255, 0.08); --line-2: rgba(255, 255, 255, 0.16);
  --navy: #293a5d; --red: #ca1c3d; --red-2: #a3142f; --yellow: #f1e344; --sky: #4193d0;
  --txt: #ffffff; --txt-2: #cfd7e6; --mute: #8f9cb6;
  --ok: #2fbf71; --ko: #ef4e5c;
  --r-xl: 24px; --r-lg: 18px; --r-md: 14px; --r-sm: 10px;
  --shadow: 0 12px 32px rgba(2, 6, 18, 0.45);
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  /* anciens noms (régie, écran) */
  --card: var(--surface); --gold: var(--yellow);
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt); font-family: var(--font); font-size: 16px; line-height: 1.45; overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; background: radial-gradient(120% 60% at 50% -10%, #1b2c52 0%, var(--bg) 60%) fixed, var(--bg); }
h1, h2, h3, p, figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.i.xl { width: 44px; height: 44px; }
.senyera { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 30; background: repeating-linear-gradient(90deg, var(--yellow) 0 18px, var(--red) 18px 30px); }

/* écrans */
.screen { display: none; min-height: 100%; padding: calc(16px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; flex-direction: column; gap: 14px; }
.screen.on { display: flex; }

/* marque */
.mark { display: inline-grid; place-items: center; background: var(--red); color: #fff; font-weight: 900; letter-spacing: 0.08em; font-size: 15px; padding: 7px 10px 6px; border-radius: 8px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.mark.sm { font-size: 12px; padding: 6px 8px 5px; border-radius: 7px; }

/* boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 15px 18px; border: 0; border-radius: var(--r-md); font-weight: 800; font-size: 16px; letter-spacing: 0.01em; cursor: pointer; text-decoration: none; color: #fff; background: var(--surface-2); transition: transform 0.08s, filter 0.15s, background 0.15s; }
.btn:active { transform: scale(0.98); }
.btn-primary, .btn.gold { background: linear-gradient(180deg, #d72347, var(--red) 55%, var(--red-2)); box-shadow: 0 8px 22px rgba(202, 28, 61, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18); color: #fff; }
.btn-warn { background: var(--yellow); color: #14161d; }
.btn-ghost, .btn.ghost { background: transparent; border: 1.5px solid var(--line-2); color: var(--txt); }
.btn-lg { padding: 18px 20px; font-size: 17px; border-radius: var(--r-lg); }
.btn.small { width: auto; padding: 8px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); cursor: pointer; flex: 0 0 auto; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }

/* blocs */
.panel, .card { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.label-note { color: var(--yellow); letter-spacing: 0.06em; }
.label { display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); margin-bottom: 8px; }
.field { width: 100%; padding: 15px 16px; border-radius: var(--r-md); border: 1.5px solid var(--line-2); background: rgba(5, 10, 22, 0.55); font-size: 19px; font-weight: 700; -webkit-user-select: text; user-select: text; }
.field::placeholder { color: #5f6c86; font-weight: 600; }
.field:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(65, 147, 208, 0.25); }
.muted { color: var(--mute); font-size: 14px; }
.err { color: var(--ko); min-height: 20px; font-size: 14px; font-weight: 600; text-align: center; }
.err:empty { min-height: 0; }
.fine { color: var(--mute); font-size: 12.5px; text-align: center; margin-top: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; background: var(--surface-3); color: var(--txt-2); }
.badge.test { background: rgba(65, 147, 208, 0.18); color: #9fd0f3; border: 1px solid rgba(65, 147, 208, 0.45); }
.badge.closed { background: #39445c; color: #c3cad8; } .badge.open { background: rgba(47, 191, 113, 0.18); color: #7fe0a9; }
.section-title { font-size: 13px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); margin-top: 6px; }

/* barre d'en-tête des écrans */
.appbar { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.appbar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.appbar-title small { font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.appbar-title b { font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* accueil */
.screen-home { padding: 0 0 calc(20px + env(safe-area-inset-bottom)); gap: 0; max-width: none; }
.hero { position: relative; min-height: 64vh; padding: calc(20px + env(safe-area-inset-top)) 20px 64px; display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, rgba(13, 22, 40, 0.35) 0%, rgba(13, 22, 40, 0.55) 45%, var(--bg) 100%), url(/media/ui/hero.webp) center 30% / cover no-repeat, var(--navy); }
.hero::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(115deg, rgba(202, 28, 61, 0.28), transparent 45%); pointer-events: none; }
.topbar { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero-content { position: relative; z-index: 1; margin-top: auto; max-width: 520px; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--yellow); margin-bottom: 6px; }
.hero-title { font-weight: 900; font-size: clamp(48px, 15vw, 84px); line-height: 0.9; letter-spacing: -0.02em; text-transform: uppercase; text-shadow: 0 6px 30px rgba(0, 0, 0, 0.45); }
.hero-title > span:first-child { display: block; font-size: 0.42em; font-weight: 800; letter-spacing: 0.06em; color: var(--txt-2); margin-bottom: 4px; }
.hero-lead { margin-top: 14px; font-size: 16px; font-weight: 500; color: var(--txt-2); max-width: 32ch; }
.hero-games { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-games li { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 11px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.host-chip { display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px; border-radius: 99px; background: rgba(13, 22, 40, 0.55); border: 1px solid rgba(255, 255, 255, 0.18); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.host-chip img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; background: var(--surface); }
.host-chip figcaption { font-size: 10px; font-weight: 700; line-height: 1.15; color: var(--txt-2); text-transform: uppercase; letter-spacing: 0.06em; }
.host-chip figcaption b { display: block; color: var(--yellow); font-size: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.join { position: relative; z-index: 2; margin: -40px 16px 0; max-width: 528px; align-self: center; width: calc(100% - 32px); }
.join .btn { margin-top: 4px; }
@media (min-width: 600px) { .hero { min-height: 58vh; padding-left: 40px; padding-right: 40px; } }

/* menu : vignettes de jeu */
.games { display: grid; gap: 12px; }
.game-tile { position: relative; display: flex; align-items: stretch; gap: 0; width: 100%; padding: 0; border-radius: var(--r-lg); overflow: hidden; text-align: left; cursor: pointer; border: 1px solid var(--line); background: linear-gradient(180deg, var(--surface), var(--bg-2)); box-shadow: var(--shadow); transition: transform 0.1s, border-color 0.15s; }
.game-tile:active { transform: scale(0.985); border-color: var(--line-2); }
.game-img { position: relative; flex: 0 0 38%; min-height: 112px; background: center / cover no-repeat var(--navy); }
.game-img::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(90deg, transparent 55%, rgba(16, 28, 51, 0.95)); }
.tag { position: absolute; z-index: 1; left: 8px; top: 8px; font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 7px; border-radius: 6px; background: rgba(13, 22, 40, 0.78); color: var(--yellow); }
.game-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 14px 16px 14px 12px; }
.game-name { font-size: 18px; font-weight: 800; line-height: 1.15; }
.game-desc { font-size: 13.5px; color: var(--txt-2); line-height: 1.35; }
.rec { margin-top: 4px; font-size: 12.5px; font-weight: 800; color: var(--yellow); }
.state-off { display: none; position: absolute; right: 10px; top: 10px; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: #39445c; color: #d4dae5; }
.game-card.off { opacity: 0.55; filter: grayscale(0.6); } .game-card.off .state-off { display: block; }
#space-badge:empty { display: none; }

/* règles */
.cover { height: 150px; border-radius: var(--r-lg); background: center / cover no-repeat var(--navy); position: relative; overflow: hidden; box-shadow: var(--shadow); }
.cover::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(180deg, transparent 40%, rgba(13, 22, 40, 0.7)); }
.rule { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; font-size: 15.5px; line-height: 1.4; }
.rule + .rule { border-top: 1px solid var(--line); }
.rule .ico { flex: 0 0 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(65, 147, 208, 0.14); color: #8fc7f0; }
.rule .ico .i { width: 22px; height: 22px; }
.rule b { color: #fff; }
.cta-bar { position: sticky; bottom: 0; margin-top: auto; padding: 12px 0 calc(4px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--bg) 35%); display: flex; flex-direction: column; gap: 10px; }
.vs { display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 800; font-size: 13px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.1em; padding-bottom: 6px; }
.vs .t { padding: 9px 14px; border-radius: 12px; border: 2px solid; font-size: 18px; font-weight: 900; letter-spacing: 0.02em; text-transform: none; color: #fff; }
.lineup { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0 6px; }
.pl { text-align: center; font-size: 11px; line-height: 1.2; color: var(--mute); }
.pl .ph { width: 100%; aspect-ratio: 1; border-radius: 14px; background: linear-gradient(160deg, var(--surface-3), var(--navy)); display: grid; place-items: center; font-weight: 900; font-size: 20px; color: var(--txt-2); overflow: hidden; position: relative; border: 1px solid var(--line-2); }
.pl .ph img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.pl .ph .n { position: absolute; left: 4px; top: 4px; z-index: 1; font-size: 11px; font-weight: 900; background: var(--red); color: #fff; border-radius: 6px; padding: 1px 5px; }
.pl b { display: block; margin-top: 5px; font-size: 12px; color: #fff; font-weight: 700; }

/* résultat */
.score-hero { text-align: center; padding: 26px 16px 18px; border-radius: var(--r-xl); background: radial-gradient(90% 120% at 50% 0%, rgba(241, 227, 68, 0.14), transparent 60%), linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); box-shadow: var(--shadow); }
.score-big { font-size: 76px; font-weight: 900; line-height: 1; letter-spacing: -0.03em; color: var(--yellow); font-variant-numeric: tabular-nums; }
.score-unit { margin-top: 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute); }
.status { text-align: center; font-weight: 700; font-size: 14px; padding: 11px 12px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; gap: 8px; }
.status.wait { background: rgba(241, 227, 68, 0.12); color: #f3ea8c; } .status.ok { background: rgba(47, 191, 113, 0.14); color: #86e3ae; } .status.ko { background: rgba(239, 78, 92, 0.14); color: #ffb3ba; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats:empty { display: none; }
.kv { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 3px; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.kv span { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.kv b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* classements */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.tabs button { flex: 1; padding: 10px 6px; border-radius: 10px; border: 0; background: transparent; font-weight: 800; font-size: 13.5px; color: var(--mute); cursor: pointer; }
.tabs button.on { background: var(--surface-3); color: #fff; box-shadow: inset 0 -2px 0 var(--red); }
.board-sub { font-size: 13px; color: var(--mute); text-align: center; margin-top: -4px; }
.board-sub:empty { display: none; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; }
.podium:empty { display: none; }
.pod { text-align: center; padding: 14px 8px 12px; border-radius: var(--r-md) var(--r-md) 6px 6px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); min-width: 0; }
.pod .rk { width: 30px; height: 30px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 14px; color: #14161d; }
.pod .nm { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod .sc { font-weight: 900; font-size: 18px; color: var(--yellow); font-variant-numeric: tabular-nums; }
.pod .dt { font-size: 11.5px; color: var(--mute); }
.pod.p1 { padding-top: 22px; border-color: rgba(241, 227, 68, 0.5); box-shadow: 0 0 0 1px rgba(241, 227, 68, 0.18), var(--shadow); } .pod.p1 .rk { background: var(--yellow); } .pod.p1 .sc { font-size: 22px; }
.pod.p2 .rk { background: #cfd6e2; } .pod.p3 .rk { background: #d49a63; }
.pod.me { outline: 2px solid var(--sky); }
.list { padding: 6px 14px; }
table.lb { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.lb td { padding: 11px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
table.lb tr:last-child td { border-bottom: 0; }
table.lb td:first-child { width: 38px; color: var(--mute); font-weight: 800; }
table.lb td:nth-child(2) { font-weight: 700; }
table.lb td:last-child { text-align: right; font-weight: 900; color: var(--yellow); }
table.lb .dt { display: block; font-size: 12px; color: var(--mute); font-weight: 600; }
table.lb tr.me td { background: rgba(65, 147, 208, 0.12); } table.lb tr.me td:first-child { box-shadow: inset 3px 0 0 var(--sky); }
table.lb tr.gap td { text-align: center; color: var(--mute); padding: 4px; }
.empty { text-align: center; color: var(--mute); padding: 18px 8px; font-size: 14px; }

/* toast */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: 528px; margin: 0 auto; background: rgba(13, 22, 40, 0.94); border: 1px solid var(--line-2); padding: 13px 14px; border-radius: var(--r-md); text-align: center; z-index: 40; font-weight: 700; font-size: 14px; display: none; box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.toast.on { display: block; }

/* ---------------- partie ---------------- */
#s-game { padding: 0; max-width: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: #000; touch-action: none; }
#stage, #stage canvas { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; padding-top: calc(4px + env(safe-area-inset-top)); }
#hud .quit, #hud .tapzone { pointer-events: auto; }
.hud-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 10px 0; }
.hud-sub { display: flex; gap: 8px; padding: 8px 10px 0; }
.chip { background: rgba(10, 17, 32, 0.72); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px; padding: 7px 12px; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.chip.big { font-size: 24px; color: var(--yellow); min-width: 90px; text-align: center; font-weight: 900; }
#k-lives { color: #ff6b7a; letter-spacing: 2px; }
.flash { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-size: 34px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.02em; opacity: 0; transform: scale(0.85); transition: opacity 0.15s, transform 0.15s; text-shadow: 0 4px 18px rgba(0, 0, 0, 0.7); padding: 0 12px; }
.flash.show { opacity: 1; transform: scale(1); } .flash.good { color: var(--yellow); } .flash.bad { color: #fff; }
.trail { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; }
.hint { position: absolute; left: 0; right: 0; bottom: calc(26% + env(safe-area-inset-bottom)); text-align: center; font-weight: 800; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); font-size: 15px; }
.hint .finger { display: inline-block; font-size: 26px; animation: flick 1.2s infinite; }
@keyframes flick { 0% { transform: translateY(18px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-34px); opacity: 0; } }
.quit { position: absolute; left: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); background: rgba(10, 17, 32, 0.7) !important; backdrop-filter: blur(6px); }
.coach { position: absolute; right: 8px; top: calc(104px + env(safe-area-inset-top)); width: 70px; text-align: center; pointer-events: none; }
.coach img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; background: var(--surface); display: block; margin: 0 auto; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); transition: border-color 0.2s, box-shadow 0.2s; }
.coach span { display: block; font-size: 9px; font-weight: 800; letter-spacing: 0.06em; background: var(--red); border-radius: 6px; padding: 2px 4px; margin-top: 4px; line-height: 1.15; }
.gauge { display: flex; align-items: center; gap: 8px; padding: 10px 10px 0; font-weight: 800; font-size: 12px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }
.g-bar { flex: 1; height: 14px; background: rgba(10, 17, 32, 0.75); border-radius: 8px; position: relative; border: 1px solid rgba(255, 255, 255, 0.2); overflow: hidden; }
.g-fill { position: absolute; top: 0; bottom: 0; } .g-fill.pos { background: linear-gradient(90deg, var(--sky), #7cc0f0); } .g-fill.neg { background: var(--ko); }
.g-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #fff; }
.g-mark { position: absolute; top: -2px; bottom: -2px; width: 5px; margin-left: -2px; background: #fff; border-radius: 3px; }
.g-r { color: #9fd0f3; }
.count { position: absolute; left: 0; right: 0; top: 44%; text-align: center; font-size: 88px; font-weight: 900; text-shadow: 0 6px 24px rgba(0, 0, 0, 0.6); color: var(--yellow); }
.count.pop { animation: pop 0.5s; } @keyframes pop { from { transform: scale(1.6); opacity: 0.3; } to { transform: scale(1); opacity: 1; } }
.tapzone { position: absolute; left: 0; right: 0; bottom: 0; top: 110px; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px calc(18px + env(safe-area-inset-bottom)); touch-action: none; }
.tapbtn { width: 100%; max-width: 480px; height: 30%; min-height: 120px; border-radius: 28px; background: radial-gradient(120% 140% at 50% 0%, #e0294d, var(--red) 50%, var(--red-2)); display: grid; place-items: center; text-align: center; font-weight: 900; font-size: 24px; line-height: 1.15; letter-spacing: 0.02em; box-shadow: 0 14px 36px rgba(202, 28, 61, 0.45), inset 0 0 0 3px rgba(255, 255, 255, 0.14), inset 0 -6px 0 rgba(0, 0, 0, 0.18); }
.tapbtn.hit { animation: hit 0.09s; } @keyframes hit { from { transform: scale(0.95); background: var(--yellow); color: #14161d; } to { transform: scale(1); } }
#pause { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(6, 10, 20, 0.8); display: none; place-items: center; padding: 24px; z-index: 25; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
#pause.on { display: grid; }
.pause-card { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 28px 30px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.pause-card b { font-size: 22px; font-weight: 900; } .pause-card span { color: var(--mute); font-size: 14px; } .pause-card .i { color: var(--yellow); }

/* quiz */
#s-game.quiz-mode { background: radial-gradient(120% 70% at 50% 0%, #22365f 0%, var(--bg) 70%); }
#s-game.quiz-mode #hud { pointer-events: auto; overflow-y: auto; }
#s-game.quiz-mode .coach { top: calc(10px + env(safe-area-inset-top)); }
.quiz { max-width: 560px; margin: 0 auto; padding: 10px 14px calc(70px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; min-height: 100%; }
.quiz-top { display: flex; gap: 8px; align-items: center; padding-right: 78px; }
.quiz-steps { display: flex; gap: 4px; padding-right: 78px; } .quiz-steps i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); }
.quiz-steps i.off { opacity: 0.25; }
.chip.lives { color: #ff6b7a; letter-spacing: 2px; font-size: 16px; } .chip.lives span { opacity: 0.25; } .chip.lives span.on { opacity: 1; }
.quiz-steps i.now { background: #fff; } .quiz-steps i.ok { background: var(--ok); } .quiz-steps i.ko { background: var(--ko); }
.quiz-level { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); margin-top: 4px; } .quiz-level b { color: var(--yellow); }
.quiz-level[data-n="4"] b { color: #ffa24a; } .quiz-level[data-n="5"] b { color: #ff6b7a; }
.quiz-timer { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; } .quiz-timer div { height: 100%; width: 100%; background: linear-gradient(90deg, var(--sky), #7cc0f0); } .quiz-timer div.low { background: var(--ko); }
.quiz-q { font-size: 22px; font-weight: 800; line-height: 1.25; padding: 14px 2px 4px; min-height: 92px; }
.quiz-choices { display: grid; gap: 10px; }
.quiz-choice { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-radius: var(--r-md); border: 1.5px solid var(--line-2); background: linear-gradient(180deg, var(--surface), var(--bg-2)); font-size: 16.5px; font-weight: 700; cursor: pointer; min-height: 58px; transition: border-color 0.15s, background 0.15s; }
.quiz-choice span { flex: 0 0 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--yellow); font-weight: 900; }
.quiz-choice:active { transform: scale(0.985); } .quiz-choice[disabled] { cursor: default; }
.quiz-choice.picked { border-color: #fff; } .quiz-choice.good { background: rgba(47, 191, 113, 0.18); border-color: var(--ok); } .quiz-choice.good span { background: var(--ok); color: #06210f; }
.quiz-choice.bad { background: rgba(239, 78, 92, 0.16); border-color: var(--ko); } .quiz-choice.bad span { background: var(--ko); color: #2a0408; }
.quiz-expl { font-size: 14.5px; line-height: 1.4; padding: 12px 14px; border-radius: var(--r-md); opacity: 0; transition: opacity 0.2s; border: 1px solid transparent; }
.quiz-expl.show { opacity: 1; } .quiz-expl.good { background: rgba(47, 191, 113, 0.12); border-color: rgba(47, 191, 113, 0.35); } .quiz-expl.bad { background: rgba(239, 78, 92, 0.1); border-color: rgba(239, 78, 92, 0.35); } .quiz-expl b { display: block; margin-bottom: 2px; }
.quiz-net { color: #f3ea8c; text-align: center; font-size: 13px; min-height: 18px; }
@media (max-height: 700px) { .quiz-q { font-size: 19px; min-height: 70px; padding-top: 6px; } .quiz-choice { padding: 10px 12px; min-height: 50px; font-size: 15.5px; } }

/* option « Moscato coach » (quiz) */
.coach-bubble { display: none; position: absolute; z-index: 20; top: calc(12px + env(safe-area-inset-top)); left: 10px; right: 90px; padding: 11px 13px; border-radius: 14px; background: #fff; color: #14161d; font-weight: 800; font-size: 14.5px; line-height: 1.3; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5); opacity: 0; transform: translateY(-6px) scale(0.96); transition: opacity 0.18s, transform 0.18s; pointer-events: none; }
#s-game.quiz-mode .coach-bubble { display: block; }
.coach-bubble::after { content: ''; position: absolute; right: -9px; top: 22px; border: 9px solid transparent; border-left-color: #fff; border-right: 0; }
.coach-bubble.show { opacity: 1; transform: none; }
.coach-bubble.ok { box-shadow: inset 4px 0 0 var(--ok), 0 8px 26px rgba(0, 0, 0, 0.5); } .coach-bubble.ko { box-shadow: inset 4px 0 0 var(--ko), 0 8px 26px rgba(0, 0, 0, 0.5); }
.coach.react-ok img { animation: coach-ok 0.7s ease-out; border-color: var(--ok); box-shadow: 0 0 18px rgba(47, 191, 113, 0.8); }
.coach.react-ko img { animation: coach-ko 0.6s ease-in-out; border-color: var(--ko); filter: saturate(0.6); }
@keyframes coach-ok { 0% { transform: scale(1); } 35% { transform: scale(1.22) rotate(-6deg); } 65% { transform: scale(0.96) rotate(3deg); } 100% { transform: scale(1); } }
@keyframes coach-ko { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(5deg); } }
@media (prefers-reduced-motion: reduce) { .coach.react-ok img, .coach.react-ko img, .hint .finger { animation: none; } }

/* anciens navigateurs sans aspect-ratio (Samsung Internet < 15) */
@supports not (aspect-ratio: 1) { .pl .ph { height: 0; padding-top: 100%; } }

/* écran de secours si le jeu ne démarre pas */
.boot-fail { position: fixed; left: 16px; right: 16px; top: 30%; z-index: 50; padding: 22px 18px; border-radius: 18px; background: #16233f; border: 1px solid rgba(255,255,255,0.16); color: #fff; text-align: center; font-family: system-ui, sans-serif; box-shadow: 0 12px 32px rgba(2,6,18,0.5); }
.boot-fail b { display: block; font-size: 19px; margin-bottom: 6px; } .boot-fail p { margin: 0 0 14px; color: #cfd7e6; font-size: 14.5px; line-height: 1.4; }
.boot-fail button { width: 100%; padding: 14px; border: 0; border-radius: 12px; background: #ca1c3d; color: #fff; font-weight: 800; font-size: 16px; } .boot-fail small { display: block; margin-top: 10px; color: #8f9cb6; font-size: 11.5px; word-break: break-word; }

/* duel entre supporters (mêlée) */
.cover-tag { position: absolute; z-index: 1; left: 14px; bottom: 12px; font-size: 12px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; background: var(--red); color: #fff; padding: 6px 10px; border-radius: 8px; }
.duel-actions { display: flex; flex-direction: column; gap: 10px; }
.duel-join .row { align-items: stretch; } .duel-join .row > .field { flex: 1 1 auto; min-width: 0; } .duel-join .row > .btn { flex: 0 0 auto; width: auto; padding-left: 16px; padding-right: 16px; }
.field.code { text-transform: uppercase; letter-spacing: 0.16em; padding-left: 8px; padding-right: 8px; font-size: 22px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.field.code::placeholder { letter-spacing: 0.2em; font-size: 18px; }
.duel-wait { text-align: center; padding: 22px 16px; }
.duel-code { font-size: 64px; font-weight: 900; letter-spacing: 0.18em; padding-left: 0.18em; color: var(--yellow); line-height: 1.05; font-variant-numeric: tabular-nums; margin: 4px 0 8px; }
.duel-code.small { font-size: 34px; color: var(--txt-2); }
.duel-msg { font-size: 17px; font-weight: 800; margin: 0 0 12px; } .duel-msg b { color: var(--yellow); }
.dots { display: flex; justify-content: center; gap: 8px; margin: 6px 0 12px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--sky); animation: dots 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: 0.15s; } .dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dots { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }
.kv.wide { grid-column: 1 / -1; } .kv.wide b { font-size: 17px; }
.score-big.word { font-size: 52px; letter-spacing: -0.01em; } .score-big.word.lose { color: #ff9aa5; } .score-big.word.draw { color: var(--txt-2); }
.btn.pulse { animation: pulse 1.1s infinite; } @keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(241, 227, 68, 0.6); } 50% { box-shadow: 0 0 0 8px rgba(241, 227, 68, 0); } }
@media (prefers-reduced-motion: reduce) { .dots i, .btn.pulse { animation: none; } }
