/* =====================================================================
   SALLE DE JEUX — thème « Aurore arcade »
   ===================================================================== */
:root {
  --bg: #07060f; --bg2: #0e0c1d; --panel: rgba(22, 19, 44, .62); --panel-solid: #141128; --panel-2: rgba(255,255,255,.035);
  --line: rgba(255, 255, 255, .085); --line-2: rgba(255,255,255,.16);
  --text: #f4f2ff; --muted: #9b97be; --accent: #8b5cf6; --accent2: #22d3ee; --pink: #ec4899; --gold: #fbbf24; --ok: #34d399; --danger: #f87171;
  --radius: 20px; --shadow: 0 24px 70px rgba(0, 0, 0, .5);
  --grad: linear-gradient(120deg, #8b5cf6 0%, #ec4899 55%, #f59e0b 100%);
  --grad-cool: linear-gradient(120deg, #6366f1, #22d3ee);
  --font-title: 'Figtree', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; }
h1, h2, h3 { font-family: var(--font-title); letter-spacing: -.02em; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(236,72,153,.4); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; } ::-webkit-scrollbar-track { background: transparent; }

/* ---------- Fond aurore ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(1200px 600px at 50% -10%, #1d1440 0%, transparent 70%), var(--bg); }
.bg::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse at 50% 0%, #000 10%, transparent 70%); }
.bg i { position: absolute; width: 620px; height: 620px; border-radius: 50%; filter: blur(110px); opacity: .32; animation: float 22s ease-in-out infinite; }
.bg i:nth-child(1) { background: #7c3aed; top: -220px; left: -160px; }
.bg i:nth-child(2) { background: #db2777; top: 18%; right: -260px; animation-delay: -7s; opacity: .22; }
.bg i:nth-child(3) { background: #0891b2; bottom: -300px; left: 25%; animation-delay: -14s; opacity: .2; }
.bg i:nth-child(4) { background: #f59e0b; top: 55%; left: -280px; animation-delay: -4s; opacity: .1; }
.bg .noise { position: absolute; inset: 0; opacity: .05; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes float { 33% { transform: translate(80px, 50px) scale(1.12); } 66% { transform: translate(-40px, 30px) scale(.95); } }

/* ---------- Boutons / champs ---------- */
.btn, button { font: inherit; cursor: pointer; }
.btn { border: 0; border-radius: 14px; padding: 11px 18px; font-weight: 700; color: var(--text); background: rgba(255,255,255,.07);
  transition: transform .15s, filter .15s, background .15s, box-shadow .2s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn:hover { background: rgba(255,255,255,.12); }
.btn:active { transform: scale(.96); }
.btn:focus-visible, input:focus-visible, button:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
.btn.primary { background: var(--grad); background-size: 160% 100%; color: #fff; box-shadow: 0 10px 30px -6px rgba(236,72,153,.55), inset 0 1px 0 rgba(255,255,255,.25); text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.btn.primary:hover { background-position: 100% 0; box-shadow: 0 14px 38px -6px rgba(236,72,153,.75), inset 0 1px 0 rgba(255,255,255,.3); transform: translateY(-1px); }
.btn.ghost { background: transparent; border: 1px solid var(--line-2); }
.btn.ghost:hover { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.05); }
.btn.glass { background: rgba(255,255,255,.12); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.2); }
.btn.big { padding: 15px 26px; font-size: 16px; border-radius: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); transform: none; box-shadow: none; }
input { font: inherit; color: var(--text); background: rgba(7,6,15,.6); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px rgba(139,92,246,.18); }
input::placeholder { color: #5f5a85; }
input[type=checkbox], input[type=radio] { width: auto; padding: 0; accent-color: var(--pink); box-shadow: none; }
#game button:not([class]), #game button.ghost, #game button.play { border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 600; background: var(--accent); color: #fff; }
#game button.ghost { background: transparent; border: 1px solid #3a3570; color: var(--text); }
#game button:disabled { opacity: .4; cursor: not-allowed; }
#game input { width: 100%; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; vertical-align: middle; }

/* ---------- Barre du haut (flottante) ---------- */
.nav { position: sticky; top: 10px; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 10px auto 0; width: min(1280px, calc(100% - 20px)); padding: 9px 12px 9px 16px; border-radius: 20px;
  background: rgba(14,12,29,.7); backdrop-filter: blur(18px) saturate(1.4); border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-title); font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.brand b { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0 4px; }
.logo { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--grad); box-shadow: 0 6px 20px -4px rgba(236,72,153,.6); transition: transform .3s; }
.brand:hover .logo { transform: rotate(-10deg) scale(1.08); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.status { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.status.on i { background: var(--ok); box-shadow: 0 0 0 3px rgba(52,211,153,.2), 0 0 10px var(--ok); }
.status.on span { display: none; }
.profile { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text);
  border-radius: 999px; padding: 4px 12px 4px 4px; font-weight: 700; transition: background .15s, border-color .15s; }
.profile:hover { background: rgba(255,255,255,.08); border-color: var(--line-2); }
.profile .edit { color: var(--muted); font-size: 13px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; flex: none;
  background: var(--grad); text-transform: uppercase; box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); }
body.in-game .nav { display: none; }

/* ---------- Écrans ---------- */
.screen { width: 100%; max-width: 1280px; margin: 0 auto; padding: clamp(18px, 3vw, 34px) clamp(14px, 3vw, 28px) 40px; animation: appear .4s ease; }
#game { max-width: none; padding: 0; animation: none; }
@keyframes appear { from { opacity: 0; transform: translateY(10px); } }
.kicker { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #f9a8d4; margin-bottom: 10px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(14px); box-shadow: var(--shadow); position: relative; }
.panel h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-family: var(--font-title); font-weight: 800; }
.panel.glow::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }

/* ---------- Accueil : vitrine ---------- */
.hero2 { display: grid; grid-template-columns: 1fr 320px; gap: 18px; margin-bottom: 18px; }
.showcase { position: relative; height: 420px; border-radius: 28px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: 0 40px 90px -20px rgba(0,0,0,.8); background: #000; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease; pointer-events: none; }
.slide.on { opacity: 1; pointer-events: auto; }
.slide > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: scale(1.12); transition: transform 7s ease-out; }
.slide.on > svg { transform: scale(1.02); }
.slide-fade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,6,15,.95) 0%, rgba(7,6,15,.7) 38%, rgba(7,6,15,0) 75%), linear-gradient(0deg, rgba(7,6,15,.85), transparent 45%); }
.slide-txt { position: absolute; left: clamp(20px, 4vw, 44px); bottom: clamp(22px, 4vw, 44px); max-width: 520px; transform: translateY(14px); opacity: 0; transition: all .7s .2s; }
.slide.on .slide-txt { transform: none; opacity: 1; }
.slide-txt h2 { font-size: clamp(32px, 5vw, 56px); line-height: 1; margin: 0 0 12px; text-shadow: 0 6px 30px rgba(0,0,0,.6); }
.slide-txt p { color: #d6d3f0; font-size: 17px; line-height: 1.5; margin: 0 0 20px; }
.slide-txt .kicker { color: color-mix(in srgb, var(--c) 60%, #fff); }
.dots { position: absolute; right: 22px; bottom: 22px; display: flex; gap: 8px; z-index: 2; }
.dots button { width: 10px; height: 10px; border-radius: 99px; border: 0; background: rgba(255,255,255,.35); transition: all .3s; padding: 0; }
.dots button.on { width: 30px; background: #fff; }
.hero-side { display: flex; flex-direction: column; gap: 14px; }
.join-card label { display: block; font-weight: 800; font-size: 17px; margin-bottom: 12px; font-family: var(--font-title); }
.join-card small { display: block; color: var(--muted); margin-top: 10px; }
.code-input { display: flex; gap: 10px; }
.code-input input { font-family: var(--font-title); font-size: 24px; font-weight: 800; letter-spacing: .35em; text-transform: uppercase; text-align: center; padding: 10px; }
.stats-card { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; }
.stats-card div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; }
.stats-card b { font-family: var(--font-title); font-size: 24px; } .stats-card span { color: var(--muted); font-size: 12px; font-weight: 600; }
.catbar { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 14px; margin-bottom: 18px; scrollbar-width: none; }
.cat { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; white-space: nowrap; transition: all .2s; }
.cat span { font-size: 20px; } .cat small { color: var(--muted); background: rgba(255,255,255,.07); padding: 1px 8px; border-radius: 99px; }
.cat:hover { border-color: rgba(236,72,153,.5); transform: translateY(-2px); background: rgba(236,72,153,.08); }
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 16px; overflow-x: auto; padding: 6px 4px 22px; margin: -6px -4px -10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.shelf > * { scroll-snap-align: start; }
.more { color: var(--muted); font-weight: 700; font-size: 14px; } .more:hover { color: #fff; }

/* ---------- Sections ---------- */
.section { margin-bottom: 38px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 22px; margin: 0; display: flex; align-items: center; gap: 10px; }
.count { font-family: var(--font-title); font-size: 13px; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: rgba(236,72,153,.16); color: #f9a8d4; }
.live { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; box-shadow: 0 0 8px var(--ok); }
@keyframes pulse { 50% { opacity: .3; } }
.page-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin: 6px 0 20px; }
.page-hero p { margin: 4px 0 0; max-width: 560px; }

/* ---------- Cartes de jeux ---------- */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 18px; }
.game-card { position: relative; border-radius: 24px; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--c, #8b5cf6) 14%, #141128) 0%, #110f22 60%); border: 1px solid var(--line);
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.7); transition: transform .25s ease, border-color .25s, box-shadow .25s; display: flex; flex-direction: column; transform-style: preserve-3d; will-change: transform; }
.game-card:hover { border-color: color-mix(in srgb, var(--c, #8b5cf6) 60%, transparent); box-shadow: 0 30px 60px -16px color-mix(in srgb, var(--c, #8b5cf6) 55%, transparent), 0 0 0 1px color-mix(in srgb, var(--c, #8b5cf6) 30%, transparent); }
.game-art { height: 160px; position: relative; overflow: hidden; }
.game-art svg { width: 100%; height: 100%; display: block; transition: transform .6s ease; }
.game-card:hover .game-art svg { transform: scale(1.07); }
.game-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, color-mix(in srgb, var(--c, #8b5cf6) 14%, #141128) 0%, transparent 45%); }
.art-shine { position: absolute; inset: 0; z-index: 1; background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.28), transparent 45%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.game-card:hover .art-shine { opacity: 1; }
.art-icon { position: absolute; left: 16px; bottom: -2px; z-index: 2; font-size: 34px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px; background: rgba(10,8,22,.7); backdrop-filter: blur(8px); border: 1px solid var(--line-2); box-shadow: 0 10px 24px rgba(0,0,0,.5); transform: translateY(50%); transition: transform .3s; }
.game-card:hover .art-icon { transform: translateY(50%) rotate(-8deg) scale(1.08); }
.game-art { overflow: visible; } .game-art > svg { border-radius: 24px 24px 0 0; } .game-card { overflow: visible; }
.game-art .badge { position: absolute; z-index: 2; top: 12px; left: 12px; background: rgba(7,6,15,.6); backdrop-filter: blur(8px); padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; border: 1px solid rgba(255,255,255,.12); }
.game-body { padding: 36px 18px 18px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.game-body h3 { margin: 0; font-size: 20px; }
.game-body p { margin: 0; color: var(--muted); line-height: 1.45; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.06); color: #d8d5f3; border: 1px solid var(--line); }
.game-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 6px; }
.game-actions .btn { flex: 1; padding: 10px 12px; }
.live-tag { color: var(--ok) !important; background: rgba(52,211,153,.12) !important; border-color: rgba(52,211,153,.3) !important; }

/* ---------- Salons ---------- */
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.room { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); text-align: left; transition: border-color .15s, transform .15s; width: 100%; backdrop-filter: blur(10px); }
.room:hover { border-color: var(--accent); transform: translateY(-2px); }
.room .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex: none; background: linear-gradient(135deg, var(--c, #8b5cf6), color-mix(in srgb, var(--c, #8b5cf6) 40%, #000)); box-shadow: 0 6px 18px -4px var(--c, #8b5cf6); }
.room .info { flex: 1; min-width: 0; }
.room .info b { display: block; } .room .info small { color: var(--muted); }
.room .go { color: #f9a8d4; font-weight: 800; font-size: 14px; }
.stack { display: flex; margin-top: 4px; } .stack .uav { margin-right: -6px; box-shadow: 0 0 0 2px var(--panel-solid); }
.empty-rooms { grid-column: 1 / -1; text-align: center; padding: 34px 16px; border: 1px dashed var(--line-2); border-radius: 18px; color: var(--muted); background: rgba(255,255,255,.015); }
.empty-rooms b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }

/* ---------- Étapes ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 10px; }
.step { display: flex; gap: 14px; padding: 18px; border-radius: 18px; background: var(--panel-2); border: 1px solid var(--line); }
.step > b { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; flex: none; font-family: var(--font-title); }
.step h3 { margin: 2px 0 4px; font-size: 16px; } .step p { margin: 0; color: var(--muted); font-size: 14px; }
.foot { text-align: center; color: #5f5a85; font-size: 13px; padding-top: 12px; }

/* ---------- Salon d'attente ---------- */
.back { background: none; border: 0; color: var(--muted); font-weight: 700; padding: 6px 0; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.lobby-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.lobby-banner { margin: -22px -22px 22px; height: 190px; border-radius: var(--radius) var(--radius) 0 0; position: relative; overflow: hidden; background: var(--c, #3b2f8f); }
.lobby-art, .lobby-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lobby-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(14,12,29,.95), rgba(14,12,29,.2) 70%); }
.lobby-title { position: absolute; left: 22px; bottom: 18px; z-index: 1; }
.lobby-banner h1 { margin: 0; font-size: clamp(28px, 4vw, 42px); text-shadow: 0 4px 20px rgba(0,0,0,.6); }
.lobby-banner .kicker { margin-bottom: 4px; }
.invite { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 18px; border-radius: 18px; background: rgba(7,6,15,.5); border: 1px solid var(--line); margin-bottom: 26px; }
.code-box .muted { font-size: 13px; }
.big-code { font-family: var(--font-title); font-size: 46px; font-weight: 800; letter-spacing: .25em; line-height: 1.1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.invite-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; justify-content: flex-end; }
.players { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.players li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); animation: appear .3s; min-width: 0; }
.players li .who { min-width: 0; } .players li b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players li small { color: var(--muted); }
.players li.me { border-color: rgba(236,72,153,.5); background: rgba(236,72,153,.08); }
.players li.slot { border-style: dashed; color: #5f5a85; justify-content: center; background: transparent; }
.start-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--line); }
.start-bar p { margin: 0; color: var(--muted); }
.waiting::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.lobby-side { display: flex; flex-direction: column; gap: 20px; }
.rules ul { margin: 0; padding-left: 18px; color: #d8d5f3; line-height: 1.65; font-size: 14px; }
.chat { display: flex; flex-direction: column; }
.chat-log { height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; margin-bottom: 12px; font-size: 14px; }
.chat-log .msg { line-height: 1.4; word-wrap: break-word; animation: appear .2s; }
.chat-log .msg b { margin-right: 4px; }
.chat-log .sys { color: var(--muted); font-size: 13px; font-style: italic; }
.chat-log .empty { margin: auto; }
.chat-form { display: flex; gap: 8px; } .chat-form .btn { padding: 0 16px; }

/* ---------- Fenêtre & notifications ---------- */
dialog { border: 1px solid var(--line-2); border-radius: 24px; background: linear-gradient(180deg, #1b1735, #110f22); color: var(--text); padding: 28px; width: min(430px, calc(100vw - 32px)); box-shadow: 0 40px 100px rgba(0,0,0,.7); }
dialog::backdrop { background: rgba(5,4,12,.72); backdrop-filter: blur(6px); }
dialog[open] { animation: pop .25s ease; } @keyframes pop { from { opacity: 0; transform: scale(.95) translateY(10px); } }
dialog h2 { margin: 0 0 6px; } dialog p { margin: 0 0 18px; }
dialog input { font-size: 17px; }
.dlg-actions { margin-top: 18px; } .dlg-actions .btn { width: 100%; }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 9999; pointer-events: none; }
.toast { background: rgba(20,18,40,.95); border: 1px solid var(--line-2); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow);
  font-weight: 600; animation: toastIn .3s cubic-bezier(.2,1.4,.4,1); backdrop-filter: blur(12px); max-width: calc(100vw - 32px); }
.toast.err { border-color: rgba(248,113,113,.6); } .toast.ok { border-color: rgba(52,211,153,.6); }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }

/* ---------- Mobile ---------- */
@media (max-width: 980px) { .hero2 { grid-template-columns: 1fr; } .showcase { height: 380px; } .hero-side { display: grid; grid-template-columns: 1fr 1fr; } .hero-side .tcard { grid-column: 1 / -1; } }
@media (max-width: 860px) {
  .lobby-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .invite-actions { justify-content: flex-start; }
  .big-code { font-size: 38px; }
}
@media (max-width: 600px) {
  .hero-side { grid-template-columns: 1fr; } .showcase { height: 440px; } .slide-fade { background: linear-gradient(0deg, rgba(7,6,15,.97) 10%, rgba(7,6,15,.5) 60%, rgba(7,6,15,.1)); }
  .slide-txt p { font-size: 15px; } .dots { top: 16px; bottom: auto; }
  .brand > span:last-child { display: none; }
  .profile #myName { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .games { grid-template-columns: 1fr; }
  .start-bar .btn { width: 100%; }
  .shelf { grid-auto-columns: 82%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Catalogue ---------- */
.section-head.wrap { flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; background: rgba(7,6,15,.6); border: 1px solid var(--line-2); border-radius: 16px; padding: 0 14px; min-width: min(340px, 100%); }
.search input { border: 0; background: transparent; padding: 12px 0; box-shadow: none !important; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(139,92,246,.18); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip { border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); border-radius: 999px; padding: 9px 15px; font-weight: 700; font-size: 14px; transition: all .15s; }
.chip small { color: var(--muted); margin-left: 4px; }
.chip:hover { border-color: rgba(255,255,255,.25); }
.chip.on { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -6px rgba(236,72,153,.6); } .chip.on small { color: #fffc; }

/* ---------- Paramètres de partie ---------- */
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 24px; }
.setting { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); }
.setting.toggle { flex-direction: row; align-items: center; justify-content: space-between; }
.set-lbl span { font-weight: 700; } .set-lbl small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.set-val { color: #f9a8d4; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; background: rgba(7,6,15,.55); padding: 4px; border-radius: 12px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 7px 8px; border-radius: 9px; font-weight: 700; font-size: 13px; white-space: nowrap; transition: all .15s; }
.seg button:hover { color: #fff; }
.seg button.on { background: var(--grad); color: #fff; box-shadow: 0 4px 14px -4px rgba(236,72,153,.6); }
.range { display: flex; align-items: center; gap: 10px; }
.range input { flex: 1; padding: 0; accent-color: var(--pink); background: none; border: 0; box-shadow: none; }
.range output { min-width: 58px; text-align: right; font-weight: 800; color: #f9a8d4; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,.12); transition: background .2s; cursor: pointer; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + i { background: var(--grad); } .switch input:checked + i::after { transform: translateX(20px); }

/* ---------- Coque commune des jeux (kit) ---------- */
.gk-shell { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.gk-top { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: rgba(10,8,22,.88); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); z-index: 5; min-height: 52px; }
.gk-shell.overlay .gk-top { position: absolute; left: 0; right: 0; top: 0; background: linear-gradient(rgba(5,4,12,.78), transparent); border: 0; }
.gk-title { font-family: var(--font-title); font-weight: 800; font-size: 17px; white-space: nowrap; }
.gk-bar { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; min-width: 0; font-size: 14px; }
.gk-actions { display: flex; gap: 6px; }
.gk-main { flex: 1; position: relative; min-height: 0; overflow: hidden; }
.gk-btn { border: 0; border-radius: 11px; padding: 8px 14px; font-weight: 700; background: rgba(255,255,255,.08); color: var(--text); transition: filter .15s, transform .1s, background .15s; }
.gk-btn:hover { background: rgba(255,255,255,.14); } .gk-btn:active { transform: scale(.97); }
.gk-btn.primary { background: var(--grad); color: #fff; } .gk-btn.primary:hover { filter: brightness(1.12); }
.gk-btn.ghost { background: transparent; border: 1px solid var(--line-2); } .gk-btn.ghost:hover { background: rgba(255,255,255,.06); }
.gk-btn.danger { background: #dc2626; color: #fff; } .gk-btn.ok { background: #059669; color: #fff; }
.gk-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.gk-muted { color: var(--muted); }
.gk-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.gk-hud { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.gk-hud .pe { pointer-events: auto; }
.gk-panel { background: rgba(10,8,22,.74); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; backdrop-filter: blur(10px); }
.gk-end { position: absolute; inset: 0; background: rgba(5,4,12,.74); display: grid; place-items: center; z-index: 50; backdrop-filter: blur(8px); animation: appear .3s; padding: 16px; }
.gk-end-box { background: linear-gradient(180deg, #1b1735, #110f22); border: 1px solid var(--line-2); border-radius: 26px; padding: 28px; width: min(500px, 100%); box-shadow: var(--shadow); text-align: center; max-height: 100%; overflow: auto; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.gk-end-box h1 { margin: 0 0 8px; font-size: 30px; } .gk-end-box p { color: var(--muted); margin: 0 0 14px; }
.gk-end-box table { width: 100%; border-collapse: collapse; text-align: left; margin: 10px 0 18px; }
.gk-end-box td, .gk-end-box th { padding: 8px; border-bottom: 1px solid var(--line); } .gk-end-box th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.gk-end-box tr.me { background: rgba(236,72,153,.1); }
.gk-end-box .avatar { display: inline-grid; vertical-align: middle; margin-right: 6px; }
.gk-end-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }
.gk-chat { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.gk-chat-log { flex: 1; overflow-y: auto; font-size: 14px; display: flex; flex-direction: column; gap: 5px; padding: 4px 2px; min-height: 80px; }
.gk-chat form { display: flex; gap: 6px; margin-top: 8px; } .gk-chat input { padding: 9px 12px; }
.gk-touch { position: absolute; inset: auto 0 0 0; height: 0; z-index: 6; }
.gk-joy { position: absolute; left: 24px; bottom: 24px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.2); touch-action: none; }
.gk-joy i { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.35); }
.gk-fire { position: absolute; right: 24px; bottom: 34px; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: rgba(239,68,68,.35); border: 2px solid rgba(255,255,255,.25); touch-action: none; }
kbd { background: rgba(255,255,255,.08); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; font-size: 12px; font-family: inherit; }
@media (max-width: 640px) { .gk-title b { display: none; } .gk-top { gap: 6px; padding: 6px 8px; } .gk-btn { padding: 7px 10px; } }
