:root {
  --bg: #14111f; --card: #1f1a30; --card2: #2a2340; --text: #f1edff; --muted: #a59cc4;
  --accent: #8b5cf6; --accent2: #f59e0b; --danger: #ef4444; --ok: #22c55e; --radius: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100dvh; background: radial-gradient(circle at 50% -20%, #3b2a6b 0%, var(--bg) 60%) fixed; }
#app { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
h1 { font-size: 1.8rem; margin: 8px 0 4px; } h2 { font-size: 1.3rem; margin: 4px 0 12px; } h3 { margin: 16px 0 8px; font-size: 1.05rem; color: var(--muted); }
p { margin: 6px 0; } .muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
a { color: inherit; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin: 12px 0; box-shadow: 0 6px 20px #0004; }
.game-card { display: flex; gap: 14px; align-items: center; text-decoration: none; transition: transform .1s; }
.game-card:active { transform: scale(.98); }
.game-card .emoji { font-size: 2.6rem; }
.btn { display: block; width: 100%; padding: 14px 16px; margin: 8px 0; border: 0; border-radius: 12px; background: var(--accent); color: white; font: inherit; font-weight: 600; text-align: center; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: var(--card2); } .btn.danger { background: var(--danger); } .btn.ok { background: var(--ok); } .btn.gold { background: var(--accent2); color: #1b1200; }
.btn.small { display: inline-block; width: auto; padding: 8px 12px; margin: 4px 4px 4px 0; font-size: .9rem; }
.row { display: flex; gap: 8px; align-items: center; } .row > * { flex: 1; } .spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
input[type=text] { width: 100%; padding: 14px; border-radius: 12px; border: 2px solid var(--card2); background: #0f0c18; color: var(--text); font: inherit; }
input[type=text]:focus { outline: none; border-color: var(--accent); }
.code { font-size: 2.6rem; font-weight: 800; letter-spacing: .3em; text-align: center; font-family: ui-monospace, monospace; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; background: var(--card2); border-radius: 10px; margin: 6px 0; }
.list li.dead { opacity: .5; text-decoration: line-through; }
.badge { font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: #0006; color: var(--muted); white-space: nowrap; }
.targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.target { padding: 12px; border-radius: 12px; border: 2px solid transparent; background: var(--card2); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.target.sel { border-color: var(--accent2); background: #3a2d14; }
.target .votes { display: block; font-size: .78rem; color: var(--muted); }
.banner { text-align: center; padding: 18px; border-radius: var(--radius); margin: 12px 0; font-weight: 700; font-size: 1.2rem; }
.banner.night { background: linear-gradient(135deg, #1e1b4b, #312e81); } .banner.day { background: linear-gradient(135deg, #b45309, #f59e0b); color: #1b1200; }
.banner.end { background: linear-gradient(135deg, #065f46, #10b981); }
.news p { padding: 8px 10px; background: var(--card2); border-radius: 10px; }
.role-card { text-align: center; padding: 22px; border-radius: var(--radius); background: linear-gradient(160deg, #2e1065, #4c1d95); cursor: pointer; user-select: none; }
.role-card .big { font-size: 4rem; } .role-card.hidden-role { background: var(--card2); }
.toggle { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--card2); }
.toggle:last-child { border: 0; }
.stepper { display: flex; align-items: center; gap: 10px; } .stepper button { width: 38px; height: 38px; border-radius: 10px; border: 0; background: var(--card2); color: var(--text); font-size: 1.2rem; }
input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--accent); }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.topbar a, .linkbtn { color: var(--muted); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 6px 0; }
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #000d; padding: 12px 18px; border-radius: 12px; max-width: 90vw; z-index: 9; }
/* Puissance 4 */
.p4 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 8px; background: #1d4ed8; border-radius: 16px; touch-action: manipulation; }
.p4 .cell { aspect-ratio: 1; border-radius: 50%; background: var(--bg); border: 0; padding: 0; cursor: pointer; transition: background .15s; }
.p4 .cell.c0 { background: #ef4444; } .p4 .cell.c1 { background: #facc15; }
.p4 .cell.win { box-shadow: 0 0 0 4px white inset; } .p4 .cell.last { outline: 3px solid #fff8; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 6px; } .dot.c0 { background: #ef4444; } .dot.c1 { background: #facc15; }
.footer { text-align: center; margin-top: 28px; color: var(--muted); font-size: .8rem; }
