/* ─── Barre du haut ─── */
.topbar {
  position:sticky; top:0; z-index:50; display:flex; align-items:center; gap:18px;
  padding:10px max(16px, calc((100% - 1220px) / 2)); border-bottom:1px solid var(--border);
  background:rgba(10,12,16,.82); backdrop-filter:blur(12px);
}
.brand { display:flex; align-items:center; gap:10px; text-decoration:none; }
.brand span { font:700 16px var(--font-display); letter-spacing:3px; }
.brand b { color:var(--red); font-weight:700; }
.brand em { margin-left:4px; color:var(--cyan); font-style:normal; letter-spacing:1.5px; text-transform:uppercase; font-size:12px; }
.topnav { display:flex; gap:4px; margin-left:auto; }
.topnav a { padding:8px 12px; border-radius:6px; color:var(--muted); font-size:13px; font-weight:600; text-decoration:none; }
.topnav a:hover { color:var(--text); background:rgba(255,255,255,.05); }
.profile-chip {
  display:flex; align-items:center; gap:8px; min-height:40px; padding:4px 12px 4px 4px; border:1px solid var(--border2);
  border-radius:999px; background:var(--surf); color:var(--text); cursor:pointer;
}
.profile-chip:hover { border-color:var(--text); }
.profile-chip img, .profile-chip > span { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; object-fit:cover; background:var(--surf3); font:700 12px var(--font-display); }
.profile-chip strong { max-width:140px; overflow:hidden; font-size:13px; text-overflow:ellipsis; white-space:nowrap; }

/* ─── Portail ─── */
.portal { position:relative; z-index:1; flex:1; display:flex; flex-direction:column; gap:48px; width:100%; max-width:1220px; margin:0 auto; padding:clamp(32px,6vh,72px) 16px 56px; }
.hero { display:grid; gap:12px; max-width:720px; }
.kicker { color:var(--cyan); font:700 11px var(--font-display); letter-spacing:3px; text-transform:uppercase; }
.hero h1 { font:700 clamp(34px,6vw,60px)/1.05 var(--font-display); letter-spacing:-.5px; }
.hero h1 span { color:var(--cyan); }
.hero p { max-width:560px; color:var(--muted); font-size:clamp(15px,1.8vw,17px); }

.section-head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:16px; }
.section-head h2 { font:700 22px var(--font-display); letter-spacing:.4px; }
.section-head p { margin-top:4px; color:var(--muted); font-size:13px; }
.empty { color:var(--muted); font-size:14px; }

/* ─── Soirée ─── */
.night-panel { padding:20px; border:1px solid var(--border); border-radius:var(--radius); background:linear-gradient(120deg, rgba(168,127,255,.12), transparent 60%), var(--surf); }
.night-panel .section-head { margin-bottom:12px; }
.night-content { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:16px; min-height:56px; }
.night-content > div { display:grid; gap:3px; min-width:0; grid-column:2; }
.night-content > div:only-child { grid-column:1 / -1; }
.night-content strong { overflow:hidden; font:700 18px var(--font-body); text-overflow:ellipsis; white-space:nowrap; }
.night-content small { color:var(--muted); font-size:13px; }
.night-cover { grid-column:1; width:120px; height:56px; border-radius:6px; object-fit:cover; }
.night-time { grid-column:3; color:var(--gold); font:700 24px var(--font-display); }
.night-people, .night-attendees { display:flex; align-items:center; min-height:31px; margin-top:6px; padding-left:5px; }
.night-person { display:grid; width:29px; height:29px; margin-left:-5px; place-items:center; overflow:hidden; border:2px solid var(--surf); border-radius:50%; background:var(--surf3); font-size:10px; font-weight:700; }
.night-person img { width:100%; height:100%; object-fit:cover; }
.night-person.is-maybe { opacity:.55; }
.night-person.is-no { opacity:.3; filter:grayscale(1); }
.night-empty, .night-hint { color:var(--muted); font-size:12px; }

/* ─── Jeux maison ─── */
.games-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:16px; }
.game-card {
  --accent:var(--cyan);
  display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--border); border-radius:var(--radius);
  background:var(--surf); text-decoration:none; transition:transform .25s cubic-bezier(.22,1,.36,1), border-color .25s, box-shadow .25s;
}
a.game-card:hover, a.game-card:focus-visible {
  transform:translateY(-3px); border-color:color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow:0 22px 50px -24px color-mix(in srgb, var(--accent) 50%, transparent); outline:none;
}
.game-card-art { display:grid; place-items:center; height:130px; background:radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 65%), var(--surf2); }
.game-card-art span { color:var(--accent); font:700 64px var(--font-display); opacity:.85; }
.game-card.is-soon .game-card-art { filter:grayscale(.6) brightness(.7); }
.game-card-body { display:grid; gap:10px; padding:16px 18px 18px; }
.game-card-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.game-card h3 { font:700 19px var(--font-display); letter-spacing:1px; text-transform:uppercase; }
.game-card p { color:var(--muted); font-size:14px; }

/* ─── Catalogue coop (repris du tracker) ─── */
.coop-page { min-height:0; padding:0; background:transparent; scroll-margin-top:72px; }
.coop-hero { padding-top:0; }
#soiree, #jeux { scroll-margin-top:72px; }
.data-state-card { display:flex; align-items:center; gap:14px; padding:18px; border:1px solid var(--border); border-radius:8px; background:var(--surf); }
.data-state-card > div { display:grid; gap:2px; flex:1; }
.data-state-card small { color:var(--muted); font-size:12px; }
.data-state-pulse { width:9px; height:9px; border-radius:50%; background:var(--gold); animation:pulse 1.2s ease-in-out infinite; }
.data-state-card.is-error .data-state-pulse { background:var(--red); animation:none; }
.data-state-card.is-empty .data-state-pulse { background:var(--dim); animation:none; }
.data-state-lines { display:none; }
@keyframes pulse { 50% { opacity:.35; } }

/* ─── Fenêtre de planification ─── */
.sheet { position:fixed; z-index:1200; inset:0; display:grid; place-items:center; padding:18px; background:rgba(5,7,11,.78); backdrop-filter:blur(12px); }
.sheet[hidden] { display:none; }
.sheet-card { width:min(620px, 100%); max-height:calc(100vh - 36px); overflow:auto; padding:22px; border:1px solid var(--border2); border-radius:12px; background:#111319; box-shadow:0 22px 70px rgba(0,0,0,.55); }
.sheet-card > header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:14px; }
.sheet-card > header span { color:var(--violet); font:700 10px var(--font-display); letter-spacing:2px; text-transform:uppercase; }
.sheet-card > header h2 { font:700 24px var(--font-display); }
.sheet-card > header button { display:grid; place-items:center; width:40px; height:40px; border:0; border-radius:8px; background:transparent; color:var(--muted); font-size:22px; cursor:pointer; }
.sheet-card > footer { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px; margin-top:16px; }
.night-field { margin-top:14px; border:0; }
.night-field legend { margin-bottom:8px; font-weight:700; font-size:14px; }
.night-field legend small { margin-left:6px; color:var(--muted); font-weight:500; font-size:12px; }
.night-slot-editor { display:grid; grid-template-columns:22px 1fr 110px; align-items:center; gap:8px; margin-bottom:8px; }
.night-slot-editor > span { color:var(--dim); font:700 12px var(--font-display); }
.night-slot-editor input, .night-game-editors select { width:100%; min-height:42px; padding:0 10px; border:1px solid var(--border2); border-radius:8px; background:var(--surf); }
.night-game-editors { display:grid; gap:8px; }
.night-vote { margin-top:16px; }
.night-vote h3 { margin:12px 0 8px; font-size:14px; }
.night-vote-slots { display:grid; gap:8px; }
.night-vote-slots article { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border:1px solid var(--border); border-radius:8px; }
.night-vote-slots article > span { display:grid; }
.night-vote-slots small, .night-vote-games small { color:var(--muted); font-size:11px; }
.night-vote-slots article > div { display:flex; gap:4px; }
.night-vote button { min-height:36px; padding:0 10px; border:1px solid var(--border2); border-radius:6px; background:transparent; cursor:pointer; font-size:12px; }
.night-vote button.is-active { border-color:var(--cyan); background:rgba(63,207,207,.12); color:var(--cyan); }
.night-vote-games { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:8px; }
.night-vote-games button { display:grid; justify-items:start; gap:2px; padding:10px 12px; text-align:left; }
.night-locked { margin-top:10px; color:var(--green); font-size:13px; }
.night-status { min-height:18px; margin-top:6px; color:var(--muted); font-size:12px; }
.night-status.is-error { color:var(--red); }

footer { position:relative; z-index:1; display:flex; flex-wrap:wrap; justify-content:center; gap:6px 18px; padding:24px 16px 32px; color:var(--dim); font-size:12.5px; }
footer a { color:var(--muted); text-decoration:none; }
footer a:hover { color:var(--text); }

@media (max-width:720px) {
  .topnav { display:none; }
  .profile-chip { margin-left:auto; }
  .night-content { grid-template-columns:minmax(0,1fr) auto; }
  .night-content > div { grid-column:1; }
  .night-cover { display:none; }
  .night-time { grid-column:2; font-size:20px; }
  .section-head { align-items:flex-start; }
  .sheet { align-items:end; padding:0; }
  .sheet-card { max-height:90vh; border-radius:14px 14px 0 0; padding:18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .night-vote-slots article { flex-direction:column; align-items:flex-start; }
  .sheet-card > footer .btn { flex:1; }
}
