/* =====================================================================
   LE QG · la plateforme
   Un lanceur sombre, sobre : les couvertures des jeux portent la couleur.
   Charte : fond encre, surfaces graphite, un seul jaune « QG » pour la marque,
   et l'accent du jeu choisi (variables --bg/--fg/--accent) dans son contexte.
   Les jeux ont leur propre DA dans leur style.css (sous [data-game="<id>"]).
   ===================================================================== */

@font-face { font-family: 'Schibsted Grotesk'; src: url('fonts/schibsted-grotesk-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Schibsted Grotesk'; src: url('fonts/schibsted-grotesk-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Schibsted Grotesk'; src: url('fonts/schibsted-grotesk-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --p-bg: #0E1015;
  --p-surface: #171A21;
  --p-raised: #1E222B;
  --p-sunken: #12141A;
  --p-ink: #F1F2F5;
  --p-muted: #959BA8;
  --p-faint: #6A7080;
  --p-line: #272B35;
  --p-line-2: #343947;
  --p-brand: #FFD23F;
  --p-brand-ink: #15130A;
  --p-green: #2BC48A;
  --p-red: #FF5A5F;
  --p-focus: #8FB4FF;
  --p-font: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --p-r: 14px;
  --p-rail: 88px;
  --accent: var(--p-brand);
  --accent-ink: var(--p-brand-ink);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--p-font); font-size: 15px; line-height: 1.45; color: var(--p-ink); background: var(--p-bg); -webkit-font-smoothing: antialiased; }
body.in-game { background: #0A0B0F; }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--p-focus); outline-offset: 2px; }
.icon { width: 1.2em; height: 1.2em; flex: none; display: block; }
.noscript { padding: 40px; text-align: center; }
.p-muted { color: var(--p-muted); }
.p-error { color: var(--p-red); font-weight: 600; min-height: 1.3em; }
.p-stack { display: flex; flex-direction: column; gap: 12px; }
.p-hide-sm { display: inline; }
.p-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

/* ---------- Boutons, champs ---------- */
.p-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 11px; border: none;
  background: var(--p-raised); color: var(--p-ink); font-weight: 600; white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--p-line-2);
  transition: background 120ms, transform 120ms, filter 120ms;
}
.p-btn:hover:not(:disabled) { background: #272C37; }
.p-btn:active:not(:disabled) { transform: translateY(1px); }
.p-btn:disabled { opacity: .4; cursor: not-allowed; }
.p-btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.p-btn.primary, .p-btn.play { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.p-btn.primary:hover:not(:disabled), .p-btn.play:hover:not(:disabled) { background: var(--accent); filter: brightness(1.1); }
.p-btn.play { min-height: 52px; padding: 0 28px; font-size: 17px; font-weight: 800; border-radius: 13px; }
.p-btn.play .icon { width: 20px; height: 20px; fill: currentColor; }
.p-btn.wide { width: 100%; }
.p-btn.ghost { background: transparent; }
.p-btn.ghost:hover:not(:disabled) { background: var(--p-raised); }
.p-btn.glass { background: rgba(10, 11, 15, .45); color: #fff; backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.p-btn.glass:hover:not(:disabled) { background: rgba(10, 11, 15, .65); }
.p-link { border: none; background: none; padding: 0; margin-left: 6px; color: var(--p-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--p-faint); }
.p-link.small { font-size: 13px; margin: 2px 0 0; color: var(--p-muted); align-self: flex-start; }
.p-icon { width: 38px; height: 38px; border-radius: 10px; border: none; background: transparent; display: grid; place-items: center; padding: 0; color: inherit; }
.p-icon:hover { background: rgba(255, 255, 255, .08); }
.p-icon.sm { width: 30px; height: 30px; }
.p-icon.sm .icon { width: 16px; height: 16px; }
.p-icon.danger:hover, .p-icon.armed { background: var(--p-red); color: #fff; }
.p-input { font: inherit; width: 100%; padding: 10px 12px; border-radius: 11px; border: 1.5px solid var(--p-line-2); background: var(--p-sunken); color: var(--p-ink); }
.p-input:focus { outline: none; border-color: var(--accent); }
.p-input.big { font-size: 22px; font-weight: 800; padding: 10px 14px; }
.p-input:disabled { color: var(--p-muted); }
.p-input::placeholder { color: var(--p-faint); }
.p-label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.p-switch { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.p-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.p-track { width: 40px; height: 24px; flex: none; border-radius: 99px; background: var(--p-line-2); position: relative; transition: background 200ms; }
.p-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: transform 200ms; }
.p-switch input:checked + .p-track { background: var(--p-green); }
.p-switch input:checked + .p-track::after { transform: translateX(16px); }
.p-switch input:focus-visible + .p-track { outline: 2px solid var(--p-focus); outline-offset: 2px; }
.p-switch input:disabled + .p-track { opacity: .5; }
.p-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.p-chip { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--p-line-2); background: transparent; border-radius: 99px; padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--p-muted); transition: background 120ms, color 120ms, border-color 120ms; }
.p-chip:hover { color: var(--p-ink); border-color: var(--p-faint); }
.p-chip .icon { width: 14px; height: 14px; }
.p-chip.on { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); color: var(--p-ink); }
.p-badge-18 { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--p-red); color: #fff; font-size: 11px; font-weight: 800; vertical-align: 2px; line-height: 18px; }
.p-bot-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--p-line-2); color: var(--p-muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; vertical-align: 2px; line-height: 18px; }
.p-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; width: fit-content; }
.p-stat { display: inline-flex; align-items: center; gap: 5px; }
.p-stat .icon { width: 15px; height: 15px; }
.p-card { background: var(--p-surface); border-radius: 18px; padding: 22px; border: 1px solid var(--p-line); }
.p-card h2 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 14px; }
.p-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.p-card-head h2 { margin-bottom: 2px; }
.p-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: p-spin .8s linear infinite; flex: none; }
@keyframes p-spin { to { transform: rotate(360deg); } }
.p-wait { display: flex; align-items: center; gap: 10px; color: var(--p-muted); font-weight: 600; }
.p-note { color: var(--p-muted); font-size: 14px; margin-top: 10px; }
.p-hint { display: flex; align-items: center; gap: 8px; color: var(--p-muted); font-size: 13px; margin-top: 14px; }
.p-hint .icon { width: 16px; height: 16px; }

/* ---------- Coque ---------- */
.p-shell { display: grid; grid-template-columns: var(--p-rail) 1fr; min-height: 100vh; }
.p-rail { position: sticky; top: 0; height: 100vh; background: var(--p-sunken); border-right: 1px solid var(--p-line); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; z-index: 40; }
.p-logo { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 18px; }
.p-logo-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--p-brand); color: var(--p-brand-ink); font-weight: 800; font-size: 19px; letter-spacing: -.02em; transform: rotate(-6deg); }
.p-logo-text { font-weight: 800; font-size: 12px; }
.p-nav-item { width: 74px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; font-size: 12px; font-weight: 600; color: var(--p-muted); position: relative; }
.p-nav-item .icon { width: 24px; height: 24px; }
.p-nav-item:hover { background: var(--p-surface); color: var(--p-ink); }
.p-nav-item.active { color: var(--p-ink); background: var(--p-raised); }
.p-nav-item.active::before { content: ''; position: absolute; left: -6px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--p-brand); }
.p-nav-avatar .avatar { width: 28px; height: 28px; }
.p-body { min-width: 0; }
.p-header { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: rgba(14, 16, 21, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--p-line); }
.p-join { display: flex; align-items: center; gap: 8px; }
.p-join-label { font-weight: 600; font-size: 14px; color: var(--p-muted); }
.p-code { width: 96px; font: inherit; font-weight: 800; letter-spacing: .25em; text-transform: uppercase; text-align: center; padding: 8px; border-radius: 10px; border: 1.5px solid var(--p-line-2); background: var(--p-sunken); color: var(--p-ink); }
.p-code::placeholder { color: var(--p-faint); }
.p-code:focus { outline: none; border-color: var(--p-brand); }
.p-back-room { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 99px; padding: 7px 14px; background: var(--p-brand); color: var(--p-brand-ink); font-weight: 800; font-size: 14px; }
.p-header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.p-me { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; background: var(--p-surface); border: 1px solid var(--p-line); font-weight: 600; font-size: 14px; max-width: 220px; }
.p-me span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-me .avatar { width: 30px; height: 30px; }
.p-main { padding: 26px 28px 60px; max-width: 1480px; }

/* ---------- Accueil ---------- */
.p-hero-box { margin-bottom: 36px; }
.p-hero { position: relative; height: clamp(300px, 36vw, 460px); border-radius: 22px; overflow: hidden; background: var(--bg); color: #fff; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); animation: p-fade 400ms ease; }
@keyframes p-fade { from { opacity: .4; } to { opacity: 1; } }
.p-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 9, 12, .92) 0%, rgba(8, 9, 12, .7) 34%, rgba(8, 9, 12, 0) 66%), linear-gradient(0deg, rgba(8, 9, 12, .55), transparent 40%); }
.p-hero-text { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px; padding: 38px 42px; max-width: 600px; }
.p-hero h1 { font-size: clamp(36px, 4.6vw, 62px); font-weight: 800; line-height: .98; letter-spacing: -.025em; }
.p-hero p { font-size: 17px; color: rgba(255, 255, 255, .86); }
.p-hero-meta { display: flex; gap: 16px; color: rgba(255, 255, 255, .7); font-size: 14px; font-weight: 600; }
.p-hero-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.p-dots { position: absolute; z-index: 2; right: 26px; bottom: 26px; display: flex; gap: 8px; }
.p-dot { width: 9px; height: 9px; padding: 0; border-radius: 99px; border: none; background: rgba(255, 255, 255, .35); transition: width 200ms, background 200ms; }
.p-dot.on { width: 26px; background: #fff; }

.p-row { margin-bottom: 38px; }
.p-row-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.p-row-title { font-size: 22px; font-weight: 800; letter-spacing: -.015em; }
.p-row-sub { color: var(--p-muted); }
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px 18px; margin-top: 16px; }
.p-grid.compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: 0; gap: 16px 12px; }
.p-tile { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.p-tile-art { position: relative; aspect-ratio: 16 / 9; border-radius: var(--p-r); overflow: hidden; background: var(--bg); box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); transition: box-shadow 160ms, transform 160ms; }
.p-tile-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 300ms cubic-bezier(.2, .8, .2, 1); }
.p-tile:hover .p-tile-art { box-shadow: 0 0 0 2px var(--accent), 0 14px 30px -14px color-mix(in srgb, var(--accent) 60%, transparent); transform: translateY(-2px); }
.p-tile:hover .p-tile-art img { transform: scale(1.04); }
.p-tile.current .p-tile-art { box-shadow: 0 0 0 3px var(--accent); }
.p-tile-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; color: #fff; font-weight: 800; font-size: 22px; background: linear-gradient(135deg, var(--bg), var(--accent)); }
.p-live { position: absolute; z-index: 1; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; background: rgba(8, 9, 12, .75); color: #fff; font-size: 12px; font-weight: 700; }
.p-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--p-green); box-shadow: 0 0 0 3px rgba(43, 196, 138, .25); }
.p-tile-name { font-weight: 700; font-size: 16px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-tile-meta { display: flex; gap: 14px; color: var(--p-muted); font-size: 13px; font-weight: 600; }
.p-foot { color: var(--p-faint); font-size: 13px; padding-top: 10px; }

/* ---------- Page d'un jeu ---------- */
.p-gp-top { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); gap: 28px; align-items: start; }
.p-gallery { display: flex; flex-direction: column; gap: 10px; }
.p-gal-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: var(--bg, #111); }
.p-gal-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.p-gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: none; background: rgba(8, 9, 12, .7); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.p-gal-nav.prev { left: 12px; }
.p-gal-nav.next { right: 12px; }
.p-gal-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px; }
.p-gal-thumb { flex: none; width: 112px; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; border: none; padding: 0; opacity: .55; box-shadow: 0 0 0 2px transparent; background: var(--bg); }
.p-gal-thumb.on { opacity: 1; box-shadow: 0 0 0 2px var(--accent); }
.p-gal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-gp-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 90px; }
.p-gp-title { font-size: 38px; font-weight: 800; line-height: 1.02; letter-spacing: -.025em; }
.p-gp-tag { font-size: 17px; color: var(--p-muted); margin-bottom: 8px; }
.p-gp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.p-gp-stats .p-stat { flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--p-surface); border: 1px solid var(--p-line); font-size: 14px; font-weight: 700; }
.p-gp-stats .p-stat small { color: var(--p-muted); font-weight: 600; font-size: 12px; }
.p-gp-stats .p-stat .icon { color: var(--accent); width: 18px; height: 18px; margin-bottom: 4px; }
.p-gp-bottom { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); gap: 28px; margin-top: 28px; align-items: start; }
.p-desc { font-size: 16px; line-height: 1.65; max-width: 68ch; margin-bottom: 8px; color: #D7DAE1; }
.p-rooms { display: flex; flex-direction: column; gap: 8px; }
.p-room { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--p-raised); }
.p-room-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--p-green); }
.p-room-dot.busy { background: #F5A524; }
.p-room-info { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }

/* ---------- Avatar ---------- */
.p-avatar { display: grid; grid-template-columns: 320px minmax(0, 620px); gap: 28px; align-items: start; }
.p-av-left { display: flex; flex-direction: column; gap: 16px; }
.p-av-big { aspect-ratio: 1; border-radius: 22px; background: radial-gradient(circle at 50% 40%, #2A2F3B, var(--p-surface) 70%); border: 1px solid var(--p-line); display: grid; place-items: center; }
.p-av-big .avatar { width: 78%; height: 78%; }
.p-av-editor { color: var(--p-ink); }
.p-av-editor .skin-preview { display: none; }
.p-av-editor .skin { grid-template-columns: 1fr; }

/* ---------- Salon ---------- */
.p-lobby { display: flex; flex-direction: column; gap: 22px; padding-bottom: 90px; }
.p-lobby-head { position: relative; display: grid; grid-template-columns: 300px minmax(0, 1fr) auto; gap: 26px; align-items: center; padding: 18px; border-radius: 22px; background: linear-gradient(120deg, color-mix(in srgb, var(--bg) 85%, #000) 0%, var(--p-surface) 70%); border: 1px solid var(--p-line); overflow: hidden; }
.p-lobby-head::before { content: ''; position: absolute; inset: 0; background: radial-gradient(600px 200px at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); pointer-events: none; }
.p-lobby-head > * { position: relative; }
.p-lh-art { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--bg); box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .7); }
.p-lh-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-lh-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.p-lh-text h1 { font-size: clamp(28px, 3vw, 40px); font-weight: 800; line-height: 1; letter-spacing: -.025em; }
.p-lh-text p { color: var(--p-muted); font-size: 16px; }
.p-lh-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--p-muted); font-size: 13px; font-weight: 600; margin-top: 4px; }
.p-lh-meta .icon { color: var(--accent); }
.p-change { align-self: start; }
.p-lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.p-lobby-main, .p-lobby-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* La table */
.p-slots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.p-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px 12px; border-radius: 14px; background: var(--p-raised); border: 1px solid var(--p-line-2); text-align: center; min-width: 0; }
.p-slot.me { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.p-slot.off { opacity: .45; }
.p-slot.bot { background: transparent; border: 1.5px dashed var(--p-line-2); color: var(--p-muted); }
.p-slot-av { position: relative; width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 6px; }
.p-slot-av .avatar { width: 56px; height: 56px; }
.p-slot.bot .p-slot-av { border-radius: 50%; background: var(--p-sunken); }
.p-slot.bot .p-slot-av .icon { width: 28px; height: 28px; }
.p-slot-crown { position: absolute; right: -6px; top: -8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--p-brand); color: var(--p-brand-ink); }
.p-slot-crown .icon { width: 14px; height: 14px; }
.p-slot-name { font-weight: 700; font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-slot-sub { font-size: 12px; color: var(--p-muted); }
.p-slot-acts { position: absolute; inset: auto 4px 4px; display: flex; justify-content: center; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(8, 9, 12, .9); opacity: 0; transition: opacity 120ms; }
.p-slot:hover .p-slot-acts, .p-slot:focus-within .p-slot-acts { opacity: 1; }

/* Compteurs et boutons segmentés */
.p-stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; background: var(--p-sunken); border: 1px solid var(--p-line-2); width: fit-content; }
.p-stepper-btn { width: 34px; height: 34px; border: none; border-radius: 9px; background: var(--p-raised); display: grid; place-items: center; }
.p-stepper-btn:hover:not(:disabled) { background: #2B303C; }
.p-stepper-btn:disabled { opacity: .3; cursor: not-allowed; }
.p-stepper-btn .icon { width: 16px; height: 16px; }
.p-stepper-val { min-width: 72px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.p-stepper.big .p-stepper-btn { width: 40px; height: 40px; }
.p-stepper.big .p-stepper-val { min-width: 100px; font-size: 17px; }
.p-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--p-sunken); border: 1px solid var(--p-line-2); width: fit-content; max-width: 100%; }
.p-seg.wrap { flex-wrap: wrap; }
.p-seg-btn { border: none; background: transparent; color: var(--p-muted); font-weight: 700; font-size: 14px; padding: 7px 13px; border-radius: 9px; min-width: 38px; }
.p-seg-btn:hover { color: var(--p-ink); }
.p-seg-btn.on { background: var(--accent); color: var(--accent-ink); }

/* Réglages */
.p-settings { display: flex; flex-direction: column; gap: 6px; }
.p-set-list { display: flex; flex-direction: column; gap: 18px; }
.p-set { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.p-set-label { font-weight: 700; font-size: 14px; }
.p-set small { font-size: 12px; }
.p-set-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 18px; }
.p-adv { margin-top: 16px; border-top: 1px solid var(--p-line); padding-top: 14px; }
.p-adv summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-weight: 700; color: var(--p-muted); width: fit-content; }
.p-adv summary::-webkit-details-marker { display: none; }
.p-adv summary:hover { color: var(--p-ink); }
.p-adv summary .icon:last-child { width: 16px; height: 16px; transition: transform 160ms; }
.p-adv[open] summary .icon:last-child { transform: rotate(180deg); }
.p-adv[open] > .p-set-list { margin-top: 18px; }
.p-set-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.p-set-summary > div { padding: 10px 12px; border-radius: 12px; background: var(--p-raised); }
.p-set-summary dt { font-size: 12px; color: var(--p-muted); font-weight: 600; }
.p-set-summary dd { font-weight: 700; font-size: 14px; }

/* Invitation */
.p-invite { display: flex; flex-direction: column; gap: 14px; }
.p-invite h2 { margin-bottom: 0; }
.p-code-tiles { display: grid; place-items: center; padding: 14px; border-radius: 14px; background: var(--p-sunken); border: 1px dashed var(--p-line-2); }
.p-code-big { font-size: 38px; font-weight: 800; letter-spacing: .3em; margin-right: -.3em; color: var(--p-brand); }
.p-host-controls { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--p-line); }

/* Chat + musique */
.p-chat-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; height: 420px; }
.p-music { display: flex; align-items: center; gap: 4px; color: var(--p-muted); font-size: 13px; font-weight: 600; padding: 2px 4px 8px; border-bottom: 1px solid var(--p-line); }
.p-music .p-icon { width: 32px; height: 32px; }
.p-music-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 4px; }
.p-music-vol { width: 70px; accent-color: var(--p-brand); }
.p-chat { flex: 1; min-height: 0; font-family: var(--p-font); color: var(--p-ink); }
.p-chat .chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.p-chat .msg { font-size: 14px; display: flex; gap: 8px; align-items: flex-start; padding: 4px 6px; border-radius: 8px; overflow-wrap: anywhere; color: var(--p-ink); background: none; }
.p-chat .msg .who { font-weight: 700; white-space: nowrap; }
.p-chat .msg.system { color: var(--p-muted); }
.p-chat .msg .icon { width: 15px; height: 15px; margin-top: 2px; }
.p-chat .chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; position: relative; }
.p-chat .chat-form input { font: inherit; padding: 10px 12px; border-radius: 11px; border: 1.5px solid var(--p-line-2); background: var(--p-sunken); color: var(--p-ink); min-width: 0; }
.p-chat .chat-form input:focus { outline: none; border-color: var(--p-brand); }
.p-chat .chat-send { border: none; border-radius: 11px; width: 44px; background: var(--p-brand); color: var(--p-brand-ink); display: grid; place-items: center; }
.p-chat .chat-lock { display: none; }

/* Barre de lancement, toujours visible */
.p-startbar { position: fixed; z-index: 30; left: calc(var(--p-rail) + 28px); right: 28px; bottom: 18px; max-width: calc(1480px - 56px); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 12px 12px 20px; border-radius: 18px; background: rgba(23, 26, 33, .92); backdrop-filter: blur(14px); border: 1px solid var(--p-line-2); box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .8); }
.p-startbar-info { display: flex; flex-direction: column; min-width: 0; }
.p-startbar-info b { font-size: 16px; }
.p-startbar-info .p-muted { font-size: 13px; }
.p-startbar .p-btn.play { min-width: 240px; }

/* ---------- Partie : plein écran, le jeu prend la main ---------- */
.p-full { min-height: 100vh; display: flex; flex-direction: column; }
.p-strip { position: sticky; top: 0; z-index: 30; height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: #0A0B0F; color: #E9EBF0; font-size: 14px; font-weight: 600; }
.p-strip-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--p-brand); color: var(--p-brand-ink); font-weight: 800; font-size: 13px; transform: rotate(-6deg); }
.p-strip-code { letter-spacing: .18em; color: #9AA1B0; }
.p-strip-space { flex: 1; }
.p-strip-btn { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 8px; padding: 6px 10px; background: rgba(255, 255, 255, .08); color: #E9EBF0; font-weight: 600; font-size: 13px; }
.p-strip-btn:hover { background: rgba(255, 255, 255, .16); }
.p-strip-btn.armed { background: var(--p-red); }
.p-strip .p-icon { color: #E9EBF0; width: 34px; height: 34px; }
.p-stage { flex: 1; background: var(--bg); color: var(--fg); padding: 16px; }
.p-stage > .game-root { max-width: 1400px; margin: 0 auto; min-height: calc(100vh - 80px); }
.p-spectator { display: flex; align-items: center; justify-content: center; gap: 8px; max-width: 1400px; margin: 0 auto 12px; padding: 8px 14px; border-radius: 10px; background: rgba(255, 255, 255, .12); font-weight: 600; }
.p-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 80px; font-weight: 600; opacity: .8; }
.p-error-box { color: var(--p-ink); max-width: 560px; margin: 40px auto; }
.p-error-box pre { white-space: pre-wrap; color: var(--p-red); font-size: 13px; }

/* ---------- Résultats ---------- */
.p-banner { position: relative; min-height: 170px; border-radius: 22px; overflow: hidden; background: var(--bg); color: #fff; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 24px 28px; }
.p-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.p-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 9, 12, .9) 0%, rgba(8, 9, 12, .6) 45%, rgba(8, 9, 12, .15) 100%); }
.p-banner > * { position: relative; z-index: 1; }
.p-banner-text { max-width: 60%; }
.p-banner h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.p-banner p { color: rgba(255, 255, 255, .82); margin-top: 4px; }
.p-results { display: flex; flex-direction: column; gap: 24px; }
.p-podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; padding-top: 10px; }
.p-step { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 150px; }
.p-step .avatar { width: 84px; height: 84px; }
.p-crown { color: var(--p-brand); }
.p-crown .icon { width: 30px; height: 30px; }
.p-step-name { font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.p-step-block { width: 100%; display: grid; place-items: center; font-size: 26px; font-weight: 800; border-radius: 14px 14px 0 0; background: var(--p-surface); border: 1px solid var(--p-line); border-bottom: none; }
.p-step-1 .p-step-block { height: 110px; background: var(--p-brand); color: var(--p-brand-ink); border-color: var(--p-brand); }
.p-step-2 .p-step-block { height: 80px; }
.p-step-3 .p-step-block { height: 56px; }
.p-awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.p-award { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.p-award-players { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.p-ranking { list-style: none; margin: 0 auto; padding: 10px; width: min(560px, 100%); background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 16px; }
.p-ranking li { display: grid; grid-template-columns: 26px auto 1fr auto auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 9px; }
.p-ranking li.me { background: var(--p-raised); }
.p-ranking .avatar { width: 26px; height: 26px; }
.p-rank { font-weight: 800; color: var(--p-muted); text-align: center; }
.recap.game-root { border-radius: 18px; background: var(--bg); padding: 16px; }
.recap.game-root:empty { display: none; }
.p-rate { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; flex-wrap: wrap; }
.p-results-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Modale, toast, hors ligne ---------- */
.p-modal-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(4, 5, 8, .7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.p-modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--p-surface); border: 1px solid var(--p-line-2); border-radius: 20px; padding: 22px; color: var(--p-ink); }
.p-modal.wide { width: min(980px, 100%); }
.p-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.p-modal-head h2 { font-size: 20px; font-weight: 800; }
.p-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { font-family: var(--p-font) !important; }
body.offline::after { content: 'Connexion perdue, reconnexion en cours…'; position: fixed; top: 0; left: 0; right: 0; z-index: 80; background: var(--p-red); color: #fff; text-align: center; font-weight: 600; padding: 6px; }

@media (prefers-reduced-motion: reduce) {
  .p-tile-art, .p-tile-art img, .p-btn, .p-track::after, .p-dot { transition: none; }
  .p-hero { animation: none; }
  .p-spinner { animation-duration: 3s; }
}

/* ---------- Petits écrans ---------- */
@media (max-width: 1100px) {
  .p-lobby-grid, .p-gp-top, .p-gp-bottom { grid-template-columns: 1fr; }
  .p-gp-side { position: static; }
  .p-avatar { grid-template-columns: 1fr; }
  .p-av-left { max-width: 360px; }
  .p-lobby-head { grid-template-columns: 220px minmax(0, 1fr); }
  .p-change { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 760px) {
  :root { --p-rail: 0px; }
  .p-shell { grid-template-columns: 1fr; padding-bottom: 66px; }
  .p-rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: 64px; flex-direction: row; justify-content: space-around; padding: 4px; border-right: none; border-top: 1px solid var(--p-line); }
  .p-nav-item.active::before { left: 20px; right: 20px; top: -4px; bottom: auto; width: auto; height: 3px; }
  .p-logo { display: none; }
  .p-nav-item { padding: 6px 4px; }
  .p-header { padding: 0 12px; height: 58px; gap: 8px; }
  .p-join-label { display: none; }
  .p-me > span:not(.avatar) { display: none; }
  .p-me { padding: 3px; }
  .p-main { padding: 16px 12px 40px; }
  .p-hero { height: 400px; border-radius: 18px; }
  .p-hero::after { background: linear-gradient(0deg, rgba(8, 9, 12, .95) 25%, rgba(8, 9, 12, .4) 65%, rgba(8, 9, 12, .1)); }
  .p-hero-text { padding: 22px 20px 44px; }
  .p-dots { left: 20px; right: auto; bottom: 18px; }
  .p-grid { grid-template-columns: 1fr 1fr; gap: 16px 10px; }
  .p-tile-name { font-size: 14px; }
  .p-tile-meta { font-size: 12px; gap: 8px; }
  .p-tile-meta .p-stat:nth-child(n+2) { display: none; }
  .p-lobby-head { grid-template-columns: 1fr; padding: 12px; gap: 14px; }
  .p-lh-art { aspect-ratio: 21 / 9; }
  .p-slots { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .p-slot-acts { opacity: 1; position: static; background: none; }
  .p-startbar { left: 10px; right: 10px; bottom: 74px; padding: 10px 10px 10px 14px; }
  .p-startbar .p-btn.play { min-width: 0; padding: 0 18px; }
  .p-startbar-info b { display: none; }
  .p-banner { min-height: 150px; padding: 18px; flex-direction: column; align-items: flex-start; justify-content: flex-end; }
  .p-banner-text { max-width: 100%; }
  .p-banner h1 { font-size: 26px; }
  .p-hide-sm { display: none; }
  .p-strip-code { display: none; }
  .p-stage { padding: 10px; }
  .p-step { width: 96px; }
  .p-step .avatar { width: 58px; height: 58px; }
  .p-step-1 .p-step-block { height: 76px; } .p-step-2 .p-step-block { height: 54px; } .p-step-3 .p-step-block { height: 38px; }
  .p-back-room { font-size: 0; padding: 8px; }
  .p-back-room .icon { width: 18px; height: 18px; }
  .p-gp-title { font-size: 30px; }
}

/* Modes prêts à jouer */
.p-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 20px; }
.p-preset { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--p-line-2); background: var(--p-raised); color: var(--p-ink); transition: border-color 120ms, background 120ms; }
.p-preset:hover { border-color: var(--p-faint); }
.p-preset b { font-size: 15px; }
.p-preset span { font-size: 12.5px; color: var(--p-muted); line-height: 1.35; }
.p-preset.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--p-raised)); }
