/* Vista utente (sypherverse.it): le sezioni degli spettatori di tutti i siti.
   Stesso stile delle pagine mod/streamer: la base (colori, barra, menu, bottoni) è in /shared/portal.css, qui solo il resto. */
:root { --accent-text: #bf94ff; --accent-glow: rgba(145,71,255,.18); --gold: #f5b301; }
a { color: var(--accent-text); }
h2 { margin: 0; font-size: 15px; }

.main { max-width: 960px; margin: 0 auto; padding: 24px 20px calc(48px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 860px) { .main { padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); gap: 16px; } }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.error { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--red-bg); color: #fca5a5; }
/* bottoni: quelli di portal.css, viola come i "primari" delle pagine mod/streamer */
.btn { background: var(--accent); color: #fff; }
.btn:hover { background: var(--accent-2); }
.btn:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- stato della serata ---------- */
.status { display: flex; flex-direction: column; gap: 12px; }
.banner { border-radius: 12px; padding: 16px 20px; background: var(--panel); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.banner.live { border-color: var(--accent); background: rgba(145,71,255,.12); }
.banner.me { border-color: rgba(245,179,1,.5); background: var(--amber-bg); }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.banner.me .kicker { color: var(--gold); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.big { font-size: 16px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.sub { color: #d4d4d8; overflow-wrap: anywhere; }
.queue { margin: 4px 0 0; padding-left: 20px; color: #d4d4d8; }

/* ---------- scelta del gioco ---------- */
.pick { display: flex; flex-direction: column; gap: 12px; }
.pick-intro { margin: 0; color: #d4d4d8; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: var(--panel); border: 1px solid var(--border); }
.tab { min-height: 38px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--panel-2); color: var(--text); }
.tab .count { font-weight: 600; opacity: .8; }
.games { display: flex; flex-direction: column; gap: 10px; }
.empty { padding: 16px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 12px; }
.list-note { margin: 0; padding: 10px 12px; font-size: 14px; line-height: 1.4; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; }
.game { border-radius: 10px; border: 1px solid var(--border); background: var(--panel); overflow: hidden; }
.game.selected { border-color: var(--accent); background: var(--accent-glow); box-shadow: inset 0 0 0 1px var(--accent); }
.game-top {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; text-align: left; cursor: pointer;
  border: 0; background: transparent; color: inherit; font: inherit;
}
.game-top:focus-visible { outline: 3px solid var(--accent-text); outline-offset: -3px; border-radius: 10px; }
.cover { flex: none; width: 96px; aspect-ratio: 460 / 215; border-radius: 6px; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); font-weight: 700; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-name { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.tick { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #52525b; display: grid; place-items: center; }
.game.selected .tick { background: var(--accent); border-color: var(--accent); }
.game-more { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.game-rules { margin: 0; color: #d4d4d8; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.game-link { align-self: flex-start; font-weight: 600; min-height: 36px; display: inline-flex; align-items: center; }

.confirm {
  position: sticky; bottom: 0; z-index: 2; margin-top: 4px; padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel); box-shadow: 0 -8px 20px rgba(0,0,0,.45);
}
.confirm-text { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.confirm .btn { flex: none; }

/* ---------- regole e albo d'oro ---------- */
.rules { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: #d4d4d8; }
.rules li::marker { color: var(--muted); font-weight: 600; }
.rules ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; list-style: disc; }
.rules a { color: var(--accent-text); text-decoration: underline; }
.rules strong { color: var(--text); }
.score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; padding: 8px 0; }
.score .side { display: flex; flex-direction: column; gap: 2px; }
.score .n { font-size: 28px; font-weight: 800; line-height: 1; }
.score .who-s { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.score .vs { font-weight: 700; color: var(--muted); }
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.board li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.board .badge { flex: none; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.badge.sub { background: rgba(245,179,1,.16); color: var(--gold); }
.badge.sypher { background: var(--accent-glow); color: var(--accent-text); }
.board .what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.board .when { flex: none; color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }

@media (min-width: 560px) {
  .cover { width: 140px; }
}

/* ---------- profilo ---------- */
.profile { display: flex; flex-direction: column; gap: 16px; }
.switch-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); cursor: pointer; }
.switch-row input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.switch-row span { display: flex; flex-direction: column; gap: 2px; }
.switch-row small, .help { color: var(--muted); font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.input { min-height: 42px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 15px; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.input:disabled { opacity: .45; }
.profile-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-msg { color: var(--green); font-weight: 600; }
.profile-msg.err { color: #fca5a5; }
.pick-note { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border); color: #d4d4d8; font-size: 14px; }
.tabs.single { grid-template-columns: 1fr; }
.invite-btn { align-self: flex-start; margin-top: 6px; }
.invite-wait { font-style: italic; }
.game-invite { margin: 0; color: var(--accent-text); font-size: 14px; }

/* ---------- sezioni: Sy Vs Subs, SypherDance, Profilo ---------- */
.page-panel { display: flex; flex-direction: column; gap: 16px; }

/* ---------- SypherDance: voto ---------- */
.timer-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.timer { padding: 3px 12px; border-radius: 999px; background: var(--red-bg); border: 1px solid rgba(239,68,68,.45); color: #fca5a5; font-weight: 700; font-variant-numeric: tabular-nums; }
.vote { display: flex; flex-direction: column; gap: 12px; }
.intro { margin: 0; color: #d4d4d8; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.song {
  display: flex; flex-direction: column; width: 100%; padding: 0; text-align: left; cursor: pointer;
  border-radius: 10px; overflow: hidden; font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--border);
}
.song:hover { border-color: #52525b; }
.song:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.song[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-glow); box-shadow: inset 0 0 0 1px var(--accent); }
.song[disabled] { cursor: default; }
.song.winner { border-color: var(--gold); }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #000; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.num { position: absolute; top: 6px; left: 6px; width: 26px; height: 26px; border-radius: 6px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.check { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; background: var(--green); display: grid; place-items: center; }
.song-text { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; }
.song-user { font-weight: 600; overflow-wrap: anywhere; }
.song-title { font-size: 13px; color: #d4d4d8; line-height: 1.3; overflow-wrap: anywhere; }
.mine { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); }
.mine strong { color: var(--text); }
.banner .btn { align-self: flex-start; margin-top: 6px; }
.text-link { font: inherit; color: var(--accent-text); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
