/* Brio Game · temi del sito (29/11/2026). Il tema è su <html data-theme="chiaro|scuro|sfumato"> (vedi tema.js).
   Caricato DOPO lo stile della pagina: le regole qui sotto hanno «html[data-theme]» davanti e quindi vincono. */

/* ── quadratino «TEMA» ── */
.tema { position: relative; }
.tema-btn {
  width: 52px; height: 38px; padding: 0; border: 0; cursor: pointer; border-radius: 11px;
  display: grid; place-items: center; gap: 1px; align-content: center;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-d); font-weight: 800; font-size: 9px; letter-spacing: .08em; color: var(--txt);
  transition: background .2s, box-shadow .2s;
}
.tema-btn:hover, .tema.open .tema-btn { background: rgba(255, 255, 255, .12); box-shadow: inset 0 0 0 1px var(--cyan), 0 0 18px -4px var(--cyan); }
.tema-sw { width: 22px; height: 12px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 1px 4px rgba(0, 0, 0, .3); }
.tema-t { line-height: 1; }
.tema-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; list-style: none; margin: 0; padding: 6px; min-width: 190px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--menu-bg, rgba(10, 22, 50, .97)); backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .6);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.97); transform-origin: top right; transition: opacity .2s, transform .25s cubic-bezier(.3, 1.4, .5, 1), visibility .2s;
}
html[dir=rtl] .tema-menu { right: auto; left: 0; transform-origin: top left; }
.tema.open .tema-menu { opacity: 1; visibility: visible; transform: none; }
.tema-menu button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 11px; background: none; cursor: pointer; font-weight: 600; font-size: 16px; color: var(--mut); text-align: start; }
.tema-menu button:hover, .tema-menu button[aria-selected=true] { background: rgba(56, 225, 255, .14); color: var(--txt); }
.tema-menu button i { width: 30px; height: 22px; border-radius: 7px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, .45), 0 2px 6px rgba(0, 0, 0, .3); }
.tema-menu button[aria-selected=true]::after { content: '✓'; margin-inline-start: auto; color: var(--cyan); font-weight: 800; }
@media (max-width: 520px) { .tema-btn { width: 44px; } }

html[data-theme] body { transition: background-color .4s, color .4s; }

/* ═════════════ SCURO · blu scuro ═════════════ */
html[data-theme=scuro] {
  --bg: #050d1f; --bg2: #0a1a36; --card: rgba(120, 170, 255, .06); --line: rgba(140, 185, 255, .14);
  --txt: #eef5ff; --mut: #9db3d6; --vio: #3d7bff;
  --grad: linear-gradient(100deg, #38e1ff, #3d7bff 50%, #7b5cff);
  --menu-bg: rgba(8, 20, 46, .97);
}
html[data-theme=scuro] .top.solid { background: rgba(5, 13, 31, .78); }
html[data-theme=scuro] .hero::before {
  background: radial-gradient(60% 50% at 20% 30%, rgba(61, 123, 255, .35), transparent 70%), radial-gradient(50% 45% at 85% 70%, rgba(56, 225, 255, .16), transparent 70%), radial-gradient(40% 40% at 60% 10%, rgba(123, 92, 255, .2), transparent 70%), var(--bg);
}
html[data-theme=scuro] .hero::after { background-image: linear-gradient(rgba(61, 123, 255, .35) 1px, transparent 1px), linear-gradient(90deg, rgba(61, 123, 255, .35) 1px, transparent 1px); }
html[data-theme=scuro] .ticker { background: #071430; }
html[data-theme=scuro] .lang-menu { background: linear-gradient(160deg, rgba(14, 32, 70, .97), rgba(6, 14, 32, .98)); }
html[data-theme=scuro] .doc section { background: rgba(120, 170, 255, .05); }

/* ═════════════ SFUMATO · blu → azzurro con un po' di bianco ═════════════ */
html[data-theme=sfumato] {
  --bg: #1a4fb8; --bg2: #133f97; --card: rgba(255, 255, 255, .10); --line: rgba(255, 255, 255, .22);
  --txt: #ffffff; --mut: #d5e8ff; --vio: #2f6fe8; --lime: #c8ff6b;
  --grad: linear-gradient(100deg, #7fe3ff, #2f8bff 50%, #ffffff);
  --menu-bg: rgba(16, 58, 150, .97);
}
html[data-theme=sfumato] body {
  background:
    radial-gradient(45% 35% at 85% 8%, rgba(255, 255, 255, .45), transparent 70%),
    radial-gradient(40% 30% at 10% 60%, rgba(255, 255, 255, .18), transparent 70%),
    linear-gradient(170deg, #0a2f7e 0%, #1a5bd6 38%, #3aa6f4 72%, #a9e2ff 92%, #eaf8ff 100%) fixed;
  background-attachment: fixed;
}
html[data-theme=sfumato] .hero::before { background: radial-gradient(55% 45% at 50% 25%, rgba(255, 255, 255, .22), transparent 70%), radial-gradient(50% 45% at 85% 70%, rgba(127, 227, 255, .25), transparent 70%); }
html[data-theme=sfumato] .hero::after { background-image: linear-gradient(rgba(255, 255, 255, .3) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .3) 1px, transparent 1px); }
html[data-theme=sfumato] .top.solid { background: rgba(14, 56, 150, .72); }
html[data-theme=sfumato] .ticker { background: rgba(255, 255, 255, .12); }
html[data-theme=sfumato] .ticker-track, html[data-theme=sfumato] .lead, html[data-theme=sfumato] .doc p, html[data-theme=sfumato] .doc li { color: #f2f8ff; }
html[data-theme=sfumato] .game .p, html[data-theme=sfumato] .sub, html[data-theme=sfumato] .steps li { color: var(--mut); }
html[data-theme=sfumato] .glass { background: linear-gradient(160deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .06)); box-shadow: 0 30px 80px -30px rgba(5, 20, 70, .7); }
html[data-theme=sfumato] .field input, html[data-theme=sfumato] .tabs, html[data-theme=sfumato] .f-stats div { background: rgba(5, 25, 80, .35); }
html[data-theme=sfumato] .eyebrow { color: #ffffff; text-shadow: 0 0 12px rgba(127, 227, 255, .8); }
html[data-theme=sfumato] .stat b, html[data-theme=sfumato] .soon .q { background: linear-gradient(100deg, #ffffff, #bfeaff); -webkit-background-clip: text; background-clip: text; }
html[data-theme=sfumato] .lang-menu { background: linear-gradient(160deg, rgba(22, 74, 180, .97), rgba(10, 45, 125, .98)); }
html[data-theme=sfumato] .short { color: #f4ffe0; }
html[data-theme=sfumato] .doc section { background: rgba(255, 255, 255, .08); }

/* ═════════════ CHIARO · azzurro ═════════════ */
html[data-theme=chiaro] {
  --bg: #dff2ff; --bg2: #ffffff; --card: rgba(255, 255, 255, .7); --line: rgba(20, 80, 150, .16);
  --txt: #0b2545; --mut: #456789; --vio: #1f6fff; --cyan: #0a8fd6; --lime: #0f9d58; --pink: #e0306f; --red: #d63355;
  --grad: linear-gradient(100deg, #18b6f0, #1f6fff 55%, #5b5bff);
  --menu-bg: rgba(255, 255, 255, .98);
}
html[data-theme=chiaro] body { background: linear-gradient(180deg, #e9f7ff, #d3edff 60%, #e9f7ff) fixed; }
html[data-theme=chiaro] ::selection { background: #9fdcff; color: #0b2545; }
html[data-theme=chiaro] .top.solid { background: rgba(233, 247, 255, .85); }
html[data-theme=chiaro] .hero::before { background: radial-gradient(60% 50% at 20% 30%, rgba(31, 111, 255, .16), transparent 70%), radial-gradient(50% 45% at 85% 70%, rgba(24, 182, 240, .22), transparent 70%), radial-gradient(40% 40% at 60% 10%, rgba(255, 255, 255, .9), transparent 70%), #dff2ff; }
html[data-theme=chiaro] .hero::after { background-image: linear-gradient(rgba(31, 111, 255, .22) 1px, transparent 1px), linear-gradient(90deg, rgba(31, 111, 255, .22) 1px, transparent 1px); }
html[data-theme=chiaro] h1.mega .az { background-image: radial-gradient(circle var(--vr) at var(--mx, 50%) var(--my, 50%), #c4b5fd 0%, #8b5cf6 30%, rgba(139, 92, 246, 0) 100%), linear-gradient(180deg, #2fa8ff 0%, #1f6fff 50%, #0b3fa8 100%); filter: drop-shadow(0 6px 0 rgba(10, 60, 140, .25)) drop-shadow(0 0 30px rgba(56, 189, 248, .35)); }
html[data-theme=chiaro] .lead { color: #234a74; }
html[data-theme=chiaro] .lead b, html[data-theme=chiaro] .beta-banner b { color: #0b2545; }
html[data-theme=chiaro] .scroll-hint { border-color: rgba(11, 37, 69, .35); }
html[data-theme=chiaro] .scroll-hint::after { background: #0b2545; }
html[data-theme=chiaro] .kicker, html[data-theme=chiaro] .chip, html[data-theme=chiaro] .btn.ghost, html[data-theme=chiaro] .tag, html[data-theme=chiaro] .lang-btn, html[data-theme=chiaro] .tema-btn, html[data-theme=chiaro] .dlg-x { background: rgba(255, 255, 255, .7); }
html[data-theme=chiaro] .btn.ghost { color: var(--txt); }
html[data-theme=chiaro] .btn.ghost:hover, html[data-theme=chiaro] .nav a.l:hover { background: #fff; }
html[data-theme=chiaro] .btn { box-shadow: 0 10px 26px -12px rgba(31, 111, 255, .7), inset 0 1px 0 rgba(255, 255, 255, .3); }
html[data-theme=chiaro] .ticker { background: #c9e9ff; }
html[data-theme=chiaro] .ticker-track { color: #1b4a7a; }
html[data-theme=chiaro] .tag { color: #1b4a7a; }
html[data-theme=chiaro] .game { box-shadow: 0 20px 50px -30px rgba(20, 80, 150, .5); }
html[data-theme=chiaro] .soon { border-color: rgba(20, 80, 150, .25); background: repeating-linear-gradient(135deg, rgba(31, 111, 255, .05) 0 14px, transparent 14px 28px); }
html[data-theme=chiaro] .feat .ic { background: rgba(31, 111, 255, .12); box-shadow: inset 0 0 0 1px rgba(31, 111, 255, .3); }
html[data-theme=chiaro] .founder { background: linear-gradient(135deg, rgba(255, 255, 255, .85), rgba(190, 230, 255, .7)); }
html[data-theme=chiaro] .f-stats div, html[data-theme=chiaro] .xp { background: rgba(255, 255, 255, .75); }
html[data-theme=chiaro] .f-quote { color: #234a74; }
html[data-theme=chiaro] .glass { background: linear-gradient(160deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .65)); box-shadow: 0 30px 80px -40px rgba(20, 80, 150, .55); }
html[data-theme=chiaro] .field input { background: #fff; color: var(--txt); }
html[data-theme=chiaro] .tabs { background: rgba(20, 80, 150, .1); }
html[data-theme=chiaro] .beta-note { background: rgba(15, 157, 88, .1); box-shadow: inset 0 0 0 1px rgba(15, 157, 88, .3); color: #0b5d36; }
html[data-theme=chiaro] .beta-banner { background: rgba(255, 170, 40, .14); box-shadow: inset 0 0 0 1px rgba(220, 140, 20, .4); color: #7a4a00; }
html[data-theme=chiaro] .check-priv { background: rgba(255, 255, 255, .8); }
html[data-theme=chiaro] dialog::backdrop { background: rgba(170, 215, 245, .6); }
html[data-theme=chiaro] .lang-menu { background: rgba(255, 255, 255, .98); box-shadow: 0 24px 60px -24px rgba(20, 80, 150, .5); }
html[data-theme=chiaro] .lang-menu button:hover, html[data-theme=chiaro] .lang-menu button[aria-selected=true] { background: rgba(31, 111, 255, .1); }
html[data-theme=chiaro] .tema-menu { box-shadow: 0 24px 60px -24px rgba(20, 80, 150, .5); }
html[data-theme=chiaro] .tema-menu button:hover, html[data-theme=chiaro] .tema-menu button[aria-selected=true] { background: rgba(31, 111, 255, .1); }
html[data-theme=chiaro] .eyebrow { color: #1f6fff; }
html[data-theme=chiaro] .beta, html[data-theme=chiaro] .lv { background: #b8ff3c; }
html[data-theme=chiaro] .doc section { background: rgba(255, 255, 255, .75); }
html[data-theme=chiaro] .doc p, html[data-theme=chiaro] .doc li { color: #1e3f63; }
html[data-theme=chiaro] .short { background: rgba(15, 157, 88, .1); color: #0b5d36; box-shadow: inset 0 0 0 1px rgba(15, 157, 88, .3); }
html[data-theme=chiaro] footer { background: rgba(255, 255, 255, .4); }

/* header fisso della pagina privacy (data-sticky) */
html[data-theme=scuro] .top[data-sticky] { background: rgba(5, 13, 31, .82); }
html[data-theme=sfumato] .top[data-sticky] { background: rgba(14, 56, 150, .75); }
html[data-theme=chiaro] .top[data-sticky] { background: rgba(233, 247, 255, .88); }
html[data-theme=sfumato] body.priv, html[data-theme=chiaro] body.priv { min-height: 100vh; }
/* testi con colore bianco scritto dentro le traduzioni (es. «fase beta») */
html[data-theme=chiaro] [style*="color:#fff"] { color: var(--txt) !important; }
/* sfumato: scritta BRIO GAME bianca e azzurro chiaro, con ombra blu scuro (si legge sul blu) */
html[data-theme=sfumato] h1.mega .az { background-image: radial-gradient(circle var(--vr) at var(--mx, 50%) var(--my, 50%), #e9d5ff 0%, #c084fc 20%, rgba(139, 92, 246, 0) 100%), linear-gradient(180deg, #ffffff 0%, #e3f6ff 45%, #9fdcff 100%); filter: drop-shadow(0 6px 0 rgba(8, 35, 100, .65)) drop-shadow(0 0 34px rgba(255, 255, 255, .35)); }
