/* Regolamento LSPD - stesso stile del sito LSPD (blu notte + oro) */
:root {
  --bg: #050912;
  --bg2: #0a1226;
  --panel: rgba(13, 22, 46, .72);
  --panel2: rgba(20, 32, 64, .6);
  --line: rgba(224, 178, 90, .18);
  --line2: rgba(255, 255, 255, .07);
  --gold: #e0b25a;
  --gold2: #f8dc95;
  --gold3: #a8742a;
  --blue: #2f6bff;
  --red: #ff2d4a;
  --text: #e9edf7;
  --muted: #8f9ab6;
  --radius: 16px;
  --head: 'Chakra Petch', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --gold-grad: linear-gradient(180deg, var(--gold2) 0%, var(--gold) 45%, var(--gold3) 100%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 50% -200px, rgba(47, 107, 255, .16), transparent 70%),
    radial-gradient(900px 500px at 100% 30%, rgba(224, 178, 90, .06), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
b { color: #fff; font-weight: 600; }
em { font-style: normal; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
::selection { background: rgba(224, 178, 90, .35); }

.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(var(--line2) 1px, transparent 1px),
    linear-gradient(90deg, var(--line2) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}

.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; background: transparent; }
.progress i { display: block; height: 100%; width: 0; background: var(--gold-grad); box-shadow: 0 0 12px var(--gold); }

/* ============================================================ hero */
.hero { position: relative; text-align: center; padding: 64px 20px 40px; max-width: 900px; margin: 0 auto; }
.lightbar { position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: flex; gap: 120px; }
.lightbar i { width: 140px; height: 3px; border-radius: 3px; }
.lightbar i:first-child { background: var(--red); box-shadow: 0 0 18px 4px var(--red); animation: flashA 1.6s infinite; }
.lightbar i:last-child { background: var(--blue); box-shadow: 0 0 18px 4px var(--blue); animation: flashB 1.6s infinite; }
@keyframes flashA { 0%, 45% { opacity: 1; } 50%, 100% { opacity: .15; } }
@keyframes flashB { 0%, 45% { opacity: .15; } 50%, 100% { opacity: 1; } }
.hero-logo { width: 200px; height: 200px; margin: 0 auto 18px; object-fit: contain; filter: drop-shadow(0 18px 40px rgba(224, 178, 90, .25)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.kicker { font: 600 12px/1 var(--body); letter-spacing: .28em; text-transform: uppercase; color: var(--gold); margin: 0 0 12px; }
h1 { font: 700 clamp(40px, 7vw, 68px)/1 var(--head); margin: 0 0 16px; letter-spacing: .02em; text-transform: uppercase; }
.lead { color: var(--muted); margin: 0 auto 28px; max-width: 620px; }
.updated { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

.search {
  position: relative; display: flex; align-items: center; gap: 10px; max-width: 620px; margin: 0 auto;
  padding: 0 16px; height: 56px; border-radius: 14px;
  background: rgba(10, 18, 38, .9); border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: rgba(224, 178, 90, .6); box-shadow: 0 16px 40px rgba(0, 0, 0, .35), 0 0 0 4px rgba(224, 178, 90, .12); }
.search svg { width: 20px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--text); font: 500 16px var(--body); }
.search input::placeholder { color: #66708c; }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }
.qcount { font-size: 12px; color: var(--gold); white-space: nowrap; }
.search kbd { font: 600 12px var(--body); color: var(--muted); border: 1px solid var(--line2); border-radius: 6px; padding: 2px 8px; }

/* ============================================================ layout */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 36px; max-width: 1240px; margin: 0 auto; padding: 0 24px 60px; }
.toc {
  position: sticky; top: 20px; align-self: start; max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 18px 10px 18px 16px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line2);
  scrollbar-width: thin; scrollbar-color: rgba(224, 178, 90, .3) transparent;
}
.toc h4 { font: 600 11px/1 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin: 16px 8px 8px; }
.toc h4:first-child { margin-top: 2px; }
.toc a {
  display: block; padding: 6px 10px; border-radius: 8px; font-size: 14px; line-height: 1.35;
  color: var(--muted); text-decoration: none; border-left: 2px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.toc a:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.toc a.active { color: #fff; background: rgba(224, 178, 90, .1); border-left-color: var(--gold); }
.toc a.dim { opacity: .3; }
.toc-toggle { display: none; }

/* ============================================================ chapters */
main { min-width: 0; }
.chapter {
  position: relative; margin: 0 0 28px; padding: 30px 32px 28px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 32, 64, .55), rgba(10, 18, 38, .55));
  border: 1px solid var(--line2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
.chapter::before { content: ''; position: absolute; left: 32px; top: 0; width: 64px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold-grad); }
.chapter h2 {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font: 700 26px/1.2 var(--head); text-transform: uppercase; letter-spacing: .03em; margin: 0 0 16px;
}
.chapter h2 small { font: 500 14px var(--body); color: var(--muted); text-transform: none; letter-spacing: 0; }
.anchor {
  margin-left: auto; border: 1px solid var(--line2); background: rgba(255, 255, 255, .03); color: var(--muted);
  border-radius: 8px; height: 30px; padding: 0 10px; font: 500 12px var(--body); cursor: pointer; transition: color .15s, border-color .15s;
}
.anchor:hover { color: var(--gold2); border-color: var(--line); }
.chapter p { margin: 0 0 12px; }
.chapter > p { color: #cfd6e8; }
h3.tier { font: 600 15px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 26px 0 12px; }
.note { padding: 12px 16px; border-radius: 12px; background: rgba(47, 107, 255, .08); border: 1px solid rgba(47, 107, 255, .25); color: #cfd8ff; font-size: 15px; }
.note.warn { background: rgba(255, 45, 74, .08); border-color: rgba(255, 45, 74, .3); color: #ffd2d8; }

ol.rules { list-style: none; margin: 0; padding: 0; counter-reset: none; }
ol.rules > li { position: relative; padding: 12px 14px 12px 56px; margin: 0 0 8px; border-radius: 12px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line2); }
ol.rules > li::before {
  content: attr(data-n); position: absolute; left: 14px; top: 12px; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; font: 700 14px var(--head); color: #1a1205; background: var(--gold-grad);
}
ol.rules ul, .card ul, ul.list { margin: 6px 0 0; padding-left: 20px; }
.card ul li, ul.list li, ol.rules ul li { margin: 4px 0; }
ul.list li::marker, .card ul li::marker, ol.rules ul li::marker { color: var(--gold); }

ol.steps { counter-reset: s; list-style: none; margin: 0 0 8px; padding: 0; }
ol.steps > li { counter-increment: s; position: relative; padding: 8px 0 8px 42px; }
ol.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 7px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font: 700 13px var(--head); color: var(--gold2); border: 1px solid rgba(224, 178, 90, .5);
}

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { padding: 18px 18px 14px; border-radius: 14px; background: rgba(5, 9, 18, .55); border: 1px solid var(--line2); transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--line); transform: translateY(-2px); }
.card h3 { display: flex; align-items: center; gap: 8px; font: 600 17px/1.25 var(--head); margin: 0 0 10px; color: var(--gold2); }
.card p { font-size: 15px; color: #cfd6e8; }
.card.alert { border-color: rgba(255, 45, 74, .35); background: linear-gradient(180deg, rgba(255, 45, 74, .08), rgba(5, 9, 18, .55)); }
.card.alert h3 { color: #ff8f9e; }
.card .apply { padding-top: 10px; border-top: 1px dashed var(--line2); }
.tag { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 8px; border-radius: 7px; font: 700 13px var(--head); color: #1a1205; background: var(--gold-grad); }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: 14px; }
dl.facts dt { color: var(--gold); font-weight: 600; }
dl.facts dd { margin: 0; color: #dfe5f3; }

.ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.rank { padding: 16px 18px; border-radius: 14px; background: rgba(5, 9, 18, .55); border: 1px solid var(--line2); }
.rank h4 { font: 700 18px var(--head); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rank ul { margin: 0; padding-left: 18px; font-size: 14.5px; color: #cfd6e8; }
.rank li { margin: 4px 0; }
.rank li::marker { color: var(--gold); }

blockquote.quote {
  position: relative; margin: 6px 0 14px; padding: 18px 20px 18px 22px; border-radius: 12px;
  background: rgba(224, 178, 90, .07); border-left: 3px solid var(--gold); font-size: 16px; font-style: italic; color: #fff;
}
.copy-quote { display: block; margin-top: 10px; font: 600 12px var(--body); color: var(--gold2); background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-style: normal; }
.copy-quote:hover { background: rgba(224, 178, 90, .12); }

.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.code { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(5, 9, 18, .55); border: 1px solid var(--line2); font-size: 14.5px; }
.code b { flex: none; min-width: 64px; text-align: center; padding: 4px 8px; border-radius: 7px; font: 700 14px var(--head); color: var(--gold2); background: rgba(224, 178, 90, .1); border: 1px solid var(--line); }
.code.hot b { color: #ffb3bd; background: rgba(255, 45, 74, .12); border-color: rgba(255, 45, 74, .35); }

.vehicles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.veh { padding: 14px 16px; border-radius: 12px; background: rgba(5, 9, 18, .55); border: 1px solid var(--line2); font-size: 14.5px; }
.veh b { display: block; font: 700 17px var(--head); color: var(--gold2); margin-bottom: 4px; }
.veh.gold { border-color: var(--line); background: linear-gradient(180deg, rgba(224, 178, 90, .1), rgba(5, 9, 18, .55)); }

.icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.ico { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: 12px; background: rgba(5, 9, 18, .55); border: 1px solid var(--line2); font-size: 14.5px; }
.ico img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
.ico.wide { grid-column: 1 / -1; }
.ico.wide img { width: 210px; height: 52px; object-fit: contain; border-radius: 8px; }
.oro { color: var(--gold2) !important; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.sw { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(5, 9, 18, .55); border: 1px solid var(--line2); font-size: 14.5px; }
.sw i { flex: none; width: 34px; height: 34px; border-radius: 9px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25), 0 0 16px rgba(255, 255, 255, .08); }

.defcon { display: grid; gap: 8px; margin-bottom: 14px; }
.dc { display: flex; gap: 16px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: rgba(5, 9, 18, .55); border: 1px solid var(--line2); }
.dc b { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; font: 700 13px var(--head); line-height: 1; color: #fff; }
.dc b::before { content: 'DEFCON'; display: block; font-size: 8px; letter-spacing: .14em; opacity: .85; margin-bottom: -10px; }
.dc b { font-size: 24px; flex-direction: column; }
.dc p { margin: 0; font-size: 15px; color: #dfe5f3; }
.d5 b { background: #2a7b4f; } .d4 b { background: #2f6bff; } .d3 b { background: #c9a227; color: #1a1205; } .d2 b { background: #e0701e; } .d1 b { background: #d7263d; box-shadow: 0 0 22px rgba(215, 38, 61, .55); }
.d1 { border-color: rgba(215, 38, 61, .45); }

.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line2); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 620px; }
.table th { text-align: left; font: 600 12px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); padding: 12px 14px; background: rgba(224, 178, 90, .07); }
.table td { padding: 12px 14px; border-top: 1px solid var(--line2); vertical-align: top; color: #dfe5f3; }
.table td:first-child { font: 600 15px var(--head); color: #fff; white-space: nowrap; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font: 700 12px var(--head); margin: 0 2px; }
.pill.a { background: rgba(215, 38, 61, .2); color: #ff9aa6; } .pill.b { background: rgba(224, 112, 30, .2); color: #ffbf8f; } .pill.c { background: rgba(201, 162, 39, .2); color: #f5d77a; }

ol.timeline { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; counter-reset: t; }
ol.timeline li { counter-increment: t; position: relative; padding: 16px; border-radius: 12px; background: rgba(5, 9, 18, .55); border: 1px solid var(--line2); }
ol.timeline li::before { content: counter(t); position: absolute; right: 12px; top: 8px; font: 700 28px var(--head); color: rgba(224, 178, 90, .2); }
ol.timeline b { display: block; font: 600 15px var(--head); color: var(--gold2); margin-bottom: 4px; }
ol.timeline span { font-size: 14.5px; color: #cfd6e8; }

.prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.price { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px; border-radius: 12px; background: rgba(5, 9, 18, .55); border: 1px solid var(--line); }
.price b { font: 700 20px var(--head); background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ============================================================ search */
mark { background: rgba(224, 178, 90, .38); color: #fff; border-radius: 3px; padding: 0 1px; }
.chapter.hide { display: none; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ============================================================ footer, toast */
.foot { text-align: center; padding: 30px 20px 50px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line2); }
.foot img { width: 56px; height: 56px; margin: 0 auto 8px; opacity: .85; }
.foot p { margin: 0 0 8px; }
.foot .top { color: var(--gold); text-decoration: none; }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60;
  padding: 10px 18px; border-radius: 10px; background: #0d1630; border: 1px solid var(--line); color: var(--gold2); font-size: 14px;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================ mobile */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; padding: 0 14px 40px; }
  .toc {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); max-height: none; z-index: 40; border-radius: 0 16px 16px 0;
    transform: translateX(-105%); transition: transform .25s ease; background: #0a1226;
  }
  .toc.open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .6); }
  .toc-toggle {
    display: inline-flex; align-items: center; gap: 8px; position: fixed; right: 14px; bottom: 16px; z-index: 45;
    height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: #0d1630; color: var(--gold2);
    font: 600 14px var(--body); box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  }
  .toc-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  .chapter { padding: 24px 18px 20px; }
  .chapter::before { left: 18px; }
  .chapter h2 { font-size: 21px; }
  .hero { padding-top: 48px; }
  .hero-logo { width: 150px; height: 150px; }
  .search kbd { display: none; }
  .lightbar { gap: 60px; } .lightbar i { width: 90px; }
}

@media print {
  body { background: #fff; color: #000; }
  .bg-grid, .progress, .search, .toc, .toc-toggle, .anchor, .copy-quote, .lightbar, .toast, .foot .top { display: none !important; }
  .layout { display: block; padding: 0; }
  .chapter { break-inside: avoid-page; background: none; border: 1px solid #ccc; box-shadow: none; }
  .chapter h2, .rank h4, .price b, em { color: #000 !important; background: none !important; -webkit-text-fill-color: #000; }
  .card, .rank, .code, .veh, .ico, .sw, .dc, .price, ol.rules > li { background: none !important; border-color: #ccc !important; }
  .chapter p, .card p, dl.facts dd, .rank ul, .table td { color: #222 !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
