/* =====================================================================
   DayZ Italia — direzione grafica A "Radio da campo"
   CSS vanilla, mobile first. Nessun framework, nessuna risorsa esterna.
   ===================================================================== */

/* ---------- Caratteri (ospitati localmente) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-v20-latin-regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-v20-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-v20-latin-700.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/rajdhani-v17-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/rajdhani-v17-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Rajdhani"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/rajdhani-v17-latin-700.woff2") format("woff2"); }

/* ---------- Variabili ---------- */
:root {
    --bg: #0d0f0e;
    --bg-2: #111412;
    --panel: #161a18;
    --panel-2: #1c211e;
    --line: #2a312d;
    --line-2: #39423c;
    --text: #e3e8e2;
    --muted: #9ba59d;
    --faint: #6f7a72;
    --green: #6fd38a;          /* verde fosforo: stati e dati live */
    --green-dim: #3f7d52;
    --green-glow: rgba(111, 211, 138, .18);
    --amber: #f0b43c;          /* avvisi e "Novità" */
    --amber-dim: rgba(240, 180, 60, .14);
    --red: #ec6a55;
    --red-dim: rgba(236, 106, 85, .14);
    --blue: #7db8e8;
    --discord: #6f7df2;
    --cut: 12px;               /* angolo tagliato delle "piastrine" */
    --radius: 4px;
    --font-head: "Rajdhani", "Arial Narrow", sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
    --wrap: 1240px;
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    /* griglia da mappa topografica */
    background-image:
        linear-gradient(rgba(111, 211, 138, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(111, 211, 138, .035) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, .02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px);
    background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
    color: var(--text);
    font: 400 15px/1.55 var(--font-body);
}
.page-bg {
    position: fixed; inset: 0; z-index: -1;
    background-size: cover; background-position: center;
    opacity: var(--bg-op, .12); filter: grayscale(.6) contrast(1.1);
    mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}
img { max-width: 100%; height: auto; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: #9be7ad; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; letter-spacing: .02em; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
code, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.amber { color: var(--amber); }
.green { color: var(--green); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.sr-only { position: absolute; 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: 8px; top: -60px; z-index: 100; background: var(--amber); color: #000; padding: 8px 14px; font-weight: 700; }
.skip-link:focus { top: 8px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ---------- Header: nome e descrizione in alto, menu a schede sotto, "radio" a destra ---------- */
.site-header { border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(13, 15, 14, .96), rgba(13, 15, 14, .88)); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding-top: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--text); }
.brand-mark {
    flex: 0 0 34px; height: 34px; display: grid; place-items: center; font-size: .95rem;
    color: var(--green); border: 1px solid var(--green-dim); background: var(--green-glow);
    clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.45rem; text-transform: uppercase; letter-spacing: .14em; line-height: 1.1; overflow-wrap: anywhere; }
.brand-desc { flex: 1 1 260px; margin: 0; color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-nav { flex: 1 1 100%; display: flex; align-items: center; gap: 2px; margin-top: 8px; border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.nav-link {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px;
    color: var(--muted); text-decoration: none; white-space: nowrap;
    font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: .9rem;
    border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
.nav-link.is-active { color: var(--green); border-bottom-color: var(--green); }
.nav-panel { color: var(--amber); }
.radio {
    margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 12px; border: 1px solid var(--green-dim); background: rgba(0, 0, 0, .35);
    font-family: var(--font-head); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: var(--muted);
    clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}
.radio-count { color: var(--green); font-size: 1.05rem; letter-spacing: 0; text-shadow: 0 0 8px var(--green-glow); }
.radio-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(111, 211, 138, .6); animation: radio-pulse 2s infinite; }
.radio.is-stale .radio-dot { background: var(--faint); animation: none; }
.radio.is-stale .radio-count { color: var(--muted); text-shadow: none; }
@keyframes radio-pulse { 0% { box-shadow: 0 0 0 0 rgba(111, 211, 138, .6); } 70% { box-shadow: 0 0 0 8px rgba(111, 211, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(111, 211, 138, 0); } }

/* ---------- Contenuto ---------- */
.main { flex: 1; padding-top: 22px; padding-bottom: 40px; }
.card {
    position: relative;
    background: linear-gradient(180deg, rgba(28, 33, 30, .94), rgba(22, 26, 24, .94));
    border: 1px solid var(--line);
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
    padding: 18px;
}
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-weight: 600; }
.back-link:hover { color: var(--text); }

/* ---------- Pulsanti ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 38px; padding: 8px 14px; border: 1px solid var(--line-2); background: var(--panel-2);
    color: var(--text); text-decoration: none; cursor: pointer;
    font: 600 .82rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .1em;
    clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
}
.btn:hover { border-color: var(--muted); color: #fff; }
.btn-primary { background: var(--green); border-color: var(--green); color: #07130b; }
.btn-primary:hover { background: #8de3a3; color: #07130b; }
.btn-ghost { background: transparent; }
.btn-discord { background: rgba(111, 125, 242, .12); border-color: rgba(111, 125, 242, .5); }
.btn-discord:hover { background: rgba(111, 125, 242, .25); }
.btn-dzsa { background: #870724; border-color: #870724; color: #fff; }
.btn-dzsa:hover { background: #a10a2d; border-color: #c21238; color: #fff; }
.btn-lg { min-height: 46px; padding: 12px 22px; font-size: .95rem; }
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; border-radius: var(--radius); }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn.is-done { color: var(--green); }

/* ---------- Badge e stati ---------- */
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.status, .badge, .tag, .flag {
    display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
    font: 700 .72rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .1em;
    border: 1px solid var(--line-2); color: var(--muted); background: rgba(0, 0, 0, .25); text-decoration: none; white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-online { color: var(--green); border-color: var(--green-dim); background: var(--green-glow); }
.status-offline { color: var(--red); border-color: rgba(236, 106, 85, .45); background: var(--red-dim); }
.status-stale { color: var(--amber); border-color: rgba(240, 180, 60, .4); background: var(--amber-dim); }
.status-upcoming { color: var(--blue); border-color: rgba(125, 184, 232, .45); background: rgba(125, 184, 232, .12); }
.badge-persp { color: var(--blue); border-color: rgba(125, 184, 232, .45); }
.badge-lock { color: var(--amber); border-color: rgba(240, 180, 60, .45); }
.badge-mode { color: var(--text); }
.tag { text-transform: none; letter-spacing: .02em; font-weight: 600; font-family: var(--font-body); font-size: .72rem; }
a.tag:hover { color: var(--text); border-color: var(--muted); }
.flag-new { color: #1a1204; background: var(--amber); border-color: var(--amber); }
.flag-hidden { color: var(--text); background: #3a2b2b; border-color: #5c4141; }

/* ---------- Home ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.home-main, .home-side { min-width: 0; }
.home-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
.preface { margin-bottom: 16px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; padding: 14px; }
.filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-field label { font: 600 .72rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.filter-q { grid-column: 1 / -1; position: relative; }
.filter-q i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.filter-q input[type="search"] { padding-left: 36px; }
.filter-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.filter-actions .btn { flex: 1; }
.result-count { color: var(--muted); margin: -4px 0 12px; font-size: .9rem; }
.empty { text-align: center; color: var(--muted); }
.server-list { display: grid; gap: 16px; }

/* Scheda server (piastrina) */
.server-card { padding: 0; overflow: hidden; }
.server-card.is-new { border-color: rgba(240, 180, 60, .55); }
.server-card.is-hidden { border-style: dashed; }
.card-bg {
    position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center;
    opacity: var(--bg-op, .2); filter: grayscale(.35);
    mask-image: linear-gradient(90deg, transparent 0%, #000 70%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 70%);
}
.server-card > *:not(.card-bg) { position: relative; z-index: 1; }
.card-head { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: start; padding: 16px 16px 10px; }
.card-logo, .detail-logo { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--line-2); background: var(--bg-2); }
.card-title { min-width: 0; }
.card-title h2 { font-size: 1.25rem; margin: 2px 0 8px; overflow-wrap: anywhere; }
.card-title h2 a { color: var(--text); text-decoration: none; }
.card-title h2 a:hover { color: var(--green); }
.rank { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding-top: 4px; }
.rank-label { font: 600 .68rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .16em; color: var(--faint); }
.rank-value { font-size: 1.25rem; font-weight: 700; color: var(--amber); }

/* Dati live (etichette tipo "STATO", "IP") */
.live-data { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ld-item { background: rgba(13, 15, 14, .82); padding: 9px 16px; min-width: 0; }
.ld-item dt { font: 600 .68rem/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .16em; color: var(--faint); margin-bottom: 3px; }
.ld-item dt .live-icon, .rank-label i { margin-right: 3px; }
.live-icon { color: var(--green-dim); }
.rank-label i { color: var(--amber); }
.ld-item dd { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.ld-players, .ld-addr { grid-column: 1 / -1; }
.big { font-size: 1.35rem; color: var(--green); text-shadow: 0 0 10px var(--green-glow); }
.queue { color: var(--amber); font-size: .8rem; margin-left: 6px; }
.ld-last { color: var(--muted); font-size: .88rem; }
.ld-last strong { color: var(--text); }
.addr { overflow-wrap: anywhere; }
.clock .fa-sun { color: var(--amber); }
.clock .fa-moon { color: var(--blue); }

/* Server in arrivo: riquadro al posto di dati live e grafico */
.teaser {
    display: flex; align-items: center; gap: 14px; padding: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    background:
        repeating-linear-gradient(-45deg, rgba(125, 184, 232, .05) 0 10px, transparent 10px 20px),
        rgba(13, 15, 14, .82);
}
.teaser-icon {
    flex: none; display: grid; place-items: center; width: 48px; height: 48px; font-size: 1.3rem;
    color: var(--blue); border: 1px solid rgba(125, 184, 232, .45); background: rgba(125, 184, 232, .1);
}
.teaser-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.teaser-title { font: 700 1.3rem/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.teaser-date { color: var(--amber); font-size: .9rem; }
.teaser-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.detail-live .teaser { border: 0; }

/* Oscilloscopio */
.scope {
    display: block; position: relative; height: 64px; padding: 4px 0 4px 34px; color: inherit; text-decoration: none; cursor: crosshair; touch-action: pan-y;
    background:
        linear-gradient(rgba(111, 211, 138, .07) 1px, transparent 1px) 0 0 / 100% 16px,
        linear-gradient(90deg, rgba(111, 211, 138, .07) 1px, transparent 1px) 0 0 / 25% 100%,
        #0a0c0b;
}
.scope:hover { color: inherit; }
.scope-label { position: absolute; right: 10px; top: 6px; z-index: 1; font: 600 .65rem/1 var(--font-head); letter-spacing: .16em; color: var(--green-dim); }
.scope-axis { position: absolute; left: 0; top: 4px; width: 30px; height: 56px; font-size: .62rem; color: var(--faint); border-right: 1px solid rgba(111, 211, 138, .15); }
.scope-axis > span { position: absolute; right: 4px; transform: translateY(-50%); line-height: 1; }
.scope-axis > span:nth-child(1) { top: 8.9%; }
.scope-axis > span:nth-child(2) { top: 51.8%; }
.scope-axis > span:nth-child(3) { top: 94.6%; }
.scope-plot { position: relative; display: block; height: 56px; }
.spark { display: block; width: 100%; height: 56px; overflow: visible; }
.spark-guide { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .25); pointer-events: none; }
.spark-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(0, 0, 0, .6); pointer-events: none; }
.spark-tip {
    position: absolute; top: -2px; z-index: 2; padding: 3px 7px; white-space: nowrap; pointer-events: none;
    font-size: .72rem; color: var(--text); background: rgba(0, 0, 0, .85); border: 1px solid var(--green-dim);
}
.spark-line { fill: none; stroke: var(--green); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(111, 211, 138, .55)); }
.card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 16px 14px; }

/* Pagine */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 26px; }
.page-btn { display: inline-flex; align-items: center; gap: 6px; min-width: 40px; height: 40px; justify-content: center; padding: 0 12px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); text-decoration: none; font: 700 .9rem/1 var(--font-head); }
.page-btn:hover { color: var(--text); border-color: var(--muted); }
.page-btn.is-active { background: var(--green); border-color: var(--green); color: #07130b; }

/* Riquadri laterali */
.side-box h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .14em; display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.side-upcoming h2 { color: var(--amber); }
.side-new h2 { color: var(--green); }
.mini { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; color: var(--text); text-decoration: none; border: 1px solid transparent; }
.mini:hover { background: rgba(255, 255, 255, .03); border-color: var(--line); color: var(--text); }
.mini img { width: 44px; height: 44px; object-fit: cover; border: 1px solid var(--line-2); flex: 0 0 44px; }
.mini-text { display: flex; flex-direction: column; min-width: 0; }
.mini-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-meta { font-size: .8rem; }

/* ---------- Dettaglio server ---------- */
.detail { display: grid; gap: 16px; }
.detail-head { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: start; overflow: hidden; }
.detail-head > *:not(.card-bg) { position: relative; z-index: 1; }
.detail-logo { width: 72px; height: 72px; }
.detail-title h1 { margin-bottom: 10px; overflow-wrap: anywhere; }
.detail-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rank-big { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 10px; justify-content: flex-start; }
.rank-big .rank-value { font-size: 1.6rem; }
.detail-live { padding: 0; }
.detail-live .live-data { border-top: 0; border-bottom: 0; }
.opening { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); }
.chart-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.chart-head h2 { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-2); }
.seg-btn { padding: 8px 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: 600 .82rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .08em; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-2); }
.seg-btn:hover { color: var(--text); }
.seg-btn.is-active { background: var(--green-glow); color: var(--green); }
.chart-box {
    position: relative; height: 300px;
    background:
        linear-gradient(rgba(111, 211, 138, .05) 1px, transparent 1px) 0 0 / 100% 30px,
        #0a0c0b;
    border: 1px solid var(--line);
    padding: 8px;
}
.chart-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .9rem; pointer-events: none; }
.chart-note { font-size: .8rem; margin: 10px 0 0; }

/* ---------- Testo ricco (descrizioni, prefazione, privacy) ---------- */
.rich-text { overflow-wrap: anywhere; }
.rich-text > :first-child { margin-top: 0; }
.rich-text > :last-child { margin-bottom: 0; }
.rich-text p { margin: 0 0 .9em; }
.rich-text h2, .rich-text h3, .rich-text h4 { margin: 1.2em 0 .5em; }
.rich-text h4 { font-size: 1.02rem; text-transform: uppercase; letter-spacing: .08em; }
.rich-text ul, .rich-text ol { margin: 0 0 .9em; padding-left: 1.5em; }
.rich-text blockquote { margin: 0 0 .9em; padding: 8px 14px; border-left: 3px solid var(--amber); background: rgba(240, 180, 60, .06); color: #d9ddd6; }
.rich-text hr { border: 0; border-top: 1px dashed var(--line-2); margin: 1.4em 0; }
.rich-text code { background: rgba(0, 0, 0, .35); border: 1px solid var(--line); padding: 1px 5px; font-size: .9em; }
.rich-text img { display: block; margin: 10px 0; border: 1px solid var(--line); }
.rich-text img.img-small { max-width: min(100%, 240px); }
.rich-text img.img-medium { max-width: min(100%, 520px); }
.rich-text img.img-full { width: 100%; }
.rich-text .video-embed { display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); margin: 10px 0; }
.align-left { text-align: left; }
.align-center { text-align: center; }
.align-right { text-align: right; }
.align-justify { text-align: justify; }
.indent-1 { padding-left: 2em; }
.indent-2 { padding-left: 4em; }
.indent-3 { padding-left: 6em; }
.indent-4 { padding-left: 8em; }
.c-red { color: #f07a67; }
.c-orange { color: #f39a4a; }
.c-yellow { color: #f1d05a; }
.c-green { color: #7fdc95; }
.c-blue { color: #82bdf0; }
.c-purple { color: #c39af0; }
.c-gray { color: #a3aca5; }

/* ---------- Moduli ---------- */
.form-card { max-width: 900px; margin: 0 auto; }
.form-card h1 { display: flex; align-items: center; gap: 10px; color: var(--green); }
.lead { color: var(--muted); margin: 0 0 20px; }
.form { display: grid; gap: 18px; }
fieldset { margin: 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line); display: grid; gap: 14px; min-width: 0; }
legend { padding: 0 10px 0 0; font: 700 .85rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .16em; color: var(--amber); }
.grid-2, .grid-3 { display: grid; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .captcha-box label { font-weight: 600; font-size: .9rem; }
.sub-label { font-size: .8rem; color: var(--muted); }
.req { color: var(--red); }
.help { color: var(--muted); font-size: .8rem; margin: 0; }
input[type="text"], input[type="search"], input[type="email"], input[type="url"], input:not([type]), input[type="number"], input[type="password"], input[type="date"], input[type="datetime-local"], select, textarea {
    width: 100%; min-height: 40px; padding: 9px 11px;
    background: #0b0d0c; border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--text);
    font: inherit;
}
textarea { resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px var(--green-glow); }
input[type="file"] { font-size: .85rem; color: var(--muted); max-width: 100%; }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 7px 12px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); cursor: pointer; font: 600 .8rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .08em; }
.upload-preview { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--line-2); }
.captcha-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--green-dim); background: rgba(111, 211, 138, .05); }
.captcha-box input { max-width: 140px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; color: var(--muted); cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--green); flex: 0 0 auto; }
.form-actions { display: flex; justify-content: flex-end; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 12px 14px; margin-bottom: 16px; border: 1px solid; border-left-width: 4px; }
.alert ul { margin: 6px 0 0; padding-left: 1.2em; }
.alert-success { border-color: var(--green-dim); background: var(--green-glow); color: #d5f5dd; }
.alert-error { border-color: rgba(236, 106, 85, .55); background: var(--red-dim); color: #fbd9d2; }
.alert:focus { outline: none; }

/* Tag con "bolle" (site.js) */
.tags-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 40px; padding: 5px 8px; background: #0b0d0c; border: 1px solid var(--line-2); border-radius: var(--radius); cursor: text; }
.tags-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.tags-box input { flex: 1 0 120px; min-height: 28px; border: 0; padding: 2px; background: transparent; box-shadow: none !important; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 8px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: .82rem; }
.tag-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 4px; font-size: .9rem; line-height: 1; }
.tag-chip button:hover { color: var(--red); }

/* Email nascosta */
.email-alt { margin-top: 28px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.email-alt h2 { font-size: 1.05rem; }
.reveal { margin: 10px 0 16px; padding: 12px 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); }
.reveal label { display: block; margin-bottom: 8px; font-size: .9rem; }
.inline { display: flex; gap: 8px; }
.inline input { max-width: 110px; }
.reveal-error { color: var(--red); margin: 8px 0 0; font-size: .85rem; }
.reveal-result { margin: 0; font-size: 1.15rem; }
.reveal-result a { font-family: var(--font-mono); font-weight: 700; }

/* Testi lunghi e 404 */
.text-card { max-width: 860px; margin: 0 auto; }
.text-card h1 { color: var(--green); }
.text-card h2 { margin-top: 1.5em; color: var(--text); }
.notfound { max-width: 720px; margin: 20px auto; text-align: center; }
.nf-code { font-size: 5rem; line-height: 1; margin: 0 0 6px; color: var(--amber); text-shadow: 0 0 18px rgba(240, 180, 60, .35); }
.nf-hint { margin: 22px 0; padding: 14px; border: 1px dashed var(--line-2); text-align: left; }
.nf-hint h2 { font-size: 1.05rem; color: var(--green); }

/* ---------- Accesso e area riservata ---------- */
.auth-card { max-width: 480px; }
.form-actions.spread { justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-actions.gap { gap: 8px; flex-wrap: wrap; }
.form.compact { gap: 12px; }
.form.compact h2 { margin: 0; font-size: 1.15rem; }
.btn-danger { color: #ffd9d2; border-color: rgba(236, 106, 85, .6); background: var(--red-dim); }
.btn-danger:hover { color: #fff; border-color: var(--red); background: rgba(236, 106, 85, .3); }
.alert-warn { border-color: rgba(240, 180, 60, .55); background: var(--amber-dim); color: #fbe8c2; }
.warn { color: var(--amber); }
.strong { font-weight: 700; color: var(--text); }
.flag-ok { color: var(--green); border-color: var(--green-dim); }

.panel-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.panel-side { min-width: 0; }
.panel-who { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); color: var(--green); }
.panel-who span { display: flex; flex-direction: column; min-width: 0; }
.panel-who strong { color: var(--text); overflow-wrap: anywhere; }
.panel-who small { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; }
.panel-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.panel-link {
    position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px;
    border: 1px solid transparent; border-left: 3px solid transparent; background: transparent; color: var(--muted);
    text-decoration: none; font: 600 .9rem/1.2 var(--font-body); cursor: pointer; text-align: left;
}
.panel-link i { width: 18px; text-align: center; }
.panel-link:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.panel-link.is-active { color: var(--green); border-left-color: var(--green); background: var(--green-glow); }
.panel-logout { margin: 0; }
.count { min-width: 22px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; background: var(--amber); color: #1a1204; font: 700 .75rem/1 var(--font-mono); border-radius: 10px; }
.panel-main { min-width: 0; }
.panel-main > h1, .panel-head h1 { color: var(--green); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.panel-head h1 { margin: 0; overflow-wrap: anywhere; }
.panel-card { margin-top: 18px; }
.panel-card h2 { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; }
.panel-main > .card.form { margin-top: 12px; }
.danger-zone { border-color: rgba(236, 106, 85, .35); }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 14px 0 4px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); text-decoration: none; font-size: .85rem; }
.stat:hover { border-color: var(--green-dim); color: var(--text); }
.stat-n { font-size: 1.9rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-n.is-warn { color: var(--amber); }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; border-bottom: 1px solid var(--line); }
.tab { padding: 9px 12px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; font: 600 .82rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .1em; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--green); border-bottom-color: var(--green); }
.inline-search { display: flex; gap: 8px; margin-bottom: 12px; max-width: 520px; }

.table-wrap { margin-top: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font: 700 .72rem/1.2 var(--font-head); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-2); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.table tr.is-muted td { opacity: .6; }
.table .num { text-align: right; }
.table td.mono { white-space: nowrap; overflow-wrap: normal; }
td.row-actions { white-space: nowrap; text-align: right; }
td.row-actions > * { display: inline-flex; vertical-align: middle; margin: 2px 0 2px 6px; }
.row-flags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; vertical-align: middle; }
.row-logo { width: 28px; height: 28px; object-fit: cover; vertical-align: middle; margin-right: 6px; border: 1px solid var(--line-2); }
.compact-table { margin: 8px 0 12px; }
del { color: #f2a497; text-decoration-color: rgba(236, 106, 85, .7); }
ins { color: var(--green); text-decoration: none; }

.plain-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row-between form { margin: 0; }
.invite-box p { margin: 0 0 8px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; font-size: .82rem; }
.current-media { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.upload-preview.is-wide { width: 128px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.audit-list { list-style: none; margin: 0; padding: 0; }
.audit-list > li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.audit-list > li:last-child { border-bottom: 0; }
.audit-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.audit-head time { color: var(--faint); font-size: .8rem; }
.audit-who { margin-left: auto; color: var(--muted); font-size: .85rem; }
.audit-changes { margin: 6px 0 0; padding-left: 1.2em; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }

.menu-rows { display: grid; gap: 10px; }
.menu-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.menu-row > input:nth-of-type(5) { grid-column: 2; }
.menu-row-head { display: none; }
.menu-icon { grid-column: 2; display: flex; align-items: center; gap: 8px; }
.menu-icon i { width: 20px; text-align: center; color: var(--green); }
.menu-opts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* Scelta del tema e cursori */
.theme-choices { display: grid; gap: 10px; margin-bottom: 8px; }
.theme-choice { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); cursor: pointer; }
.theme-choice:has(input:checked) { border-color: var(--green); background: var(--green-glow); }
.theme-choice > span:last-child { display: flex; flex-direction: column; }
.theme-swatch { flex: 0 0 56px; height: 36px; border: 1px solid var(--line-2); background: linear-gradient(135deg, #0d0f0e 0 50%, #6fd38a 50% 75%, #f0b43c 75%); }
.theme-swatch-legacy { border-radius: 6px; background: linear-gradient(135deg, #0b0c10 0 50%, #2ecc71 50% 75%, #f1c40f 75%); }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--green); min-height: 32px; }
.range-row output { min-width: 4ch; text-align: right; color: var(--green); }
.result-reset { margin-left: 10px; white-space: nowrap; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: rgba(0, 0, 0, .35); color: var(--muted); font-size: .85rem; }
.footer-inner { padding-top: 22px; padding-bottom: 26px; text-align: center; }
.footer-inner p { margin: 0 0 10px; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 14px; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--text); }
.footer-legal { color: var(--faint); font-size: .76rem; border-top: 1px solid var(--line); padding-top: 14px; }

/* ---------- Tablet e desktop ---------- */
@media (min-width: 600px) {
    .grid-2 { grid-template-columns: 1fr 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
    .live-data { grid-template-columns: repeat(2, 1fr); }
    .ld-addr { grid-column: auto; }
    .filters { grid-template-columns: repeat(4, 1fr); }
    .filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .filter-actions .btn { flex: 0 0 auto; }
    .card-head { grid-template-columns: 64px 1fr auto; padding: 18px 18px 12px; }
    .card-logo { width: 64px; height: 64px; }
}
@media (min-width: 768px) {
    h1 { font-size: 2.2rem; }
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .menu-row { grid-template-columns: 64px 1fr 1.4fr 1fr auto; align-items: center; }
    .menu-row > input:nth-of-type(5), .menu-icon, .menu-opts { grid-column: auto; }
    .menu-row-head { display: grid; border: 0; padding: 0; font: 700 .72rem/1 var(--font-head); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
    .menu-opts { flex-direction: column; gap: 4px; }
    .live-data { grid-template-columns: 1.2fr 1.5fr 1fr 1fr; }
    .ld-players { grid-column: auto; }
    .detail-head { grid-template-columns: 96px 1fr auto; padding: 22px; }
    .detail-logo { width: 96px; height: 96px; }
    .rank-big { grid-column: auto; flex-direction: column; align-items: flex-end; }
    .chart-box { height: 360px; }
    .card { padding: 22px; }
    .server-card, .detail-live { padding: 0; }
    .filters { padding: 14px; }
}
@media (min-width: 1024px) {
    .panel-grid { grid-template-columns: 230px minmax(0, 1fr); align-items: start; }
    .panel-side { position: sticky; top: 16px; }
    .panel-nav { flex-direction: column; flex-wrap: nowrap; }
    .stat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .home-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
    .home-side { position: sticky; top: 16px; }
    .filters { grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; align-items: end; }
    .filter-q { grid-column: auto; }
    .filter-actions { grid-column: auto; }
}

/* Telefono: il rank scende sotto il titolo, il titolo si ferma a due righe (intero nel tooltip e nella pagina del server) */
@media (max-width: 599.98px) {
    .card-head { grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "logo title" "logo rank" "badges badges"; row-gap: 6px; align-items: center; }
    .card-logo { grid-area: logo; align-self: start; }
    .card-title { display: contents; }
    .card-title h2 { grid-area: title; margin: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
    .card-title .badges { grid-area: badges; }
    .card-head .rank { grid-area: rank; justify-self: start; flex-direction: row; align-items: baseline; gap: 8px; padding-top: 0; }
}

/* Sotto i 768px i pulsanti mostrano solo l'icona (requisito del brief) */
@media (max-width: 767.98px) {
    .btn-dzsa { display: none; } /* DZSA Launcher esiste solo per PC */
    .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .btn, .nav-link { min-width: 44px; min-height: 44px; padding-left: 12px; padding-right: 12px; justify-content: center; }
    .brand-desc { display: none; }
    .main-nav { justify-content: space-between; }
    .radio { margin-left: 0; padding: 5px 9px; }
    .radio-label { display: none; }
    .btn-lg .btn-label, .form-actions .btn-label { position: static; width: auto; height: auto; clip: auto; }
    .panel-nav { justify-content: space-between; }
    .panel-link { justify-content: center; min-width: 44px; padding: 8px 10px; border-left-width: 1px; border-bottom: 2px solid transparent; }
    .panel-link.is-active { border-left-color: transparent; border-bottom-color: var(--green); }
    .panel-link .count { position: absolute; top: 2px; right: -2px; min-width: 18px; height: 16px; font-size: .65rem; }
    .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
    .table td { border: 0; padding: 3px 0; text-align: left !important; }
    .table td[data-label]::before { content: attr(data-label) ": "; color: var(--faint); font-size: .78rem; }
    td.row-actions { white-space: normal; padding-top: 8px !important; }
    td.row-actions > * { margin: 0 6px 6px 0; }
    .table td.mono { white-space: normal; }
    .audit-who { margin-left: 0; width: 100%; }
}
@media (max-width: 380px) {
    .brand-name { font-size: 1.15rem; letter-spacing: .08em; }
    .brand-mark { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
    body { background: #fff; color: #000; }
    .site-header, .site-footer, .card-actions, .scope, .filters, .pagination { display: none; }
    .card { clip-path: none; border-color: #999; background: #fff; }
}

/* ---------- Manutenzione ---------- */
.page-maintenance .main { display: grid; place-items: center; min-height: 50vh; }
.maintenance-card { max-width: 560px; padding: 32px 24px; text-align: center; }
.maintenance-card h1 { margin: 12px 0 8px; }
.maintenance-card p { margin: 0 0 10px; }
.maintenance-icon { font-size: 2.4rem; color: var(--amber); }
.maintenance-bar a { color: inherit; text-decoration: underline; }
