/* UCP American Dream Roleplay */

:root {
    --bg: #05070d;
    --panel: rgba(14, 19, 30, 0.62);
    --panel-border: rgba(140, 170, 255, 0.14);
    --text: #eef2f8;
    --muted: #8a93a6;
    --accent: #2e9bff;
    --accent-2: #8b5cff;
    --green: #4cc38a;
    --yellow: #f5c542;
    --red: #e5484d;
    --radius: 18px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
    background: radial-gradient(1200px 800px at 70% -10%, #13204a 0%, var(--bg) 60%);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* scena 3D a tutto schermo dietro i contenuti */
#scena {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    display: block;
}

.veil {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(5, 7, 13, 0.15) 0%, rgba(5, 7, 13, 0.55) 70%, rgba(5, 7, 13, 0.9) 100%);
}

body.scene-app .veil { background: linear-gradient(180deg, rgba(5, 7, 13, 0.55) 0%, rgba(5, 7, 13, 0.82) 60%, rgba(5, 7, 13, 0.95) 100%); }

/* senza WebGL resta uno sfondo sfumato */
body.no-webgl #scena { display: none; }

a { color: inherit; }

.glass {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- navigazione */

.nav {
    position: sticky;
    top: 14px;
    z-index: 10;
    margin: 14px auto 0;
    width: min(1180px, calc(100% - 28px));
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 14px 10px 20px;
    border-radius: 999px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
}

.logo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 14px var(--accent);
    animation: pulse 2.4s ease-in-out infinite;
}

.nav-links { display: flex; gap: 4px; margin-left: auto; }

.nav-links a {
    text-decoration: none;
    color: var(--muted);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.92rem;
    transition: color .2s, background .2s;
}

.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-links a.active { color: var(--text); background: rgba(46, 155, 255, 0.18); }

.nav-logout { margin: 0; }

/* ---------------------------------------------------------------- pagine */

.page {
    width: min(1180px, calc(100% - 28px));
    margin: 40px auto 60px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.page-head { margin-bottom: 4px; }

.kicker {
    display: block;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.75rem;
    font-weight: 700;
}

.title {
    margin: 6px 0 10px;
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(120deg, #ffffff 10%, #a8c8ff 50%, #b9a4ff 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-title { margin: 14px 0 0; font-size: 1.15rem; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge.gold { color: #ffd76a; border-color: rgba(255, 215, 106, 0.4); background: rgba(255, 215, 106, 0.1); }
.badge.staff { color: #ff8a8a; border-color: rgba(255, 138, 138, 0.4); background: rgba(255, 138, 138, 0.1); }
.badge.tutor { color: #7fdbff; border-color: rgba(127, 219, 255, 0.4); background: rgba(127, 219, 255, 0.1); }
.badge.online { color: var(--green); border-color: rgba(76, 195, 138, 0.4); }

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.mono { font-family: Consolas, "Courier New", monospace; letter-spacing: 0.04em; }

.back { color: var(--muted); text-decoration: none; font-size: 0.9rem; width: fit-content; }
.back:hover { color: var(--text); }

/* ---------------------------------------------------------------- statistiche */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

.stat {
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.stat::after {
    content: "";
    position: absolute;
    inset: auto -40% -60% auto;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(46, 155, 255, 0.28), transparent 70%);
    pointer-events: none;
}

.stat-label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; }
.stat-value { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.small-value { font-size: 1.3rem; }

.dot-online, .dot-offline { display: inline-flex; align-items: center; gap: 8px; }
.dot-online::before, .dot-offline::before { content: ""; width: 9px; height: 9px; border-radius: 50%; }
.dot-online::before { background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 2s infinite; }
.dot-offline::before { background: var(--red); }

/* ---------------------------------------------------------------- carte dei personaggi (inclinazione 3D) */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }

.tilt { transform-style: preserve-3d; transition: transform .25s ease, box-shadow .25s ease; will-change: transform; }

.char-card {
    padding: 22px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.char-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(46, 155, 255, 0.18), transparent 45%);
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}

.char-card:hover::before { opacity: 1; }
.char-card:hover { box-shadow: 0 30px 80px rgba(46, 155, 255, 0.18); }

.avatar {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 30px rgba(139, 92, 255, 0.35);
    transform: translateZ(30px);
}

.char-name { font-size: 1.3rem; font-weight: 800; transform: translateZ(24px); }
.char-meta { color: var(--muted); font-size: 0.86rem; margin-bottom: 6px; }

.char-row {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 8px;
    font-size: 0.92rem;
}

.char-row span { color: var(--muted); }
.char-cta { margin-top: 8px; color: var(--accent); font-weight: 700; font-size: 0.9rem; }

/* ---------------------------------------------------------------- scheda personaggio */

.hero-char { display: grid; grid-template-columns: 1fr minmax(280px, 520px); gap: 26px; align-items: center; }

.idcard-3d {
    width: 100%;
    aspect-ratio: 560 / 360;
    height: auto;
    cursor: grab;
    border-radius: var(--radius);
    filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.55));
}

.idcard-3d:active { cursor: grabbing; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.panel { padding: 22px 24px; }
.panel-title { margin: 0 0 14px; font-size: 1.05rem; letter-spacing: 0.02em; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }

.progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 14px rgba(46, 155, 255, 0.6);
    transition: width 1.2s cubic-bezier(.2, .8, .2, 1);
}

.progress.small { height: 6px; min-width: 90px; }

.checklist { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.checklist li::before { content: ""; width: 18px; height: 18px; border-radius: 6px; border: 2px solid rgba(255, 255, 255, 0.2); flex: none; }
.checklist li.done { color: var(--text); }
.checklist li.done::before { background: var(--green); border-color: var(--green); box-shadow: 0 0 10px rgba(76, 195, 138, 0.6); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; padding: 8px 10px; }
.table td { padding: 12px 10px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.04); }

.tag { padding: 3px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; background: rgba(255, 255, 255, 0.08); }
.tag.green { color: var(--green); background: rgba(76, 195, 138, 0.12); }
.tag.red { color: var(--red); background: rgba(229, 72, 77, 0.12); }
.tag.blue { color: var(--accent); background: rgba(46, 155, 255, 0.12); }
.schedine-title { margin-top: 26px; }

.tag.yellow { color: var(--yellow); background: rgba(245, 197, 66, 0.12); }

/* ---------------------------------------------------------------- aggiornamenti */

.page-lead { margin: 6px 0 0; max-width: 640px; color: #b9c2d3; font-size: 1.02rem; line-height: 1.65; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filter {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 10px 18px; border-radius: 999px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(14, 19, 30, 0.6);
    color: var(--muted); font: inherit; font-size: 0.9rem; font-weight: 600;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    transition: color .2s, background .2s, border-color .2s, box-shadow .2s;
}
.filter span { min-width: 26px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 0.76rem; text-align: center; }
.filter:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.22); }
.filter.active { color: #fff; border-color: transparent; background: linear-gradient(120deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 28px rgba(46, 155, 255, 0.35); }
.filter.active span { background: rgba(255, 255, 255, 0.22); }

/* ---- giorno: banner con data grande, titolo e conteggi */
.release { display: grid; gap: 20px; margin-top: 18px; }

.release-head {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center;
    padding: 24px 28px;
    background: linear-gradient(120deg, rgba(46, 155, 255, 0.16), rgba(139, 92, 255, 0.12) 45%, var(--panel) 80%);
}
.release-head::after {
    content: ""; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; border-radius: 50%;
    background: radial-gradient(rgba(139, 92, 255, 0.28), transparent 70%); pointer-events: none;
}
.release-date {
    display: grid; place-items: center; min-width: 96px; padding: 12px 16px; border-radius: 16px;
    background: rgba(5, 8, 14, 0.55); border: 1px solid rgba(46, 155, 255, 0.35);
    box-shadow: 0 0 30px rgba(46, 155, 255, 0.18) inset;
}
.release-day {
    font-size: 2.6rem; font-weight: 900; line-height: 1; letter-spacing: -0.03em;
    background: linear-gradient(160deg, #ffffff, #8fc8ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.release-month { margin-top: 6px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.18em; color: var(--accent); }
.release-info { display: grid; gap: 8px; min-width: 0; }
.release-kicker { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.release-title { margin: 0; font-size: 1.6rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.release-counts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.count { padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; color: var(--c); background: var(--c-soft); }

/* ---- colori per tipo, usati da card e conteggi */
[data-tipo] { --c: var(--accent); --c-soft: rgba(46, 155, 255, 0.14); --c-glow: rgba(46, 155, 255, 0.35); }
[data-tipo="nuovo"] { --c: var(--green); --c-soft: rgba(76, 195, 138, 0.14); --c-glow: rgba(76, 195, 138, 0.35); }
[data-tipo="correzione"] { --c: var(--yellow); --c-soft: rgba(245, 197, 66, 0.14); --c-glow: rgba(245, 197, 66, 0.35); }

/* ---- card */
.entries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; grid-auto-flow: dense; }

.entry {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column;
    transition: border-color .25s, box-shadow .25s;
}
.entry:hover { border-color: var(--c-glow); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--c-soft); }

.entry-top {
    position: relative;
    display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center;
    padding: 22px 24px 20px;
    background: linear-gradient(135deg, var(--c-soft), transparent 75%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.entry-top::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--c), transparent); }

.entry-icon {
    width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
    color: var(--c); background: rgba(5, 8, 14, 0.5); border: 1px solid var(--c-glow);
    box-shadow: 0 0 22px var(--c-soft), 0 0 12px var(--c-soft) inset;
}
.entry-heading { display: grid; gap: 6px; min-width: 0; }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.entry-type, .entry-area, .entry-star {
    padding: 2px 9px; border-radius: 6px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
}
.entry-type { color: var(--c); background: var(--c-soft); }
.entry-area { color: #c9d1de; background: rgba(255, 255, 255, 0.07); }
.entry-star { color: #fff; background: linear-gradient(120deg, var(--accent), var(--accent-2)); }
.entry-title { margin: 0; font-size: 1.2rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.005em; color: var(--text); }

.entry-body { display: grid; gap: 16px; padding: 20px 24px 24px; align-content: start; flex: 1; }
.entry-text { margin: 0; color: #e1e6ef; font-size: 1rem; font-weight: 500; line-height: 1.6; }

.entry-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.entry-points li {
    position: relative; padding-left: 30px;
    color: #aab3c4; font-size: 0.92rem; line-height: 1.6;
}
/* spunta disegnata in CSS: cerchio colorato con un segno di visto */
.entry-points li::before {
    content: ""; position: absolute; left: 0; top: 0.2em; width: 18px; height: 18px; border-radius: 50%;
    background: var(--c-soft); border: 1px solid var(--c-glow);
}
.entry-points li::after {
    content: ""; position: absolute; left: 6.5px; top: calc(0.2em + 4.5px); width: 4px; height: 7px;
    border: solid var(--c); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.entry-foot {
    display: grid; gap: 10px; padding: 16px 24px 20px;
    background: rgba(5, 8, 14, 0.35); border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.entry-foot-label { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.cmds { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cmds li {
    padding: 5px 12px; border-radius: 8px; font-family: "Cascadia Code", Consolas, "Courier New", monospace;
    font-size: 0.82rem; color: var(--c); background: var(--c-soft); border: 1px solid var(--c-glow);
}

/* ---- card in evidenza: due colonne, testo piu' grande, punti affiancati */
.entry.featured { grid-column: span 2; }
.entry.featured .entry-top { padding: 28px 30px 24px; background: linear-gradient(135deg, var(--c-glow), var(--c-soft) 40%, transparent 85%); }
.entry.featured .entry-icon { width: 62px; height: 62px; border-radius: 18px; }
.entry.featured .entry-icon svg { width: 30px; height: 30px; }
.entry.featured .entry-title { font-size: 1.55rem; }
.entry.featured .entry-body { padding: 24px 30px 28px; gap: 20px; }
.entry.featured .entry-text { font-size: 1.1rem; }
.entry.featured .entry-points { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.entry.featured .entry-foot { padding: 18px 30px 22px; }

/* display:flex/grid batterebbe l'attributo hidden usato dal filtro */
.filters[hidden], .release[hidden], .entry[hidden] { display: none; }

@media (max-width: 1100px) {
    .entries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .entries { grid-template-columns: 1fr; }
    .entry.featured { grid-column: auto; }
    .entry.featured .entry-points { grid-template-columns: 1fr; }
    .release-head { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
    .release-date { justify-self: start; display: flex; gap: 10px; align-items: baseline; }
    .release-title { font-size: 1.3rem; }
    .entry-top, .entry-body, .entry-foot { padding-left: 20px; padding-right: 20px; }
}

.loan { display: grid; gap: 8px; margin-bottom: 14px; }

.post { padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.post:first-child { border-top: 0; padding-top: 0; }
.post p { margin: 4px 0; overflow-wrap: anywhere; }
.handle { color: var(--accent); font-weight: 700; font-size: 0.9rem; }
.feed { max-height: 420px; overflow-y: auto; padding-right: 6px; }

.players { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.players li { padding: 6px 12px; border-radius: 999px; background: rgba(46, 155, 255, 0.12); font-size: 0.88rem; }

.access-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.access-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }

.empty { padding: 26px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- moduli */

.form { display: grid; gap: 14px; }

.field { display: grid; gap: 6px; }
.field span { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.04em; }

.field input {
    width: 100%;
    padding: 13px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(5, 8, 14, 0.6);
    color: var(--text);
    font: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(46, 155, 255, 0.2); }

.btn {
    border: 0;
    border-radius: 12px;
    padding: 13px 18px;
    font: inherit;
    font-weight: 700;
    color: #fff;
    /* sfondo scuro di base: senza, il browser mette il grigio chiaro dei pulsanti e il testo bianco non si legge */
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    text-decoration: none;
    line-height: 1.25;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s, box-shadow .2s, background .2s;
}

.btn.success { background: linear-gradient(120deg, #1f9d61, #2fbf7a); box-shadow: 0 10px 26px rgba(47, 191, 122, 0.3); }
.btn.success:hover { background: linear-gradient(120deg, #23ad6b, #3fd08b); }
.btn.warning { color: #1a1204; background: linear-gradient(120deg, #f5a524, #f5c542); box-shadow: 0 10px 26px rgba(245, 165, 36, 0.3); }
.btn.warning:hover { background: linear-gradient(120deg, #f7b13f, #f8d061); }
.btn.red { background: linear-gradient(120deg, #c8333a, #e5484d); box-shadow: 0 10px 26px rgba(229, 72, 77, 0.32); }
.btn.red:hover { background: linear-gradient(120deg, #d63c43, #ec5b60); }
.btn.success:hover, .btn.warning:hover, .btn.red:hover { transform: translateY(-2px); }
.btn.block { display: flex; width: 100%; }

.btn.primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 30px rgba(46, 155, 255, 0.35); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(46, 155, 255, 0.45); }
.btn.primary:active { transform: translateY(0); }
.btn.ghost { background: rgba(255, 255, 255, 0.08); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.14); }
.btn.small { padding: 8px 14px; border-radius: 999px; font-size: 0.85rem; }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.alert { padding: 12px 14px; border-radius: 12px; font-size: 0.92rem; margin: 0 0 14px; }
.alert.error { background: rgba(229, 72, 77, 0.14); border: 1px solid rgba(229, 72, 77, 0.35); }
.alert.success { background: rgba(76, 195, 138, 0.14); border: 1px solid rgba(76, 195, 138, 0.35); }
.alert.info { background: rgba(46, 155, 255, 0.14); border: 1px solid rgba(46, 155, 255, 0.35); }

/* ---------------------------------------------------------------- login */

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }

.login-card { width: min(420px, 100%); padding: 34px 32px 26px; }

.brand { margin-bottom: 22px; }
.brand-kicker { color: var(--muted); text-transform: uppercase; letter-spacing: 0.24em; font-size: 0.72rem; }

.brand-title {
    margin: 8px 0 4px;
    font-size: 2.6rem;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.02em;
    background: linear-gradient(120deg, #fff 0%, #9cc7ff 50%, #c3b0ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-sub { color: var(--accent); font-weight: 800; letter-spacing: 0.4em; font-size: 0.8rem; }

.login-links { display: grid; gap: 10px; margin-top: 18px; text-align: center; }
.login-links .btn { text-decoration: none; }
.link-muted { color: var(--muted); font-size: 0.88rem; text-decoration: none; }
.link-muted:hover { color: var(--text); }

/* ---------------------------------------------------------------- registrazione e pagine pubbliche */

.nav > .btn { text-decoration: none; }
.center { text-align: center; }
.page-lead a, .register a, .step-card a, .empty a, .center a { color: var(--accent); }

.field select, .field textarea {
    width: 100%;
    padding: 13px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(5, 8, 14, 0.6);
    color: var(--text);
    font: inherit;
    transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 96px; }
.field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(46, 155, 255, 0.2); }
.field select option { background: #0b1020; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.register { gap: 18px; }
.register .panel { display: grid; gap: 14px; }
.register .panel-title, .form .panel-title { margin: 0; display: flex; align-items: center; gap: 12px; }
.btn.wide { width: 100%; padding: 15px 18px; font-size: 1.02rem; }

.step {
    display: inline-grid; place-items: center; flex: none;
    width: 32px; height: 32px; border-radius: 10px;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: #fff; font-weight: 800; font-size: 0.95rem;
}

/* campo trappola per i programmi automatici: fuori dallo schermo, non nascosto con display */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.error-list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }

.skins { border: 0; padding: 0; margin: 0; min-width: 0; }
.skins legend { padding: 0; margin-bottom: 10px; font-size: 0.82rem; color: var(--muted); letter-spacing: 0.04em; }
.skin-group-title { margin: 6px 0 10px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
html.js .skin-group-title { display: none; }
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.skin { position: relative; display: grid; place-items: center; padding: 8px 4px; border-radius: 14px; cursor: pointer;
    background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); transition: border-color .2s, background .2s, transform .15s; }
.skin:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-2px); }
.skin input { position: absolute; opacity: 0; pointer-events: none; }
.skin img { width: 100%; max-width: 66px; height: auto; display: block; }
.skin:has(input:checked) { border-color: var(--accent); background: rgba(46, 155, 255, 0.16); box-shadow: 0 0 0 3px rgba(46, 155, 255, 0.25); }
.skin:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.quiz { display: grid; gap: 14px; }
.quiz-q { border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 14px 16px; margin: 0; display: grid; gap: 8px; min-width: 0; }
.quiz-q.wrong { border-color: rgba(229, 72, 77, 0.5); background: rgba(229, 72, 77, 0.06); }
.quiz-q legend { padding: 0 6px; font-weight: 700; }
.quiz-a, .check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; color: #c9d1de; }
.quiz-a input, .check input { margin-top: 4px; accent-color: var(--accent); flex: none; }
.check { padding: 6px 0; }

.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 14px; }
.rule { padding: 20px 22px; display: grid; gap: 8px; align-content: start; }
.rule-tag { width: fit-content; padding: 4px 10px; border-radius: 8px; font-weight: 800; font-size: 0.78rem; letter-spacing: 0.12em;
    color: #fff; background: linear-gradient(120deg, var(--accent), var(--accent-2)); }
.rule-title { margin: 0; font-size: 1.1rem; }
.rule-text { margin: 0; color: #d4dae5; }
.rule-example { margin: 0; color: var(--muted); font-size: 0.88rem; border-left: 2px solid rgba(46, 155, 255, 0.5); padding-left: 10px; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.section-head .section-title { margin: 0; }
.section-head .btn { text-decoration: none; }

.hero { padding: 30px 0 6px; display: grid; gap: 14px; }
.hero-title { margin: 0; font-size: clamp(2.4rem, 7vw, 4.4rem); line-height: 1; font-weight: 900; letter-spacing: -0.01em;
    background: linear-gradient(120deg, #fff 0%, #9cc7ff 50%, #c3b0ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-title span { font-size: 0.5em; letter-spacing: 0.3em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero-cta .btn, .cta-final .btn { text-decoration: none; }

.pub-block { display: grid; gap: 16px; margin-top: 28px; }
.block-title { margin: 0; font-size: 1.8rem; font-weight: 800; letter-spacing: -0.01em; }

.rp-examples { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; margin: 0; }
.rp-examples dt { color: var(--accent); font-weight: 700; }
.rp-examples dd { margin: 0; }
.rp-examples .muted { display: block; font-size: 0.88rem; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.step-card { padding: 20px 22px; display: grid; gap: 8px; align-content: start; }
.step-card h3 { margin: 4px 0 0; font-size: 1.1rem; }
.step-card p { margin: 0; color: #c9d1de; font-size: 0.94rem; }

.systems { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.system { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.system[hidden] { display: none; }
.system-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.system-area { color: var(--muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.12em; }
.system-title { margin: 0; font-size: 1.15rem; }
.system-text { margin: 0; color: #d4dae5; flex: 1; }

.cta-final { display: grid; gap: 12px; justify-items: center; text-align: center; margin-top: 28px; padding: 34px 24px; }

@media (max-width: 1000px) {
    .rules, .systems { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .rules, .systems, .steps, .form-grid { grid-template-columns: 1fr; }
    .block-title { font-size: 1.5rem; }
}

/* ---------------------------------------------------------------- piede */

.footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 0 0 30px; }
body.scene-login .footer { position: fixed; bottom: 0; left: 0; right: 0; }

/* ---------------------------------------------------------------- animazioni */

/* nascosti solo quando c'e' JavaScript a farli comparire: senza JS restano visibili */
html.js .reveal { opacity: 0; transform: translateY(24px); }
html.js .reveal.in { animation: reveal .8s cubic-bezier(.2, .8, .2, 1) forwards; }
.reveal.d1.in { animation-delay: .08s; }
.reveal.d2.in { animation-delay: .16s; }
.reveal.d3.in { animation-delay: .24s; }
.reveal.d4.in { animation-delay: .32s; }
.reveal.d5.in { animation-delay: .40s; }
.reveal.d6.in { animation-delay: .48s; }

@keyframes reveal { to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    html.js .reveal { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- schermi piccoli */

@media (max-width: 900px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2, .hero-char { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .nav { top: 8px; margin-top: 8px; width: calc(100% - 16px); border-radius: 18px; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; padding: 10px 12px 8px 16px; }
    /* le voci del menu scorrono in orizzontale invece di uscire dallo schermo */
    .nav-links {
        order: 3; width: 100%; margin: 0; justify-content: flex-start;
        overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
        mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 18px), transparent 100%);
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 18px), transparent 100%);
        padding: 2px 10px;
    }
    .nav-links::-webkit-scrollbar { display: none; }
    .nav-links a { flex: none; white-space: nowrap; padding: 9px 13px; scroll-snap-align: start; }
    .nav-police-link { padding: 7px 12px; }
    .stat-value { font-size: 1.5rem; }
    .brand-title { font-size: 2.1rem; }
}

/* ---------------------------------------------------------------- LSPD CAD / POLICE PORTAL STYLES */

/* Nav Police Link */
.nav-police-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(30, 64, 175, 0.28);
    border: 1px solid rgba(96, 165, 250, 0.45);
    color: #93c5fd !important;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
    transition: all 0.25s ease;
}

.nav-police-link:hover, .nav-police-link.active {
    background: rgba(37, 99, 235, 0.5);
    border-color: #60a5fa;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.police-siren-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 10px #3b82f6;
    animation: sirenBlink 1.4s ease-in-out infinite;
}

@keyframes sirenBlink {
    0%, 100% { background: #3b82f6; box-shadow: 0 0 12px #3b82f6; transform: scale(1); }
    50% { background: #ef4444; box-shadow: 0 0 12px #ef4444; transform: scale(1.25); }
}

/* Dashboard Police Dispatch Banner */
.police-banner {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 24px 0 32px;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.85) 0%, rgba(30, 58, 138, 0.4) 100%);
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-left: 6px solid #3b82f6;
    box-shadow: 0 15px 40px rgba(15, 23, 42, 0.6), inset 0 0 30px rgba(37, 99, 235, 0.12);
}

.police-banner-icon {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border: 1px solid rgba(147, 197, 253, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
    font-size: 2rem;
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.4);
}

.police-banner-content { flex: 1; }
.police-banner-content h3 { margin: 4px 0 8px; font-size: 1.35rem; font-weight: 800; color: #f8fafc; }
.police-banner-content p { margin: 0; color: #94a3b8; font-size: 0.92rem; line-height: 1.5; }
.police-banner-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #60a5fa;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.pulse-dot-red {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    animation: pulse 1.2s infinite;
}

.pulse-dot-blue {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 8px #3b82f6;
    animation: pulse 1.5s infinite;
}

.pulse-dot-green {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    animation: pulse 1.5s infinite;
}

.police-cta-btn {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 12px;
    white-space: nowrap;
    border: 1px solid rgba(147, 197, 253, 0.4);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    text-decoration: none;
    transition: all 0.25s ease;
}

.police-cta-btn:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.5);
}

.police-badge-tag {
    background: rgba(30, 64, 175, 0.5) !important;
    border: 1px solid rgba(96, 165, 250, 0.4) !important;
    color: #93c5fd !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 6px;
    margin-left: 8px;
}

.police-card-glow {
    border-color: rgba(96, 165, 250, 0.32) !important;
    box-shadow: 0 15px 40px rgba(30, 58, 138, 0.2) !important;
}

.avatar-police {
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.4) !important;
}

/* CAD Page Layout */
.cad-page { max-width: 1240px; margin: 0 auto; padding: 24px 20px 80px; }

.cad-alert-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    margin-bottom: 24px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #6ee7b7;
    font-weight: 600;
}

.cad-alert-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
}

/* Header CAD */
.cad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 24px 30px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.75) 0%, rgba(30, 58, 138, 0.35) 100%);
    border: 1px solid rgba(96, 165, 250, 0.25);
}

.cad-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cad-badge-shield {
    width: 64px;
    height: 64px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 100%);
    border: 2px solid #93c5fd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.5);
    flex-shrink: 0;
}

.cad-badge-shield .police-star { color: #fbbf24; font-size: 1.5rem; line-height: 1; }
.cad-badge-shield .shield-text { font-size: 0.65rem; font-weight: 900; letter-spacing: 0.1em; color: #ffffff; }

.cad-sys-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #60a5fa;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.cad-title { margin: 0; font-size: 1.85rem; font-weight: 900; letter-spacing: -0.02em; color: #f8fafc; }
.cad-subtitle { margin: 2px 0 0; color: #94a3b8; font-size: 0.9rem; }

.cad-officer-badge {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(96, 165, 250, 0.25);
}

.officer-avatar-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.officer-meta { display: flex; flex-direction: column; }
.officer-rank-pill {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #60a5fa;
}
.officer-fullname { font-size: 1.05rem; font-weight: 800; color: #f8fafc; }
.officer-badge-num { font-size: 0.78rem; color: #94a3b8; }

/* CAD Navigation Tabs */
.cad-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 24px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(147, 197, 253, 0.15);
}

.cad-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    transition: all 0.2s ease;
}

.cad-tab:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.05);
}

.cad-tab.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.4) 0%, rgba(30, 64, 175, 0.5) 100%);
    color: #ffffff;
    border: 1px solid rgba(96, 165, 250, 0.4);
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.35);
}

.tab-badge {
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}
.tab-badge.red { background: rgba(239, 68, 68, 0.3); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.5); }
.tab-badge.yellow { background: rgba(245, 158, 11, 0.3); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.5); }
.tab-badge.green { background: rgba(34, 197, 94, 0.3); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.5); }
.tab-badge.blue { background: rgba(59, 130, 246, 0.3); color: #bfdbfe; border: 1px solid rgba(59, 130, 246, 0.5); }

/* Quick Stats Strip */
.cad-stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.55);
}

.pill-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pill-dot.green { background: #22c55e; box-shadow: 0 0 10px #22c55e; }
.pill-dot.red { background: #ef4444; box-shadow: 0 0 10px #ef4444; }
.pill-dot.yellow { background: #f59e0b; box-shadow: 0 0 10px #f59e0b; }
.pill-dot.blue { background: #3b82f6; box-shadow: 0 0 10px #3b82f6; }

.pill-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; display: block; }
.stat-pill strong { font-size: 0.95rem; color: #f8fafc; font-weight: 800; }

/* Grid Layouts */
.cad-layout-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
}

.cad-main-col { display: flex; flex-direction: column; gap: 24px; }
.cad-side-col { display: flex; flex-direction: column; gap: 24px; }

.cad-panel-highlight {
    border-color: rgba(96, 165, 250, 0.35);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 58, 138, 0.25) 100%);
}

.cad-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
}

.cad-panel-head h2 { margin: 0; font-size: 1.2rem; font-weight: 800; color: #f8fafc; }
.panel-icon { font-size: 1.25rem; color: #60a5fa; }
.link-more { color: #60a5fa; text-decoration: none; font-size: 0.85rem; font-weight: 700; }
.link-more:hover { text-decoration: underline; }

.cad-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

/* Wanted Cards */
.wanted-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.wanted-card {
    padding: 18px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-top: 4px solid #ef4444;
}

.wanted-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.wanted-stars { color: #ef4444; font-size: 1.2rem; letter-spacing: 2px; }
.wanted-stars-inline { color: #ef4444; font-size: 1.1rem; letter-spacing: 1px; margin-right: 6px; }
.wanted-target { margin: 0 0 10px; font-size: 1.25rem; font-weight: 800; color: #f8fafc; }
.wanted-details { display: flex; flex-direction: column; gap: 4px; font-size: 0.84rem; color: #94a3b8; margin-bottom: 14px; }
.wanted-actions { display: flex; gap: 8px; }

/* 10-Codes Quick Grid */
.code-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.code-item {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
}

.code-item strong { color: #60a5fa; font-size: 0.88rem; }
.code-item span { color: #94a3b8; font-size: 0.74rem; }
.code-item.alert strong { color: #ef4444; }

/* Patrol List */
.patrol-list { display: flex; flex-direction: column; gap: 10px; }
.patrol-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.patrol-info { flex: 1; display: flex; flex-direction: column; }

/* Search Box */
.cad-search-box {
    padding: 24px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 58, 138, 0.25) 100%);
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.search-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #60a5fa;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.search-row {
    display: flex;
    gap: 12px;
}

.cad-input {
    flex: 1;
    background: rgba(10, 15, 28, 0.8);
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 10px;
    padding: 12px 16px;
    color: #f8fafc;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.cad-input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.4);
}

/* Citizen Dossier */
.citizen-dossier { display: flex; flex-direction: column; gap: 24px; }

.dossier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    border-left: 6px solid #3b82f6;
}

.dossier-left { display: flex; align-items: center; gap: 20px; }

.dossier-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border: 1px solid rgba(147, 197, 253, 0.4);
    color: #ffffff;
    font-size: 2rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dossier-name { margin: 2px 0 6px; font-size: 1.8rem; font-weight: 900; color: #f8fafc; }
.dossier-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.dossier-fast-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dossier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 24px;
}

/* Modals & Action Forms */
.modal-card {
    padding: 24px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(96, 165, 250, 0.35);
    margin-top: 12px;
    transition: box-shadow 0.3s ease;
}

.modal-card h3 { margin: 0 0 16px; font-size: 1.2rem; color: #f8fafc; font-weight: 800; }
.modal-card .form-row { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.modal-card .form-row label { font-size: 0.82rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; }

.highlight-pulse {
    animation: highlightPulse 2s ease forwards;
}

@keyframes highlightPulse {
    0% { box-shadow: 0 0 35px rgba(59, 130, 246, 0.8); border-color: #60a5fa; }
    100% { box-shadow: var(--shadow); border-color: rgba(96, 165, 250, 0.35); }
}

/* Arrest Timeline */
.arrest-timeline { display: flex; flex-direction: column; gap: 14px; }
.arrest-item {
    padding: 16px 20px;
    border-left: 4px solid #ef4444;
}

.arrest-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; }
.arrest-body { color: #cbd5e1; font-size: 0.92rem; line-height: 1.6; }

/* Penal Code Accordion */
.penal-code-accordion { display: flex; flex-direction: column; gap: 20px; }
.penal-group { display: flex; flex-direction: column; gap: 10px; }
.penal-group-title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #60a5fa;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
}

.penal-item {
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.penal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.penal-header strong { color: #f8fafc; font-size: 0.92rem; }
.penal-desc { margin: 0; color: #94a3b8; font-size: 0.84rem; }

/* Miranda Box */
.panel-miranda {
    border-left: 4px solid #f59e0b;
}

.miranda-text-box {
    padding: 16px 20px;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px dashed rgba(245, 158, 11, 0.4);
    margin-bottom: 12px;
}

.miranda-quote {
    margin: 0;
    font-style: italic;
    color: #fde68a;
    font-size: 0.95rem;
    line-height: 1.6;
}

.protocol-list {
    margin: 0;
    padding-left: 20px;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Radar & Forensics */
.radar-mini-card {
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.radar-loc { font-weight: 800; font-size: 0.85rem; color: #60a5fa; }
.radar-log { font-size: 0.78rem; color: #cbd5e1; }
.radar-time { font-size: 0.72rem; }

.radar-feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.radar-full-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-left: 4px solid #3b82f6;
}

.radar-full-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.radar-pre {
    margin: 0;
    padding: 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    color: #93c5fd;
    font-family: monospace;
    font-size: 0.84rem;
    white-space: pre-wrap;
}
.radar-full-foot { display: flex; justify-content: space-between; align-items: center; }

/* Lockout page */
.police-lockout {
    max-width: 600px;
    margin: 60px auto;
    padding: 40px;
    text-align: center;
    border-top: 6px solid #ef4444;
}

.lockout-badge {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 16px;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 2rem;
}

.lockout-desc { color: #cbd5e1; line-height: 1.6; margin: 16px 0 24px; }
.lockout-meta {
    display: flex;
    justify-content: space-around;
    padding: 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 24px;
}

/* General Helpers */
.price-tag { font-weight: 800; color: #4ade80; font-family: monospace; }
.red-text { color: #ef4444 !important; }
.green-text { color: #22c55e !important; }
.text-accent { color: #60a5fa; }
.block { width: 100%; display: block; }
.my-officer-row { background: rgba(59, 130, 246, 0.12); }
.officer-rank-badge { background: rgba(30, 64, 175, 0.4) !important; color: #93c5fd !important; font-weight: 700; }
.empty-state { text-align: center; color: #94a3b8; padding: 30px; font-style: italic; }

@media (max-width: 900px) {
    .cad-header { flex-direction: column; align-items: flex-start; }
    .cad-layout-grid { grid-template-columns: 1fr; }
    .dossier-header { flex-direction: column; align-items: flex-start; }
    .dossier-fast-actions { width: 100%; }
}


/* ---------------------------------------------------------------- classi del CAD senza stile */

.badge.red { color: #fca5a5; border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.14); }
.badge.green { color: #86efac; border-color: rgba(34, 197, 94, 0.45); background: rgba(34, 197, 94, 0.12); }
.badge.yellow { color: #fcd34d; border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.12); }
.badge.blue { color: #93c5fd; border-color: rgba(96, 165, 250, 0.45); background: rgba(59, 130, 246, 0.14); }
.badge.small { font-size: 0.68rem; padding: 2px 8px; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }

.panel-title.red { color: #fca5a5; }
.panel-danger { border-color: rgba(239, 68, 68, 0.35); border-left: 4px solid #ef4444; }

.status-indicator { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #64748b; }
.status-indicator.online { background: #22c55e; box-shadow: 0 0 10px #22c55e; animation: pulse 2s infinite; }

.table-link { color: #93c5fd; text-decoration: none; }
.table-link:hover { text-decoration: underline; }
.font-bold { font-weight: 800; }
.mt-2 { margin-top: 12px; }

.cad-alert-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cad-header-info { min-width: 0; }
.officer-star { line-height: 1; }
.police-star-badge { line-height: 1; }
.tab-icon { font-size: 1rem; line-height: 1; }
.search-badge { font-size: 1rem; }
.radar-mini-feed { display: grid; }
.radar-location { color: #93c5fd; font-size: 0.9rem; }
.radar-full-foot { flex-wrap: wrap; gap: 8px; }

.cad-empty-guide { padding: 36px 24px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.cad-empty-guide h3 { margin: 0; font-size: 1.15rem; color: #f8fafc; }
.cad-empty-guide p { margin: 0; max-width: 560px; }
.big-icon { font-size: 2.6rem; line-height: 1; }

.cad-form { display: grid; gap: 14px; }
.form-group { display: grid; gap: 6px; }
.form-group label { font-size: 0.82rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; }

/* le tendine aperte usano lo sfondo del sistema: senza questo il testo chiaro finisce su bianco */
select.cad-input option { background: #0b1020; color: #f8fafc; }
textarea.cad-input { resize: vertical; min-height: 80px; }
.cad-input::placeholder, .field input::placeholder, .field textarea::placeholder { color: #64748b; }

.wanted-card { display: flex; flex-direction: column; gap: 8px; }
.wanted-card p { margin: 0; }
.wanted-actions { flex-wrap: wrap; }
.cad-panel-head { flex-wrap: wrap; }
.cad-panel-head h2 { flex: 1 1 220px; min-width: 0; }
.penal-header { flex-wrap: wrap; }

/* le colonne delle griglie possono restringersi: senza min-width 0 una tabella larga allarga la colonna e la pagina */
.grid-2 > *, .cad-main-col > *, .cad-side-col > *, .cad-layout-grid > *, .dossier-grid > *, .hero-char > * { min-width: 0; }
.cad-layout-grid { grid-template-columns: minmax(0, 1fr) 360px; }
.dossier-grid { grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }
.radar-feed-grid { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.wanted-grid { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.cad-stats-strip { grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); }
.kv dd { overflow-wrap: anywhere; }

@media (max-width: 900px) {
    .cad-layout-grid { grid-template-columns: minmax(0, 1fr); }
    .cad-officer-badge { width: 100%; }
}

/* ---------------------------------------------------------------- telefono */

@media (max-width: 620px) {
    .page { width: calc(100% - 24px); margin: 22px auto 40px; gap: 16px; }
    .cad-page { padding: 4px 0 40px; }

    .panel { padding: 18px 16px; }
    .stats { gap: 10px; }
    .stat { padding: 14px 14px; }
    .stat-label { font-size: 0.7rem; letter-spacing: 0.08em; }
    .stat-value { font-size: 1.3rem; overflow-wrap: anywhere; }
    .small-value { font-size: 1.1rem; }

    .section-head { flex-wrap: wrap; }
    .table { font-size: 0.86rem; }
    .table th, .table td { padding-left: 8px; padding-right: 8px; }
    .table th, .table td.mono, .table td .tag, .table td .badge { white-space: nowrap; }
    .table-wrap { margin: 0 -4px; padding: 0 4px; -webkit-overflow-scrolling: touch; }

    /* sotto i 16px iOS ingrandisce la pagina quando si tocca un campo */
    .field input, .field select, .field textarea, .cad-input { font-size: 16px; }
    .btn { min-height: 44px; }
    .btn.small { min-height: 38px; }

    .login-wrap { min-height: 100svh; padding: 16px 12px 60px; }
    .login-card { padding: 26px 20px 22px; }
    body.scene-login .footer { position: static; }

    .hero-cta .btn { flex: 1 1 100%; }
    .cta-final { padding: 26px 18px; }

    .access-list li { grid-template-columns: auto 1fr; }
    .access-list li > :last-child { grid-column: 1 / -1; }

    /* banner polizia in dashboard: in colonna */
    .police-banner { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 16px; margin: 4px 0 8px; border-left-width: 4px; }
    .police-banner-icon { width: 48px; height: 48px; font-size: 1.6rem; }
    .police-banner-content h3 { font-size: 1.15rem; }
    .police-cta-btn { text-align: center; white-space: normal; }

    /* intestazione CAD compatta */
    .cad-header { padding: 18px 16px; gap: 16px; margin-bottom: 16px; }
    .cad-header-left { gap: 14px; }
    .cad-badge-shield { width: 52px; height: 52px; }
    .cad-title { font-size: 1.4rem; }
    .cad-sys-label { font-size: 0.64rem; letter-spacing: 0.1em; }
    .cad-officer-badge { padding: 10px 14px; }

    /* schede CAD: una riga che scorre */
    .cad-tabs {
        flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
        padding: 6px; margin-bottom: 16px; gap: 6px;
    }
    .cad-tabs::-webkit-scrollbar { display: none; }
    .cad-tab { flex: none; white-space: nowrap; padding: 9px 12px; font-size: 0.84rem; }

    .cad-stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
    .stat-pill { padding: 12px; gap: 4px 8px; flex-wrap: wrap; align-items: center; }
    .stat-pill strong { flex-basis: 100%; }
    .stat-pill strong { font-size: 0.85rem; }
    .pill-dot { width: 8px; height: 8px; }
    .pill-title { font-size: 0.66rem; }

    .cad-layout-grid, .cad-main-col, .cad-side-col, .citizen-dossier, .dossier-grid { gap: 16px; }
    .cad-panel-head h2 { font-size: 1.05rem; }
    .cad-quick-actions .btn { flex: 1 1 100%; }

    .cad-search-box { padding: 16px; margin-bottom: 16px; }
    .search-label { font-size: 0.74rem; align-items: flex-start; }
    .search-row { flex-direction: column; }

    .dossier-header { padding: 18px 16px; border-left-width: 4px; }
    .dossier-left { gap: 14px; }
    .dossier-avatar { width: 52px; height: 52px; font-size: 1.6rem; }
    .dossier-name { font-size: 1.4rem; overflow-wrap: anywhere; }
    .dossier-fast-actions .btn { flex: 1 1 100%; }

    .modal-card { padding: 18px 16px; }
    .modal-card .form-row .btn { width: 100%; }

    .code-quick-grid { grid-template-columns: 1fr 1fr; }
    .lockout-meta { flex-direction: column; gap: 6px; }
    .police-lockout { padding: 28px 18px; margin: 24px auto; }
}

/* sui telefoni la sfocatura dei pannelli e' costosa: la riduco */
@media (max-width: 620px), (pointer: coarse) {
    .glass { backdrop-filter: blur(10px) saturate(130%); -webkit-backdrop-filter: blur(10px) saturate(130%); }
}
