/* =====================================================
   MythicOlbia Wiki — foglio di stile (versione C)
   Mobile-first, tema scuro (predefinito) e chiaro.
   Nessuna libreria, nessun font esterno.
   ===================================================== */

:root {
  color-scheme: dark;
  --bg: #060914;
  --bg-2: #0a0f20;
  --surface: rgba(16, 23, 43, 0.82);
  --surface-solid: #10172b;
  --surface-2: #172041;
  --border: rgba(140, 170, 255, 0.15);
  --border-strong: rgba(140, 170, 255, 0.32);
  --text: #e9effb;
  --text-2: #b3c0da;
  --muted: #8794b2;
  --cyan: #00d8ff;
  --blue: #3a8fff;
  --violet: #a06bff;
  --magenta: #ef48d6;
  --gold: #ffcf4d;
  --green: #35e3a0;
  --red: #ff6f88;
  --accent-ink: #03121a;
  --grad: linear-gradient(100deg, #00d8ff 0%, #7b2fff 52%, #e82dcd 100%);
  --grad-soft: linear-gradient(135deg, rgba(0, 216, 255, 0.16), rgba(123, 47, 255, 0.12) 55%, rgba(232, 45, 205, 0.14));
  --glow: 0 0 0 1px rgba(0, 216, 255, 0.28), 0 14px 44px -14px rgba(123, 47, 255, 0.6);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 34px -18px rgba(0, 0, 0, 0.75);
  --code-bg: rgba(0, 216, 255, 0.1);
  --code-text: #85ebff;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1280px;
  --gutter: 16px;
  --header-h: 62px;
  --side-w: 270px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3f6fd; --bg-2: #e9eefb; --surface: rgba(255, 255, 255, 0.86); --surface-solid: #ffffff; --surface-2: #eef1fb;
    --border: rgba(20, 30, 70, 0.13); --border-strong: rgba(20, 30, 70, 0.26);
    --text: #0e1630; --text-2: #34405f; --muted: #536080;
    --cyan: #006f99; --blue: #1f5fc4; --violet: #5b22d6; --magenta: #a5128c; --gold: #7a5600; --green: #04704c; --red: #b81d3b;
    --accent-ink: #fff;
    --grad-soft: linear-gradient(135deg, rgba(0, 150, 200, 0.10), rgba(91, 34, 214, 0.08) 55%, rgba(165, 18, 140, 0.08));
    --glow: 0 0 0 1px rgba(0, 111, 153, 0.25), 0 12px 30px -16px rgba(91, 34, 214, 0.4);
    --shadow: 0 1px 2px rgba(15, 23, 48, 0.06), 0 12px 28px -18px rgba(15, 23, 48, 0.3);
    --code-bg: rgba(0, 111, 153, 0.09); --code-text: #00557a;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fd; --bg-2: #e9eefb; --surface: rgba(255, 255, 255, 0.86); --surface-solid: #ffffff; --surface-2: #eef1fb;
  --border: rgba(20, 30, 70, 0.13); --border-strong: rgba(20, 30, 70, 0.26);
  --text: #0e1630; --text-2: #34405f; --muted: #536080;
  --cyan: #006f99; --blue: #1f5fc4; --violet: #5b22d6; --magenta: #a5128c; --gold: #7a5600; --green: #04704c; --red: #b81d3b;
  --accent-ink: #fff;
  --grad-soft: linear-gradient(135deg, rgba(0, 150, 200, 0.10), rgba(91, 34, 214, 0.08) 55%, rgba(165, 18, 140, 0.08));
  --glow: 0 0 0 1px rgba(0, 111, 153, 0.25), 0 12px 30px -16px rgba(91, 34, 214, 0.4);
  --shadow: 0 1px 2px rgba(15, 23, 48, 0.06), 0 12px 28px -18px rgba(15, 23, 48, 0.3);
  --code-bg: rgba(0, 111, 153, 0.09); --code-text: #00557a;
}

/* transizioni morbide fra le pagine (browser che le supportano) */
@view-transition { navigation: auto; }

/* ── Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 18px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 1rem; line-height: 1.65; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: var(--magenta); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3.6vw, 1.75rem); }
h3 { font-size: 1.12rem; margin-top: 1.4em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
code {
  font-family: var(--font-mono); font-size: 0.87em; background: var(--code-bg); color: var(--code-text);
  padding: 0.1em 0.42em; border-radius: 6px; overflow-wrap: anywhere;
}
code.copiable { cursor: copy; position: relative; transition: background 0.15s, box-shadow 0.15s; }
code.copiable:hover { background: color-mix(in srgb, var(--cyan) 22%, transparent); }
code.copiable.copied { box-shadow: 0 0 0 2px var(--green); }
kbd { font-family: var(--font-mono); font-size: 0.8em; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; padding: 0.05em 0.4em; background: var(--surface-2); }
strong { color: var(--text); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 200; background: var(--cyan); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); } .text-2 { color: var(--text-2); } .small { font-size: 0.88rem; }
.mt { margin-top: 18px; } .center { text-align: center; }

/* ── Sfondo dinamico ────────────────────────────────── */
#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.bg-static {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60vmax 40vmax at 85% -10%, rgba(123, 47, 255, 0.20), transparent 60%),
    radial-gradient(50vmax 35vmax at -10% 10%, rgba(0, 216, 255, 0.15), transparent 60%),
    radial-gradient(45vmax 30vmax at 60% 110%, rgba(232, 45, 205, 0.13), transparent 60%),
    var(--bg);
}
:root[data-theme="light"] .bg-static { opacity: 0.6; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .bg-static { opacity: 0.6; } }

/* ── Testata ────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 60; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 10px; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; flex: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand span { font-size: 1.05rem; }
.brand small { display: none; font-weight: 600; color: var(--muted); font-size: 0.78rem; margin-left: 4px; }
@media (min-width: 520px) { .brand small { display: inline; } }
.top-nav { display: none; gap: 2px; margin-left: 12px; }
.top-nav a { padding: 8px 11px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 0.93rem; }
.top-nav a:hover, .top-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
@media (min-width: 1100px) { .top-nav { display: flex; } }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn {
  min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-solid);
  color: var(--text); cursor: pointer; font-size: 1rem; line-height: 1; font-family: inherit;
}
.icon-btn:hover { border-color: var(--border-strong); }
.search-btn { min-width: 42px; color: var(--text-2); }
.search-btn .label { display: none; font-size: 0.9rem; }
.search-btn kbd { display: none; }
@media (min-width: 720px) { .search-btn { min-width: 210px; justify-content: flex-start; } .search-btn .label { display: inline; } .search-btn kbd { display: inline; margin-left: auto; } }
.theme-icon-light { display: none; }
:root[data-theme="light"] .theme-icon-light { display: inline; } :root[data-theme="light"] .theme-icon-dark { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .theme-icon-light { display: inline; } :root:not([data-theme="dark"]) .theme-icon-dark { display: none; } }
.bg-btn[aria-pressed="false"] { opacity: 0.55; }
@media (min-width: 1024px) { .menu-btn { display: none; } }

/* ── Disposizione: barra laterale + contenuto + indice pagina ── */
.layout { display: grid; gap: 28px; padding: 22px 0 40px; }
@media (min-width: 1024px) { .layout { grid-template-columns: var(--side-w) minmax(0, 1fr); } }
@media (min-width: 1360px) { .layout.has-toc { grid-template-columns: var(--side-w) minmax(0, 1fr) 220px; } }

.sidebar {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 55; background: var(--bg); padding: 14px var(--gutter) 40px;
  overflow-y: auto; transform: translateX(-102%); transition: transform 0.28s var(--ease); border-right: 1px solid var(--border);
}
.sidebar.open { transform: none; }
@media (min-width: 1024px) {
  .sidebar { position: sticky; top: calc(var(--header-h) + 18px); inset: auto; transform: none; z-index: 1; height: calc(100vh - var(--header-h) - 36px);
    background: transparent; padding: 0 6px 20px 0; border-right: 0; }
}
.side-group { margin-bottom: 6px; }
.side-group summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px;
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.side-group summary::-webkit-details-marker { display: none; }
.side-group summary::after { content: "›"; margin-left: auto; font-size: 1.1rem; transition: transform 0.2s; }
.side-group[open] summary::after { transform: rotate(90deg); }
.side-group summary:hover { color: var(--text); }
.side-group ul { list-style: none; margin: 0 0 4px; padding: 0 0 0 10px; border-left: 1px solid var(--border); margin-left: 16px; }
.side-group li { margin: 0; }
.side-group a {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 10px; color: var(--text-2);
  text-decoration: none; font-size: 0.94rem; transition: background 0.15s, color 0.15s, transform 0.15s;
}
.side-group a:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
.side-group a[aria-current="page"] { background: var(--grad-soft); color: var(--text); font-weight: 700; box-shadow: inset 3px 0 0 var(--cyan); }
.side-group .ic { width: 22px; text-align: center; flex: none; }
.side-home { display: flex; align-items: center; gap: 9px; padding: 8px 10px; margin-bottom: 8px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
.side-home:hover { background: var(--surface-2); color: var(--text); }
.backdrop { position: fixed; inset: var(--header-h) 0 0 0; background: rgba(0, 0, 0, 0.45); z-index: 54; }

/* indice "in questa pagina" */
.page-toc { display: none; }
@media (min-width: 1360px) {
  .page-toc { display: block; position: sticky; top: calc(var(--header-h) + 18px); align-self: start; max-height: calc(100vh - var(--header-h) - 36px); overflow: auto; }
}
.page-toc h2 { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 8px; }
.page-toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border); }
.page-toc li { margin: 0; }
.page-toc a { display: block; padding: 5px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-2); text-decoration: none; font-size: 0.88rem; }
.page-toc a:hover { color: var(--text); }
.page-toc a.active { color: var(--cyan); border-left-color: var(--cyan); font-weight: 700; }
.mobile-toc { margin: 0 0 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.mobile-toc summary { cursor: pointer; padding: 12px 16px; font-weight: 700; }
.mobile-toc ol { margin: 0; padding: 0 16px 12px 36px; }
.mobile-toc a { color: var(--text-2); text-decoration: none; }
@media (min-width: 1360px) { .mobile-toc { display: none; } }

/* ── Testa della pagina ─────────────────────────────── */
.breadcrumb { font-size: 0.86rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumb li { margin: 0; display: flex; gap: 6px; align-items: center; }
.breadcrumb li + li::before { content: "›"; color: var(--muted); }
.breadcrumb a { color: var(--text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--cyan); }
.page-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.page-icon {
  width: 60px; height: 60px; flex: none; display: grid; place-items: center; font-size: 1.9rem; border-radius: 18px;
  background: var(--grad-soft); border: 1px solid var(--border-strong); box-shadow: var(--glow);
}
.page-head h1 { margin: 2px 0 6px; }
.page-head p { color: var(--text-2); margin: 0; font-size: 1.05rem; }
.content { min-width: 0; }
.content > section { padding: 6px 0 18px; }
.content > section + section { border-top: 1px solid var(--border); padding-top: 26px; }
.content h2 { display: flex; align-items: center; gap: 10px; scroll-margin-top: calc(var(--header-h) + 18px); }
.content h2 .anchor { opacity: 0; text-decoration: none; color: var(--muted); font-size: 0.9em; margin-left: 4px; transition: opacity 0.15s; }
.content h2:hover .anchor, .content h2 .anchor:focus { opacity: 1; }

/* ── Componenti ─────────────────────────────────────── */
.card, .callout, .table-wrap, .cmds li, .faq details, .stat, .tile-link, .step-list li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.card { padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.card h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 1.05rem; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.grid { display: grid; gap: 14px; margin: 14px 0 20px; }
@media (min-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ico { width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); font-size: 1.15rem; }

/* sollevamento e luce sui box */
.lift { transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s; }
.lift::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(0, 216, 255, 0.16), transparent 60%);
}
.lift:hover { transform: translateY(-4px); box-shadow: var(--glow); border-color: color-mix(in srgb, var(--cyan) 50%, transparent); }
.lift:hover::after { opacity: 1; }
.tile-link { display: block; padding: 18px; text-decoration: none; color: inherit; position: relative; overflow: hidden; }
.tile-link:hover { color: inherit; }
.tile-link h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 1.05rem; }
.tile-link p { margin: 0; color: var(--text-2); font-size: 0.92rem; }
.tile-link .go { display: inline-block; margin-top: 10px; color: var(--cyan); font-weight: 700; font-size: 0.88rem; }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin: 16px 0; color: var(--text-2); }
.callout > .ci { font-size: 1.2rem; line-height: 1.5; flex: none; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout strong.ct { display: block; color: var(--text); margin-bottom: 2px; }
.callout-tip { border-left: 4px solid var(--green); }
.callout-warn { border-left: 4px solid var(--gold); }
.callout-info { border-left: 4px solid var(--cyan); }
.callout-example { border-left: 4px solid var(--violet); }

.table-wrap { width: 100%; overflow-x: auto; margin: 12px 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; min-width: 480px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: color-mix(in srgb, var(--cyan) 6%, transparent); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.cmds { display: grid; gap: 8px; margin: 12px 0 20px; padding: 0; list-style: none; }
.cmds li { display: grid; gap: 4px; margin: 0; padding: 10px 12px; transition: border-color 0.2s; }
.cmds li:hover { border-color: var(--border-strong); }
@media (min-width: 760px) { .cmds li { grid-template-columns: minmax(210px, 36%) 1fr; align-items: baseline; gap: 14px; } }
.cmds li > span { color: var(--text-2); font-size: 0.94rem; }

.step-list { counter-reset: s; list-style: none; padding: 0; margin: 12px 0 20px; display: grid; gap: 10px; }
.step-list li { counter-increment: s; position: relative; padding: 13px 16px 13px 58px; margin: 0; }
.step-list li::before {
  content: counter(s); position: absolute; left: 14px; top: 12px; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-weight: 800; background: var(--grad); color: #fff; font-size: 0.92rem;
}

.badge { display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-2); vertical-align: middle; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 0.82rem; font-weight: 600; }
.chip-accent { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 40%, transparent); }

.faq { display: grid; gap: 10px; margin: 12px 0 20px; }
.faq summary { cursor: pointer; list-style: none; padding: 14px 46px 14px 16px; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.35rem; color: var(--cyan); transition: transform 0.25s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details[open] { border-color: color-mix(in srgb, var(--cyan) 40%, transparent); }
.faq .answer { padding: 0 16px 14px; color: var(--text-2); }
@media (prefers-reduced-motion: no-preference) { .faq details[open] .answer { animation: drop 0.3s var(--ease); } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.faq .answer p:last-child { margin: 0; }

.dl { display: grid; gap: 8px; margin: 12px 0 20px; }
.dl > div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.dl dt { font-weight: 800; color: var(--text); }
.dl dd { margin: 2px 0 0; color: var(--text-2); font-size: 0.94rem; }
@media (min-width: 760px) { .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.letter-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 18px; }
.letter-nav a { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); font-weight: 700; }

/* bottoni */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--text); font-weight: 700;
  font-size: 0.97rem; text-decoration: none; cursor: pointer; font-family: inherit;
  transition: transform 0.18s var(--ease), border-color 0.18s, filter 0.18s;
}
.btn:hover { color: var(--text); border-color: var(--cyan); transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: #fff; border: 0; box-shadow: var(--glow); }
.btn-primary:hover { color: #fff; filter: brightness(1.1); }
.btn-discord { background: #5865f2; color: #fff; border: 0; }
.btn-discord:hover { color: #fff; filter: brightness(1.1); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row.btn-center { justify-content: center; }

/* indirizzi copiabili */
.ip-grid { display: grid; gap: 12px; max-width: 780px; margin: 0 auto 18px; text-align: left; }
@media (min-width: 640px) { .ip-grid { grid-template-columns: 1fr 1fr; } }
.ip-card { position: relative; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); padding: 14px 16px; box-shadow: var(--shadow); }
.ip-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--grad); opacity: 0.6;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.ip-label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 800; }
.ip-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.ip-value { font-family: var(--font-mono); font-size: 1.04rem; font-weight: 700; color: var(--text); word-break: break-all; }
.ip-port { display: block; font-family: var(--font-mono); color: var(--text-2); font-size: 0.92rem; margin-top: 2px; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 0.86rem; cursor: pointer; font-family: inherit;
}
.copy-btn:hover { border-color: var(--cyan); }
.copy-btn.done { border-color: var(--green); color: var(--green); }
.copy-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Home ───────────────────────────────────────────── */
.hero { padding: 46px 0 26px; text-align: center; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 18px; }
.hero-logo { width: min(640px, 92%); margin: 0 auto 6px; filter: drop-shadow(0 12px 44px rgba(123, 47, 255, 0.4)); }
.hero-title { font-size: clamp(1.5rem, 5vw, 2.5rem); font-weight: 800; margin: 8px auto 10px; max-width: 24ch; }
.hero-title .word { display: inline-block; background: var(--grad); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { color: var(--text-2); font-size: clamp(1rem, 2.6vw, 1.15rem); max-width: 58ch; margin: 0 auto 26px; }
@media (prefers-reduced-motion: no-preference) {
  .hero-logo { animation: float 7s ease-in-out infinite; }
  @keyframes float { 50% { transform: translateY(-7px); } }
  .hero-title .word { opacity: 0; transform: translateY(14px); animation: wordin 0.7s var(--ease) forwards, shimmer 6s linear infinite; }
  .hero-title .word:nth-child(2) { animation-delay: 0.15s, 0s; } .hero-title .word:nth-child(3) { animation-delay: 0.3s, 0s; }
  .hero-title .word:nth-child(4) { animation-delay: 0.45s, 0s; } .hero-title .word:nth-child(5) { animation-delay: 0.6s, 0s; }
  @keyframes wordin { to { opacity: 1; transform: none; } }
  @keyframes shimmer { to { background-position: -200% 0; } }
}
.hero .btn-row { justify-content: center; margin-top: 8px; }
.hero-note { color: var(--muted); font-size: 0.86rem; margin-top: 14px; }
.stats-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 30px 0 10px; }
@media (min-width: 860px) { .stats-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { padding: 16px; text-align: center; position: relative; overflow: hidden; }
.stat b { display: block; font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.1; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--text-2); font-size: 0.9rem; }
.home-section { padding: 46px 0; }
.section-head { max-width: 760px; margin-bottom: 20px; }
.eyebrow { display: inline-block; font-size: 0.76rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); margin-bottom: 8px; }
.lead { color: var(--text-2); font-size: 1.06rem; }
.group-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 6px; font-size: 1.15rem; }

/* fine pagina: precedente / successiva */
.pager { display: grid; gap: 12px; margin: 36px 0 10px; }
@media (min-width: 640px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a { display: block; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); position: relative; overflow: hidden; }
.pager a small { display: block; color: var(--muted); font-size: 0.8rem; }
.pager a b { font-size: 1.02rem; }
.pager .next { text-align: right; }
.edit-note { color: var(--muted); font-size: 0.84rem; margin-top: 16px; }

/* ── Ricerca ────────────────────────────────────────── */
.search-dialog { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 70px var(--gutter) 20px; background: rgba(3, 6, 15, 0.6); backdrop-filter: blur(4px); }
.search-panel { width: 100%; max-width: 680px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7); overflow: hidden; }
@media (prefers-reduced-motion: no-preference) { .search-panel { animation: drop 0.22s var(--ease); } }
.search-field { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.search-field input { flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; color: var(--text); background: transparent; border: 0; outline: none; padding: 6px 2px; }
.search-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search-results li { margin: 0; }
.search-results a { display: block; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--text); }
.search-results a small { display: block; color: var(--muted); font-size: 0.78rem; }
.search-results a span { display: block; color: var(--text-2); font-size: 0.88rem; margin-top: 2px; }
.search-results a:hover, .search-results a.sel { background: var(--grad-soft); }
.search-results mark { background: color-mix(in srgb, var(--gold) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 18px; color: var(--muted); text-align: center; }
.search-hint { padding: 8px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.8rem; display: flex; gap: 14px; flex-wrap: wrap; }

/* ── Statistiche ────────────────────────────────────── */
.stat-tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin: 18px 0 24px; }
@media (min-width: 860px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.tile-label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.tile-value { font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 800; font-variant-numeric: tabular-nums; }
.board-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.board-tabs button { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 700; cursor: pointer; font-family: inherit; }
.board-tabs button[aria-selected="true"] { background: var(--grad); color: #fff; border-color: transparent; }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board li { display: grid; grid-template-columns: 34px 36px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); margin: 0; }
.board .pos { font-weight: 800; color: var(--muted); text-align: center; }
.board li:nth-child(1) .pos { color: #e5b100; } .board li:nth-child(2) .pos { color: #9fb0c8; } .board li:nth-child(3) .pos { color: #c8814a; }
.avatar { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--grad); font-size: 0.85rem; }
.board .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .val { font-family: var(--font-mono); font-weight: 700; color: var(--cyan); }
.bar { height: 4px; border-radius: 4px; background: var(--surface-2); grid-column: 3 / 5; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); }
.demo-banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: repeating-linear-gradient(135deg, rgba(255, 202, 58, 0.18) 0 12px, rgba(255, 202, 58, 0.08) 12px 24px); border: 1px solid rgba(255, 202, 58, 0.5); font-weight: 700; margin-bottom: 16px; }
.coming { text-align: center; padding: 34px 18px; border-radius: 22px; background: var(--surface); border: 1px dashed var(--border-strong); }
.coming .big { font-size: 2.8rem; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; border-radius: 12px; min-height: 52px; }
@media (prefers-reduced-motion: no-preference) { .skeleton { animation: shimmer 1.3s linear infinite; } }

/* ── Piè di pagina ──────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); padding: 30px 0 40px; color: var(--muted); font-size: 0.9rem; background: color-mix(in srgb, var(--bg) 70%, transparent); }
.footer-grid { display: grid; gap: 18px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-2); margin-bottom: 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--cyan); }
.footer-logo { width: 190px; margin-bottom: 10px; }
.to-top { position: fixed; right: 16px; bottom: 16px; z-index: 40; opacity: 0; pointer-events: none; transition: opacity 0.2s; box-shadow: var(--shadow); }
.to-top.show { opacity: 1; pointer-events: auto; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); z-index: 120; background: var(--surface-solid); color: var(--text); border: 1px solid var(--green); padding: 10px 16px; border-radius: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ── Comparsa allo scorrimento e ingresso pagina ────── */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
  .js .reveal.in { opacity: 1; transform: none; }
  .content, .home-main { animation: pagein 0.45s var(--ease); }
  @keyframes pagein { from { opacity: 0; transform: translateY(8px); } }
}
@media print {
  .site-header, #bg-canvas, .bg-static, .sidebar, .page-toc, .to-top, .pager, .mobile-toc { display: none !important; }
  body { background: #fff; color: #000; }
}

/* foto di anteprima (?foto=1): contenuti già visibili */
.foto .hero-title .word { animation: none !important; opacity: 1 !important; transform: none !important; }
.foto .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
.foto .content, .foto .home-main { animation: none !important; }
