:root {
  --bg: #0e1116;
  --bg2: #161b23;
  --panel: #1b222c;
  --panel2: #212a36;
  --line: #2c3644;
  --text: #e7ecf3;
  --muted: #93a1b3;
  --gold: #e5b567;
  --gold2: #caa04a;
  --green: #3fb27f;
  --green-bg: #12351f;
  --red: #e0645e;
  --blue: #5b8def;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1a2230, var(--bg)) fixed;
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--gold); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 20px 16px 60px; }

header.top {
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--line); padding: 14px 16px; background: rgba(14,17,22,.7);
  position: sticky; top: 0; backdrop-filter: blur(6px); z-index: 10;
}
header.top .crown { font-size: 26px; }
header.top h1 { font-size: 18px; margin: 0; letter-spacing: .3px; }
header.top h1 small { color: var(--gold); font-weight: 600; }
header.top .spacer { flex: 1; }
header.top .who { color: var(--muted); font-size: 14px; }
/* i comandi dell'intestazione non si stringono sotto al proprio testo */
header.top .btn, header.top a.btn, header.top .lang { flex: 0 0 auto; }
header.top .hdr-title { min-width: 0; }
header.top .who b { color: var(--text); }

.btn {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600;
  transition: .12s;
}
.btn:hover { border-color: var(--gold2); }
.btn.gold { background: linear-gradient(180deg, var(--gold), var(--gold2)); color: #2a1e05; border: none; }
.btn.gold:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #5a2b2b; color: var(--red); }
.btn.danger:hover { background: #2a1414; }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
h1 { font-size: 18px; }
h2 { font-size: 16px; }
h3 { font-size: 15px; font-weight: 800; margin: 0 0 10px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label.f { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px; font-size: 14px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill.king { background: #3a2d08; color: var(--gold); border: 1px solid var(--gold2); }
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.no { background: #2a1414; color: var(--red); }

/* tabs giorni */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.tab {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  background: var(--panel); min-width: 120px; text-align: center;
}
.tab.active { border-color: var(--gold); background: var(--panel2); box-shadow: 0 0 14px -6px rgba(229,181,103,.6), inset 0 -2px 0 var(--gold); }
.tab .d { font-weight: 800; font-size: 14px; }
.tab .t { font-size: 12px; color: var(--gold); }
.tab.nores .t { color: var(--muted); }

/* griglia slot */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.slot {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg2);
  display: flex; flex-direction: column; gap: 4px; min-height: 58px;
}
.slot .time { font-weight: 800; font-size: 13px; letter-spacing: .5px; }
.slot.free { border-style: dashed; }
.slot.free .who { color: var(--muted); font-size: 12px; }
.slot.taken { background: linear-gradient(180deg, #14261c, var(--bg2)); border-color: #285138; border-left: 3px solid var(--green); }
.slot.done { background: linear-gradient(180deg, #2a2410, var(--bg2)); border-color: var(--gold2); border-left: 3px solid var(--gold); }
.slot .who { font-size: 12.5px; }
.slot .who b { color: var(--text); }
.slot .sub { font-size: 11px; color: var(--muted); }
.slot .actions { display: flex; gap: 6px; margin-top: 2px; }

.banner { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.banner.info { background: #10202e; border: 1px solid #1d3a52; color: #bcdcf5; }
.banner.warn { background: #2a2410; border: 1px solid var(--gold2); color: #f2dca0; }

/* modale */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-bg.open { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; width: 420px; max-width: 100%; box-shadow: var(--shadow);
  max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; }
.modal h3 { margin: 0 0 4px; }
/* pulsanti azione SEMPRE raggiungibili: barra fissa in fondo alla modale (niente
   margini negativi: romperebbero position:sticky) */
.modal-actions { position: sticky; bottom: 0; z-index: 2; background: var(--panel);
  margin-top: 16px; padding: 12px 0 2px;
  box-shadow: 0 -14px 16px -8px var(--panel), 0 -1px 0 var(--line); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
tr:hover td { background: rgba(255,255,255,.02); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 100; opacity: 0; transition: .2s; }
.toast.show { opacity: 1; }
.toast.err { border-color: var(--red); }
.hidden { display: none !important; }
.small { font-size: 12px; }

/* ---- auth ---- */
.auth-wrap { max-width: 440px; margin: 40px auto; }
.btn.block { width: 100%; justify-content: center; }
.link { background: none; border: none; color: var(--gold); cursor: pointer; font-size: 13px; padding: 0; }
.err-text { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }
.ok-text { color: var(--green); font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.spinner { display:inline-block; width:16px; height:16px; border:2px solid var(--line); border-top-color: var(--gold); border-radius:50%; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ mobile-first ============ */
.lang { width: auto; min-width: 92px; padding: 6px 8px; font-size: 13px; background: var(--panel2); }
.btn.big { min-height: 50px; font-size: 16px; }
.card.compact { padding: 12px 14px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }

/* liste (giocatori/prenotazioni) come schede */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg2); }
.item-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.slot-t { font-size: 15px; letter-spacing: .5px; min-width: 46px; }

/* editor giorni */
.day-row { display: grid; grid-template-columns: 70px 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.day-lbl { font-weight: 700; font-size: 13px; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.chk input { width: auto; }

/* tab giorni scrollabili in orizzontale */
.tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: thin; }
.tab { flex: 0 0 auto; min-width: 104px; }

/* tocco comodo */
.btn { min-height: 40px; }
.btn.sm { min-height: 32px; }
input, select, textarea { font-size: 16px; } /* evita lo zoom automatico iOS */

@media (max-width: 640px) {
  /* tasti più comodi da toccare col pollice (≈44px) — override deliberato delle utility base */
  .btn.sm { min-height: 44px !important; padding: 8px 14px; }
  .tz-btn { min-height: 44px !important; }
  .time-jump .tj { min-height: 44px !important; }
  .mb-chip { min-height: 40px !important; }
  .lang { min-height: 44px !important; }
  /* mancavano proprio i campi da compilare: Player ID e password stavano a 38-40px */
  input, select, textarea { min-height: 44px; }
  .wrap { padding: 12px 12px 80px; }
  header.top { padding: 10px 12px; gap: 8px; }
  header.top h1 { font-size: 15px; }
  .card { padding: 14px; border-radius: 12px; }
  .grid2 { grid-template-columns: 1fr; }
  .slots { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .day-row { grid-template-columns: 1fr 1fr; grid-template-areas: "lbl lbl" "title desc" "chk chk"; }
  .day-row .day-lbl { grid-area: lbl; }
  /* modale come foglio dal basso, con maniglia e spazio per la gesture bar */
  .modal-bg { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; max-height: 88vh; max-height: 88dvh; overflow-y: auto; }
  .modal-actions { padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px)); }
  .modal::before { content: ""; display: block; width: 44px; height: 4px; border-radius: 99px;
    background: var(--line); margin: -6px auto 12px; position: sticky; top: -4px; }
  header.top { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
}
@media (min-width: 641px) {
  header.top h1 { font-size: 18px; }
  .slots { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* dashboard Re */
.king-row { display: flex; align-items: stretch; gap: 8px; justify-content: space-between; flex-wrap: wrap; position: relative;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); overflow: hidden; border-left: 3px solid #2e6b4b; }
.king-row.done { border-color: var(--gold2); background: linear-gradient(180deg, #2a2410, var(--bg2)); border-left-color: var(--gold); }
.king-copy { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex: 1; min-width: 0; }
.king-row.copyable .king-copy { cursor: pointer; }
.king-row.copyable .king-copy:hover, .king-row.copyable .king-copy:active { background: rgba(229,181,103,.10); }
.king-time { font-size: 20px; font-weight: 800; letter-spacing: .5px; min-width: 58px; color: var(--gold); }
.king-pid { font-size: 13px; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.king-row.copyable .king-pid { color: var(--text); }
.king-actions { display: flex; gap: 6px; align-items: center; padding: 8px 10px; }

/* ==== card giocatore ricca (usa i dati API) ==== */
.avatar-lg { width: 54px; height: 54px; border-radius: 14px; object-fit: cover; border: 1px solid var(--line); flex-shrink: 0; }
.big-name { font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); background: var(--bg2); color: var(--muted); white-space: nowrap; }
.chip.power { color: var(--gold); border-color: var(--gold2); }
.chip.tg { color: #7fd4ff; border-color: #2b5a72; background: #10222c; }
.chip.alliance { color: var(--text); }
.chip.ok { color: var(--green); border-color: #2b5a3a; background: var(--green-bg); }
.chip.kd { color: var(--text); }

/* badge TG e avatar negli slot / righe */
.tg-badge { display: inline-block; padding: 1px 6px; border-radius: 6px; font-size: 11px; font-weight: 800; background: #10222c; color: #7fd4ff; border: 1px solid #2b5a72; vertical-align: middle; }
.slot-av { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; vertical-align: middle; border: 1px solid var(--line); margin-right: 5px; }
.king-av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); flex-shrink: 0; }
.slot .who { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }

.av-wrap.sm .avatar, .av-wrap.sm .av-ph { width: 34px; height: 34px; }
.av-ph { display: inline-flex; align-items: center; justify-content: center; background: var(--panel2);
  color: var(--muted); font-weight: 800; border-radius: 50%; border: 1px solid var(--line); text-transform: uppercase; }
.avatar-lg.av-ph { border-radius: 50%; font-size: 22px; }

/* =====================================================================
   WAR ROOM / TRANSFER TARGET  —  estetica "dossier tattico"
   ===================================================================== */
:root { --war: #e0645e; --war2: #ff8a84; }

/* ---- header di guerra: griglia + bagliore rosso + radar sull'emblema ---- */
header.top.warroom {
  background:
    linear-gradient(90deg, rgba(224,100,94,.22), rgba(14,17,22,.72) 52%),
    repeating-linear-gradient(90deg, rgba(224,100,94,.045) 0 1px, transparent 1px 7px);
  border-bottom-color: #5a2b2b;
  box-shadow: 0 1px 0 rgba(224,100,94,.25), 0 10px 24px -18px rgba(224,100,94,.7);
}
header.top.warroom .crown { font-size: 27px; filter: drop-shadow(0 0 10px rgba(224,100,94,.7)); position: relative; }
header.top.warroom .crown::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 1.5px solid rgba(224,100,94,.55); animation: radarPulse 2.6s ease-out infinite;
}
@keyframes radarPulse { 0% { transform: scale(.55); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
.hdr-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
@media (max-width: 560px) { .hdr-tag { display: none; } }
.hdr-tag { font-size: 11px; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header.top.warroom h1 small { color: var(--war2); }

/* ---- pagina Manager (accento blu, per distinguerla dalla war room) ---- */
header.top.manager {
  background:
    linear-gradient(90deg, rgba(91,141,239,.20), rgba(14,17,22,.72) 52%),
    repeating-linear-gradient(90deg, rgba(91,141,239,.05) 0 1px, transparent 1px 7px);
  border-bottom-color: #2b4a72;
  box-shadow: 0 1px 0 rgba(91,141,239,.25), 0 10px 24px -18px rgba(91,141,239,.7);
}
header.top.manager .crown { filter: drop-shadow(0 0 10px rgba(91,141,239,.7)); }
header.top.manager h1 small { color: #8fb4ff; }
.manager-page .tab.active { border-color: var(--blue); box-shadow: 0 0 14px -6px rgba(91,141,239,.7), inset 0 -2px 0 var(--blue); }
.manager-page .tab .t { color: #8fb4ff; }
.gate-card.mgr { border-color: #2b4a72;
  background: radial-gradient(120% 90% at 50% -20%, rgba(91,141,239,.16), transparent 62%), var(--panel); }
.gate-card.mgr::before, .gate-card.mgr::after { border-color: rgba(91,141,239,.5); }
.gate-card.mgr .gate-emblem { filter: drop-shadow(0 0 16px rgba(91,141,239,.6)); }
.gate-card.mgr .gate-emblem::before, .gate-card.mgr .gate-emblem::after { border-color: rgba(91,141,239,.45); }
.gate-card.mgr .gate-badge { color: #bcd3ff; background: rgba(91,141,239,.14); border-color: rgba(91,141,239,.42); }
.gate-card.mgr input { letter-spacing: normal; text-align: left; }
.gate-card.mgr label.f, .gate-card.mgr .err-text { text-align: left; }
.gate-card.mgr input:focus { border-color: var(--blue); box-shadow: 0 0 14px -3px rgba(91,141,239,.6); }
.mgr-row .king-actions { flex-wrap: wrap; justify-content: flex-end; }
.mgr-row.free { opacity: .82; }

/* ═══════════════════ KvK Room (confronto NOI vs avversario) ═══════════════════
   Tutto qui dentro è ESCLUSIVO della KvK Room (.kvk-page / classi .kvk-* .kdp-* .pvp-*).
   ATTENZIONE: `.kvk-bar` (barra countdown del portale giocatori) sta più in basso nel
   file e NON c'entra nulla con questo blocco. */
/* I due colori del confronto. Stanno alla radice perche' confrontare due cose
   succede in piu' posti: i regni nella KvK Room, due giocatori in Insights. */
:root { --us: #5b8def; --us2: #8fb4ff; --them: #e0645e; --them2: #ff8a84; }
.kvk-page header.top .btn, .kvk-page header.top a.btn { white-space: nowrap; }
.kvk-page .wrap { max-width: 1180px; }
.kvk-page .card + .card { margin-top: 14px; }

/* ---- console: due modalità (confronto regni / duello fra giocatori) ---- */
.kvk-console { padding: 14px 16px 16px; }
.kvk-modes { display: flex; gap: 4px; padding: 4px; margin: -4px -4px 14px; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 12px; }
.kvk-mode { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 12px; border-radius: 9px; border: 1px solid transparent; background: transparent;
  color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 800; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s; }
.kvk-mode:hover { color: var(--text); }
.kvk-mode.on { background: linear-gradient(180deg, var(--panel2), var(--panel)); color: var(--text);
  border-color: var(--gold2); box-shadow: 0 2px 10px -4px rgba(229,181,103,.6); }
.kvk-mode .km-ico { font-size: 15px; }
.kvk-mp { animation: kvkFade .22s ease both; }
@keyframes kvkFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.kvk-search { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.kvk-search .kvk-field { width: 200px; flex: 0 1 auto; min-width: 0; }
.kvk-search .kvk-field label.f { margin-top: 0; }
.kvk-search .kvk-field input { font-size: 18px; font-weight: 800; letter-spacing: 1.5px; text-align: center; }
.kvk-search .btn { min-height: 44px; white-space: nowrap; }
.kvk-search .btn.gold { padding-inline: 26px; font-size: 15px; }
.kvk-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid var(--line); }

/* riga "il tuo regno": chip di statistica invece di una riga di testo minuscola */
.kvk-mine { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.kvk-mine .kmi, .cb-sum .kmi { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: var(--bg2); border: 1px solid var(--line); font-size: 12px; }
.kvk-mine .kmi span, .cb-sum .kmi span { color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-size: 10px; font-weight: 800; }
.kvk-mine .kmi b, .cb-sum .kmi b { font-weight: 900; font-variant-numeric: tabular-nums; }
.kvk-mine .kmi.hi, .cb-sum .kmi.hi { border-color: rgba(91,141,239,.45); background: rgba(91,141,239,.10); }
.kvk-mine .kmi.hi b, .cb-sum .kmi.hi b { color: var(--us2); }

/* scout rivali */
.kvk-rivals { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.kvk-rival { cursor: pointer; }

/* striscia KvK attuale */
.kvk-current { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  padding: 9px 14px; margin-bottom: 14px; border-radius: 12px; font-size: 12.5px;
  background: linear-gradient(180deg, rgba(224,100,94,.14), rgba(224,100,94,.05));
  border: 1px solid rgba(224,100,94,.32); color: #ffd7d4; }
.kvk-current .kc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--war, #c8433c);
  box-shadow: 0 0 8px var(--war, #c8433c); animation: livePulse 1.4s ease-in-out infinite; flex-shrink: 0; }
.kvk-current .kc-t { font-variant-numeric: tabular-nums; color: #fff; }
.kvk-current .kc-sep { opacity: .45; }

/* ---- HERO: il verdetto, la cosa più importante della pagina ---- */
.kvk-hero { position: relative; overflow: hidden; padding: 0; border-radius: 16px;
  border: 1px solid var(--gold2); background: var(--panel);
  box-shadow: 0 10px 40px -18px rgba(0,0,0,.9), 0 0 30px -18px rgba(229,181,103,.7); }
.kvk-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(90% 130% at 0% 0%, rgba(91,141,239,.20), transparent 55%),
              radial-gradient(90% 130% at 100% 0%, rgba(224,100,94,.20), transparent 55%); }
.kvk-hero > * { position: relative; }
.kvk-hero-grid { display: grid; grid-template-columns: 1fr minmax(230px, 1.25fr) 1fr; align-items: stretch; }
.kh-side { padding: 20px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-align: center; min-width: 0; }
.kh-side.us { background: linear-gradient(180deg, rgba(91,141,239,.10), transparent); }
.kh-side.them { background: linear-gradient(180deg, rgba(224,100,94,.10), transparent); }
.kh-kid { font-size: 22px; font-weight: 900; letter-spacing: .5px; }
.kh-tag { font-size: 10px; font-weight: 900; letter-spacing: 1.6px; text-transform: uppercase; }
.kh-side.us .kh-tag { color: var(--us2); } .kh-side.them .kh-tag { color: var(--them2); }
.kh-rating { font-size: 32px; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; margin-top: 6px; }
.kh-side.us .kh-rating { color: var(--us2); text-shadow: 0 0 22px rgba(91,141,239,.45); }
.kh-side.them .kh-rating { color: var(--them2); text-shadow: 0 0 22px rgba(224,100,94,.45); }
.kh-sub { font-size: 11px; color: var(--muted); font-weight: 700; }
.kh-form { margin-top: 8px; }

.kh-mid { padding: 18px 18px 20px; text-align: center; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0,0,0,.22), transparent); }
.kh-lbl { font-size: 10px; font-weight: 900; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.kh-odds { font-size: 54px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; margin: 2px 0 0; }
.kh-odds.us { color: var(--us2); text-shadow: 0 0 30px rgba(91,141,239,.5); }
.kh-odds.them { color: var(--them2); text-shadow: 0 0 30px rgba(224,100,94,.5); }
.kh-fav { font-size: 13px; font-weight: 900; letter-spacing: .4px; margin-bottom: 12px; }
.kh-fav.us { color: var(--us2); } .kh-fav.them { color: var(--them2); }
.kh-phases { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.kh-phases > div > span { display: block; font-size: 10px; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.kh-phases .kvk-prob { height: 18px; font-size: 10.5px; }
.kh-conf { margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.kh-conf .kvk-model { font-style: italic; opacity: .85; }
.kh-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 900;
  letter-spacing: .8px; text-transform: uppercase; border: 1px solid var(--line); background: var(--bg2); }
.kh-badge.high { color: var(--green); border-color: #2b5a3a; background: var(--green-bg); }
.kh-badge.med { color: var(--gold); border-color: var(--gold2); background: rgba(229,181,103,.10); }
.kh-badge.low { color: var(--muted); }

/* ---- barra di probabilità ---- */
.kvk-prob { display: flex; height: 30px; border-radius: 9px; overflow: hidden; background: var(--bg2);
  border: 1px solid var(--line); font-weight: 900; font-size: 12.5px; }
.kp-fill { display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.kp-fill.us { background: linear-gradient(180deg, #6f9bf2, #3f6fd8); color: #08132b; }
.kp-fill.them { background: linear-gradient(180deg, #e8807a, #cf514b); color: #2b0b09; }
.kvk-legend { display: flex; gap: 14px; justify-content: center; margin: 10px 0 2px; font-size: 12px; font-weight: 800; }
.kvk-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.kvk-legend .lg::before { content: ""; width: 11px; height: 11px; border-radius: 3px; }
.kvk-legend .lg.us { color: var(--us2); } .kvk-legend .lg.us::before { background: var(--us); }
.kvk-legend .lg.them { color: var(--them2); } .kvk-legend .lg.them::before { background: var(--them); }

/* ---- navigazione a schede del risultato ---- */
.kvk-tabs { display: flex; gap: 6px; margin: 14px 0; padding: 5px; overflow-x: auto; scrollbar-width: none;
  background: rgba(14,17,22,.92); border: 1px solid var(--line); border-radius: 12px;
  position: sticky; top: 54px; z-index: 6; backdrop-filter: blur(8px); }
.kvk-tabs::-webkit-scrollbar { display: none; }
.kvk-tabs button { flex: 1; white-space: nowrap; padding: 9px 14px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
  transition: background .15s, color .15s; }
.kvk-tabs button:hover { color: var(--text); background: var(--bg2); }
.kvk-tabs button.on { background: var(--panel2); color: var(--text); border-color: var(--gold2); }
.kvk-panel { display: none; }
.kvk-panel.on { display: block; animation: kvkFade .24s ease both; }
.kvk-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.kvk-grid2 > .card { margin-top: 0 !important; }

/* ---- titolo di sezione con filetto colorato ---- */
.card h2.kvk-h { display: flex; align-items: center; gap: 9px; }
.card h2.kvk-h::before { content: ""; width: 3px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold), var(--gold2)); flex-shrink: 0; }

/* ---- tabella comparativa ---- */
.kvk-cmp { width: 100%; border-collapse: collapse; margin-top: 10px; }
.kvk-cmp td { padding: 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.kvk-cmp tr:last-child td { border-bottom: none; }
.kvk-cmp tr:hover td { background: rgba(255,255,255,.02); }
.kvk-cmp .kc-a { text-align: left; font-weight: 800; width: 34%; }
.kvk-cmp .kc-b { text-align: right; font-weight: 800; width: 34%; }
.kvk-cmp .kc-l { text-align: center; color: var(--muted); font-size: 11.5px; }
.kvk-cmp .kc-a.win { color: var(--us2); } .kvk-cmp .kc-b.win { color: var(--them2); }
.kvk-cmp.mini td { font-size: 13px; }
/* le due teste del confronto fra giocatori: chi e' a sinistra e chi a destra */
/* "mettilo nel confronto" sta accanto al nome, dove uno decide */
.dt-vs { margin-left: auto; flex: 0 0 auto; white-space: nowrap; }
.kvs-heads { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 2px; }
.kvs-h { min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px;
  border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); }
.kvs-h.us { border-left: 3px solid var(--us); }
.kvs-h.them { border-left: 3px solid var(--them); text-align: right; }

/* ---- "perché": una barra divergente per fattore, molto più leggibile di una tabella ---- */
.kvk-facs { display: flex; flex-direction: column; gap: 11px; margin-top: 10px; }
.kfac-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; }
.kfac-l { color: var(--muted); font-weight: 700; text-align: center; flex: 1; min-width: 0; }
.kfac-v { font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.kfac-v.lead.us { color: var(--us2); } .kfac-v.lead.them { color: var(--them2); }
.kfac-bar { display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: var(--bg2);
  border: 1px solid var(--line); margin-top: 5px; }
.kfac-f { display: block; height: 100%; }
.kfac-f.us { background: linear-gradient(90deg, var(--us), var(--us2)); }
.kfac-f.them { background: linear-gradient(90deg, var(--them2), var(--them)); }

/* ---- scontri diretti ---- */
.kvk-h2h { display: flex; flex-direction: column; gap: 7px; }
.kvk-h2h-row { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 10px;
  background: var(--bg2); border: 1px solid var(--line); border-left-width: 3px; }
.kvk-h2h-row.w { border-left-color: var(--us); } .kvk-h2h-row.l { border-left-color: var(--them); }
.kvk-h2h-row .h2h-k { font-weight: 900; min-width: 62px; }
.kvk-h2h-row .h2h-r { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; }

/* ---- forma recente ---- */
.kvk-form { display: inline-block; width: 21px; height: 21px; line-height: 21px; text-align: center;
  border-radius: 6px; font-size: 11px; font-weight: 900; margin-right: 3px; }
.kvk-form.w { background: rgba(91,141,239,.16); color: var(--us2); border: 1px solid rgba(91,141,239,.45); }
.kvk-form.l { background: rgba(224,100,94,.14); color: var(--them2); border: 1px solid rgba(224,100,94,.42); }

/* ---- due colonne noi/loro ---- */
.kvk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.kvk-col-h { display: flex; align-items: center; gap: 7px; font-weight: 900; font-size: 12.5px; margin-bottom: 9px;
  padding-bottom: 7px; border-bottom: 1px solid var(--line); color: var(--us2); }
.kvk-col-h.them { color: var(--them2); }
.kvk-col-h::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--us); flex-shrink: 0; }
.kvk-col-h.them::before { background: var(--them); }

/* ---- barre Mystic (magnitudine dei punteggi) ---- */
.kvk-bars { display: flex; flex-direction: column; gap: 4px; }
.kb-row { display: grid; grid-template-columns: 22px minmax(64px, 1fr) minmax(60px, 1.4fr) auto;
  align-items: center; gap: 8px; font-size: 12px; padding: 3px 6px; border-radius: 7px; }
.kb-row:hover { background: var(--bg2); }
.kb-rk { color: var(--muted); font-weight: 800; font-size: 10.5px; font-variant-numeric: tabular-nums; text-align: right; }
.kb-name { min-width: 0; font-weight: 700; }
.kb-track { height: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.kb-fill { display: block; height: 100%; border-radius: 999px; }
.kb-fill.us { background: linear-gradient(90deg, #3f6fd8, var(--us2)); }
.kb-fill.them { background: linear-gradient(90deg, #cf514b, var(--them2)); }
.kb-val { white-space: nowrap; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 11px; }
.kb-val .kb-sc { color: #d9b3ff; } .kb-val .kb-pw { color: var(--gold); }
/* riga cliccabile (classifica bacino/mondo): stessa griglia, ma è un bottone */
button.kb-click { width: 100%; text-align: left; font: inherit; color: var(--text); background: transparent;
  border: 1px solid transparent; cursor: pointer; }
button.kb-click:hover { background: var(--bg2); border-color: var(--line); }
button.kb-click.mine { background: rgba(91,141,239,.10); border-color: rgba(91,141,239,.35); }

/* ---- duelli 1v1: contromosse + abbinamento ottimale ---- */
.kvk-ct-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 4px 0 8px; }
.kvk-ct-h .kvk-ct-t { font-weight: 800; color: var(--text); }
.kvk-counters { display: flex; flex-direction: column; gap: 6px; }
.kvk-ct-row { display: grid; grid-template-columns: 1fr 22px 1fr 78px; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line);
  border-left-width: 3px; border-left-color: var(--us); }
.kvk-ct-row.threat { border-left-color: var(--them); background: rgba(224,100,94,.07); }
.kvk-ct-arrow { color: var(--muted); font-weight: 900; text-align: center; }
.kvk-ct-enemy, .kvk-ct-ours { min-width: 0; font-size: 12.5px; display: flex; align-items: baseline; gap: 6px; }
.kvk-ct-enemy b, .kvk-ct-ours b { font-weight: 800; }
.kvk-ct-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; align-self: center; }
.kvk-ct-dot.us { background: var(--us); } .kvk-ct-dot.them { background: var(--them); }
.kvk-ct-p { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.kvk-ct-p b { font-weight: 900; font-variant-numeric: tabular-nums; font-size: 13px; }
.kvk-ct-p.w b { color: var(--us2); } .kvk-ct-p.l b { color: var(--them2); }
.kvk-ct-mini { width: 62px; height: 4px; border-radius: 999px; background: var(--bg); overflow: hidden; border: 1px solid var(--line); }
.kvk-ct-mini i { display: block; height: 100%; background: var(--us); }
.kvk-ct-p.l .kvk-ct-mini i { background: var(--them); }

/* ---- matrice duelli (heatmap) ---- */
.kvk-mtx-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg2); padding: 8px; }
.kvk-mtx { border-collapse: separate; border-spacing: 3px; margin: 0 auto; font-size: 12px; }
.kvk-mtx th { color: var(--muted); font-weight: 800; font-size: 10.5px; padding: 3px 6px; white-space: nowrap; }
.kvk-mtx thead th { color: var(--them2); }
.kvk-mtx tbody th { text-align: right; color: var(--us2); position: sticky; left: 0; background: var(--bg2); }
.kvk-mtx td { padding: 8px 10px; text-align: center; font-weight: 900; color: var(--text); border-radius: 6px;
  font-variant-numeric: tabular-nums; min-width: 34px; border: 1px solid rgba(255,255,255,.05); }
.kvk-mtx td:hover { outline: 1px solid var(--gold2); }

/* ---- alleanze nemiche ---- */
.kvk-ally { display: flex; flex-direction: column; gap: 6px; }
.kvk-ally-row { display: grid; grid-template-columns: 62px 1fr auto auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line);
  border-left: 3px solid var(--them); }
.kvk-ally-row b { font-weight: 900; }
.kvk-pl-score { color: #d9b3ff; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kvk-pl-pow { color: var(--gold); font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- intestazione "dossier" di un singolo regno ---- */
.kvk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kvk-head .kside { flex: 1; text-align: center; min-width: 0; }
.kvk-head .knum { font-weight: 900; font-size: 19px; letter-spacing: .3px; }
.kvk-head .kbadge { font-size: 10px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; color: var(--us2); }
.kvk-head .kbadge.them { color: var(--them2); }
.kvk-head .kscore { font-size: 27px; font-weight: 900; color: var(--gold); line-height: 1.1;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 16px rgba(229,181,103,.35); }
.kvk-head .kvs { font-size: 22px; opacity: .75; flex-shrink: 0; padding: 0 6px; }

/* ---- esploratore: classifica dei top regni ---- */
.kvk-top { display: flex; flex-direction: column; gap: 5px; }
.kvk-top-row { display: grid; grid-template-columns: 46px 62px 62px 1fr; align-items: center; gap: 10px; text-align: left;
  padding: 9px 12px; border-radius: 9px; background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  cursor: pointer; font: inherit; transition: border-color .12s, transform .12s; }
.kvk-top-row:hover { border-color: var(--gold2); transform: translateX(2px); }
.kvk-top-row .kt-rank { color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.kvk-top-row .kt-kid { font-weight: 900; }
.kvk-top-row .kt-rating { color: var(--gold); font-weight: 900; font-variant-numeric: tabular-nums; }

/* ---- radar ---- */
.kvk-radar { display: block; width: 100%; max-width: 320px; margin: 6px auto; height: auto; }
.kvk-radar .rad-grid { fill: none; stroke: var(--line); stroke-width: .6; }
.kvk-radar .rad-spoke { stroke: var(--line); stroke-width: .5; }
.kvk-radar .rad-lbl { fill: var(--muted); font-size: 8px; font-weight: 700; }
.kvk-radar .rad-us { fill: rgba(91,141,239,.30); stroke: var(--us); stroke-width: 1.6; }
.kvk-radar .rad-them { fill: rgba(224,100,94,.26); stroke: var(--them); stroke-width: 1.6; }

/* ---- PvP diretto ---- */
.pvp-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pvp-row { display: flex; gap: 6px; }
.pvp-row input:first-child { flex: 1; min-width: 0; }
.pvp-kid { width: 82px; flex-shrink: 0; text-align: center; }
.pvp-vs { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.pvp-side { flex: 1; text-align: center; padding: 14px 10px; border-radius: 12px; background: var(--bg2);
  border: 1px solid var(--line); min-width: 0; }
.pvp-side.us { border-color: rgba(91,141,239,.45); background: linear-gradient(180deg, rgba(91,141,239,.10), var(--bg2)); }
.pvp-side.them { border-color: rgba(224,100,94,.45); background: linear-gradient(180deg, rgba(224,100,94,.10), var(--bg2)); }
.pvp-side b { font-size: 15px; }
.pvp-side .pvp-stat { font-weight: 800; font-size: 13px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.pvp-vs .kvs { font-size: 22px; opacity: .8; flex-shrink: 0; }

/* ---- duello scelto: liste giocatori ricercabili + selezionabili ---- */
.kdp-wrap { margin-top: 6px; }
.kdp-search { width: 100%; margin-bottom: 7px; padding: 8px 11px; font-size: 13px; }
.kdp-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg2); padding: 4px; display: flex; flex-direction: column; gap: 2px; }
.kdp-row { display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 6px;
  width: 100%; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 6px 8px; cursor: pointer; color: var(--text); font-size: 12.5px; font-family: inherit; }
.kdp-row:hover { background: var(--panel2); border-color: var(--line); }
.kdp-row.sel { background: rgba(91,141,239,.16); border-color: var(--us); }
.kdp-list:has(.kdp-row.sel) .kdp-row:not(.sel) { opacity: .72; }
#kdpListThem .kdp-row.sel { background: rgba(224,100,94,.16); border-color: var(--them); }
.kdp-rank { color: var(--muted); font-weight: 800; font-size: 11px; }
.kdp-name { min-width: 0; font-weight: 700; }
.kdp-sc { color: #d9b3ff; font-weight: 800; white-space: nowrap; }
.kdp-pw { color: var(--gold); font-weight: 700; white-space: nowrap; font-size: 11.5px; }
.kdp-empty { padding: 10px; text-align: center; }
.kdp-result { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }

/* ---- verdetto testuale (riusato da PvP e duello scelto) ---- */
.kvk-verdict { text-align: center; font-size: 17px; font-weight: 900; letter-spacing: .3px; margin: 4px 0 10px; }
.kvk-verdict.us { color: var(--us2); } .kvk-verdict.them { color: var(--them2); }
.kvk-conf { margin-top: 10px; }
.kvk-model { font-style: italic; opacity: .85; }
.kvk-src { text-align: center; padding: 16px 0 4px; }

/* ---- stato vuoto: prima di analizzare qualcosa ---- */
.kvk-empty { text-align: center; padding: 34px 20px; }
.kvk-empty .ke-ico { font-size: 42px; opacity: .55; }
.kvk-empty h3 { margin: 10px 0 4px; font-size: 16px; }
.kvk-empty p { margin: 0; color: var(--muted); font-size: 13px; }

/* ---- scheletro di caricamento ---- */
.kvk-skel { display: flex; flex-direction: column; gap: 10px; }
.kvk-skel i { display: block; height: 13px; border-radius: 6px; background: linear-gradient(90deg, var(--bg2), var(--panel2), var(--bg2));
  background-size: 220% 100%; animation: kvkShimmer 1.2s linear infinite; }
.kvk-skel i:nth-child(1) { width: 42%; height: 22px; }
.kvk-skel i:nth-child(3) { width: 78%; } .kvk-skel i:nth-child(4) { width: 60%; }
@keyframes kvkShimmer { from { background-position: 120% 0; } to { background-position: -20% 0; } }

@media (max-width: 900px) {
  .kvk-grid2 { grid-template-columns: 1fr; }
  .kvk-hero-grid { grid-template-columns: 1fr 1fr; }
  .kh-mid { grid-column: 1 / -1; order: -1; border: none; border-bottom: 1px solid var(--line); }
  .kh-side.us { border-right: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .kvk-search { grid-template-columns: 1fr 1fr; }
  .kvk-search .kvk-field { grid-column: 1 / -1; }
  .kvk-search .btn.gold { grid-column: 1 / -1; }
  .kvk-two { grid-template-columns: 1fr; }
  .pvp-form { grid-template-columns: 1fr; }
  .kvk-tabs { top: 50px; }
  .kvk-tabs button { padding: 9px 10px; font-size: 12px; }
  .kh-odds { font-size: 42px; }
  .kh-rating { font-size: 25px; }
  .kh-kid { font-size: 18px; }
  .kvk-ct-row { grid-template-columns: 1fr 18px 1fr 62px; padding: 8px 10px; gap: 6px; }
  .kb-row { grid-template-columns: 20px minmax(52px, 1fr) minmax(40px, 1fr) auto; }
  .kvk-mode { font-size: 12.5px; padding: 8px 8px; }
}

/* ---- tabellone del KvK realmente in corso ---- */
.kvk-live { border-color: rgba(224,100,94,.45);
  background: radial-gradient(120% 100% at 50% -30%, rgba(224,100,94,.10), transparent 60%), var(--panel); }
.lv-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.lv-head b { font-size: 15px; }
.lv-spacer { flex: 1; }
.lv-score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.lv-side { text-align: center; min-width: 0; }
.lv-side span { display: block; font-size: 10px; font-weight: 900; letter-spacing: .8px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.lv-side b { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.lv-side.us b { color: var(--us2); } .lv-side.them b { color: var(--them2); }
.lv-gap { font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; padding: 5px 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel); white-space: nowrap; }
.lv-gap.us { color: var(--us2); border-color: rgba(91,141,239,.45); }
.lv-gap.them { color: var(--them2); border-color: rgba(224,100,94,.45); }
.lv-days { display: flex; flex-direction: column; gap: 7px; margin-top: 14px; }
.lv-day { display: grid; grid-template-columns: 62px 52px 1fr 52px 46px; align-items: center; gap: 9px;
  font-size: 12px; }
.lv-day.idle { opacity: .42; }
.lv-n { font-weight: 800; color: var(--muted); font-size: 11px; }
.lv-v { font-weight: 900; font-variant-numeric: tabular-nums; text-align: right; }
.lv-v.us { color: var(--us2); } .lv-v.them { color: var(--them2); text-align: left; }
.lv-bar .kfac-bar { margin-top: 0; height: 11px; }
.lv-mk { text-align: center; }
.lv-now { display: inline-block; font-size: 9px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase;
  color: #ffd7d4; background: rgba(224,100,94,.2); border: 1px solid rgba(224,100,94,.5);
  border-radius: 999px; padding: 2px 7px; animation: livePulse 1.6s ease-in-out infinite; }
.lv-foot { margin-top: 12px; text-align: center; }
@media (max-width: 640px) {
  .lv-day { grid-template-columns: 50px 46px 1fr 46px 34px; gap: 6px; font-size: 11px; }
  .lv-side b { font-size: 19px; }
  .lv-gap { font-size: 13px; padding: 4px 9px; }
}

/* ---- Castle Battle: mappa castello + 4 torrette con i ruoli assegnati ---- */
.cb-sum { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cb-map { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cb-slot.mid { grid-column: 1 / -1; }
.cb-pos { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; height: 100%; }
.cb-pos.main { border-color: var(--gold2);
  background: linear-gradient(180deg, rgba(229,181,103,.09), var(--bg2));
  box-shadow: 0 0 26px -14px rgba(229,181,103,.9); }
.cb-h { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.cb-h b { font-weight: 900; }
.cb-ico { font-size: 17px; }
.cb-role { font-size: 10px; font-weight: 900; letter-spacing: .9px; text-transform: uppercase;
  color: var(--muted); margin: 10px 0 5px; }
.cb-p { display: grid; grid-template-columns: 22px 1fr auto auto auto; align-items: center; gap: 7px;
  padding: 4px 6px; border-radius: 7px; font-size: 12px; }
.cb-p.lead { background: rgba(91,141,239,.12); border: 1px solid rgba(91,141,239,.38); padding: 7px 6px; }
.cb-p.skill { background: rgba(229,181,103,.07); }
.cb-av { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--panel2);
  border: 1px solid var(--line); }
.cb-av.ph { display: block; }
.cb-n { min-width: 0; font-weight: 700; }
.cb-my { font-size: 10.5px; font-weight: 900; color: #d9b3ff; white-space: nowrap; }
.cb-tg { font-size: 10.5px; font-weight: 900; color: var(--gold); white-space: nowrap; }
.cb-pw { font-size: 10.5px; font-weight: 800; color: var(--muted); white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.cb-vs { margin-top: 8px; font-size: 11.5px; color: var(--muted); display: flex; align-items: center;
  gap: 6px; flex-wrap: wrap; padding-top: 8px; border-top: 1px dashed var(--line); }
.cb-vs b { color: var(--them2); }
.cb-odds { margin-left: auto; font-weight: 900; font-variant-numeric: tabular-nums; font-size: 13px; }
.cb-odds.w { color: var(--us2); } .cb-odds.l { color: var(--them2); }
.cb-skill-h { font-size: 10.5px; color: var(--gold); margin: 2px 0 4px; font-weight: 800; }
.cb-more { margin-top: 8px; }
.cb-more summary { cursor: pointer; font-size: 11.5px; color: var(--muted);
  font-weight: 800; padding: 5px 7px; border-radius: 7px; list-style: none; }
.cb-more summary::-webkit-details-marker { display: none; }
.cb-more summary::before { content: "▸ "; }
.cb-more[open] summary::before { content: "▾ "; }
.cb-more summary:hover { background: var(--panel2); color: var(--text); }
.cb-warn { margin-top: 16px; padding: 11px 13px; border-radius: 10px; font-size: 12px; line-height: 1.5;
  background: rgba(224,100,94,.08); border: 1px solid rgba(224,100,94,.3); color: #ffd7d4; }
@media (max-width: 640px) {
  .cb-map { gap: 10px; }
  .cb-p { grid-template-columns: 20px 1fr auto auto; gap: 5px; }
  .cb-p .cb-pw { display: none; }
  .cb-p.lead .cb-pw { display: block; }
}

/* ---- Castle Battle: verdetto della simulazione + strategie ---- */
.cb-verdict { text-align: center; padding: 16px; border-radius: 14px; margin-bottom: 14px;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(0,0,0,.2), transparent); }
.cb-verdict.us { border-color: rgba(91,141,239,.45); background: linear-gradient(180deg, rgba(91,141,239,.12), transparent); }
.cb-verdict.them { border-color: rgba(224,100,94,.45); background: linear-gradient(180deg, rgba(224,100,94,.12), transparent); }
.cb-vlbl { font-size: 10px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.cb-vnum { font-size: 44px; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.cb-verdict.us .cb-vnum { color: var(--us2); text-shadow: 0 0 26px rgba(91,141,239,.45); }
.cb-verdict.them .cb-vnum { color: var(--them2); text-shadow: 0 0 26px rgba(224,100,94,.45); }
.cb-vsub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.cb-strats { margin: 14px 0; }
.cb-st { display: grid; grid-template-columns: 1fr 90px 44px 40px; align-items: center; gap: 10px;
  width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px;
  margin-bottom: 5px; transition: border-color .12s; }
.cb-st:hover { border-color: var(--gold2); }
.cb-st.on { border-color: var(--gold); background: rgba(229,181,103,.09); }
.cb-st-n { font-weight: 800; font-size: 12.5px; }
.cb-st-b { height: 6px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.cb-st-b i { display: block; height: 100%; background: linear-gradient(90deg, var(--us), var(--us2)); }
.cb-st-v { font-weight: 900; font-variant-numeric: tabular-nums; text-align: right; font-size: 13px; }
.cb-st-t { font-size: 11px; color: var(--gold); font-weight: 800; text-align: right; }

.cb-side { font-weight: 900; }
.cb-side.us { color: var(--us2); } .cb-side.them { color: var(--them2); }
.cb-hold { font-size: 10px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; margin: 6px 0 2px; }
.cb-hold.us { color: var(--us2); } .cb-hold.them { color: var(--them2); }
.cb-pos.lost { border-color: rgba(224,100,94,.4); background: linear-gradient(180deg, rgba(224,100,94,.07), var(--bg2)); }
.cb-pos.main.lost { border-color: var(--them); box-shadow: 0 0 26px -14px rgba(224,100,94,.9); }
.cb-p.lead.them { background: rgba(224,100,94,.13); border-color: rgba(224,100,94,.4); }
.cb-h .cb-odds { margin-left: auto; font-size: 14px; }

.cb-dist { margin-top: 16px; }
.cb-dist-row { display: grid; grid-template-columns: 34px 1fr 44px; align-items: center; gap: 9px;
  font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; margin-bottom: 4px; color: var(--muted); }
.cb-dist-b { height: 8px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; }
.cb-dist-b i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold2), var(--gold)); }
@media (max-width: 640px) {
  .cb-st { grid-template-columns: 1fr 56px 40px 36px; gap: 7px; padding: 7px 9px; }
  .cb-vnum { font-size: 36px; }
}

/* ---- consigliere prep: cosa fare oggi ---- */
.kvk-prep { border-color: var(--gold2); }
.pp-gap { display: flex; align-items: baseline; gap: 10px; justify-content: center; padding: 10px;
  border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); margin-bottom: 10px; }
.pp-gap span { font-size: 10px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.pp-gap b { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.pp-gap.behind b { color: var(--them2); } .pp-gap.ahead b { color: var(--us2); }
.pp-intro { margin-bottom: 12px; }
.pp-day { border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; margin-bottom: 10px; background: var(--bg2); }
.pp-day.now { border-color: var(--gold); background: rgba(229,181,103,.07); }
.pp-h { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; font-size: 13px; }
.pp-none { font-size: 11.5px; color: #ffd7d4; background: rgba(224,100,94,.10);
  border: 1px solid rgba(224,100,94,.3); border-radius: 8px; padding: 6px 9px; margin-bottom: 8px; }
/* --- la priorita' del giorno: sta fuori dalla tabella perche' l'ordine per punti
       la seppellirebbe in fondo, e invece e' la cosa che fa vincere la giornata --- */
.pp-top { border: 1px solid var(--gold); border-radius: 10px; padding: 10px 11px; margin-bottom: 10px;
  background: linear-gradient(180deg, rgba(229,181,103,.14), rgba(229,181,103,.05)); }
.pp-top-h { font-size: 10px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--gold); display: flex; align-items: center; gap: 7px; }
.pp-top-a { font-size: 16px; font-weight: 900; margin: 3px 0 8px; display: flex;
  align-items: baseline; gap: 9px; flex-wrap: wrap; }
.pp-top-p { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--gold); }
.pp-top-p i { font-size: 10.5px; font-style: normal; font-weight: 800; color: var(--muted); }
.pp-tiers { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 7px; }
.pp-tier { display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 7px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg2); font-size: 10.5px; font-weight: 800; color: var(--muted); }
.pp-tier b { font-size: 12px; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; }
.pp-tier.best { border-color: var(--gold); color: var(--gold); background: rgba(229,181,103,.12); }
.pp-tier.best b { color: var(--gold); }
/* i ranghi che non possiamo ancora addestrare: barrati, non nascosti — sapere che
   esistono e che non li abbiamo e' un'informazione, farli sparire no. */
.pp-tier.off { opacity: .42; text-decoration: line-through; }
.pp-tier.off b { color: var(--muted); }
.pp-lock { font-size: 11px; font-weight: 800; color: #ffd7d4; margin-bottom: 6px; }
.pp-need { font-size: 13px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums;
  padding: 6px 8px; border-radius: 8px; background: var(--bg2); margin-bottom: 7px; }
.pp-why { font-size: 11px; color: var(--muted); line-height: 1.45; margin-top: 5px; }
.pp-also { font-size: 10px; font-weight: 900; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--muted); margin: 12px 0 2px; }
.pp-t { width: 100%; border-collapse: collapse; font-size: 12px; }
.pp-t th { text-align: left; font-size: 10px; font-weight: 900; letter-spacing: .6px;
  text-transform: uppercase; color: var(--muted); padding: 3px 6px; }
.pp-t td { padding: 5px 6px; border-top: 1px solid var(--line); }
.pp-n { font-weight: 700; }
.pp-p, .pp-q { text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-q { color: var(--gold); }
.pp-u { font-size: 10.5px; white-space: nowrap; }
.pp-cf { text-align: right; }
.pp-c { font-size: 9px; letter-spacing: -1px; }
.pp-c.ok { color: var(--green); } .pp-c.mid { color: var(--gold); } .pp-c.bad { color: var(--them2); letter-spacing: 0; font-weight: 900; }
@media (max-width: 640px) { .pp-t .pp-u { display: none; } .pp-gap b { font-size: 21px; } }

/* ---- 1817 Insights: la scheda privata sul nostro regno ---- */
.ins-head .ins-base { margin-top: 10px; }
.ins-list { display: flex; flex-direction: column; gap: 3px; }
.ins-row { display: grid; grid-template-columns: 1fr 46px 62px 62px 66px auto; align-items: center; gap: 8px;
  width: 100%; text-align: left; font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 9px; }
.ins-row:hover { background: var(--bg2); border-color: var(--line); }
.ins-n { min-width: 0; font-weight: 700; }
.ins-tc { font-size: 11px; font-weight: 900; color: var(--gold); text-align: right; }
.ins-pw { font-weight: 900; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ins-my { font-size: 11px; font-weight: 800; color: #d9b3ff; text-align: right; white-space: nowrap; }
.ins-ago { font-size: 10.5px; font-weight: 800; text-align: right; white-space: nowrap; }
.ins-ago.ok { color: var(--green); } .ins-ago.mid { color: var(--muted); }
.ins-ago.warn { color: var(--gold); } .ins-ago.bad { color: var(--them2); } .ins-ago.unk { color: var(--muted); opacity: .6; }
.ins-d { font-size: 11px; font-weight: 900; white-space: nowrap; text-align: right; }
.ins-d.up { color: var(--green); } .ins-d.down { color: var(--them2); } .ins-d.zero { color: var(--muted); }
.ins-als { display: flex; flex-direction: column; gap: 4px; }
.ins-al { display: grid; grid-template-columns: 52px 1fr 84px 72px 92px 62px; align-items: center; gap: 9px;
  font-size: 12px; padding: 8px 10px; border-radius: 9px; background: var(--bg2); border: 1px solid var(--line); }
.ins-al b { font-weight: 900; }
.ins-act { font-size: 11px; font-weight: 800; color: var(--muted); text-align: right; }
@media (max-width: 700px) {
  .ins-row { grid-template-columns: 1fr 54px 58px auto; }
  .ins-row .ins-tc, .ins-row .ins-my { display: none; }
  .ins-al { grid-template-columns: 44px 1fr 62px 70px; }
  .ins-al .ins-act, .ins-al .ins-my { display: none; }
}

/* ---- Insights: scheda dettagliata giocatore / alleanza ---- */
.dt-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dt-av { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--panel2);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.dt-id { min-width: 0; }
.dt-id h2 { margin: 0; font-size: 17px; }
.dt-chips { margin-bottom: 10px; }
.dt-bs { display: flex; flex-direction: column; gap: 2px; }
.dt-b { display: grid; grid-template-columns: 1fr 92px 46px 62px; align-items: center; gap: 8px;
  font-size: 12px; padding: 5px 7px; border-radius: 7px; }
.dt-b:nth-child(odd) { background: var(--bg2); }
.dt-b.trail { opacity: .85; }
.dt-bn { min-width: 0; font-weight: 700; }
.dt-bv { text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; }
.dt-br { text-align: right; font-weight: 900; color: var(--gold); }
.dt-ba { text-align: right; font-size: 10.5px; font-weight: 800; }
.dt-ba.ok { color: var(--green); } .dt-ba.mid { color: var(--muted); }
.dt-ba.warn { color: var(--gold); } .dt-ba.bad { color: var(--them2); } .dt-ba.unk { color: var(--muted); opacity: .5; }
.dt-bars { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
/* La scomposizione ha nomi piu' lunghi delle prove ("Governor Charm", "Hero's Total")
   e due numeri per riga, quindi vuole colonne sue. */
.dt-bars.pot .dt-bar { grid-template-columns: 104px 1fr 76px; }
.dt-bars.pot .dt-bv { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.dt-bars.pot .dt-bv em { font-style: normal; font-weight: 700; font-size: 10px; color: var(--muted); }
.dt-bar { display: grid; grid-template-columns: 96px 1fr 54px; align-items: center; gap: 9px; font-size: 11.5px; }
.dt-bl { color: var(--muted); font-weight: 700; }
.dt-bt { height: 9px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; }
.dt-bt i { display: block; height: 100%; background: linear-gradient(90deg, var(--us), var(--us2)); }
.dt-bt i.my { background: linear-gradient(90deg, #8d5bd6, #d9b3ff); }
.dt-bt i.pw { background: linear-gradient(90deg, var(--gold2), var(--gold)); }
.dt-bt i.tc { background: linear-gradient(90deg, #2f7f5b, var(--green)); }
.dt-hint { margin-top: 2px; }
button.ins-al { width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
button.ins-al:hover { border-color: var(--gold2); }
@media (max-width: 700px) {
  .dt-b { grid-template-columns: 1fr 76px 40px; } .dt-b .dt-ba { display: none; }
  .dt-bar { grid-template-columns: 74px 1fr 44px; }
  .dt-bars.pot .dt-bar { grid-template-columns: 90px 1fr 64px; }
}

.ins-notice { white-space: pre-wrap; font-size: 12px; line-height: 1.55; padding: 10px 12px;
  border-radius: 9px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); }
.ins-req { margin-top: 8px; }

.dt-hist { display: flex; flex-direction: column; gap: 2px; }
.dt-h { display: grid; grid-template-columns: 58px 66px 56px 1fr; align-items: center; gap: 8px;
  font-size: 11.5px; padding: 5px 7px; border-radius: 7px; }
.dt-h:nth-child(odd) { background: var(--bg2); }
.dt-hd { color: var(--muted); font-weight: 800; }
.dt-hp { font-weight: 900; font-variant-numeric: tabular-nums; text-align: right; }
.dt-hm { color: #d9b3ff; font-weight: 800; text-align: right; }
.dt-hn { min-width: 0; color: var(--muted); }
@media (max-width: 700px) { .dt-h { grid-template-columns: 50px 60px 1fr; } .dt-h .dt-hm { display: none; } }

/* ---- grafico dell'andamento (una serie sola: nessuna legenda, il titolo la nomina) ---- */
.tc-wrap { position: relative; margin: 4px 0 12px; }
.tc-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.tc-t { font-size: 12px; font-weight: 800; }
.tc-delta { font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tc-delta.up { color: var(--green); } .tc-delta.down { color: var(--them2); }
.tc-svg { display: block; width: 100%; height: 168px; overflow: visible; cursor: crosshair;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; }
.tc-grid { stroke: var(--line); stroke-width: .8; }
.tc-line { fill: none; stroke: #c98500; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke; }
.tc-area { fill: #c98500; opacity: .13; stroke: none; }
.tc-end { fill: #c98500; stroke: var(--bg2); stroke-width: 2; }
.tc-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.tc-dot { fill: #c98500; stroke: var(--bg2); stroke-width: 2; }
.tc-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted);
  font-weight: 800; margin-top: 3px; }
/* niente dissolvenza: il riquadro insegue il cursore e una transizione lo lascerebbe
   indietro. E un elemento che deve essere VISIBILE non puo dipendere da
   un'animazione che in certi contesti non parte mai. */
.tc-tip { position: absolute; top: 26px; pointer-events: none; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 11.5px;
  max-width: 220px; box-shadow: var(--shadow); }
.tc-tip b { font-variant-numeric: tabular-nums; }

/* ---- scheda di un regno qualsiasi ---- */
.ins-kpick { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.ins-kpick label { font-size: 10px; font-weight: 900; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); }
.ins-kpick input { width: 96px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); font-weight: 900; font-size: 14px;
  font-variant-numeric: tabular-nums; text-align: center; }
.ins-kpick input:focus { outline: none; border-color: var(--gold); }
.ins-other { color: #cbd8ff; background: rgba(143,180,255,.10); border-radius: 8px; padding: 7px 9px; }
.ins-cov { color: #e6d4ff; background: rgba(217,179,255,.10); border-radius: 8px; padding: 7px 9px; }
/* il piazzamento fra tutti i regni: e' il numero che da' la misura, quindi e' il piu' grande */
.sr-rank { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
  padding: 10px 12px; border-radius: 11px; background: var(--bg2); border: 1px solid var(--line); }
.sr-pos { display: flex; align-items: baseline; gap: 8px; }
.sr-pos b { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--gold); }
.sr-pos b::after { content: '°'; font-size: 18px; }
.sr-pos span { font-size: 10px; font-weight: 900; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); }
.sr-band { font-size: 12px; font-weight: 900; padding: 3px 9px; border-radius: 999px; }
.sr-band.up { color: var(--green); background: rgba(74,201,126,.12); }
.sr-band.down { color: var(--muted); background: var(--panel); }
.sr-note { margin: -2px 0 7px; }
.sr-list { display: flex; flex-direction: column; gap: 2px; }
.sr-r { display: grid; grid-template-columns: 30px 1fr 66px 66px; align-items: center; gap: 8px;
  font-size: 12px; padding: 5px 7px; border-radius: 7px; }
.sr-r:nth-child(odd) { background: var(--bg2); }
.sr-i { color: var(--muted); font-weight: 900; font-variant-numeric: tabular-nums; }
.sr-n { min-width: 0; font-weight: 700; }
.sr-s { text-align: right; color: #d9b3ff; font-weight: 800; font-variant-numeric: tabular-nums; }
.sr-p { text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .sr-r { grid-template-columns: 26px 1fr 58px; } .sr-r .sr-p { display: none; } }

/* ============ VETRINA DEL REGNO (index) ============================== */
.home-page .wrap { padding-bottom: 40px; }
.sec-h { font-size: 17px; font-weight: 900; letter-spacing: .2px; margin: 26px 0 6px; }
.sec-note { margin: 0 0 10px; }

/* --- l'insegna del regno: la prima cosa che si vede --- */
.hero-k { margin: 14px 0 6px; padding: 16px 16px 14px; border-radius: 14px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(229,181,103,.16), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--panel)); }
.hk-skel { display: flex; flex-direction: column; gap: 10px; }
.hk-skel i { height: 16px; border-radius: 7px; background: var(--bg2); display: block; }
.hk-skel i:first-child { height: 34px; width: 60%; }
.hk-main { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hk-crest { font-size: 40px; line-height: 1; filter: drop-shadow(0 2px 8px rgba(229,181,103,.35)); }
.hk-id { min-width: 0; flex: 1; }
.hk-sub { font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: .2px; }
.hk-rank { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.05; }
.hk-rank b { font-size: 30px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.hk-rank b::after { content: '\00b0'; font-size: 17px; }
.hk-rank span { font-size: 11px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.hk-rank em { font-style: normal; font-size: 11px; font-weight: 900; color: var(--muted); margin-top: 3px; }
.hk-rank em.up { color: var(--green); }

/* --- i conti alla rovescia: il dato piu' deperibile della pagina --- */
.hk-clocks { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 13px; }
.hk-clock { flex: 1 1 160px; padding: 9px 11px; border-radius: 11px;
  background: var(--bg2); border: 1px solid var(--line); }
.hkc-l { display: block; font-size: 9.5px; font-weight: 900; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted); }
.hkc-v { display: block; font-size: 20px; font-weight: 900; color: var(--gold);
  font-variant-numeric: tabular-nums; margin-top: 2px; }
.hk-rec { margin-top: 11px; font-size: 12px; color: var(--muted); }
@media (max-width: 560px) {
  .hk-rank { flex: 1 0 100%; flex-direction: row; align-items: baseline; gap: 8px;
    border-top: 1px solid var(--line); padding-top: 9px; margin-top: 2px; }
  .hk-rank b { font-size: 26px; }
  .hk-rank em { margin-top: 0; margin-left: auto; }
  .hk-sub { font-size: 15px; }
}

/* --- le sezioni: e' per queste che la pagina esiste --- */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 9px; }
.sec-card { display: flex; align-items: center; gap: 11px; padding: 12px 13px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg2); text-decoration: none; color: var(--text);
  transition: border-color .15s, transform .15s, background .15s; }
.sec-card:hover { border-color: var(--gold); background: var(--panel); transform: translateY(-1px); }
.sc-ico { font-size: 22px; line-height: 1; }
.sc-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.sc-txt b { font-size: 13.5px; font-weight: 800; }
.sc-go { color: var(--muted); font-weight: 900; }
.sc-lock { font-size: 13px; opacity: .75; }
/* chiusa a chiave: si vede prima di cliccare, non dopo */
.sec-card.locked { border-style: dashed; }
.sec-card.locked .sc-ico { opacity: .82; }

/* --- riquadri di forza --- */
.k-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 9px; }
.k-tile { padding: 11px 12px; border-radius: 11px; background: var(--bg2); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 1px; }
.kt-i { font-size: 16px; line-height: 1; }
.kt-v { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; margin-top: 3px; }
.kt-l { font-size: 10px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.kt-s { margin-top: 2px; }

/* --- barre delle vittorie --- */
.wr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 11px; }
.wr-card { padding: 10px 12px; border-radius: 11px; background: var(--bg2); border: 1px solid var(--line); }
.wr-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.wr-h span { font-size: 11px; font-weight: 900; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.wr-h b { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.wr-bar { height: 7px; border-radius: 999px; background: var(--panel); overflow: hidden; }
.wr-bar i { display: block; height: 100%; border-radius: 999px; }
.wr-bar i.green { background: var(--green); }
.wr-bar i.blue { background: #5bc0de; }

/* --- griglia settimanale degli eventi --- */
.ev-head, .ev-r { display: grid; grid-template-columns: 1fr 210px; align-items: center; gap: 8px; }
.ev-r { padding: 3px 0; border-top: 1px solid var(--line); }
.ev-n { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; font-weight: 700; }
.ev-n .ellipsis { min-width: 0; }
.ev-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.ev-d { font-size: 9px; font-weight: 900; text-transform: uppercase; color: var(--muted); text-align: center; }
.ev-d.today { color: var(--gold); }
.ev-c { height: 15px; border-radius: 4px; background: var(--bg2); }
.ev-c.today { box-shadow: inset 0 0 0 1px var(--gold); }
/* un colore per famiglia: battaglia, gara, speciale. Non decorazione: dice cosa si fa. */
.ev-c.on.battle { background: #d9534f; }
.ev-c.on.competition { background: #5bc0de; }
.ev-c.on.special { background: var(--gold); }
.ev-c.on { background: var(--muted); }
.ev-live { flex: 0 0 auto; font-size: 9px; font-weight: 900; text-transform: uppercase; color: var(--green); }
.ev-pack { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
@media (max-width: 620px) {
  /* La striscia dei 7 giorni stava in 120px: ~14px a colonna, mentre "LUN" ne chiede 20.
     Le sigle uscivano dal riquadro. Il nome dell'evento ha gia' i puntini di sospensione,
     quindi lo spazio lo prende la striscia, che senza etichette leggibili non dice nulla. */
  .ev-head, .ev-r { grid-template-columns: 1fr; gap: 2px 8px; }
  .ev-g { grid-column: 1; gap: 3px; }
  .ev-head .ev-n { display: none; }
  .ev-r { padding: 6px 0; }
  .ev-c { height: 13px; }
}

/* --- corte, alleanze, campioni --- */
.court-row { display: flex; flex-wrap: wrap; gap: 9px; }
.ct-p { display: flex; flex-direction: column; padding: 7px 11px; border-radius: 10px;
  background: var(--bg2); border: 1px solid var(--line); }
.ct-p b { font-size: 13px; font-weight: 800; }
.ch-list { display: flex; flex-direction: column; gap: 2px; }
.ch-r { display: grid; grid-template-columns: 32px 1fr 52px 62px 72px; align-items: center; gap: 8px;
  font-size: 12.5px; padding: 6px 8px; border-radius: 8px; }
.ch-r:nth-child(odd) { background: var(--bg2); }
.ch-i { color: var(--muted); font-weight: 900; font-variant-numeric: tabular-nums; }
.ch-n { min-width: 0; font-weight: 700; }
.ch-tc { font-size: 11px; color: var(--muted); font-weight: 800; }
.ch-my { color: #d9b3ff; font-weight: 800; text-align: right; }
.ch-p { text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  /* nell'elenco dei piu' forti resta la potenza: centro citta' e prove si possono
     perdere, sono di contorno. */
  .ch-r:not(.eroe) { grid-template-columns: 26px 1fr 60px; }
  .ch-r:not(.eroe) .ch-tc, .ch-r:not(.eroe) .ch-my { display: none; }

  /* Per gli EROI no: stelle e abilita' sono le uniche due cose che distinguono un eroe
     da un altro (il livello e' 80 per tutti, i pezzi 4+1 per tutti), e nascondendole
     restava una riga che non diceva niente. Invece di togliere, si va a capo. E il
     tooltip da telefono non si raggiunge, quindi la qualita' dell'equipaggiamento va
     scritta nella riga. */
  .ch-r.eroe {
    grid-template-columns: 28px 1fr auto;
    grid-template-areas: "stella nome abilita" ".      lv   equip";
    row-gap: 1px; padding: 7px 8px;
  }
  .ch-r.eroe .ch-i { grid-area: stella; }
  .ch-r.eroe .ch-n { grid-area: nome; }
  .ch-r.eroe .ch-my { grid-area: abilita; display: block; }
  .ch-r.eroe .ch-tc { grid-area: lv; display: block; text-align: left; }
  .ch-r.eroe .ch-p { grid-area: equip; font-weight: 800; font-size: 11px; color: var(--muted); }
}
.home-foot { text-align: center; margin-top: 22px; }

/* ---- gate "accesso riservato": terminale con reticolo e radar ---- */
.gate-card { position: relative; text-align: center; overflow: hidden; border-color: #5a2b2b;
  background: radial-gradient(120% 90% at 50% -20%, rgba(224,100,94,.16), transparent 62%), var(--panel); }
.gate-card::before, .gate-card::after {
  content: ""; position: absolute; width: 20px; height: 20px; border: 2px solid rgba(224,100,94,.5); pointer-events: none; }
.gate-card::before { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.gate-card::after { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }
.gate-emblem { font-size: 50px; line-height: 1; position: relative; display: inline-block; margin: 6px 0 4px;
  filter: drop-shadow(0 0 16px rgba(224,100,94,.6)); animation: crownPulse 3s ease-in-out infinite; }
.gate-emblem::before, .gate-emblem::after {
  content: ""; position: absolute; inset: -12px; border-radius: 50%;
  border: 1px solid rgba(224,100,94,.45); animation: radarPulse 2.8s ease-out infinite; }
.gate-emblem::after { animation-delay: 1.4s; }
.gate-badge { display: inline-block; font-family: ui-monospace, Consolas, monospace; font-size: 11px; font-weight: 800;
  letter-spacing: 2.5px; color: #ffc3bf; background: rgba(224,100,94,.14); border: 1px solid rgba(224,100,94,.42);
  border-radius: 999px; padding: 4px 14px; margin-bottom: 10px; }
.gate-card h2 { letter-spacing: .4px; }
.gate-card input { text-align: center; letter-spacing: 4px; font-family: ui-monospace, Consolas, monospace; }
.gate-card input:focus { border-color: var(--war); box-shadow: 0 0 14px -3px rgba(224,100,94,.6); }

/* ---- form aggiungi target ---- */
.tg-add { display: grid; grid-template-columns: 1.2fr .8fr 1.4fr auto; gap: 10px; align-items: end; }
.tg-add .btn { min-height: 44px; }

/* ---- HUD di riepilogo ---- */
.tg-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 2px 0 16px; }
.tg-stats .hud { position: relative; overflow: hidden; text-align: center; padding: 13px 8px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(224,100,94,.1), var(--panel)); border: 1px solid var(--line);
  animation: cardIn .4s ease both; }
.tg-stats .hud::after { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--war), transparent); opacity: .7; }
.tg-stats .hud b { display: block; font-size: 23px; font-weight: 900; color: var(--gold); line-height: 1.1;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 16px rgba(229,181,103,.4); }
.tg-stats .hud span { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--muted); }

/* ---- tab filtro: accento di guerra ---- */
.warroom-page .tab.active { border-color: var(--war); background: var(--panel2);
  box-shadow: 0 0 14px -6px rgba(224,100,94,.75), inset 0 -2px 0 var(--war); }
.warroom-page .tab .t { color: var(--war2); }

/* ---- header di sezione (alleanza) ---- */
.tg-group-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 22px 2px 10px; font-size: 15px; padding-bottom: 7px; position: relative; border-bottom: 1px solid var(--line); }
.tg-group-h::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 62px; height: 2px;
  background: linear-gradient(90deg, var(--war), transparent); }
.tg-group-h .gh-name b { color: var(--text); }
.tg-group-h .gh-meta { font-size: 12px; color: var(--muted); font-weight: 800; white-space: nowrap; letter-spacing: .3px; }

/* ---- griglia dossier ---- */
.tg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }

/* ---- card dossier ---- */
.tg-card { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  box-shadow: var(--shadow); overflow: hidden; animation: cardIn .35s ease both; --tc: #e0645e;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.tg-card.tier-rare { --tc: #4aa3ff; } .tg-card.tier-epic { --tc: #b06bff; }
.tg-card.tier-legendary { --tc: #ffc24a; } .tg-card.tier-mythic { --tc: #ff9a4d; } .tg-card.tier-founder { --tc: #ffd24a; }
.tg-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--tc) 55%, var(--line));
  box-shadow: 0 14px 30px -16px rgba(0,0,0,.7), 0 0 22px -10px var(--tc); }
/* reticolo di mira agli angoli */
.tg-card::before { content: ""; position: absolute; inset: 6px; z-index: 3; pointer-events: none; opacity: .5;
  background:
    linear-gradient(var(--tc),var(--tc)) left top, linear-gradient(var(--tc),var(--tc)) left top,
    linear-gradient(var(--tc),var(--tc)) right top, linear-gradient(var(--tc),var(--tc)) right top,
    linear-gradient(var(--tc),var(--tc)) left bottom, linear-gradient(var(--tc),var(--tc)) left bottom,
    linear-gradient(var(--tc),var(--tc)) right bottom, linear-gradient(var(--tc),var(--tc)) right bottom;
  background-repeat: no-repeat;
  background-size: 12px 2px, 2px 12px, 12px 2px, 2px 12px, 12px 2px, 2px 12px, 12px 2px, 2px 12px; }

/* striscia livello/minaccia in alto */
.tg-strip { display: flex; align-items: center; padding: 6px 13px; font-size: 11.5px; font-weight: 900;
  letter-spacing: 1.3px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.45);
  background: linear-gradient(90deg, var(--tc), transparent 82%); border-bottom: 1px solid rgba(0,0,0,.28); }
.tg-strip .ts-tier { flex: 1; }
.tg-card.tier-legendary .tg-strip, .tg-card.tier-mythic .tg-strip, .tg-card.tier-founder .tg-strip {
  color: #241804; text-shadow: 0 1px 1px rgba(255,255,255,.28); }
/* glint sui top tier */
.tg-card.tier-legendary .tg-strip, .tg-card.tier-mythic .tg-strip, .tg-card.tier-founder .tg-strip { position: relative; overflow: hidden; }
.tg-card.tier-legendary .tg-strip::after, .tg-card.tier-mythic .tg-strip::after, .tg-card.tier-founder .tg-strip::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.5) 50%, transparent 60%);
  background-size: 300% 100%; animation: glint 6s linear infinite; }

.tg-body { position: relative; padding: 13px 14px 14px; }
.tg-head { display: flex; align-items: center; gap: 11px; }
.tg-head .avatar { width: 46px; height: 46px; border-radius: 12px; }
.tg-head .avatar.av-ph { font-size: 20px; }
.tg-id { min-width: 0; flex: 1; }
.tg-name { font-weight: 800; font-size: 15px; }
.tg-sub { margin-top: 1px; }
.tg-act { display: flex; gap: 6px; flex-shrink: 0; }
.tg-act .ic { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; cursor: pointer;
  background: var(--bg2); border: 1px solid var(--line); font-size: 13px; padding: 0; transition: .12s; }
.tg-act .ic:hover { border-color: var(--gold2); transform: translateY(-1px); }
.tg-act .ic.danger:hover { border-color: #5a2b2b; background: #2a1414; }
.tg-act .ic:active { transform: scale(.9); }

/* readout: potenza in evidenza + kills/TC */
.tg-readout { display: flex; gap: 8px; margin: 12px 0 10px; }
.tg-readout .ro { flex: 1; text-align: center; padding: 8px 6px; border-radius: 10px; background: var(--bg2);
  border: 1px solid var(--line); min-width: 0; }
.tg-readout .ro b { display: block; font-size: 15px; font-weight: 900; color: var(--text);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-readout .ro span { font-size: 9.5px; font-weight: 800; letter-spacing: 1px; color: var(--muted); }
.tg-readout .ro.big { flex: 1.5; background: linear-gradient(180deg, rgba(255,255,255,.05), var(--bg2)); border-color: color-mix(in srgb, var(--tc) 35%, var(--line)); }
.tg-readout .ro.big b { font-size: 19px; color: var(--tc); filter: drop-shadow(0 0 7px var(--tc)); }

/* chip Player ID copiabile a tutta larghezza */
.tg-card .chip.pid { width: 100%; justify-content: center; cursor: pointer; margin-bottom: 2px;
  font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .5px; }
.tg-card .chip.pid:hover { border-color: var(--gold2); color: var(--text); }
.chip.pid { cursor: pointer; font-family: ui-monospace, Menlo, Consolas, monospace; }
.chip.pid:active { filter: brightness(1.2); }

/* campi editabili */
.tg-field { margin-top: 4px; }
.tg-card label.f { margin: 8px 0 3px; }
.tg-note { width: 100%; resize: vertical; min-height: 44px; }

/* stato vuoto scenografico */
.tg-empty-box { text-align: center; padding: 44px 16px; }
.tg-empty-box .ee { font-size: 58px; opacity: .55; position: relative; display: inline-block; margin-bottom: 12px;
  filter: drop-shadow(0 0 14px rgba(224,100,94,.5)); animation: crownPulse 3s ease-in-out infinite; }
.tg-empty-box .ee::after { content: ""; position: absolute; inset: -16px; border-radius: 50%;
  border: 1px dashed rgba(224,100,94,.45); animation: radarPulse 3s ease-out infinite; }

@media (max-width: 640px) {
  .tg-add { grid-template-columns: 1fr 1fr; }
  .tg-add > :nth-child(3), .tg-add > button { grid-column: 1 / -1; }
  .tg-stats .hud b { font-size: 19px; }
  .tg-stats .hud span { font-size: 9px; }
}

/* firma */
.site-footer { text-align: center; color: var(--muted); font-size: 12px; padding: 26px 12px 14px; opacity: .85; }
.site-footer b { color: var(--gold); }

/* ============================================================
   ✨ ANIMAZIONI & TIER ESCLUSIVI (potenza + Founder)
   ============================================================ */

/* colori per livello */
.tier-rare      { --ring-a:#123049; --ring-b:#4aa3ff; --tc:#4aa3ff; }
.tier-epic      { --ring-a:#2c1550; --ring-b:#b06bff; --tc:#b06bff; }
.tier-legendary { --ring-a:#4a3410; --ring-b:#ffc24a; --tc:#ffc24a; }
.tier-mythic    { --ring-a:#2b1440; --ring-b:#ff7a1a; --tc:#ff9a4d; }
.tier-founder   { --ring-a:#ff6a2a; --ring-b:#ffd24a; --tc:#ffd24a; }

/* --- aura rotante attorno agli avatar --- */
.av-wrap { position: relative; display: inline-flex; border-radius: 50%; vertical-align: middle; }
.av-wrap.lg { border-radius: 16px; }
.av-wrap[class*="tier-"] { padding: 2px; }
.av-wrap[class*="tier-"]::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 0;
  background: conic-gradient(from 0deg, var(--ring-b), var(--ring-a), var(--ring-b));
  animation: spinRing 3.4s linear infinite; animation-delay: var(--phase, 0s);
}
.av-wrap.tier-founder::before {
  background: conic-gradient(from 0deg, #ffd24a, #ff7a3a, #fff3b0, #ffb43a, #ffd24a);
  animation-duration: 2.4s; box-shadow: 0 0 10px rgba(255,180,58,.55);
}
.av-wrap.tier-mythic::before { /* disco di accrescimento: arco incandescente che orbita nel buio */
  background: conic-gradient(from 0deg, #0a0512 0deg, #7a3cff 45deg, #0a0512 95deg,
    #ffb066 165deg, #fff3e0 185deg, #ff7a1a 205deg, #0a0512 265deg, #0a0512 360deg);
  animation-duration: 2.6s; box-shadow: 0 0 14px rgba(255,122,26,.55);
}
.av-wrap > img { position: relative; z-index: 1; display: block; }
@keyframes spinRing { to { transform: rotate(360deg); } }

/* --- nome brillante per i top --- */
.big-name.tier-legendary, .big-name.tier-founder {
  background: linear-gradient(90deg, #ffe9a8, #ffb43a, #fff6d0, #ffb43a, #ffe9a8);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmerText 3s linear infinite; animation-delay: var(--phase, 0s);
}
.big-name.tier-mythic {
  background: linear-gradient(90deg, #ff7a1a, #ffd9b0, #b98cff, #7a3cff, #ffb066, #ff7a1a);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: shimmerText 2.6s linear infinite; animation-delay: var(--phase, 0s);
}
@keyframes shimmerText { to { background-position: 200% center; } }

/* --- chip livello --- */
.chip.tier { color: #17110a; border: none; font-weight: 800; letter-spacing: .3px; }
.chip.tier.tier-rare { background: linear-gradient(180deg,#7cc4ff,#3a8fe0); color:#04121f; }
.chip.tier.tier-epic { background: linear-gradient(180deg,#c79bff,#8f52e0); color:#fff; }
.chip.tier.tier-legendary { background: linear-gradient(180deg,#ffd76a,#e0a13a); }
.chip.tier.tier-founder {
  background: linear-gradient(120deg,#ffe08a,#ff8a3a,#fff3c0,#ff8a3a,#ffe08a);
  background-size: 200% auto; animation: shimmerText 2.4s linear infinite;
  box-shadow: 0 0 12px rgba(255,180,58,.5);
}
.chip.tier.tier-mythic {
  background: linear-gradient(120deg,#12081f,#ff7a1a,#0b0614,#7a3cff,#12081f);
  background-size: 220% auto; color: #ffd9b0; animation: shimmerText 2.6s linear infinite;
  box-shadow: 0 0 12px rgba(255,122,26,.5); border: 1px solid rgba(255,122,26,.4);
}

/* --- livelli su slot e righe del Re — look "card premium":
   · rare/epic: barra laterale colorata + bagliore statico morbido
   · legendary/mythic/founder: CORNICE CONICA che ruota lenta (gradient border,
     Houdini @property; senza supporto resta una cornice sfumata statica),
     filigrana con l'emoji del livello e GLINT occasionale.
   animation-delay: var(--phase) aggancia la fase all'orologio: i re-render
   realtime non fanno mai "ripartire" le animazioni a scatti. --- */
@property --bang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spinBorder { to { --bang: 360deg; } }

.slot.tier-rare, .king-row.tier-rare { border-color:#2b5a72; box-shadow: inset 0 0 26px -18px rgba(74,163,255,.8), 0 0 12px -4px rgba(74,163,255,.28); }
.slot.tier-epic, .king-row.tier-epic { border-color:#6b3a9c; box-shadow: inset 0 0 26px -18px rgba(176,107,255,.85), 0 0 12px -4px rgba(176,107,255,.30); }
.slot.tier-rare { border-left-color:#4aa3ff; } .king-row.tier-rare { border-left-color:#4aa3ff; }
.slot.tier-epic { border-left-color:#b06bff; } .king-row.tier-epic { border-left-color:#b06bff; }

.slot.tier-legendary, .king-row.tier-legendary {
  border-color: transparent;
  background: linear-gradient(180deg, #221c10, var(--bg2)) padding-box,
    conic-gradient(from var(--bang), #8a6a24, #ffe9a8, #c99b3f, #6e5116, #ffc24a, #8a6a24) border-box;
  box-shadow: 0 0 14px -4px rgba(255,194,74,.35);
  animation: spinBorder 5s linear infinite; animation-delay: var(--phase, 0s);
}
.slot.tier-mythic, .king-row.tier-mythic { /* orizzonte degli eventi: cornice buia con l'arco incandescente che orbita */
  border-color: transparent;
  background: linear-gradient(180deg, #120a1d, #0c0714) padding-box,
    conic-gradient(from var(--bang), #0a0512 0deg, #7a3cff 40deg, #0a0512 90deg,
      #ff7a1a 160deg, #fff3e0 185deg, #ffb066 210deg, #0a0512 270deg, #0a0512 360deg) border-box;
  box-shadow: 0 0 18px -4px rgba(255,122,26,.45), inset 0 0 30px -18px rgba(122,60,255,.6);
  animation: spinBorder 4s linear infinite; animation-delay: var(--phase, 0s);
}
.slot.tier-founder, .king-row.tier-founder {
  border-color: transparent;
  background: linear-gradient(180deg, #271d0d, var(--bg2)) padding-box,
    conic-gradient(from var(--bang), #ffd24a, #b87a1e, #fff3b0, #ff9d2a, #ffd24a) border-box;
  box-shadow: 0 0 18px -4px rgba(255,170,60,.5);
  animation: spinBorder 3.2s linear infinite; animation-delay: var(--phase, 0s);
}

/* filigrana del livello nell'angolo (solo slot; le righe del Re restano pulite) */
.slot.tier-legendary::before, .slot.tier-mythic::before, .slot.tier-founder::before {
  position: absolute; right: 6px; top: 2px; font-size: 26px; opacity: .13;
  pointer-events: none; filter: saturate(1.2);
}
.slot.tier-legendary::before { content: "⭐"; }
.slot.tier-founder::before { content: "👑"; }
/* mythic: mini BUCO NERO disegnato in CSS (nucleo nero + disco che orbita) */
.slot.tier-mythic::before {
  content: ""; width: 36px; height: 36px; right: 6px; top: 6px; border-radius: 50%;
  font-size: 0; opacity: .55; filter: blur(.4px);
  background:
    radial-gradient(circle at 50% 50%, #000 0 33%, rgba(0,0,0,.85) 38%, transparent 42%),
    conic-gradient(from 0deg, transparent 0deg, rgba(255,122,26,.95) 55deg, rgba(255,235,200,.95) 85deg,
      rgba(255,122,26,.8) 115deg, transparent 175deg, rgba(122,60,255,.55) 250deg, transparent 320deg);
  animation: bhSpinFlat 4s linear infinite; animation-delay: var(--phase, 0s);
}
@keyframes bhSpinFlat { to { transform: rotate(360deg); } }

/* orario e dettagli nel colore del livello */
.slot .time { font-variant-numeric: tabular-nums; }
.slot[class*="tier-"] .time { color: var(--tc); }

/* glint: un riflesso attraversa la card una volta ogni ~6s, poi quiete */
.slot.tier-legendary, .slot.tier-mythic, .slot.tier-founder,
.king-row.tier-legendary, .king-row.tier-mythic, .king-row.tier-founder { position: relative; overflow: hidden; }
.slot.tier-legendary::after, .slot.tier-founder::after, .king-row.tier-legendary::after, .king-row.tier-founder::after,
.slot.tier-mythic::after, .king-row.tier-mythic::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255,240,190,.30) 50%, transparent 58%);
  background-size: 300% 100%; background-position: 150% 0;
  animation: glint 6s linear infinite; animation-delay: var(--phase, 0s);
}
.slot.tier-mythic::after, .king-row.tier-mythic::after {
  background-image: linear-gradient(115deg, transparent 42%, rgba(255,180,110,.30) 50%, transparent 58%);
}
@keyframes glint { 0% { background-position: 150% 0; } 18% { background-position: -150% 0; } 100% { background-position: -150% 0; } }
@keyframes shine { to { background-position: -250% 0; } }

/* --- entrata degli slot al cambio giorno (fallback CSS; con anime.js c'è la
   cascata orchestrata easeOutQuint) --- */
.slots { perspective: 800px; }
.slot.slot-in { animation: slotIn .42s cubic-bezier(.22,.61,.36,1) both; }
@keyframes slotIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --- materializzazione 3D quando una NUOVA prenotazione compare (la vedono tutti):
   la card "atterra" ruotando sull'asse X con un lampo di luce --- */
/* .slot.slot-pop vince (per specificità e ordine) sulla cornice conica dei tier:
   il flip gioca per primo, poi il JS toglie la classe e la cornice riprende in fase */
.slot.slot-pop { animation: slotFlip .65s cubic-bezier(.2,.75,.25,1) both; transform-origin: 50% 30%; }
@keyframes slotFlip {
  0% { transform: rotateX(-72deg) scale(.96); opacity: 0; filter: brightness(1.9) saturate(1.3); }
  55% { transform: rotateX(9deg) scale(1.01); opacity: 1; }
  78% { transform: rotateX(-4deg); }
  100% { transform: none; opacity: 1; filter: none; }
}

/* --- slot dell'ora in corso: pulsa "live" (rosso) --- */
.slot.slot-live { border-color: var(--red) !important; animation: liveSlot 1.7s ease-in-out infinite; }
@keyframes liveSlot { 0%,100% { box-shadow: 0 0 0 0 rgba(224,100,94,.55); } 60% { box-shadow: 0 0 0 8px rgba(224,100,94,0); } }

/* --- combo multi-giorno --- */
.fx-combo { position: fixed; left: 50%; top: 34%; transform: translate(-50%,-50%); z-index: 9999; pointer-events: none;
  font-size: 44px; font-weight: 900; letter-spacing: 2px; color: #ffd24a; white-space: nowrap;
  text-shadow: 0 3px 20px rgba(0,0,0,.85), 0 0 30px rgba(255,180,58,.7);
  animation: comboPop 1.2s cubic-bezier(.2,1.2,.3,1) both; }
@keyframes comboPop {
  0% { transform: translate(-50%,-50%) scale(2.6) rotate(-8deg); opacity: 0; }
  30% { transform: translate(-50%,-50%) scale(1) rotate(0); opacity: 1; }
  74% { opacity: 1; }
  100% { transform: translate(-50%,-72%) scale(.9); opacity: 0; } }

/* --- respiro verde quando uno slot torna libero --- */
.slot.slot-freed { animation: slotFreed .8s ease both; }
@keyframes slotFreed {
  0% { box-shadow: inset 0 0 0 999px rgba(63,178,127,.16), 0 0 0 0 rgba(63,178,127,.35); }
  100% { box-shadow: inset 0 0 0 999px rgba(63,178,127,0), 0 0 0 14px rgba(63,178,127,0); }
}

/* --- feedback azioni --- */
.btn.gold:active { transform: scale(.96); }
.fx-pulse { animation: fxPulse .5s ease; }
@keyframes fxPulse { 0%{ transform: scale(1);} 35%{ transform: scale(1.035); background: rgba(229,181,103,.16);} 100%{ transform: scale(1);} }

/* --- particelle (celebrate) --- */
.fx-layer { position: fixed; z-index: 9999; pointer-events: none; transform: translate(-50%,-50%); }

.fx-ring { position: absolute; left: 0; top: 0; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; }
.fx-ring-gold { border: 3px solid rgba(255,194,74,.8); animation: fxRing 1s ease-out forwards; }
.fx-ring-founder { border: 4px solid rgba(255,180,58,.9); box-shadow: 0 0 18px rgba(255,180,58,.8); animation: fxRing 1.1s ease-out forwards; }
.fx-ring-mythic { border: 4px solid rgba(255,122,26,.9); box-shadow: 0 0 20px rgba(255,122,26,.8), inset 0 0 12px rgba(122,60,255,.6); animation: fxRing 1.1s ease-out forwards; }
@keyframes fxRing { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(9); opacity: 0; } }

/* --- canvas: coriandoli (sopra) e braci di sfondo (dietro) --- */
.fx-confetti { position: fixed; inset: 0; z-index: 9998; pointer-events: none; }
.fx-ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* --- onde (ripple) sui pulsanti --- */
.btn { position: relative; overflow: hidden; }
.btn-ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.45);
  transform: scale(0); animation: ripple .6s ease-out; pointer-events: none; }
.btn.gold .btn-ripple { background: rgba(255,255,255,.55); }
@keyframes ripple { to { transform: scale(2.4); opacity: 0; } }

/* --- modali: apertura in scala + sfondo sfocato --- */
.modal-bg { backdrop-filter: blur(0); transition: backdrop-filter .25s; }
.modal-bg.open { backdrop-filter: blur(3px); animation: fadeIn .2s ease; }
.modal-bg.open .modal { animation: modalIn .3s cubic-bezier(.2,.9,.3,1.25); transform-origin: center bottom; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { transform: translateY(14px) scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }

/* --- toast con rimbalzo --- */
.toast { transform: translate(-50%, 22px); }
.toast.show { transform: translate(-50%, 0); animation: toastPop .38s cubic-bezier(.2,.9,.3,1.35); }
@keyframes toastPop { 0% { transform: translate(-50%, 40px); opacity: 0; } 100% { transform: translate(-50%, 0); opacity: 1; } }

/* --- entrata delle card + corona pulsante --- */
.card { animation: cardIn .42s ease both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
header.top .crown { display: inline-block; animation: crownPulse 3.2s ease-in-out infinite; }
@keyframes crownPulse {
  0%,100% { transform: scale(1) rotate(0); filter: drop-shadow(0 0 0 rgba(229,181,103,0)); }
  50% { transform: scale(1.12) rotate(-4deg); filter: drop-shadow(0 0 7px rgba(229,181,103,.7)); }
}

/* --- hover/tap sugli slot --- */
.slot { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.slot.free:hover { transform: translateY(-2px); border-color: var(--gold2); border-style: solid; }
.slot.free:hover .btn.gold { box-shadow: 0 0 14px rgba(229,181,103,.5); }
.tab { transition: transform .12s ease, border-color .15s ease, background .15s ease; }
.tab:active { transform: scale(.96); }
.item { transition: transform .12s ease, border-color .15s ease; }

/* --- sheen dorato sulla card profilo al login --- */
.card.compact.sheen { position: relative; overflow: hidden; }
.card.compact.sheen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,240,190,.35) 48%, transparent 66%);
  background-size: 250% 100%; animation: shine 1.1s ease-out 1;
}

/* --- rifiniture globali --- */
:focus-visible { outline: 2px solid var(--gold2); outline-offset: 2px; }
::selection { background: rgba(229,181,103,.35); }
html { scrollbar-color: var(--panel2) transparent; }
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--panel2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--line); }
@media (hover: none) { .slot.free:hover { transform: none; } }
@media (hover: hover) {
  .slot.taken:hover { transform: translateY(-2px); filter: brightness(1.07); }
  .btn.gold::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
    background-size: 250% 100%; background-position: 150% 0;
  }
  .btn.gold:hover::after { animation: btnShine .55s ease; }
}
@keyframes btnShine { from { background-position: 150% 0; } to { background-position: -150% 0; } }

/* pallino di stato negli slot prenotati (verde = prenotato, oro = assegnato) */
.st-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); margin-right: 5px; vertical-align: middle; }
.st-dot.gold { background: var(--gold); box-shadow: 0 0 6px var(--gold); }

/* chip del profilo: entrata a cascata */
.chips .chip { animation: chipIn .34s ease both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes chipIn { from { opacity: 0; transform: translateY(5px) scale(.92); } to { opacity: 1; transform: none; } }

/* avatar negli slot un filo più grande */
.slot-av { width: 24px; height: 24px; }

/* avviso modalità test/beta */
.beta-bar { text-align: center; font-weight: 800; font-size: 13.5px; letter-spacing: .3px;
  color: #2a1e05; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px;
  background: repeating-linear-gradient(45deg, #e5b567 0 16px, #d7a24e 16px 32px);
  box-shadow: 0 2px 14px -4px rgba(229,181,103,.6); animation: betaPulse 2.6s ease-in-out infinite; }
@keyframes betaPulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }

/* barra countdown KvK */
.kvk-bar { display: flex; align-items: center; gap: 8px; justify-content: center;
  border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-weight: 800; font-size: 14px;
  background: #10202e; border: 1px solid #1d3a52; color: #bcdcf5; }
.kvk-bar.live { background: linear-gradient(180deg,#2a1414,#1a0e0e); border-color: #5a2b2b; color: #ffd0cd; }

/* annuncio "apertura prenotazioni" con countdown */
.open-banner { display: flex; align-items: center; gap: 9px; justify-content: center; flex-wrap: wrap;
  border-radius: 12px; padding: 11px 14px; margin-bottom: 12px; font-weight: 800; font-size: 14px;
  background: linear-gradient(180deg, #2a2410, #1a1408); border: 1px solid var(--gold2); color: #f2dca0;
  box-shadow: 0 2px 18px -6px rgba(229,181,103,.55); animation: betaPulse 3s ease-in-out infinite; }
.open-banner .ob-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 8px var(--gold); animation: livePulse 1.4s ease-in-out infinite; flex-shrink: 0; }
.open-banner .ob-when { color: var(--muted); font-weight: 700; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red);
  animation: livePulse 1.4s ease-in-out infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.7); } }

/* data reale sotto il giorno nei tab */
.tab .dt { font-size: 10.5px; color: var(--muted); font-weight: 700; margin-top: 1px; }
.tab.active .dt { color: var(--gold); }

/* "le tue prenotazioni" sul profilo */
.my-bookings { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--line); }
.my-bookings .mb-lbl { font-size: 12px; color: var(--muted); font-weight: 700; }
.mb-chip { background: #12261c; border: 1px solid #285138; color: #bff0d3; border-radius: 999px;
  padding: 5px 12px; font-size: 12px; font-weight: 800; cursor: pointer; min-height: 32px; }
.mb-chip:active { filter: brightness(1.15); }

/* ===== fruibilità da telefono ===== */
/* tab dei giorni SEMPRE a portata di pollice mentre scorri i 48 slot */
.tabs { position: sticky; top: 52px; z-index: 5; background: var(--panel);
  box-shadow: 0 8px 12px -10px rgba(0,0,0,.6); border-radius: 0 0 10px 10px; }
@media (min-width: 641px) { .tabs { top: 60px; } }
/* salta-orario 00/06/12/18 */
.time-jump { display: flex; gap: 6px; margin: 0 0 12px; }
.time-jump .tj { flex: 1; min-height: 34px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg2); color: var(--muted); font-weight: 800; font-size: 12.5px; cursor: pointer; }
.time-jump .tj:active { background: var(--panel2); color: var(--gold); }
/* niente ritardi/zoom accidentali sui tap */
.btn, .tab, .slot, .tj, .tz-btn, select, .chk { touch-action: manipulation; }
/* lo scroll "salta a" non finisce sotto le tab sticky */
.slot { scroll-margin-top: 130px; }
/* notch / gesture bar (iPhone & co.) */
header.top { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.toast { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
/* pulsante aggiorna dati che gira */
.spinning { animation: spin .8s linear infinite; }

/* toggle fuso orario [UTC | GMT+X] */
.tz-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.tz-btn { background: var(--bg2); border: none; color: var(--muted); padding: 6px 16px; font-size: 12.5px; font-weight: 800; cursor: pointer; min-height: 34px; letter-spacing: .3px; }
.tz-btn.active { background: linear-gradient(180deg, var(--gold), var(--gold2)); color: #2a1e05; }
.king-utc { font-size: 10px; color: var(--muted); font-weight: 700; letter-spacing: 0; line-height: 1.1; }

/* spunte "ripeti negli altri giorni" (modale prenotazione) */
.repeat-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.repeat-checks .chk { border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px;
  background: var(--bg2); cursor: pointer; user-select: none; transition: .15s; color: var(--text); }
.repeat-checks .chk:has(input:checked) { border-color: var(--gold); background: #2a2410; color: var(--gold); box-shadow: 0 0 10px -3px rgba(229,181,103,.5); }

/* ===== DRAMA: timbro reale, vignetta, raggi di luce, scossa ===== */
.fx-stamp-wrap { position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  display: flex; align-items: center; justify-content: center; transition: opacity .35s ease; }
.fx-stamp-wrap.out { opacity: 0; }
.fx-vignette { position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 28%, rgba(0,0,0,.55) 100%);
  animation: vignIn .3s ease both; }
@keyframes vignIn { from { opacity: 0; } to { opacity: 1; } }
.fx-stamp { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: stampSlam .5s cubic-bezier(.15,1.3,.4,1) both; }
@keyframes stampSlam {
  0% { transform: scale(3) rotate(-14deg); opacity: 0; filter: blur(6px); }
  38% { transform: scale(.94) rotate(2deg); opacity: 1; filter: blur(0); }
  60% { transform: scale(1.06) rotate(-1deg); }
  100% { transform: scale(1) rotate(0); }
}
.fx-emblem { font-size: 92px; line-height: 1; filter: drop-shadow(0 0 26px rgba(255,190,80,.85)); }
.fx-stamp.tier-mythic .fx-emblem { filter: drop-shadow(0 0 30px rgba(255,122,26,.9)); }

/* BUCO NERO 3D (timbro mythic): nucleo nero + disco di accrescimento inclinato
   in prospettiva che orbita (stile Gargantua) */
.fx-blackhole { position: relative; width: 120px; height: 120px; transform-style: preserve-3d; }
.fx-bh-disk { position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, #ff7a1a 45deg, #fff3e0 80deg,
    #ffb066 110deg, transparent 170deg, rgba(122,60,255,.7) 230deg, transparent 300deg);
  transform: rotateX(62deg); animation: bhOrbit 1.5s linear infinite;
  filter: blur(1px) drop-shadow(0 0 20px rgba(255,140,60,.85)); }
.fx-bh-core { position: absolute; inset: 24%; border-radius: 50%; background: #000;
  box-shadow: 0 0 26px 8px rgba(255,140,60,.55), 0 0 60px 20px rgba(122,60,255,.35),
    inset 0 0 14px 5px rgba(122,60,255,.55); }
@keyframes bhOrbit { to { transform: rotateX(62deg) rotate(360deg); } }
.fx-stamp-label { font-size: 19px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase;
  color: #ffd24a; text-shadow: 0 2px 14px rgba(0,0,0,.75);
  background: rgba(20,15,5,.6); border: 1px solid rgba(255,210,74,.55); border-radius: 999px;
  padding: 6px 20px; backdrop-filter: blur(2px); }
.fx-rays { position: absolute; inset: -110px; z-index: -1; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,210,74,.28) 0deg 12deg, transparent 12deg 30deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 68%);
  mask-image: radial-gradient(circle, #000 0%, transparent 68%);
  animation: raysSpin 6s linear infinite, raysIn .4s ease both; }
.fx-stamp.tier-mythic .fx-rays { background: repeating-conic-gradient(from 0deg, rgba(255,122,26,.26) 0deg 12deg, transparent 12deg 24deg, rgba(122,60,255,.22) 24deg 30deg, transparent 30deg 42deg); }
@keyframes raysSpin { to { transform: rotate(360deg); } }
@keyframes raysIn { from { opacity: 0; } to { opacity: 1; } }

/* scossa dello schermo (soft per tutti, hard per mythic/founder) */
.fx-shake { animation: shakeSoft .4s ease; }
.fx-shake-hard { animation: shakeHard .45s ease; }
@keyframes shakeSoft {
  10%,90% { transform: translate(1px,-1px); } 20%,80% { transform: translate(-2px,1px); }
  30%,70% { transform: translate(2px,1px); } 40%,60% { transform: translate(-2px,-1px); }
  50% { transform: translate(2px,-2px); } }
@keyframes shakeHard {
  10%,90% { transform: translate(2px,-2px); } 20%,80% { transform: translate(-4px,2px); }
  30%,70% { transform: translate(4px,2px) rotate(.3deg); } 40%,60% { transform: translate(-4px,-2px) rotate(-.3deg); }
  50% { transform: translate(4px,-3px); } }

/* rispetto dell'accessibilità: nessun movimento se l'utente lo chiede */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fx-layer, .fx-confetti, .fx-ambient, .fx-combo, .fx-stamp-wrap { display: none !important; }
}

/* RTL (arabo) */
[dir="rtl"] .spacer { }
[dir="rtl"] .item, [dir="rtl"] .row { direction: rtl; }
[dir="rtl"] .ellipsis { text-align: right; }

/* ---- area riservata: la riga che dice chi sei ---- */
.ris-who { padding: 11px 13px; }

/* ---- admin: specchietto dello stato del sistema ---- */
.st-sec { font-size: 10px; font-weight: 900; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--muted); margin: 14px 0 6px; }
.st-sec:first-child { margin-top: 0; }
.st-r { display: grid; grid-template-columns: 1fr 78px 56px 18px; align-items: center; gap: 8px;
  font-size: 12px; padding: 5px 7px; border-radius: 7px; }
.st-r:nth-child(odd) { background: var(--bg2); }
.st-n { font-weight: 700; }
.st-v, .st-a { text-align: right; font-variant-numeric: tabular-nums; }
.st-a { font-weight: 900; }
.st-a.ok { color: var(--green); } .st-a.mid { color: var(--gold); } .st-a.bad { color: var(--them2); }
.st-x { text-align: right; color: var(--gold); font-size: 12px; }
.st-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.st-p { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 9px;
  background: var(--bg2); border: 1px solid var(--line); }
.st-p span { font-size: 9.5px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.st-p b { font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }
.st-p.ok b { color: var(--green); } .st-p.mid b { color: var(--gold); } .st-p.bad b { color: var(--them2); }
.st-note { margin-top: 6px; }
.st-log { display: flex; flex-direction: column; gap: 2px; }
.st-lr { display: grid; grid-template-columns: 116px 1fr 1fr; gap: 8px; align-items: center;
  font-size: 11.5px; padding: 4px 7px; border-radius: 6px; }
.st-lr:nth-child(odd) { background: var(--bg2); }
@media (max-width: 560px) {
  .st-r { grid-template-columns: 1fr 52px 16px; }
  .st-r .st-v { display: none; }
  .st-lr { grid-template-columns: 92px 1fr; }
  .st-lr span:last-child { display: none; }
}

/* intestazione delle colonne degli eroi: senza, i tre numeri in fondo non si capiscono */
.ch-head { display: grid; grid-template-columns: 32px 1fr 52px 62px 72px; gap: 8px;
  font-size: 9px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase;
  color: var(--muted); padding: 0 8px 3px; }
.ch-head span { text-align: right; }
@media (max-width: 560px) { .ch-head { display: none; } }

/* casella di spunta in linea, per le opzioni di un comando */
.ck.small { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px;
  color: var(--muted); cursor: pointer; }
.ck.small input { width: 14px; height: 14px; accent-color: var(--gold); cursor: pointer; }

/* campo di ricerca per Player ID, accanto al selettore di regno */
.ins-kpick #insCerca { width: 118px; padding: 7px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; text-align: center; }
.ins-kpick #insCerca:focus { outline: none; border-color: var(--gold); }
@media (max-width: 620px) { .ins-kpick span[style] { display: none; } .ins-kpick { row-gap: 6px; } }

/* ============ BARRA DELLE SEZIONI =================================== */
/* Sta su tutte le pagine e mostra solo quello che chi guarda puo' davvero aprire.
   Scorre in orizzontale invece di andare a capo: una barra che diventa due righe su
   telefono spinge giu' il contenuto proprio dove lo spazio manca.

   STRUTTURA: il ritorno al regno sta FUORI dal pezzo che scorre. Non e' un dettaglio.
   Quando era dentro, le due cose che servono si escludevano a vicenda: se la barra
   inseguiva la voce attiva spingeva fuori schermo il ritorno al regno (e da Accesso
   riservato, su telefono, non restava modo di tornare indietro); se non la inseguiva,
   su riservato la voce attiva restava visibile al 3%, cioe' l'indicatore di "dove sei"
   spariva. Con il regno fuori dal contenitore scorrevole valgono tutte e due, e valgono
   per costruzione: il regno non puo' scorrere via perche' non scorre. */
.sitenav { display: flex; gap: 6px; align-items: center;
  padding: 8px 0 2px; margin: 0 auto; max-width: 1100px; }
.sn-casa { flex: 0 0 auto; }
.sn-lista { display: flex; gap: 6px; min-width: 0; flex: 1 1 auto;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sn-lista::-webkit-scrollbar { display: none; }
/* La sfumatura dice "continua". Il gradiente e' FISICO, quindi in arabo va specchiato:
   li' il contenuto nascosto sta a sinistra, e senza specchiarlo il lato tagliato
   restava netto mentre si sfumava quello integro. */
/* Sfuma il lato da cui c'e' ancora roba, su ENTRAMBI i capi: una pillola tagliata di
   netto non sembra coperta, sembra rotta. Le due misure sono variabili perche' i lati
   si accendono in modo indipendente. Il gradiente e' fisico, quindi in arabo va
   specchiato: li' l'inizio della lista sta a destra. */
.sn-lista { --sf0: 0px; --sf1: 0px; }
.sn-lista.sfuma-inizio { --sf0: 26px; }
.sn-lista.sfuma-fine { --sf1: 26px; }
.sn-lista.sfuma-inizio, .sn-lista.sfuma-fine {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--sf0), #000 calc(100% - var(--sf1)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--sf0), #000 calc(100% - var(--sf1)), transparent 100%); }
[dir="rtl"] .sn-lista.sfuma-inizio, [dir="rtl"] .sn-lista.sfuma-fine {
  -webkit-mask-image: linear-gradient(270deg, transparent 0, #000 var(--sf0), #000 calc(100% - var(--sf1)), transparent 100%);
  mask-image: linear-gradient(270deg, transparent 0, #000 var(--sf0), #000 calc(100% - var(--sf1)), transparent 100%); }
.sn-v { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 7px 12px; border-radius: 999px; text-decoration: none;
  color: var(--muted); background: var(--bg2); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 800; transition: color .15s, border-color .15s, background .15s; }
.sn-v:hover { color: var(--text); border-color: var(--gold); }
/* la sezione in cui sei si vede senza doverla cercare */
.sn-v.on { color: var(--gold); border-color: var(--gold); background: rgba(229,181,103,.12); }
.sn-i { font-size: 14px; line-height: 1; }
/* le richieste di ingresso in attesa, sulla voce della War Room */
.sn-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--war); color: #fff; font-size: 11px; font-weight: 900; line-height: 1; }
@media (max-width: 560px) {
  .sitenav { padding: 6px 10px 4px; gap: 6px; }
  /* Le etichette restano: la barra scorre, quindi lo spazio non era il problema, e
     tre emoji senza parole non dicono niente a chi arriva la prima volta.
     44px e' la misura minima di un bersaglio da dito. */
  .sn-v { padding: 10px 14px; font-size: 12px; min-height: 44px; }
}

/* una riga che porta da qualche parte deve dirlo prima del clic, non dopo */

/* ===== vetrina: come cresce il regno ===== */
.gw-card { padding: 13px 14px 11px; }
.gw-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.gw-big { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.gw-big b { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.gw-big b.su { color: var(--green); }
.gw-big b.giu { color: var(--red); }
.gw-ends { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.gw-svg { display: block; width: 100%; height: 66px; margin: 8px 0 2px; overflow: visible; }
.gw-line { fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke; stroke-dasharray: 220; stroke-dashoffset: 220; }
.gw-line.vista { animation: gwTira 1.1s cubic-bezier(.3,.8,.3,1) forwards; }
@keyframes gwTira { to { stroke-dashoffset: 0; } }
.gw-area { fill: rgba(229,181,103,.14); opacity: 0; }
.gw-area.vista { animation: gwSfuma .9s .35s ease forwards; }
@keyframes gwSfuma { to { opacity: 1; } }
.gw-scale, .gw-note { display: flex; justify-content: space-between; }
.gw-note { display: block; margin-top: 7px; }

/* ===== vetrina: di cosa è fatta la potenza ===== */
.cp-card, .tp-card { padding: 11px 13px; display: flex; flex-direction: column; gap: 7px; }
.cp-r { display: grid; grid-template-columns: 108px 1fr 64px 46px; align-items: center; gap: 9px; }
.cp-n, .tp-n { font-size: 12px; font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-b, .tp-b { height: 11px; border-radius: 6px; background: var(--bg2); overflow: hidden; }
.cp-b i, .tp-b i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--gold);
  transition: width .9s cubic-bezier(.25,.9,.3,1); }
.cp-b i.vista, .tp-b i.vista { width: var(--w); }
.cp-truppe { background: linear-gradient(90deg,#e0645e,#f0918c) !important; }
.cp-eroi { background: linear-gradient(90deg,#e5b567,#f3d199) !important; }
.cp-maestria { background: linear-gradient(90deg,#b06bff,#d0a6ff) !important; }
.cp-charm { background: linear-gradient(90deg,#5b8def,#93b4f7) !important; }
.cp-gear { background: linear-gradient(90deg,#3fb27f,#7ad3aa) !important; }
.cp-pet { background: linear-gradient(90deg,#5bc0de,#9adcee) !important; }
.cp-edifici { background: linear-gradient(90deg,#93a1b3,#c0cad7) !important; }
.cp-ricerca { background: linear-gradient(90deg,#caa04a,#e2c98a) !important; }
.cp-v, .tp-v { font-size: 12px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.cp-p { font-size: 11.5px; font-weight: 900; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.tp-r { display: grid; grid-template-columns: 132px 1fr 74px; align-items: center; gap: 9px; }
.tp-b i { background: linear-gradient(90deg,#7c5cff,#b79bff) !important; }

/* ===== vetrina: quanto è sviluppato il regno ===== */
.tc-card { padding: 13px 13px 10px; }
.tc-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; align-items: end; }
.tc-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.tc-n { font-size: 11px; font-weight: 900; color: var(--muted); font-variant-numeric: tabular-nums; }
.tc-b { width: 100%; height: 92px; display: flex; align-items: flex-end; background: var(--bg2); border-radius: 6px; overflow: hidden; }
.tc-b i { display: block; width: 100%; height: 0; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg,#e5b567,#caa04a); transition: height .85s cubic-bezier(.25,.9,.3,1); }
.tc-b i.vista { height: var(--h); }
.tc-l { font-size: 10px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.tc-l.alto { color: var(--gold); }
@media (max-width: 560px) {
  .cp-r { grid-template-columns: 84px 1fr 56px 40px; gap: 6px; }
  .tp-r { grid-template-columns: 96px 1fr 60px; gap: 6px; }
  .cp-n, .tp-n { font-size: 11px; }
  .tc-b { height: 72px; }
  .tc-n, .tc-l { font-size: 9px; }
  .gw-big b { font-size: 22px; }
}

.tc-resto { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }

.ins-d.mig { color: #b06bff; font-weight: 900; }

/* ===== la porta riservata: l'insegna della stanza ===== */
.ris-who { padding: 0; overflow: hidden; border-color: #3a2a2e; }
.rq-main { display: flex; align-items: center; gap: 13px; padding: 13px 15px;
  background: linear-gradient(135deg, rgba(224,100,94,.10), rgba(229,181,103,.07) 55%, transparent); }
.rq-crest { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 10px rgba(224,100,94,.35)); }
.rq-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.rq-id b { font-size: 15px; font-weight: 900; letter-spacing: .2px; }
.rq-bollo { font-size: 15px; flex: 0 0 auto; }
.rq-bollo.ni { opacity: .7; }
.ris-who .hk-clocks { border-top: 1px solid var(--line); margin: 0; }

/* le sezioni chiuse hanno un colore proprio: si riconoscono prima di leggerle */
/* Il filo colorato sta all'INIZIO della scheda, non a sinistra: in arabo l'inizio e'
   a destra, e un bordo 'left' fisso finiva dalla parte sbagliata. */
.warroom-page .sec-card { position: relative; padding-inline-start: 15px; }
.warroom-page .sec-card::before { content: ''; position: absolute; inset-inline-start: 0; top: 10px; bottom: 10px;
  width: 3px; border-start-end-radius: 3px; border-end-end-radius: 3px; background: var(--linea, var(--line)); transition: top .15s, bottom .15s; }
.warroom-page .sec-card:hover::before { top: 4px; bottom: 4px; }
.warroom-page .sec-card[href^="kvk"] { --linea: #e0645e; }
.warroom-page .sec-card[href^="insights"] { --linea: #5b8def; }
.warroom-page .sec-card[href^="targets"] { --linea: var(--gold); }
.warroom-page .sec-card[href^="king"] { --linea: #e5b567; }
.warroom-page .sec-card[href^="manager"] { --linea: #3fb27f; }
.warroom-page .sec-card[href^="admin"] { --linea: #b06bff; }
.warroom-page .sec-card .sc-ico { width: 34px; height: 34px; display: flex; align-items: center;
  justify-content: center; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); font-size: 17px; }
.warroom-page .sec-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.warroom-page .sec-card.locked .sc-lock { opacity: 1; }

/* un filo d'oro sotto i titoli di sezione: dà il ritmo alla pagina */
.warroom-page .sec-h { display: flex; align-items: center; gap: 10px; }
.warroom-page .sec-h::after { content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent); }

/* le spiegazioni lunghe: presenti, ma non addosso a chi entra */
.ins-perche { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.ins-perche > summary { cursor: pointer; font-size: 12px; font-weight: 800; color: var(--muted);
  list-style: none; display: flex; align-items: center; gap: 6px; }
.ins-perche > summary::-webkit-details-marker { display: none; }
.ins-perche > summary::before { content: '▸'; transition: transform .15s; }
.ins-perche[open] > summary::before { transform: rotate(90deg); }
.ins-perche > summary:hover { color: var(--gold); }
.ins-perche .ins-base:first-of-type { margin-top: 7px; }

/* la War Room quando è vuota: si spiega, invece di sembrare rotta */
.tg-empty-box h3 { margin: 0 0 4px; font-size: 16px; font-weight: 900; }
.tg-emptyq { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 9px;
  max-width: 620px; margin: 18px auto 0; text-align: start; }
.tg-emptyq span { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px;
  border-radius: 11px; background: var(--bg2); border: 1px solid var(--line); }
.tg-emptyq b { font-size: 12.5px; font-weight: 800; color: var(--gold); }
.tg-emptyq i { font-style: normal; font-size: 11.5px; color: var(--muted); }

/* ===== KvK Room: il tabellone ===== */
/* Una barra sola per il punteggio totale: chi guida si vede senza leggere tre numeri. */
.lv-split { display: flex; height: 9px; border-radius: 5px; overflow: hidden;
  background: var(--bg2); margin: 9px 0 2px; }
.lv-split i { display: block; height: 100%; transition: width .7s cubic-bezier(.25,.9,.3,1); }
.lv-split i.us { background: linear-gradient(90deg,#5b8def,#89aef5); }
.lv-split i.them { flex: 1; background: linear-gradient(90deg,#e86a64,#e0645e); }
.lv-side.us b { color: #89aef5; }
.lv-side.them b { color: #e86a64; }
/* la giornata vinta o persa si legge dal colore della riga, non solo dalla lettera */
.lv-day { border-radius: 8px; padding-inline: 6px; }
.lv-day:has(.kvk-form.w) { background: linear-gradient(90deg, rgba(91,141,239,.10), transparent 70%); }
.lv-day:has(.kvk-form.l) { background: linear-gradient(90deg, rgba(224,100,94,.10), transparent 70%); }
.lv-day:has(.lv-now) { background: linear-gradient(90deg, rgba(229,181,103,.13), transparent 75%); }

/* il filo d'oro dei titoli vale in tutte le stanze chiuse, non solo sulla porta */
.warroom-page .kvk-h { display: flex; align-items: center; gap: 10px; }
.warroom-page .kvk-h::after { content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent); }

/* ===== Insights: le righe dei giocatori ===== */
/* Dodici righe identiche in fila non guidano l'occhio: una velatura alternata dà il passo,
   e il numero di posizione va a SINISTRA — si legge posizione, poi nome, non il contrario. */
.ins-list .ins-row:nth-child(even) { background: rgba(255,255,255,.014); }
.ins-row { transition: background .12s, border-color .12s, transform .12s; }
.ins-row:hover { transform: translateX(2px); }
/* La posizione NON si sposta a sinistra: la riga e una griglia a colonne fisse, e
   spostandola li si prendeva la colonna del nome, che finiva troncato a 'JOKE…'.
   Resta in fondo, dove la griglia le ha dato spazio, ma si accende al passaggio. */
.ins-row .sr-i { font-size: 11px; opacity: .75; }
.ins-row:hover .sr-i { color: var(--gold); opacity: 1; }
/* la potenza è la colonna su cui si confronta: le cifre devono incolonnarsi davvero */
.ins-pw, .ins-my, .ins-d { font-variant-numeric: tabular-nums; }

/* le etichette dentro le schede: piccole ma con un segno che le stacca dal testo */
.warroom-page .cb-role { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.warroom-page .cb-role::before { content: ''; width: 3px; height: 11px; border-radius: 2px;
  background: var(--gold); opacity: .8; flex: 0 0 auto; }

/* la scheda aperta si vede da lontano: un filo d oro sotto, non solo un fondo diverso */
.ins-page .kvk-tabs button.on { box-shadow: inset 0 -2px 0 var(--gold); }

/* il cancello del portale: stessa forma di quello riservato, chiave d'oro invece che rossa */
.gate-card.king { border-color: #5a4522;
  background: radial-gradient(120% 90% at 50% -20%, rgba(229,181,103,.16), transparent 62%), var(--panel); }
.gate-card.king::before, .gate-card.king::after { border-color: rgba(229,181,103,.5); }
.gate-card.king .gate-emblem { filter: drop-shadow(0 0 16px rgba(229,181,103,.55)); }
.gate-card.king .gate-emblem::before, .gate-card.king .gate-emblem::after { border-color: rgba(229,181,103,.45); }
.gate-card.king .gate-badge { color: #f3d199; background: rgba(229,181,103,.13); border-color: rgba(229,181,103,.42); }
.gate-card.king input:focus { border-color: var(--gold); box-shadow: 0 0 14px -3px rgba(229,181,103,.6); }
.gate-card .banner { text-align: start; }

/* ===== le fasce libere si devono TROVARE ===== */
/* A KvK pieno resta una fascia libera su quarantotto, ed era la card più spenta della
   pagina: quelle prenotate hanno avatar, colori e livelli, la libera aveva un bordo
   tratteggiato e basta. È l'unica su cui si può agire: deve essere la prima che si vede. */
.slot.free { border-style: dashed; border-color: var(--gold2);
  background: linear-gradient(180deg, rgba(229,181,103,.07), var(--bg2)); }
.slot.free .time { color: var(--gold); }
.slot.free:hover { border-color: var(--gold); box-shadow: 0 0 16px -6px rgba(229,181,103,.7); }
.slot.free .btn.gold { box-shadow: 0 2px 10px -3px rgba(229,181,103,.55); }
@media (prefers-reduced-motion: no-preference) {
  .slot.free .btn.gold { animation: slotRespira 2.6s ease-in-out infinite; }
  @keyframes slotRespira {
    0%, 100% { box-shadow: 0 2px 10px -3px rgba(229,181,103,.45); }
    50% { box-shadow: 0 2px 16px -3px rgba(229,181,103,.85); }
  }
}


/* ===== la dashboard del Re: una lista di lavoro ===== */
/* Era al contrario: le righe GIÀ FATTE avevano il fondo dorato — le più vistose della
   pagina — e quelle ancora da fare stavano in grigio. In una lista di lavoro deve gridare
   ciò che manca, non ciò che è finito. */
.king-row { transition: background .12s, border-color .12s; }
.king-row:not(.done) { border-left-color: var(--gold); box-shadow: inset 0 0 30px -22px rgba(229,181,103,.9); }
.king-row.done { background: var(--bg2); border-color: var(--line); border-left-color: #2e6b4b; opacity: .82; }
.king-row.done:hover { opacity: 1; }
.king-row.done .king-time { color: var(--muted); }
.king-row:not(.done) .king-time { color: var(--gold); }
/* liberare uno slot è irreversibile: non deve somigliare al pulsante accanto */
.king-actions .btn.danger { border-color: #6b3131; }
.king-actions .btn.danger:hover { background: #3a1a1a; border-color: var(--red); }

/* ===== pannello admin: l'indice appiccicato in alto ===== */
.adm-indice { position: sticky; top: 0; z-index: 30; display: flex; gap: 6px; overflow-x: auto;
  padding: 9px 2px; margin-bottom: 4px; scrollbar-width: none;
  background: linear-gradient(180deg, var(--bg) 70%, transparent); }
.adm-indice::-webkit-scrollbar { display: none; }
.adm-indice button { flex: 0 0 auto; font: inherit; font-size: 11.5px; font-weight: 800;
  color: var(--muted); background: var(--bg2); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 11px; cursor: pointer; white-space: nowrap; transition: color .12s, border-color .12s; }
.adm-indice button:hover { color: var(--gold); border-color: var(--gold2); }

/* i titoli delle schede: lo stesso filo d'oro delle stanze chiuse */
#panel > .card > h2 { display: flex; align-items: center; gap: 9px; }
#panel > .card > h2::after { content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent); }

/* Trasferimenti: la porta riservata ha il suo colore (lo stesso del valore di trasferimento),
   le note sotto gli elenchi, e le righe del gruppo che non si aprono */
.warroom-page .sec-card[href*="tab=tr"] { --linea: #b06bff; }
.tr-nota { margin-top: 8px; }
.ins-row.tr-g { cursor: default; }
.ins-row.tr-g:hover { transform: none; }
.tr-rk { color: var(--gold); font-variant-numeric: tabular-nums; }

/* Su telefono le righe perdono centro citta' e prove per far posto al nome; nelle righe del
   gruppo di trasferimento pero' il regno E' l'informazione, e resta. */
@media (max-width: 700px) {
  .ins-row.tr-g .ins-tc { display: block; }
}

/* i due passi verso l uscita stanno nella stessa cella della riga */
.tr-passi { display: inline-flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }

/* ── Timeline del regno (vetrina): una linea verticale, un nodo per giorno, le tappe dello
   stesso giorno insieme. Il nodo della prossima tappa e' pieno; i colori sono quelli delle
   porte riservate, cosi' la stessa categoria ha lo stesso colore ovunque. ── */
.tl-card { padding: 14px 16px; }
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.tl-day { display: flex; flex-direction: column; line-height: 1.2; }
.tl-day b { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tl-next b { color: var(--gold); }
.tl-list { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-list::before { content: ''; position: absolute; inset-inline-start: 7px; top: 14px; bottom: 14px; width: 2px; background: var(--line); }
.tl-g { position: relative; display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 12px; padding-block: 7px; padding-inline-start: 24px; }
.tl-g::before { content: ''; position: absolute; inset-inline-start: 2px; top: 12px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--gold); }
.tl-list:not(.past) .tl-g:first-child::before { background: var(--gold); box-shadow: 0 0 0 4px rgba(229, 181, 103, .18); }
.tl-when { display: flex; flex-direction: column; line-height: 1.25; }
.tl-left { font-size: 12px; font-weight: 800; color: var(--gold); }
.tl-items { display: flex; flex-direction: column; gap: 6px; }
.tl-t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 6px 10px; border-radius: 9px;
  background: var(--bg2); border-inline-start: 3px solid var(--tl, var(--gold)); }
.tl-t.eroi { --tl: #e5b567; }
.tl-t.pet { --tl: #3fb27f; }
.tl-t.truegold { --tl: #f0a030; }
.tl-t.novita { --tl: #5b8def; }
.tl-t.pvp { --tl: #e0645e; }
.tl-cat { flex-basis: 100%; font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--tl, var(--gold)); }
.tl-x { flex-basis: 100%; }
.tl-stima { font-style: normal; font-size: 10px; font-weight: 800; padding: 0 6px; border-radius: 6px; border: 1px dashed var(--muted); color: var(--muted); }
.tl-past { margin-top: 10px; }
.tl-past summary { cursor: pointer; font-weight: 800; padding: 4px 0; }
.tl-list.past .tl-g { opacity: .7; }
.tl-foot { margin-top: 12px; }
@media (max-width: 560px) { .tl-g { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

/* ---- inviti di trasferimento dell'alleanza (War Room): quanti ne restano, e quale si usa ---- */
.tg-budget .tb-head, .tg-richieste .tb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 6px; }
.tg-budget .tb-head h2, .tg-richieste .tb-head h2 { margin: 0; }
.tb-riga { margin-top: 10px; }
.tb-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; }
.tb-top b { color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-riga.finiti .tb-top b { color: var(--red); }
.tb-bar { height: 8px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin-top: 5px; }
.tb-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), #e0645e); }
.tg-inv { display: flex; gap: 6px; }
.tg-inv button { flex: 1; min-height: 44px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2);
  color: var(--text); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.tg-inv button.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.tg-inv button b { color: var(--gold); margin-inline-start: 4px; font-variant-numeric: tabular-nums; }
.tg-inv button:disabled { opacity: .45; cursor: not-allowed; }
.tg-strip .ts-inv { font: inherit; font-size: 10.5px; font-weight: 900; padding: 1px 7px; border-radius: 6px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .18); color: inherit; white-space: nowrap; }
button.ts-inv { cursor: pointer; }
.tg-by { margin-top: 6px; }

/* ---- inviti per alleanza (admin) ---- */
.inv-tab { display: flex; flex-direction: column; gap: 4px; }
.inv-r { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr 1fr; gap: 10px; align-items: center; padding: 6px 8px;
  border-radius: 9px; background: var(--bg2); }
.inv-r.inv-h { background: none; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.inv-s { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-cella { display: flex; align-items: center; gap: 8px; }
.inv-cella input { width: 72px; text-align: center; }
@media (max-width: 560px) { .inv-r { grid-template-columns: minmax(0, 1fr) 1fr 1fr; gap: 6px; } .inv-cella { flex-direction: column; align-items: stretch; gap: 2px; } .inv-cella input { width: 100%; } }

/* la pastiglia dell'invito sulla scheda: fondo scuro, testo chiaro, bordo del suo colore. Si
   legge su ogni striscia, anche su quelle oro dei livelli alti dove il testo e' scuro. */
.tg-strip .ts-inv { font-size: 11px; font-weight: 800; letter-spacing: .2px; line-height: 1.45; padding: 2px 9px;
  border-radius: 999px; background: rgba(10, 12, 16, .88); color: #f4efe3; text-shadow: none;
  border: 1px solid rgba(255, 255, 255, .25); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); position: relative; z-index: 1; }
.tg-strip .ts-inv.transfer { color: #f3d99a; border-color: rgba(229, 181, 103, .7); }
.tg-strip .ts-inv.special { color: #e6cbff; border-color: rgba(176, 107, 255, .75); }
button.ts-inv:hover { filter: brightness(1.2); }
/* prove e migrant score: una seconda riga di letture sotto potenza, kills e centro citta' */
.tg-readout.tg-punti { margin-top: -2px; }
.tg-readout.tg-punti .ro b { font-size: 14px; }

/* ---- richieste di ingresso (War Room): una scheda per candidato, il messaggio in vista ---- */
.tg-richieste .tb-head h2 { display: flex; align-items: center; gap: 8px; }
.cand-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
  background: var(--gold); color: #1a1406; font-size: 12px; font-weight: 900; }
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 10px; }
.cand-card { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 12px 13px; min-width: 0; }
.cand-top { display: flex; align-items: center; gap: 10px; }
.cand-top .avatar { width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0; }
.cand-id { display: flex; flex-direction: column; min-width: 0; }
.cand-msg { margin: 4px 0 10px; padding: 8px 11px; border-inline-start: 3px solid var(--gold); background: var(--bg2);
  border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.cand-act { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cand-act .spacer { flex: 1; }
.cand-decise { margin-top: 12px; }
.cand-decise summary { cursor: pointer; font-weight: 800; }

/* ---- il modulo pubblico per chiedere di entrare: lo stesso terminale del cancello ma in oro,
   perche' qui non si sbatte contro una porta chiusa; i campi a sinistra, da leggere ---- */
.gate-card.join-card { border-color: #6b5530;
  background: radial-gradient(120% 90% at 50% -20%, rgba(229,181,103,.14), transparent 62%), var(--panel); }
.gate-card.join-card::before, .gate-card.join-card::after { border-color: rgba(229,181,103,.5); }
.gate-card.join-card .gate-emblem { filter: drop-shadow(0 0 16px rgba(229,181,103,.55)); }
.gate-card.join-card .gate-emblem::before, .gate-card.join-card .gate-emblem::after { border-color: rgba(229,181,103,.4); }
.gate-card.join-card input { letter-spacing: normal; text-align: start; }
.gate-card.join-card label.f, .gate-card.join-card .err-text { text-align: start; }
.gate-card.join-card input:focus, .gate-card.join-card textarea:focus { border-color: var(--gold); box-shadow: 0 0 14px -3px rgba(229,181,103,.55); }
.join-card textarea { width: 100%; resize: vertical; min-height: 110px; }
.join-card .hk-clocks { margin: 6px 0 12px; }
.join-count { text-align: end; margin-top: 4px; }

/* ---- CALCOLATORE (/calculator) ----
   Il CSS del progetto kingshot-calculator, chiuso dentro .calc-page perche' dodici suoi nomi di classe
   (card, tabs, ok, show, active...) esistono anche qui e altrimenti cambierebbero le altre pagine. I colori
   sono quelli del sito. In fondo, schede e pulsanti attivi presi dall'aspetto del portale. ---- */
.calc-page .ratio { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.calc-page .card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 18px; }
.calc-page .card h2 { font-size: 16px; margin: 0 0 12px; color: var(--gold); }
.calc-page .field { margin-bottom: 14px; }
.calc-page .field-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; margin-bottom: 7px; }
.calc-page .field-label .icon { font-size: 19px; }
.calc-page .inputwrap { display: flex; gap: 8px; align-items: stretch; }
.calc-page .inputwrap input { flex: 1 1 auto; min-width: 0; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 13px 14px; font-size: 17px; width: 100%; }
.calc-page .inputwrap input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(229,181,103,.18); }
.calc-page .unit { flex: 0 0 88px; width: 88px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 13px 10px; font-size: 16px; text-align: center; -webkit-appearance: none; appearance: none; }
.calc-page .unit:focus { outline: none; border-color: var(--gold); }
.calc-page select#baseSel, .calc-page select#objBaseSel { background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 13px 14px; font-size: 16px; margin-bottom: 14px; width: 100%; -webkit-appearance: none; appearance: none; }
.calc-page .seclabel { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.calc-page .out { font-size: 15px; line-height: 1.75; margin-top: 14px; }
.calc-page .out .val { color: var(--gold); font-weight: 700; }
.calc-page .shortage { margin-top: 12px; padding: 13px; border-radius: 10px; background: #2a1414; border: 1px solid #5a2b2b; }
.calc-page .ok { margin-top: 12px; padding: 13px; border-radius: 10px; background: var(--green-bg); border: 1px solid #2b5a3a; }
.calc-page .surplus { color: var(--green); font-weight: 700; }
.calc-page .missing { color: var(--red); font-weight: 700; }
.calc-page .enough { color: var(--green); font-weight: 700; }
.calc-page .hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.5; }
.calc-page .parsed { color: var(--blue); font-size: 12px; min-height: 15px; margin: 5px 0 0 2px; }
.calc-page .modes { display: flex; gap: 8px; margin-bottom: 12px; }
.calc-page .modes button { flex: 1; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 10px 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.calc-page .modes button.active { background: var(--gold); border-color: var(--gold); color: var(--bg2); }
@media (min-width: 520px) {
  .calc-page .inputwrap input { font-size: 16px; }
}
.calc-page .march-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.calc-page .march-card { flex: 1 1 calc(50% - 5px); min-width: 130px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 12px; text-align: center; }
.calc-page .march-card .mc-icon { font-size: 26px; }
.calc-page .march-card .mc-name { font-size: 13px; color: var(--muted); margin: 2px 0 6px; }
.calc-page .march-card .mc-count { font-size: 30px; font-weight: 800; color: var(--gold); line-height: 1; }
.calc-page .march-card .mc-count .small { font-size: 14px; color: var(--muted); font-weight: 600; }
.calc-page .march-card .mc-yield { font-size: 12px; color: var(--green); margin-top: 6px; }
.calc-page .march-card.zero .mc-count { color: #56606d; }
.calc-page .march-card.zero .mc-yield { color: #56606d; }
.calc-page .totals { margin-top: 14px; padding: 13px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); font-size: 14px; line-height: 1.7; }
.calc-page .totals b { color: var(--gold); }
.calc-page .ocr-box { margin: 0 0 16px; padding: 14px; border: 1px dashed #3a4656; border-radius: 12px; background: var(--bg2); }
.calc-page .ocr-btn { display: block; width: 100%; text-align: center; background: var(--line); color: var(--text); border: 1px solid #3a4656; border-radius: 10px; padding: 14px; font-size: 15px; font-weight: 600; cursor: pointer; }
.calc-page .ocr-btn:active { background: var(--panel2); }
.calc-page .ocr-btn.busy { opacity: .65; pointer-events: none; }
.calc-page .ocr-status { font-size: 13px; margin-top: 10px; line-height: 1.6; min-height: 0; }
.calc-page .ocr-status .okmsg { color: var(--green); }
.calc-page .ocr-status .errmsg { color: var(--red); }
.calc-page .ocr-status .working { color: var(--blue); }
.calc-page .ocr-row { color: var(--text); }
.calc-page .tg-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; }
.calc-page .tg-row { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.calc-page .tg-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.calc-page .tg-slider { flex: 0 0 46px; width: 46px; height: 26px; border-radius: 999px; background: var(--line); border: 1px solid #3a4656; position: relative; transition: background .15s; }
.calc-page .tg-slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.calc-page .tg-row input:checked + .tg-slider { background: var(--gold); border-color: var(--gold); }
.calc-page .tg-row input:checked + .tg-slider::after { transform: translateX(20px); background: var(--bg2); }
.calc-page .tg-row input:focus-visible + .tg-slider { box-shadow: 0 0 0 2px rgba(229,181,103,.35); }
.calc-page .tg-text { font-weight: 600; font-size: 15px; }
.calc-page .tg-text b { color: var(--gold); }
.calc-page .tg-note { margin: 10px 0 6px; padding: 11px 12px; border-radius: 10px; background: #2a2410; border: 1px solid #6b5530; font-size: 13px; line-height: 1.6; color: #f2dca0; }
.calc-page .tg-note b { color: var(--gold); }
.calc-page .tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.calc-page .tabs button { flex: 1; background: var(--panel); border: 1px solid var(--line); color: var(--muted); border-radius: 12px; padding: 12px 8px; font-size: 14px; font-weight: 700; cursor: pointer; }
.calc-page .tabs button.active { background: var(--gold); border-color: var(--gold); color: var(--bg2); }
.calc-page .gem-search { width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 13px 14px; font-size: 16px; margin-bottom: 12px; }
.calc-page .gem-search:focus { outline: none; border-color: var(--gold); }
.calc-page .gem-cat { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: var(--bg2); overflow: hidden; }
.calc-page .gem-cat > summary { padding: 12px 14px; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--text); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.calc-page .gem-cat > summary::-webkit-details-marker { display: none; }
.calc-page .gem-cat > summary::marker { content: ''; }
.calc-page .gem-cat[open] > summary { border-bottom: 1px solid #252e3b; }
.calc-page .gc-count { color: var(--muted); font-size: 12px; font-weight: 600; }
.calc-page .gi-head { display: grid; grid-template-columns: 1fr 62px 82px 34px; gap: 6px; padding: 8px 14px; font-size: 11px; color: #6b7788; text-transform: uppercase; letter-spacing: .04em; }
.calc-page .gi-head span:nth-child(2), .calc-page .gi-head span:nth-child(3) { text-align: center; }
.calc-page .gi-row { display: grid; grid-template-columns: 1fr 62px 82px 34px; gap: 6px; padding: 9px 14px; border-top: 1px solid #252e3b; align-items: center; }
.calc-page .gi-name { font-size: 13.5px; line-height: 1.35; }
.calc-page .gi-note { color: #6b7788; font-size: 11px; }
.calc-page .gi-badge { display: none; background: var(--gold); color: var(--bg2); border-radius: 5px; font-size: 10px; font-weight: 800; padding: 1px 5px; margin-left: 5px; vertical-align: 1px; }
.calc-page .gi-badge.on { display: inline-block; }
.calc-page .gi-sub { color: var(--green); font-size: 11.5px; margin-top: 3px; }
.calc-page .gi-sub b { color: var(--green); }
.calc-page .gi-kc { color: var(--muted); font-size: 11.5px; margin-top: 3px; line-height: 1.5; }
.calc-page .gi-kc b { color: var(--gold2); font-weight: 700; }
.calc-page .gi-kc .money { color: var(--green); font-weight: 700; }
.calc-page .gi-kc .sep { color: #46505c; margin: 0 5px; }
.calc-page .gi-kc .lbl { display: inline-block; min-width: 52px; color: #6b7788; font-size: 10px; text-transform: uppercase; letter-spacing: .03em; }
.calc-page .gi-qty, .calc-page .gi-val { background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 9px 4px; font-size: 15px; text-align: center; width: 100%; min-width: 0; }
.calc-page .gi-qty:focus, .calc-page .gi-val:focus { outline: none; border-color: var(--gold); }
.calc-page .gi-val { color: var(--gold); font-weight: 700; }
.calc-page .gi-val.custom { border-color: var(--gold); background: #2a2410; }
.calc-page .gi-reset { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 8px 0; font-size: 14px; cursor: pointer; width: 100%; }
.calc-page .gi-reset:disabled { opacity: .3; cursor: default; }
.calc-page .preset-note { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin-top: 10px; }
.calc-page .rate-note { margin-top: 8px; padding: 9px 11px; border-radius: 9px; background: var(--bg2); border: 1px solid var(--line); font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.calc-page .rate-note b { color: var(--gold2); }
.calc-page .bench { font-size: 13.5px; font-weight: 700; margin-top: 2px; display: inline-block; }
.calc-page .b-over { color: var(--green); }
.calc-page .b-near { color: var(--gold); }
.calc-page .b-under { color: var(--red); }
.calc-page .kc-line { color: var(--gold2); font-size: 13.5px; font-weight: 700; }
.calc-page .src-note { margin-top: 12px; padding: 11px 12px; border-radius: 10px; background: #2a2410; border: 1px solid #6b5530; font-size: 12.5px; line-height: 1.6; color: #f2dca0; }
.calc-page .src-note b { color: var(--gold); }
.calc-page .minibtns { display: flex; gap: 8px; margin-top: 12px; }
.calc-page .minibtns button { flex: 1; background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 10px 8px; font-size: 12.5px; cursor: pointer; }
.calc-page .verdict { font-size: 22px; font-weight: 800; }
.calc-page .v-insane { color: var(--green); }
.calc-page .v-good { color: var(--gold); }
.calc-page .v-fair { color: var(--gold); }
.calc-page .v-poor { color: var(--red); }
.calc-page .pack-line { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 2px 0; }
.calc-page .pack-line span:last-child { color: var(--gold); font-weight: 700; white-space: nowrap; }
.calc-page .pack-bar { position: fixed; left: 0; right: 0; bottom: 0; display: none; z-index: 20; background: var(--panel2); border-top: 1px solid var(--line); padding: 11px 14px calc(11px + env(safe-area-inset-bottom)); font-size: 14px; text-align: center; }
.calc-page .pack-bar.show { display: block; }
.calc-page .pack-bar b { color: var(--gold); }
.calc-page .pack-bar .bar-sub { font-size: 12px; color: var(--muted); }
.calc-page .pack-bar .bar-sub b { color: var(--green); }
.calc-page .pack-bar .bar-sub .sep { color: #46505c; margin: 0 6px; }
.calc-page .mini-file { flex: 1; background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 10px 8px; font-size: 12.5px; cursor: pointer; text-align: center; }
.calc-page .backup-status { font-size: 12.5px; margin-top: 10px; line-height: 1.6; min-height: 0; }
.calc-page .backup-status .okmsg { color: var(--green); }
.calc-page .backup-status .errmsg { color: var(--red); }
.calc-page .backup-status .working { color: var(--blue); }
.calc-page .intro { position: relative; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 38px 14px 14px; margin-bottom: 16px; }
.calc-page .intro-t { font-size: 14px; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.calc-page .intro-r { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-top: 5px; }
.calc-page .intro-r b { color: var(--text); }
.calc-page .intro-x { position: absolute; top: 8px; right: 8px; background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; width: 26px; height: 26px; font-size: 12px; cursor: pointer; line-height: 1; }
.calc-page .settings { border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); margin-bottom: 14px; }
.calc-page .settings > summary { padding: 13px 14px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.calc-page .settings > summary::-webkit-details-marker { display: none; }
.calc-page .settings > summary::marker { content: ''; }
.calc-page .settings[open] > summary { border-bottom: 1px solid var(--line); }
.calc-page .settings .sum-val { color: var(--muted); font-size: 12px; font-weight: 500; text-align: right; }
.calc-page .settings-body { padding: 14px; }
.calc-page .sec { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); margin-bottom: 14px; }
.calc-page .sec > summary { padding: 15px 16px; cursor: pointer; font-size: 16px; font-weight: 700; color: var(--gold); list-style: none; display: flex; align-items: center; gap: 8px; }
.calc-page .sec > summary::-webkit-details-marker { display: none; }
.calc-page .sec > summary::marker { content: ''; }
.calc-page .sec > summary::after { content: '▾'; margin-left: auto; color: #6b7788; font-size: 13px; }
.calc-page .sec[open] > summary::after { content: '▴'; }
.calc-page .sec[open] > summary { border-bottom: 1px solid var(--line); }
.calc-page .sec-body { padding: 16px; }
.calc-page .quicknav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.calc-page .quicknav button { flex: 0 0 auto; background: var(--panel); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 8px 13px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.calc-page .quicknav button:active { border-color: var(--gold); color: var(--gold); }
.calc-page .empty-state { text-align: center; padding: 26px 18px; border: 1px dashed #3a4656; border-radius: 12px; background: var(--bg2); margin: 14px 0; }
.calc-page .es-icon { font-size: 34px; }
.calc-page .es-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 8px 0 6px; }
.calc-page .es-text { font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 380px; margin: 0 auto; }
.calc-page .es-cta { margin-top: 14px; background: var(--gold); border: none; color: var(--bg2); border-radius: 10px; padding: 12px 20px; font-size: 14px; font-weight: 700; cursor: pointer; }
.calc-page .es-cta.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.calc-page .shop-sel { flex: 1 1 auto; min-width: 0; width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 13px 14px; font-size: 16px; -webkit-appearance: none; appearance: none; }
.calc-page .shop-head, .calc-page .shop-row { display: grid; grid-template-columns: 1fr 46px 62px 46px 30px; gap: 5px; align-items: center; }
.calc-page .shop-head { padding: 10px 2px 6px; font-size: 10px; color: #6b7788; text-transform: uppercase; letter-spacing: .04em; }
.calc-page .shop-head span:not(:first-child) { text-align: center; }
.calc-page .shop-row { padding: 6px 0; border-top: 1px solid #252e3b; }
.calc-page .shop-row select, .calc-page .shop-row input { background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 9px 5px; font-size: 14px; width: 100%; min-width: 0; -webkit-appearance: none; appearance: none; }
.calc-page .shop-row input { text-align: center; }
.calc-page .shop-row select { font-size: 13px; }
.calc-page .shop-row select:focus, .calc-page .shop-row input:focus { outline: none; border-color: var(--gold); }
.calc-page .shop-row .del { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 8px 0; font-size: 13px; cursor: pointer; width: 100%; }
.calc-page .shop-row .rowsub { grid-column: 1 / -1; font-size: 11px; color: var(--green); padding: 0 0 4px 2px; }
.calc-page .prio-row { display: grid; grid-template-columns: 1fr 62px 30px; gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid #4a3a6a; border-radius: 10px; background: #1a1630; margin-bottom: 8px; }
.calc-page .prio-main { min-width: 0; }
.calc-page .prio-name { font-size: 14px; font-weight: 600; }
.calc-page .prio-worth { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.calc-page .prio-worth b { color: #c39bff; }
.calc-page .prio-quicks { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.calc-page .prio-quick { background: var(--bg2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 700; cursor: pointer; }
.calc-page .prio-quick.on { background: #c39bff; border-color: #c39bff; color: #1a1630; }
.calc-page .prio-mult { background: var(--bg2); border: 1px solid #4a3a6a; color: #c39bff; border-radius: 8px; padding: 9px 4px; font-size: 15px; font-weight: 700; text-align: center; width: 100%; min-width: 0; }
.calc-page .prio-mult:focus { outline: none; border-color: #c39bff; }
.calc-page .gi-prio, .calc-page .rank-prio { display: inline-block; background: #c39bff; color: #1a1630; border-radius: 5px; font-size: 10px; font-weight: 800; padding: 1px 5px; margin-left: 5px; vertical-align: 1px; }
.calc-page .rank { margin-top: 4px; }
.calc-page .rank-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); margin-bottom: 8px; }
.calc-page .rank-row.best { border-color: var(--gold); background: #2a2410; }
.calc-page .rank-pos { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--line); color: var(--text); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.calc-page .rank-row.best .rank-pos { background: var(--gold); color: var(--bg2); }
.calc-page .rank-main { flex: 1 1 auto; min-width: 0; }
.calc-page .rank-name { font-size: 14px; font-weight: 600; }
.calc-page .rank-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.calc-page .rank-meta .money { color: var(--green); font-weight: 700; }
.calc-page .rank-val { flex: 0 0 auto; text-align: right; }
.calc-page .rank-num { font-size: 16px; font-weight: 800; color: var(--gold); }
.calc-page .rank-unit { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.calc-page .rank-rel { font-size: 11px; color: var(--muted); }
.calc-page .pk-row { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); margin-bottom: 8px; }
.calc-page .pk-main { flex: 1 1 auto; min-width: 0; }
.calc-page .pk-name { font-size: 14px; font-weight: 600; }
.calc-page .pk-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.calc-page .pk-meta .money { color: var(--green); font-weight: 700; }
.calc-page .pk-then { color: var(--gold2); }
.calc-page .pk-side { flex: 0 0 auto; text-align: right; }
.calc-page .pk-btns { display: flex; gap: 5px; margin-top: 6px; justify-content: flex-end; }
.calc-page .pk-btns button { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.calc-page .pk-btns .pk-load { color: var(--gold); border-color: #6b5530; }
.calc-page .log-row { display: grid; grid-template-columns: 1fr 30px; gap: 8px; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); margin-bottom: 7px; }
.calc-page .log-main { min-width: 0; }
.calc-page .log-name { font-size: 13.5px; font-weight: 600; }
.calc-page .log-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.calc-page .log-meta b { color: var(--green); }
.calc-page .plan-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 5px 0; border-bottom: 1px solid #252e3b; }
.calc-page .plan-row b { color: var(--gold); }
.calc-page .calc { max-width: 720px; margin: 0 auto; }
.calc-page .tabs button { background: var(--panel); border-radius: 10px; }
.calc-page .tabs button.active { background: var(--panel2); border-color: var(--gold); color: var(--text);
  box-shadow: 0 0 14px -6px rgba(229,181,103,.6), inset 0 -2px 0 var(--gold); }
.calc-page .modes button.active, .calc-page .es-cta { background: linear-gradient(180deg, var(--gold), var(--gold2));
  border-color: var(--gold2); color: #2a1e05; }
