/* ==========================================================================
   Eucleidae — foglio di stile principale
   Palette viola su fondo scuro
   ========================================================================== */

:root {
  --bg: #14091f;
  --bg-alt: #1b0f2b;
  --bg-soft: #241539;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(167, 139, 250, 0.18);
  --border-strong: rgba(167, 139, 250, 0.38);

  --violet: #7c3aed;
  --violet-deep: #5b21b6;
  --violet-light: #a78bfa;
  --amber: #fbbf24;
  --mint: #34d399;

  --text: #f4f1fb;
  --text-soft: #cbc2e0;
  --text-muted: #9b90b5;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;

  --shadow-sm: 0 10px 30px rgba(8, 3, 17, 0.45);
  --shadow: 0 26px 60px rgba(8, 3, 17, 0.6);

  --maxw: 1200px;
  --gutter: 24px;
  --header-h: 76px;

  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Georgia", "Times New Roman", serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-soft);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 620px at 12% -8%, rgba(124, 58, 237, 0.34), transparent 62%),
    radial-gradient(760px 540px at 96% 4%, rgba(91, 33, 182, 0.28), transparent 60%),
    radial-gradient(700px 700px at 50% 108%, rgba(167, 139, 250, 0.12), transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a {
  color: var(--violet-light);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}
a:hover { color: #fff; }

h1, h2, h3, h4 {
  color: var(--text);
  font-family: var(--font-display);
  line-height: 1.18;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 5.2vw, 3.7rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }
h4 { font-size: 1.08rem; font-family: var(--font); font-weight: 700; }

p { margin: 0 0 1.15em; }

ul, ol { margin: 0 0 1.3em; padding-left: 1.35em; }
li { margin-bottom: 0.55em; }
li::marker { color: var(--violet-light); }

strong { color: var(--text); font-weight: 700; }

:focus-visible {
  outline: 3px solid var(--violet-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow { max-width: 880px; }

.section { padding: clamp(64px, 9vw, 118px) 0; position: relative; }
.section--alt { background: linear-gradient(180deg, transparent, rgba(27, 15, 43, 0.85) 14%, rgba(27, 15, 43, 0.85) 86%, transparent); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--violet);
  color: #fff;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(15, 7, 24, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(167, 139, 250, 0.14);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-stuck {
  background: rgba(15, 7, 24, 0.94);
  box-shadow: 0 12px 40px rgba(6, 2, 12, 0.6);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.32rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand:hover { color: #fff; }

.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--violet) 0%, var(--violet-deep) 100%);
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.45);
  color: #fff;
  font-weight: 700;
  font-family: var(--font);
  font-size: 1.05rem;
}

.brand-name b { font-weight: 600; }
.brand-name span { color: var(--violet-light); }

.nav { display: flex; align-items: center; gap: 4px; }

.nav a {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.94rem;
  color: var(--text-soft);
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}
.nav a:hover,
.nav a.is-active {
  color: #fff;
  background: rgba(124, 58, 237, 0.28);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  position: absolute;
  left: 50%;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: transform 0.3s var(--ease), opacity 0.2s linear;
}
.nav-toggle span { top: 50%; margin-top: -1px; }
.nav-toggle span::before { content: ""; top: -7px; }
.nav-toggle span::after { content: ""; top: 7px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateX(-50%) translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateX(-50%) translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: clamp(56px, 8vw, 104px) 0 clamp(56px, 7vw, 96px);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(32px, 5vw, 68px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px 7px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.14);
  color: var(--violet-light);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 22px;
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}

.hero h1 { margin-bottom: 0.45em; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--violet-light), #f0abfc 60%, var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: clamp(1.03rem, 1.7vw, 1.18rem);
  max-width: 60ch;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 30px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
}
.btn--primary {
  background: linear-gradient(120deg, var(--violet) 0%, var(--violet-deep) 100%);
  color: #fff;
  box-shadow: 0 14px 34px rgba(124, 58, 237, 0.4);
}
.btn--primary:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgba(124, 58, 237, 0.55);
}
.btn--ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--ghost:hover {
  color: #fff;
  background: var(--surface-strong);
  transform: translateY(-3px);
}

/* riquadro indipendenza */
.notice {
  position: relative;
  padding: 26px 28px 26px 30px;
  border-radius: var(--radius);
  background: linear-gradient(140deg, rgba(124, 58, 237, 0.2), rgba(20, 9, 31, 0.9));
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.notice::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--amber), var(--violet));
}
.notice h2,
.notice h3 {
  font-family: var(--font);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.6em;
}
.notice p:last-child { margin-bottom: 0; }

.notice--hero { margin-top: 34px; }

.notice--xl {
  padding: clamp(30px, 4vw, 52px);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(124, 58, 237, 0.3), rgba(20, 9, 31, 0.94));
  border: 2px solid var(--border-strong);
}
.notice--xl::before { width: 8px; }
.notice--xl h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--text);
}
.notice--xl .notice-flag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.42);
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.notice--xl p { font-size: 1.05rem; }

/* pannello visivo hero */
.hero-panel {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(36, 21, 57, 0.96), rgba(20, 9, 31, 0.96));
  box-shadow: var(--shadow);
  padding: 26px;
}
.hero-panel::after {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.5), transparent 68%);
  filter: blur(14px);
  z-index: -1;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.panel-dot { width: 11px; height: 11px; border-radius: 50%; background: #3f2f5c; }
.panel-dot:nth-child(1) { background: #f87171; }
.panel-dot:nth-child(2) { background: var(--amber); }
.panel-dot:nth-child(3) { background: var(--mint); }
.panel-title {
  margin-left: 10px;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px dashed rgba(167, 139, 250, 0.14);
  font-size: 0.95rem;
}
.panel-row:last-of-type { border-bottom: 0; }
.panel-row span:first-child { color: var(--text-muted); }
.panel-row b { color: var(--text); font-weight: 600; }

.meter {
  height: 7px;
  width: 118px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.16);
  overflow: hidden;
  flex: none;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--violet-light), var(--violet));
}

/* ---------- intestazioni di sezione ---------- */
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 58px); }
.section-head--center { margin-inline: auto; text-align: center; }

.kicker {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--violet-light);
  margin-bottom: 14px;
}

.section-head p { font-size: 1.05rem; margin-bottom: 0; }

/* ---------- zigzag ---------- */
.zig {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(30px, 5vw, 64px);
  align-items: center;
}
.zig + .zig { margin-top: clamp(44px, 6vw, 84px); }
.zig--flip .zig-media { order: -1; }

.zig-body p:last-child { margin-bottom: 0; }

.value-list { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; }
.value-list li {
  position: relative;
  padding-left: 38px;
  margin: 0;
  color: var(--text-soft);
}
.value-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(124, 58, 237, 0.24);
  border: 1px solid var(--border-strong);
}
.value-list li::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 12px;
  width: 6px;
  height: 10px;
  border: solid var(--mint);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.value-list li b { display: block; color: var(--text); }

.media-frame {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(36, 21, 57, 0.9), rgba(20, 9, 31, 0.9));
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.media-frame h3 { font-family: var(--font); font-size: 1.1rem; }

.quote {
  margin: 0;
  padding: 22px 24px;
  border-left: 3px solid var(--violet);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-soft);
  font-style: italic;
}
.quote footer { margin-top: 10px; font-style: normal; font-size: 0.88rem; color: var(--text-muted); }

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

.stat {
  position: relative;
  padding: 30px 26px;
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.stat:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.stat::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -46px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.34), transparent 70%);
}
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 1;
  color: #fff;
  margin-bottom: 10px;
}
.stat-num i { font-style: normal; color: var(--violet-light); }
.stat-label {
  display: block;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.stat-note { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

/* ---------- schede giochi (orizzontali, alternate) ---------- */
.games { display: grid; gap: clamp(26px, 3.6vw, 44px); }

.game-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(150deg, rgba(36, 21, 57, 0.92), rgba(20, 9, 31, 0.92));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.game-card:hover {
  transform: translateY(-7px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.game-card:nth-child(even) .game-media { order: 2; }

.game-media {
  position: relative;
  overflow: hidden;
  background: #0f0718;
  min-height: 240px;
}
.game-media img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.7s var(--ease), filter 0.7s var(--ease);
}
.game-card:hover .game-media img { transform: scale(1.05); filter: saturate(1.08); }

.game-genre {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 7, 24, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-strong);
  color: var(--violet-light);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game-body {
  padding: clamp(26px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.game-body h3 { margin-bottom: 0.35em; }
.game-body > p { color: var(--text-soft); margin-bottom: 1.2em; }

.tags { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.tags li {
  margin: 0;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.16);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.game-card:hover .tags li { border-color: var(--border-strong); }

.games-note {
  margin-top: 34px;
  padding: 18px 24px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--surface);
  font-size: 0.95rem;
  color: var(--text-muted);
}
.games-note p { margin: 0; }

/* ---------- processo (4 fasi, disposizione a scala) ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 32px 26px;
  border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  counter-increment: step;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease), border-color 0.35s var(--ease);
}
.steps .step:nth-child(2) { transform: translateY(26px); }
.steps .step:nth-child(3) { transform: translateY(52px); }
.steps .step:nth-child(4) { transform: translateY(78px); }
.step:hover { border-color: var(--border-strong); background: linear-gradient(170deg, rgba(124, 58, 237, 0.18), rgba(255, 255, 255, 0.02)); }
.steps .step:nth-child(1):hover { transform: translateY(-6px); }
.steps .step:nth-child(2):hover { transform: translateY(20px); }
.steps .step:nth-child(3):hover { transform: translateY(46px); }
.steps .step:nth-child(4):hover { transform: translateY(72px); }

.step::before {
  content: "0" counter(step);
  display: block;
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px var(--violet-light);
  margin-bottom: 16px;
}
.step h3 { font-family: var(--font); font-size: 1.14rem; }
.step p { font-size: 0.96rem; margin-bottom: 0; color: var(--text-soft); }

.steps-spacer { height: 78px; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 14px; }

.faq-item {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.faq-item.is-open { border-color: var(--border-strong); background: var(--surface-strong); }

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 1.8vw, 1.2rem);
  line-height: 1.4;
}
.faq-q:hover { color: #fff; }

.faq-icon {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: rgba(124, 58, 237, 0.2);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease);
}
.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  background: var(--violet-light);
  border-radius: 2px;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s var(--ease);
}
.faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item.is-open .faq-icon { transform: rotate(180deg); background: rgba(124, 58, 237, 0.42); }
.faq-item.is-open .faq-icon::after { opacity: 0; }

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease);
}
.faq-a-inner { padding: 0 26px 24px; color: var(--text-soft); }
.faq-a-inner p:last-child { margin-bottom: 0; }

/* ---------- pagine di contenuto ---------- */
.page-hero {
  padding: clamp(48px, 6vw, 84px) 0 clamp(32px, 4vw, 52px);
  border-bottom: 1px solid var(--border);
}
.page-hero p { font-size: 1.08rem; max-width: 70ch; margin-bottom: 0; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--violet-light); }

.article-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(30px, 4vw, 60px);
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(36, 21, 57, 0.9), rgba(20, 9, 31, 0.9));
}
.toc h2 {
  font-family: var(--font);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--violet-light);
  margin-bottom: 14px;
}
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { counter-increment: toc; margin-bottom: 4px; }
.toc a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.45;
}
.toc a::before { content: counter(toc) ". "; color: var(--violet-light); }
.toc a:hover { background: rgba(124, 58, 237, 0.2); color: #fff; }

.prose { max-width: 78ch; }
.prose > section { padding-top: 12px; margin-bottom: clamp(38px, 5vw, 62px); }
.prose h2 { margin-top: 0; }
.prose h3 { margin-top: 1.7em; }
.prose h4 { margin-top: 1.5em; margin-bottom: 0.5em; }
.prose img { border-radius: var(--radius); margin: 26px 0; }

.lead {
  font-size: 1.12rem;
  color: var(--text);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin: 26px 0 30px;
}

.mini-card {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.mini-card:hover { transform: translateY(-5px); border-color: var(--border-strong); }
.mini-card h4 { margin-top: 0; color: var(--text); }
.mini-card p { font-size: 0.95rem; margin-bottom: 0; }
.mini-card .tag-mini {
  display: inline-block;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--violet-light);
  margin-bottom: 10px;
}

.callout {
  padding: 24px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: rgba(124, 58, 237, 0.12);
  margin: 28px 0;
}
.callout h4 { margin-top: 0; color: var(--amber); }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

.callout--warn {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.4);
}
.callout--warn h4 { color: #fca5a5; }

.checklist { list-style: none; padding: 0; }
.checklist li {
  position: relative;
  padding-left: 34px;
  margin-bottom: 12px;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: rgba(124, 58, 237, 0.2);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 30px;
  font-size: 0.95rem;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.data-table caption {
  caption-side: bottom;
  padding-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: left;
}
.data-table th,
.data-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table th {
  background: rgba(124, 58, 237, 0.18);
  color: var(--text);
  font-weight: 700;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }

.table-scroll { overflow-x: auto; }

.resource-list { list-style: none; padding: 0; display: grid; gap: 14px; }
.resource-list li {
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  margin: 0;
}
.resource-list b { display: block; margin-bottom: 4px; }
.resource-list span { font-size: 0.94rem; color: var(--text-muted); }

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: clamp(40px, 6vw, 80px);
  padding: clamp(48px, 6vw, 74px) 0 30px;
  background: rgba(11, 5, 18, 0.7);
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  gap: clamp(26px, 4vw, 56px);
  padding-bottom: 34px;
  border-bottom: 1px solid var(--border);
}
.footer-about p { font-size: 0.96rem; color: var(--text-muted); }
.footer-about .brand { margin-bottom: 16px; }

.footer-col h4 {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--violet-light);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: var(--text-soft); font-size: 0.95rem; }
.footer-col a:hover { color: #fff; }

.footer-disclaimer {
  margin: 30px 0 24px;
  padding: 20px 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(251, 191, 36, 0.32);
  background: rgba(251, 191, 36, 0.07);
  color: var(--text-soft);
  font-size: 0.95rem;
}
.footer-disclaimer p { margin: 0; }
.footer-disclaimer b { color: var(--amber); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.footer-bottom p { margin: 0; }

/* ---------- animazioni ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .steps .step:nth-child(n) { transform: none; }
  .steps .step:hover { transform: translateY(-6px); }
  .steps-spacer { display: none; }
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 18px var(--gutter) 26px;
    background: rgba(15, 7, 24, 0.98);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 24px 50px rgba(6, 2, 12, 0.6);
    transform: translateY(-140%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s var(--ease), opacity 0.3s var(--ease), visibility 0.3s;
  }
  .nav.is-open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav a { padding: 13px 16px; border-radius: 12px; font-size: 1rem; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .game-card { grid-template-columns: 1fr; }
  .game-card:nth-child(even) .game-media { order: 0; }
  .zig { grid-template-columns: 1fr; }
  .zig--flip .zig-media { order: 0; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}

@media (max-width: 520px) {
  :root { --gutter: 18px; }
  .stats { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .brand { font-size: 1.14rem; }
  .faq-q { padding: 18px 18px; }
  .faq-a-inner { padding: 0 18px 20px; }
}

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