/* =====================================================================
   MIDNIGHT INFERNO — Design Tokens v1.0
   Fantafalo 2026 / Official Game Infrastructure
   ===================================================================== */

:root {
  /* Surfaces */
  --bg: #000000;
  --bg-elev: #050507;
  --surface-01: rgba(255, 255, 255, 0.04);
  --surface-02: rgba(255, 255, 255, 0.07);
  --surface-03: rgba(255, 255, 255, 0.10);
  --border: rgba(255, 255, 255, 0.10);
  --border-hi: rgba(255, 255, 255, 0.18);

  /* Brand: Ignite */
  --ignite: #7a0820;
  --ignite-bright: #c9163c;
  --ignite-glow: rgba(201, 22, 60, 0.35);

  /* Brand: Toxic (data stable / network) */
  --toxic: #87FF00;
  --toxic-dim: rgba(135, 255, 0, 0.55);
  --toxic-glow: rgba(135, 255, 0, 0.18);

  /* Brand: Amber (warning) */
  --amber: #FFB400;
  --amber-glow: rgba(255, 180, 0, 0.20);

  /* Text */
  --text-hi: #FFFFFF;
  --text-mid: rgba(255, 255, 255, 0.62);
  --text-low: rgba(255, 255, 255, 0.38);

  /* Typography */
  --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', 'Courier New', monospace;

  /* Spacing */
  --pad-tight: 12px;
  --pad-base: 20px;
  --pad-loose: 32px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* =====================================================================
   RESET & BASE
   ===================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-mid);
  font-family: var(--font-body);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(800px circle at 0% 0%, rgba(201, 22, 60, 0.06), transparent 50%),
    radial-gradient(900px circle at 100% 100%, rgba(135, 255, 0, 0.03), transparent 55%);
  min-height: 100vh;
}

h1, h2, h3, h4, h5 {
  color: var(--text-hi);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em 0;
}
h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); line-height: 1.15; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
h1 + p { margin-top: 10px; }

p { margin: 0 0 1em 0; }

a { color: var(--toxic); text-decoration: none; border-bottom: 1px dashed transparent; transition: border-color 120ms var(--ease-out); }
a:hover { border-bottom-color: var(--toxic-dim); }

code, pre, .mono { font-family: var(--font-mono); }

.ignite { color: var(--ignite-bright); }
.toxic  { color: var(--toxic); }
.dim    { color: var(--text-low); }

/* =====================================================================
   LAYOUT PRIMITIVES
   ===================================================================== */

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--pad-base);
}

.shell {
  padding: var(--pad-loose) 0 calc(var(--pad-loose) * 2);
}

.card {
  background: var(--surface-01);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--pad-base);
  margin-bottom: var(--pad-base);
  position: relative;
}

.card--hot { border-color: var(--ignite-glow); box-shadow: inset 0 0 0 1px var(--ignite-glow); }
.card--toxic { border-color: var(--toxic-dim); box-shadow: inset 0 0 0 1px var(--toxic-glow); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--pad-tight); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--pad-tight); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--pad-tight); }
@media (max-width: 720px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================================
   BADGES & TAGS
   ===================================================================== */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--border-hi);
  color: var(--text-mid);
  background: var(--surface-02);
}
.badge--toxic { background: var(--toxic); color: #000; border-color: var(--toxic); }
.badge--ignite { background: var(--ignite); color: var(--text-hi); border-color: var(--ignite-bright); }
.badge--ghost { background: transparent; }

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-low);
  margin-bottom: var(--pad-tight);
}

/* =====================================================================
   ANSWER BOX (Information Gain / AI Overviews)
   ===================================================================== */

.answer-box {
  border: 1px solid var(--toxic-dim);
  background:
    linear-gradient(180deg, rgba(135, 255, 0, 0.04), transparent),
    var(--surface-01);
  border-radius: var(--radius-md);
  padding: var(--pad-base);
  margin-bottom: var(--pad-loose);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
}
.answer-box__query {
  display: none;
}
.answer-box__response {
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: 16px;
}
.answer-box__cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--toxic);
  vertical-align: -2px;
  margin-left: 4px;
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* =====================================================================
   TELEMETRY TABLE
   ===================================================================== */

.tele-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
}
.tele-table th, .tele-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.tele-table th {
  color: var(--text-low);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.tele-table td.val { color: var(--text-hi); font-weight: 600; }
.tele-table td.val--toxic { color: var(--toxic); }
.tele-table td.val--ignite { color: var(--ignite-bright); }

/* =====================================================================
   STAT BLOCK (KPI tiles)
   ===================================================================== */

.stat {
  background: var(--surface-02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--pad-tight);
}
.stat__label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-low);
  margin-bottom: 4px;
}
.stat__value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-hi);
  line-height: 1.1;
}
.stat__value--toxic { color: var(--toxic); }
.stat__value--ignite { color: var(--ignite-bright); }
.stat__unit { font-size: 12px; color: var(--text-low); margin-left: 4px; }

/* =====================================================================
   TELEMETRY BAR (horizontal gauge)
   ===================================================================== */

.tbar {
  margin: 14px 0;
  font-family: var(--font-mono);
}
.tbar__head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-low);
  margin-bottom: 6px;
}
.tbar__value { color: var(--text-hi); font-weight: 600; }
.tbar__track {
  height: 8px;
  background: var(--surface-03);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}
.tbar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--toxic) 0%, var(--toxic-dim) 100%);
  border-radius: var(--radius-pill);
}
.tbar__fill--ignite { background: linear-gradient(90deg, var(--ignite) 0%, var(--ignite-bright) 100%); }
.tbar__fill--amber { background: linear-gradient(90deg, var(--amber) 0%, #ff8800 100%); }

/* =====================================================================
   GAUGE (radial SVG)
   ===================================================================== */

.gauge { display: inline-block; text-align: center; }
.gauge__svg { display: block; }
.gauge__label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-low);
  margin-top: 4px;
}
.gauge__center {
  font-family: var(--font-mono);
  font-weight: 600;
  fill: var(--text-hi);
}

/* =====================================================================
   HEADER & NAV
   ===================================================================== */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pad-base);
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-hi);
  letter-spacing: -0.02em;
}
.brand .ignite { color: var(--ignite-bright); }

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-low);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 100px;
  padding: 4px 12px;
}
.nav-status__dot {
  display: none;
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-low);
  margin: var(--pad-base) 0 var(--pad-tight);
}
.breadcrumb a { color: var(--text-mid); border-bottom: none; }
.breadcrumb a:hover { color: var(--toxic); }
.breadcrumb__sep { color: var(--text-low); margin: 0 6px; }

/* =====================================================================
   FOOTER & LEGAL
   ===================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--pad-loose) 0;
  margin-top: var(--pad-loose);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-low);
}
.site-footer__legal {
  margin-top: var(--pad-tight);
  font-size: 10px;
  line-height: 1.6;
  opacity: 0.8;
}
.site-footer a { color: var(--text-mid); }

/* =====================================================================
   TERMINAL BLOCK
   ===================================================================== */

pre.term, .term {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--toxic-glow);
  border-radius: var(--radius-sm);
  padding: var(--pad-tight) var(--pad-base);
  color: var(--toxic);
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* =====================================================================
   CTA
   ===================================================================== */

.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--toxic);
  color: #000;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  border-bottom: none;
}
.cta:hover { background: #a8ff42; }
.cta--ghost {
  background: transparent;
  color: var(--toxic);
  border: 1px solid var(--toxic-dim);
}

/* =====================================================================
   FAN PROFILE REDESIGN (2026-06) — carta d'identità + verdetto + CTA
   ===================================================================== */
.fan-id__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.fan-id__cell { background: var(--surface-02); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.fan-id__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-low); margin-bottom: 5px; }
.fan-id__val { font-size: 16px; color: var(--text-hi); font-weight: 600; line-height: 1.25; word-break: break-word; }
.fan-iconic { margin: 14px 0 0; font-size: 13px; color: var(--text-mid); line-height: 1.5; }
.fan-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid; }
.fan-badge--ok  { color: #9be15d; border-color: rgba(135,255,0,0.40); background: rgba(135,255,0,0.10); }
.fan-badge--no  { color: #ff6f87; border-color: rgba(201,22,60,0.45); background: rgba(201,22,60,0.12); }
.fan-badge--mid { color: #ffce54; border-color: rgba(255,180,0,0.45); background: rgba(255,180,0,0.10); }
.verdict { margin-top: 18px; border: 1px solid rgba(255,215,0,0.28); background: rgba(255,215,0,0.045); border-radius: var(--radius-md); padding: 14px 16px; }
.verdict__q { font-size: 15px; color: #FFD700; margin: 0 0 12px; font-weight: 600; font-family: var(--font-display); line-height: 1.35; }
.verdict__tag { font-size: 10px; font-weight: 400; color: var(--text-low); border: 1px solid var(--border-hi); border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; font-family: var(--font-mono); white-space: nowrap; }
.verdict__opts { display: flex; gap: 10px; }
.verdict__btn { flex: 1; text-align: center; font-family: var(--font-body); font-size: 14px; color: var(--text-hi); background: var(--surface-02); border: 1px solid var(--border-hi); border-radius: var(--radius-sm); padding: 11px; cursor: pointer; transition: all 0.15s var(--ease-out); }
.verdict__btn:hover { border-color: var(--ignite-bright); }
.verdict__btn.sel { background: var(--ignite); border-color: var(--ignite-bright); color: #fff; }
.verdict__res { font-size: 12px; color: var(--text-low); margin: 10px 0 0; text-align: center; min-height: 15px; }
.fan-cta { margin: 8px 0 var(--pad-base); border: 1px solid var(--ignite-glow); background: linear-gradient(180deg, rgba(201,22,60,0.10), rgba(201,22,60,0.03)); border-radius: var(--radius-md); padding: 18px 20px; text-align: center; }
.fan-cta__wedge { font-size: 16px; color: var(--text-hi); font-family: var(--font-display); font-weight: 600; margin: 0 0 6px; line-height: 1.35; }
.fan-cta__sub { font-size: 13px; color: var(--text-mid); margin: 0 0 14px; line-height: 1.5; }
.fan-cta__btn { display: inline-block; font-size: 14px; font-weight: 600; color: #fff; background: var(--ignite-bright); border-radius: var(--radius-sm); padding: 11px 22px; border-bottom: none; }
.fan-cta__btn:hover { background: var(--ignite); border-bottom: none; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

/* =====================================================================
   CHAR CARD REDESIGN (2026-06) — scheda personaggio (radar responsive)
   ===================================================================== */
.char-card { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 22px; align-items: center; }
@media (max-width: 560px) { .char-card { grid-template-columns: 1fr; gap: 14px; } }
.char-card__radar { text-align: center; min-width: 0; }
.char-card__radar svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.char-card__bars { min-width: 0; }
.char-tag { font-size: 10px; font-weight: 400; color: var(--text-low); border: 1px solid var(--border-hi); border-radius: 999px; padding: 2px 9px; margin-left: 8px; vertical-align: middle; font-family: var(--font-mono); text-transform: none; letter-spacing: 0; white-space: nowrap; }
.char-ovr { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.char-ovr__label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-low); }
.char-ovr__val { font-family: var(--font-mono); font-size: 26px; font-weight: 600; color: var(--ignite-bright); line-height: 1; }
.char-ovr__val span { font-size: 12px; color: var(--text-low); margin-left: 2px; }
.char-note { margin: 16px 0 0; font-size: 11px; font-style: italic; color: var(--text-low); border-top: 1px solid rgba(255,255,255,0.06); padding-top: 10px; }

/* =====================================================================
   VOTE CARD (2026-06) — voto reale "ti è piaciuto questo personaggio?"
   ===================================================================== */
.vote-card .vote__opts { display: flex; gap: 10px; }
.vote__btn { flex: 1; text-align: center; font-family: var(--font-body); font-size: 15px; color: var(--text-hi); background: var(--surface-02); border: 1px solid var(--border-hi); border-radius: var(--radius-sm); padding: 12px; cursor: pointer; transition: all 0.15s var(--ease-out); }
.vote__btn:hover { border-color: var(--ignite-bright); }
.vote__btn.sel { background: var(--ignite); border-color: var(--ignite-bright); color: #fff; }
.vote__btn:disabled { cursor: default; opacity: 0.85; }
.vote__result { margin-top: 14px; }
.vote__bar { height: 8px; background: var(--surface-03); border-radius: var(--radius-pill); overflow: hidden; }
.vote__bar-up { height: 100%; width: 0; background: linear-gradient(90deg, var(--ignite) 0%, var(--ignite-bright) 100%); transition: width 0.4s var(--ease-out); }
.vote__counts { margin: 10px 0 0; font-family: var(--font-mono); font-size: 12px; color: var(--text-mid); text-align: center; }
