:root { color-scheme: dark; --bg: #120c2e; --panel: #1d1546; --line: #3a2d7a; --text: #f1edff; --muted: #a79fd0; --accent: #ffb454; --hero: #5b3cc4; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 16px/1.45 ui-rounded, system-ui, sans-serif; }
[hidden] { display: none !important; }
.top { padding: 0.7rem 1rem 0.2rem; padding-top: max(0.7rem, env(safe-area-inset-top)); max-width: 1100px; margin: 0 auto; }
.top h1 { margin: 0.1rem 0; font-size: 1.5rem; }
.back { color: var(--accent); text-decoration: none; font-size: 0.9rem; }
.sub { margin: 0; color: var(--muted); font-size: 0.85rem; }
main { max-width: 1100px; margin: 0 auto; padding: 0.6rem 1rem calc(2rem + env(safe-area-inset-bottom)); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: 0.9rem 1rem; }
.card h2 { margin: 0 0 0.6rem; font-size: 1.05rem; }
.card h2 small { color: var(--muted); font-weight: 600; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.4rem 0 0; }
.hint.err { color: #ff8f8f; }

.login { max-width: 420px; margin: 1rem auto; }
label { display: block; font-weight: 700; }
input { width: 100%; margin-top: 0.4rem; padding: 0.7rem 0.8rem; border-radius: 0.8rem; border: 2px solid var(--line); background: #120c2e; color: inherit; font: inherit; }
button { font: inherit; cursor: pointer; padding: 0.6rem 1rem; border-radius: 999px; border: 0; background: #2c2166; color: var(--text); font-weight: 700; }
button.primary { background: var(--hero); color: #fff; width: 100%; margin-top: 0.8rem; padding: 0.8rem; }
button:disabled { opacity: 0.45; cursor: default; }

.lobby { display: grid; gap: 0.9rem; grid-template-columns: 1fr; }
@media (min-width: 800px) { .lobby { grid-template-columns: 1.1fr 1fr; } .chat-card { grid-column: 2; grid-row: 1 / span 2; } }

.rooms { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.rooms li { display: grid; grid-template-columns: auto 1fr auto; gap: 0.7rem; align-items: center; background: #261b57; border-radius: 0.8rem; padding: 0.55rem 0.7rem; }
.rooms .ico { font-size: 1.6rem; }
.rooms .t { display: grid; line-height: 1.2; }
.rooms .t small { color: var(--muted); }
.badge { display: inline-block; padding: 0 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 800; border: 1px solid currentColor; }
.badge.wait { color: #7be08f; }
.badge.run { color: var(--accent); }
.server-form { margin-top: 0.8rem; display: grid; gap: 0.5rem; }
.server-form h3 { margin: 0; font-size: 1rem; }
.server-form .row { display: flex; gap: 0.5rem; }
.server-form select { padding: 0.6rem; border-radius: 0.8rem; border: 2px solid var(--line); background: #120c2e; color: inherit; font: inherit; flex: 1; }
.server-form input { margin: 0; flex: 1; }
.server-form button.primary { width: auto; margin: 0; white-space: nowrap; }
.badge.srv { color: #7be08f; }
.new-games { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.new-games a { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1rem; border-radius: 999px; background: var(--hero); color: #fff; text-decoration: none; font-weight: 800; }
.new-games a:hover, .rooms a:hover { filter: brightness(1.15); }
.rooms a { padding: 0.5rem 0.9rem; border-radius: 999px; background: var(--hero); color: #fff; text-decoration: none; font-weight: 800; }

.chat { height: 280px; overflow: auto; padding: 0.6rem 0.7rem; border-radius: 0.8rem; background: #120c2e; font-size: 0.95rem; }
.chat p { margin: 0 0 0.3rem; overflow-wrap: anywhere; }
.chat .sys { color: var(--muted); font-style: italic; }
.chat-form { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.chat-form input { margin: 0; }

/* le jeu d'où l'on vient (?game=) */
.rooms li.focus, .new-games a.focus { outline: 2px solid #ffd34d; outline-offset: 2px; }

/* bande des jeux (état poussé par le portail) */
.strip { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; flex-direction: column; gap: 0.1rem; padding: 0.55rem 0.9rem; border-radius: 0.8rem; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); color: var(--text); text-decoration: none; font-weight: 800; }
.chip small { color: var(--muted); font-weight: 600; }
.chip.focus { outline: 2px solid #ffd34d; outline-offset: 2px; }
.chip[data-status='à rejoindre'] small { color: #7ee787; }
.chip[data-status='hors ligne'], .chip[data-status='maintenance'] { opacity: 0.6; }

/* pastilles de jeu : des boutons (le choix se fait sans recharger) */
button.chip { font: inherit; cursor: pointer; text-align: left; }
button.chip:hover { filter: brightness(1.15); }
#game-actions a.primary { background: var(--hero); color: #fff; }
#game-actions { margin-bottom: 0.6rem; }
