:root {
  --ink: #16120e;
  --night: #1f1a15;
  --night-2: #2a231c;
  --parchment: #e9dcc0;
  --parchment-2: #d8c7a3;
  --paper-text: #2b2118;
  --text: #ece3d0;
  --muted: #b3a68c;
  --ember: #e0742b;
  --ember-2: #f2a45a;
  --blood: #a3392b;
  --moss: #7d9358;
  --frost: #8fb6c9;
  --line: rgba(233, 220, 192, .14);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --serif: "IM Fell English", Georgia, serif;
  --serif-sc: "IM Fell English SC", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(224,116,43,.08), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(143,182,201,.05), transparent 40%);
}
a { color: var(--ember-2); }
img { max-width: 100%; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- TOPBAR ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .8rem clamp(1rem, 4vw, 3rem);
  background: rgba(22,18,14,.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--serif-sc); font-size: 1.35rem;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.brand em { color: var(--ember); font-style: normal; }
.brand-icon { width: 26px; height: 26px; color: var(--ember); filter: drop-shadow(0 0 6px rgba(224,116,43,.6)); }
.nav { display: flex; gap: 1.2rem; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; }
.nav a:hover { color: var(--text); }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch button {
  background: none; border: 0; color: var(--muted);
  padding: .3rem .75rem; font: 600 .8rem var(--sans); cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--ember); color: var(--ink); }
.menu-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.5rem; cursor: pointer; margin-left: auto; }

/* ---------- HERO ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(4rem, 10vw, 8rem) clamp(1rem, 6vw, 5rem) 4rem;
  border-bottom: 1px solid var(--line);
}
.hero-inner { position: relative; z-index: 2; max-width: 760px; }
.eyebrow { font-family: var(--serif); font-style: italic; color: var(--ember-2); margin: 0 0 .5rem; font-size: 1.1rem; }
.hero h1 {
  font-family: var(--serif-sc); font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 1.05; margin: 0 0 1.2rem;
  text-shadow: 0 3px 0 rgba(0,0,0,.5);
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 600px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 2rem 0 2.5rem; }
.hero-moon {
  position: absolute; right: -80px; top: 40px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f3ead6, #cdbd98 55%, #8e7f62 100%);
  box-shadow: 0 0 120px rgba(243,234,214,.18);
  opacity: .22;
}
.hero-moon::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 60% 30%, rgba(0,0,0,.18) 0 22px, transparent 23px),
    radial-gradient(circle at 30% 65%, rgba(0,0,0,.14) 0 36px, transparent 37px),
    radial-gradient(circle at 70% 70%, rgba(0,0,0,.12) 0 16px, transparent 17px);
  border-radius: 50%;
}
.stats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; }
.stats li { border-left: 2px solid var(--ember); padding-left: .8rem; }
.stats strong { display: block; font-family: var(--serif-sc); font-size: 2rem; color: var(--text); line-height: 1; }
.stats span { font-size: .85rem; color: var(--muted); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-block; padding: .75rem 1.4rem; border-radius: 999px;
  font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent;
  font-family: var(--sans); font-size: .95rem; transition: transform .15s, background .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--ember); color: var(--ink); }
.btn-primary:hover { background: var(--ember-2); }
.btn-ghost { border-color: var(--line); color: var(--text); background: rgba(255,255,255,.03); }
.btn-ghost:hover { border-color: var(--ember); }

/* ---------- SEARCH ---------- */
.search-band { position: relative; max-width: 760px; margin: -1.6rem auto 0; padding: 0 1rem; z-index: 5; }
.search-band input {
  width: 100%; padding: 1rem 1.3rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--night-2); color: var(--text);
  font: 500 1rem var(--sans); box-shadow: var(--shadow);
}
.search-band input:focus { outline: 2px solid var(--ember); }
.search-results {
  position: absolute; left: 1rem; right: 1rem; top: calc(100% + .4rem);
  background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); max-height: 360px; overflow: auto;
}
.search-results a { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1.1rem; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.search-results a:hover { background: rgba(224,116,43,.12); }
.search-results small { color: var(--muted); }
.search-results .empty { padding: .9rem 1.1rem; color: var(--muted); }

/* ---------- SECTIONS ---------- */
.section { padding: 5rem clamp(1rem, 6vw, 5rem); }
.section.alt { background: var(--night); border-block: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 2.5rem; }
.section-head h2 { font-family: var(--serif-sc); font-weight: 400; font-size: clamp(2rem, 4vw, 2.8rem); margin: 0 0 .4rem; }
.section-head p { color: var(--muted); margin: 0; font-size: 1.05rem; }
.sub-title { font-family: var(--serif-sc); font-weight: 400; font-size: 1.7rem; margin: 4rem 0 1.4rem; }
.note { color: var(--muted); font-size: .9rem; font-style: italic; }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.2rem; counter-reset: step; }
.timeline li {
  background: var(--parchment); color: var(--paper-text);
  border-radius: var(--radius); padding: 1.5rem 1.4rem 1.3rem; position: relative;
  box-shadow: var(--shadow);
  background-image: linear-gradient(135deg, rgba(255,255,255,.25), transparent 60%);
}
.timeline .day { font-family: var(--serif-sc); color: var(--blood); font-size: .95rem; letter-spacing: .04em; }
.timeline h4 { font-family: var(--serif); font-size: 1.35rem; margin: .2rem 0 .6rem; }
.timeline ul { margin: 0; padding-left: 1.1rem; font-size: .93rem; }
.timeline li li { margin-bottom: .25rem; }

/* meters */
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.meter { background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.meter-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; margin-bottom: .8rem; border: 3px solid currentColor; }
.meter h4 { margin: 0 0 .4rem; font-family: var(--serif); font-size: 1.3rem; }
.meter p { margin: 0; color: var(--muted); font-size: .93rem; }

/* tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.data-table th { text-align: left; background: var(--night-2); color: var(--ember-2); font-weight: 600; padding: .8rem 1rem; white-space: nowrap; }
.data-table td { padding: .75rem 1rem; border-top: 1px solid var(--line); vertical-align: top; }
.data-table tr:hover td { background: rgba(255,255,255,.025); }
.data-table .num { text-align: center; width: 60px; font-variant-numeric: tabular-nums; }
.data-table td strong { font-family: var(--serif); font-size: 1.08rem; font-weight: 400; }
.tag { display: inline-block; font-size: .72rem; padding: .1rem .55rem; border-radius: 999px; background: rgba(224,116,43,.15); color: var(--ember-2); font-weight: 600; white-space: nowrap; }
.neg { color: #e07b6b; }
.highlight td { background: rgba(224,116,43,.18) !important; }

/* filters */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.chip { background: none; border: 1px solid var(--line); color: var(--muted); padding: .4rem 1rem; border-radius: 999px; cursor: pointer; font: 500 .88rem var(--sans); }
.chip.active, .chip:hover { border-color: var(--ember); color: var(--text); }
.chip.active { background: rgba(224,116,43,.15); }

/* cards */
.grid { display: grid; gap: 1.2rem; }
.cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; display: flex; flex-direction: column; gap: .5rem;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: rgba(224,116,43,.5); transform: translateY(-3px); }
.card.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { border-color: var(--ember); box-shadow: 0 0 0 3px rgba(224,116,43,.35); } 100% { box-shadow: none; } }
.card-top { display: flex; align-items: center; gap: .8rem; }
.avatar {
  width: 48px; height: 48px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--serif-sc); font-size: 1.3rem;
  background: var(--parchment); color: var(--paper-text); border: 2px solid var(--ember);
}
.card h4 { margin: 0; font-family: var(--serif); font-size: 1.3rem; font-weight: 400; }
.card .role { color: var(--muted); font-size: .85rem; font-style: italic; }
.card p { margin: 0; font-size: .92rem; color: #d5cab3; }
.card dl { margin: .4rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; font-size: .85rem; }
.card dt { color: var(--muted); }
.card dd { margin: 0; }
.card-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: auto; padding-top: .6rem; }
.diff { display: inline-flex; gap: 3px; vertical-align: middle; }
.diff i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.15); }
.diff i.on { background: var(--ember); }
.tip-line { border-left: 2px solid var(--ember); padding-left: .7rem; font-style: italic; }

/* seasons */
.seasons { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.season { border-radius: var(--radius); padding: 1.5rem; color: var(--paper-text); box-shadow: var(--shadow); }
.season h4 { font-family: var(--serif-sc); font-weight: 400; font-size: 1.6rem; margin: 0; }
.season .len { font-weight: 600; font-size: .85rem; opacity: .75; }
.season ul { padding-left: 1.1rem; margin: .8rem 0 0; font-size: .92rem; }
.season.autumn { background: linear-gradient(160deg, #e8b979, #c9834a); }
.season.winter { background: linear-gradient(160deg, #e1edf2, #a8c6d4); }
.season.spring { background: linear-gradient(160deg, #cfe0a8, #92ad6a); }
.season.summer { background: linear-gradient(160deg, #f5d27a, #df8a42); }

/* community */
.community-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.panel { background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.panel-wide { grid-column: 1 / -1; }
.panel h3 { font-family: var(--serif-sc); font-weight: 400; font-size: 1.5rem; margin: 0 0 1rem; }
.news, .servers, .tips { list-style: none; padding: 0; margin: 0; }
.news li { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.news li:last-child { border: 0; }
.news time { font-size: .8rem; color: var(--ember-2); font-weight: 600; }
.news h5 { margin: .15rem 0 .2rem; font-size: 1.02rem; font-family: var(--serif); font-weight: 400; font-size: 1.15rem; }
.news p { margin: 0; color: var(--muted); font-size: .9rem; }
.servers li { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.servers li:last-child { border: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.on { background: var(--moss); box-shadow: 0 0 8px var(--moss); }
.dot.off { background: #6b5f50; }
.servers .srv-name { font-weight: 600; }
.servers small { display: block; color: var(--muted); }
.servers .players { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.tips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.tips li { background: var(--parchment); color: var(--paper-text); padding: 1rem 1.2rem; border-radius: 10px; font-family: var(--serif); font-size: 1.05rem; transform: rotate(var(--r, 0deg)); box-shadow: var(--shadow); }
.tips cite { display: block; margin-top: .5rem; font-family: var(--sans); font-style: normal; font-size: .8rem; font-weight: 600; color: var(--blood); }
.tip-form { display: grid; grid-template-columns: 200px 1fr auto; gap: .8rem; align-items: start; }
.tip-form input, .tip-form textarea {
  background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: .75rem .9rem; font: 400 .95rem var(--sans); resize: vertical;
}
.tip-form input:focus, .tip-form textarea:focus { outline: 2px solid var(--ember); }
.join {
  margin-top: 2rem; display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap;
  padding: 2rem; border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(224,116,43,.25), rgba(163,57,43,.2)); border: 1px solid rgba(224,116,43,.4);
}
.join h3 { font-family: var(--serif-sc); font-weight: 400; font-size: 1.8rem; margin: 0 0 .3rem; }
.join p { margin: 0; color: var(--text); max-width: 520px; }
.join-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* footer */
.footer { padding: 2.5rem clamp(1rem, 6vw, 5rem); border-top: 1px solid var(--line); color: var(--muted); text-align: center; }
.footer p { margin: .3rem 0; }
.footer .small { font-size: .8rem; }


/* ---------- MULTI-PAGE ---------- */
.search-wrap { position: relative; }
.header-search { width: 230px; }
.header-search .search-input {
  width: 100%; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--night-2); color: var(--text); font: 500 .85rem var(--sans);
}
.header-search .search-input:focus { outline: 2px solid var(--ember); }
.header-search .search-results { left: auto; right: 0; width: 360px; }
.nav a[aria-current="page"] { color: var(--ember-2); }
.section.page-first { padding-top: 4rem; min-height: 60vh; }
.hub-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.hub-card { text-decoration: none; color: var(--text); }
.hub-card h4 { font-size: 1.5rem; }
.hub-icon { font-size: 2rem; }
.more-link { color: var(--ember-2); font-weight: 600; font-size: .9rem; text-decoration: none; margin-top: auto; }
.panel > .more-link { display: inline-block; margin-top: 1rem; }
.tip-day { margin: 0; background: var(--parchment); color: var(--paper-text); padding: 1.3rem 1.4rem; border-radius: 10px; font-family: var(--serif); font-size: 1.2rem; transform: rotate(-.6deg); }
.tip-day cite { display: block; margin-top: .6rem; font: 600 .8rem var(--sans); color: var(--blood); }
.section.alt .join { margin-top: 1.2rem; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem; margin-bottom: 1rem; }
.footer-nav a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.footer-nav a:hover { color: var(--text); }
@media (max-width: 1150px) { .header-search { display: none; } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--night); border-bottom: 1px solid var(--line);
  }
  .nav.open { display: flex; }
  .nav a { padding: .9rem 1.5rem; border-top: 1px solid var(--line); }
  .lang-switch { margin-left: 0; }
  .community-grid { grid-template-columns: 1fr; }
  .tip-form { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero-moon { width: 260px; height: 260px; right: -90px; }
}

/* ================= V3: CHARACTER PAGES, MOTION, VARIETY ================= */
.particles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.hero .particles { z-index: 1; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease var(--d, 0ms), transform .6s cubic-bezier(.2,.7,.2,1) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.tips li.reveal.in { transform: rotate(var(--r, 0deg)); }
.tip-day.reveal.in { transform: rotate(-.6deg); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } *, *::before, *::after { animation: none !important; } }

/* brand flame flicker */
.brand-icon { animation: flicker 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.08, .94) rotate(-3deg); } 60% { transform: scale(.95, 1.07) rotate(2deg); } }

/* headings with a decorative rule */
.section-head h2::after { content: ""; display: block; width: 64px; height: 3px; margin-top: .6rem; border-radius: 3px; background: linear-gradient(90deg, var(--ember), transparent); }
.section.alt { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.018) 0 2px, transparent 2px 14px); }

/* emblems */
.emblem {
  --accent: var(--ember);
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 52px; height: 52px; border-radius: 50%;
  color: var(--accent);
  background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--accent) 38%, #fff 0%), color-mix(in srgb, var(--accent) 12%, var(--ink)) 70%);
  border: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 0 12px rgba(0,0,0,.35);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.emblem img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.emblem-sym { width: 58%; height: 58%; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 70%, transparent)); }
.emblem.sm { width: 46px; height: 46px; }
.emblem.xl { width: 220px; height: 220px; border-width: 3px; animation: float 5s ease-in-out infinite, glow 3.2s ease-in-out infinite; }
.emblem.xl .emblem-sym { width: 56%; height: 56%; stroke-width: 2.4; animation: sway 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 30%, transparent), inset 0 0 30px rgba(0,0,0,.4); } 50% { box-shadow: 0 0 90px color-mix(in srgb, var(--accent) 55%, transparent), inset 0 0 30px rgba(0,0,0,.4); } }
@keyframes sway { 0%, 100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(4deg) scale(1.06); } }
@keyframes spin { to { transform: rotate(360deg); } }

.emblem-stage { position: relative; display: grid; place-items: center; width: 340px; height: 340px; flex: none; }
.emblem-stage .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); animation: spin 30s linear infinite; }
.emblem-stage .ring.r2 { inset: 28px; border-style: dotted; animation-duration: 22s; animation-direction: reverse; opacity: .7; }
.emblem-stage .ring.r3 { inset: -26px; border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); animation: pulse 4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(.97); opacity: .5; } 50% { transform: scale(1.04); opacity: 1; } }

/* character hero */
.char-hero {
  --accent: var(--ember);
  position: relative; overflow: hidden; isolation: isolate;
  padding: 4.5rem clamp(1rem, 6vw, 5rem) 5rem;
  background:
    radial-gradient(ellipse at 22% 45%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--ink)), var(--ink));
  border-bottom: 1px solid var(--line);
}
.char-watermark {
  position: absolute; right: -2%; bottom: -8%; z-index: 0; pointer-events: none; user-select: none;
  font-family: var(--serif-sc); font-size: clamp(6rem, 20vw, 17rem); line-height: .9; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--accent) 35%, transparent); opacity: .55;
}
.char-hero-inner { position: relative; z-index: 2; display: flex; align-items: center; gap: clamp(2rem, 6vw, 5rem); flex-wrap: wrap; }
.char-hero-text { max-width: 560px; }
.crumb { color: var(--muted); text-decoration: none; font-size: .9rem; }
.crumb:hover { color: var(--accent); }
.char-hero h1 { font-family: var(--serif-sc); font-weight: 400; font-size: clamp(3rem, 8vw, 5.6rem); line-height: 1; margin: .6rem 0 .2rem; text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 45%, transparent); animation: rise-in .8s ease both; }
.char-role { font-family: var(--serif); font-style: italic; font-size: 1.5rem; color: var(--accent); margin: 0 0 1.2rem; animation: rise-in .8s .12s ease both; }
.char-hero .card-tags { animation: rise-in .8s .24s ease both; padding: 0; }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* character body */
.char-body { --accent: var(--ember); }
.char-grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2rem; }
.char-block { background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; }
.char-block h2 { font-family: var(--serif-sc); font-weight: 400; font-size: 1.7rem; margin: 0 0 .8rem; }
.bio { font-size: 1.12rem; line-height: 1.75; margin: 0 0 1.5rem; }
.pm { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pm-col { border-radius: 10px; padding: 1rem 1.2rem; }
.pm-col h3 { margin: 0 0 .3rem; font: 600 .85rem var(--sans); letter-spacing: .05em; text-transform: uppercase; }
.pm-col p { margin: 0; font-size: .95rem; }
.pm-col.plus { background: rgba(125,147,88,.14); border: 1px solid rgba(125,147,88,.4); }
.pm-col.plus h3 { color: #a6c27a; }
.pm-col.minus { background: rgba(163,57,43,.15); border: 1px solid rgba(163,57,43,.45); }
.pm-col.minus h3 { color: #e0806f; }
.stat { margin-bottom: 1.1rem; }
.stat-label { display: block; font-size: .92rem; margin-bottom: .3rem; }
.bar { height: 12px; border-radius: 8px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; border-radius: 8px; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff)); transition: transform 1.2s cubic-bezier(.2,.8,.2,1) .25s; }
.stats-block.in .bar i { transform: scaleX(var(--v)); }
.char-tips { margin-bottom: 3rem; }
.char-nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 2rem; }
.char-nav a { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--text); padding: .8rem 1.2rem; border: 1px solid var(--line); border-radius: 999px; font-family: var(--serif); font-size: 1.25rem; transition: border-color .2s, transform .2s; }
.char-nav a:hover { border-color: var(--accent); transform: translateY(-2px); }
.char-nav small { display: block; font: 500 .72rem var(--sans); color: var(--muted); }
.char-nav .r { text-align: right; }
.char-nav a:hover .emblem { transform: rotate(-12deg) scale(1.08); }

/* character cards in the list */
.char-card { text-decoration: none; color: var(--text); --accent: var(--ember); position: relative; overflow: hidden; }
.char-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .4s; }
.char-card:hover { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 18%, transparent); }
.char-card:hover::before { transform: scaleX(1); }
.char-card:hover .emblem { transform: rotate(-10deg) scale(1.1); box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 60%, transparent); }
.char-card .card-tags { align-items: center; justify-content: space-between; }
.char-card .more-link { margin: 0; color: var(--accent); }

/* home: character strip */
.strip-section { overflow: hidden; }
.char-strip { display: flex; gap: 1rem; overflow-x: auto; padding: .5rem .2rem 1.2rem; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--ember) transparent; }
.strip-item { --accent: var(--ember); flex: none; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: .6rem; width: 96px; text-decoration: none; color: var(--text); font-family: var(--serif); font-size: 1.05rem; }
.strip-item .emblem { width: 76px; height: 76px; }
.strip-item:hover .emblem { transform: translateY(-6px) rotate(-8deg); box-shadow: 0 0 34px color-mix(in srgb, var(--accent) 65%, transparent); }

/* hub cards with their own colors */
.hub-card { --accent: var(--ember); position: relative; overflow: hidden; }
.hub-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%); transition: transform .5s; }
.hub-card:hover { border-color: var(--accent); }
.hub-card:hover::after { transform: scale(1.6); }
.hub-card:hover .hub-icon { transform: scale(1.2) rotate(-8deg); }
.hub-icon { display: inline-block; transition: transform .3s; font-size: 2.4rem; }
.hub-card:nth-child(1) { --accent: #e0742b; } .hub-card:nth-child(2) { --accent: #b48ae0; }
.hub-card:nth-child(3) { --accent: #8fb6c9; } .hub-card:nth-child(4) { --accent: #d4574a; }
.hub-card:nth-child(5) { --accent: #e8b43c; } .hub-card:nth-child(6) { --accent: #7d9358; }
.hero h1 { animation: rise-in .9s ease both; }
.hero .lead { animation: rise-in .9s .12s ease both; }
.hero .hero-actions { animation: rise-in .9s .24s ease both; }

@media (max-width: 900px) {
  .char-grid-2, .pm { grid-template-columns: 1fr; }
  .emblem-stage { width: 240px; height: 240px; margin: 0 auto; }
  .emblem.xl { width: 160px; height: 160px; }
  .char-hero-inner { justify-content: center; text-align: center; }
  .char-hero .card-tags { justify-content: center; }
  .char-nav a { font-size: 1.05rem; padding: .6rem .9rem; }
}

/* ================= GUIDE REDESIGN ================= */
.page-hero { position: relative; overflow: hidden; isolation: isolate; padding: 4.5rem clamp(1rem, 6vw, 5rem) 3.5rem;
  background: radial-gradient(ellipse at 15% 0%, rgba(224,116,43,.28), transparent 55%), radial-gradient(ellipse at 90% 100%, rgba(143,182,201,.14), transparent 50%), var(--night);
  border-bottom: 1px solid var(--line); }
.page-hero-inner { position: relative; z-index: 2; max-width: 880px; }
.page-hero h1 { font-family: var(--serif-sc); font-weight: 400; font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05; margin: 0 0 .8rem; animation: rise-in .8s ease both; }
.page-hero .lead { margin: 0; animation: rise-in .8s .1s ease both; }
.golden { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; margin-top: 2rem; }
.golden-card { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); backdrop-filter: blur(6px); transition: transform .25s, border-color .25s; }
.golden-card:hover { transform: translateY(-3px); border-color: rgba(224,116,43,.6); }
.golden-card strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.15rem; }
.golden-card small { color: var(--muted); font-size: .85rem; line-height: 1.4; display: block; }
.g-ico { font-size: 1.7rem; line-height: 1; }

.guide-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 3rem; max-width: 1240px; margin: 0 auto; padding: 3rem clamp(1rem, 4vw, 3rem) 5rem; align-items: start; }
.toc { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 1.2rem; }
.toc nav { display: flex; flex-direction: column; border-left: 2px solid var(--line); }
.toc nav a { padding: .55rem 1rem; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-weight: 500; transition: color .2s, border-color .2s, background .2s; }
.toc nav a:hover { color: var(--text); }
.toc nav a.active { color: var(--ember-2); border-left-color: var(--ember); background: linear-gradient(90deg, rgba(224,116,43,.12), transparent); }
.progress-card { display: flex; align-items: center; gap: .9rem; padding: 1rem; border-radius: 12px; background: var(--night-2); border: 1px solid var(--line); }
.progress-card strong { display: block; font-size: .95rem; }
.progress-card small { display: block; color: var(--muted); }
.link-btn { background: none; border: 0; padding: 0; margin-top: .2rem; color: var(--ember-2); font: 500 .8rem var(--sans); cursor: pointer; text-decoration: underline; }
.ring-prog { position: relative; width: 56px; height: 56px; flex: none; }
.ring-prog svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-prog circle { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 4; }
.ring-prog .val { stroke: var(--ember); stroke-linecap: round; stroke-dasharray: 113; stroke-dashoffset: calc(113 - 113 * var(--p)); transition: stroke-dashoffset .6s ease; }
.ring-prog b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; }

.g-section { margin-bottom: 4.5rem; scroll-margin-top: 90px; }
.g-section .section-head { margin-bottom: 1.8rem; }

/* vertical timeline */
.vtimeline { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 1.4rem; }
.vtimeline::before { content: ""; position: absolute; left: 21px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(180deg, var(--ember), rgba(143,182,201,.4), transparent); }
.vt-item { position: relative; padding-left: 64px; }
.vt-node { position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 600 1.15rem var(--serif-sc); color: var(--ink); background: var(--accent); box-shadow: 0 0 0 6px var(--ink), 0 0 22px color-mix(in srgb, var(--accent) 55%, transparent); transition: transform .3s; }
.vt-item.complete .vt-node { transform: scale(1.08); }
.vt-item.complete .vt-node::after { content: "✓"; position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--moss); color: #fff; font: 700 .7rem var(--sans); display: grid; place-items: center; box-shadow: 0 0 0 3px var(--ink); }
.vt-card { background: var(--night-2); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 1.3rem 1.5rem; transition: border-color .3s, box-shadow .3s; }
.vt-card:hover { box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 14%, transparent); }
.vt-head { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin-bottom: .8rem; }
.vt-head .day { font: 600 .75rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); padding: .15rem .6rem; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.vt-head h4 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 1.45rem; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.checklist label { display: flex; align-items: flex-start; gap: .75rem; padding: .5rem .6rem; border-radius: 8px; cursor: pointer; transition: background .2s; }
.checklist label:hover { background: rgba(255,255,255,.04); }
.checklist input { position: absolute; opacity: 0; pointer-events: none; }
.checklist .box { flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 6px; border: 2px solid var(--muted); display: grid; place-items: center; transition: all .2s; }
.checklist input:focus-visible + .box { outline: 2px solid var(--ember); outline-offset: 2px; }
.checklist input:checked + .box { background: var(--accent); border-color: var(--accent); }
.checklist input:checked + .box::after { content: ""; width: 5px; height: 10px; border: solid var(--ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.checklist .txt { transition: color .2s; }
.checklist input:checked ~ .txt { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); }

/* gauges */
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.2rem; }
.gauge { --accent: var(--ember); padding: 1.6rem; border-radius: 18px; background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 12%, var(--night-2)), var(--night-2) 60%); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.gauge-ring { position: relative; width: 84px; height: 84px; margin-bottom: 1rem; }
.gauge-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge-ring circle { fill: none; stroke-width: 5; }
.gauge-ring .track { stroke: rgba(255,255,255,.08); }
.gauge-ring .arc { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 214; stroke-dashoffset: 214; filter: drop-shadow(0 0 5px var(--accent)); transition: stroke-dashoffset 1.4s cubic-bezier(.2,.8,.2,1) .2s; }
.gauge.in .arc { stroke-dashoffset: 40; }
.gauge-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; animation: float 4s ease-in-out infinite; }
.gauge h4 { margin: 0 0 .4rem; font-family: var(--serif); font-weight: 400; font-size: 1.5rem; }
.gauge p { margin: 0 0 1rem; color: #d5cab3; font-size: .93rem; }
.gauge-facts { margin: 0; display: grid; gap: .6rem; }
.gauge-facts div { padding: .6rem .8rem; border-radius: 8px; background: rgba(0,0,0,.22); }
.gauge-facts dt { font: 600 .7rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.gauge-facts dd { margin: .1rem 0 0; font-size: .9rem; }

/* craft */
.craft-controls { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: center; margin-bottom: 1.4rem; }
.craft-search { flex: 1 1 220px; max-width: 320px; padding: .65rem 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--night-2); color: var(--text); font: 500 .92rem var(--sans); }
.craft-search:focus { outline: 2px solid var(--ember); }
.craft-controls .filters { margin: 0; }
.craft-controls .chip.active { border-color: var(--accent, var(--ember)); background: color-mix(in srgb, var(--accent, var(--ember)) 18%, transparent); }
.craft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.craft-card { --accent: var(--ember); display: flex; flex-direction: column; gap: .8rem; padding: 1.2rem; border-radius: 16px; background: var(--night-2); border: 1px solid var(--line); position: relative; overflow: hidden; transition: transform .25s, border-color .25s, box-shadow .25s; }
.craft-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.craft-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 16%, transparent); }
.craft-card.flash { animation: flash 1.6s ease; }
.craft-top { display: flex; gap: .8rem; align-items: center; }
.craft-ico { width: 46px; height: 46px; flex: none; display: grid; place-items: center; font-size: 1.5rem; border-radius: 12px; background: color-mix(in srgb, var(--accent) 16%, var(--ink)); transition: transform .3s; }
.craft-card:hover .craft-ico { transform: rotate(-10deg) scale(1.12); }
.craft-card h4 { margin: 0 0 .2rem; font-family: var(--serif); font-weight: 400; font-size: 1.25rem; }
.mats { display: flex; flex-wrap: wrap; gap: .35rem; }
.mat { padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.mat b { color: var(--ember-2); }
.craft-card p { margin: 0; color: var(--muted); font-size: .88rem; }

@media (max-width: 900px) {
  .guide-layout { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 1.5rem; }
  .toc { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .toc nav { flex-direction: row; border: 0; gap: .4rem; overflow-x: auto; }
  .toc nav a { border: 1px solid var(--line); border-radius: 999px; margin: 0; padding: .35rem .9rem; white-space: nowrap; }
  .toc nav a.active { border-color: var(--ember); }
  .progress-card { flex: 1 1 100%; }
  .vt-item { padding-left: 52px; } .vt-node { width: 36px; height: 36px; font-size: 1rem; } .vtimeline::before { left: 17px; }
}

/* ================= ILLUSTRAZIONI (niente icone) ================= */
.illus, .art, .scene { display: block; }
.brand-icon { display: inline-block; width: 30px; height: 30px; color: inherit; filter: none; }
.brand-icon svg { width: 100%; height: 100%; }
.menu-toggle { width: 40px; height: 40px; position: relative; }
.menu-toggle i, .menu-toggle i::before, .menu-toggle i::after { content: ""; position: absolute; left: 9px; width: 22px; height: 2.5px; border-radius: 2px; background: var(--text); }
.menu-toggle i { top: 19px; } .menu-toggle i::before { left: 0; top: -7px; } .menu-toggle i::after { left: 0; top: 7px; }

/* medaglioni con illustrazione */
.emblem { overflow: hidden; background: var(--ink); padding: 0; }
.emblem .illus { width: 100%; height: 100%; }
.emblem img { position: absolute; inset: 0; }
.emblem.xl { box-shadow: 0 0 60px color-mix(in srgb, var(--accent) 40%, transparent), inset 0 0 0 4px rgba(0,0,0,.25); }
.char-card .emblem, .strip-item .emblem { border-width: 2px; }

/* illustrazioni piccole nei testi */
.g-ico { width: 56px; height: 56px; flex: none; }
.g-ico svg, .hub-icon svg { width: 100%; height: 100%; }
.hub-icon { width: 68px; height: 68px; display: block; font-size: 0; }
.golden-card { align-items: center; }
.gauge-ring span { font-size: 0; }
.gauge-ring span svg { width: 56%; height: 56%; }
.craft-ico { width: 64px; height: 64px; background: color-mix(in srgb, var(--accent) 14%, var(--ink)); font-size: 0; padding: 6px; }
.craft-ico svg { width: 100%; height: 100%; }
.stat-ico { display: inline-block; width: 24px; height: 24px; vertical-align: -6px; margin-right: .5rem; }
.stat-ico svg { width: 100%; height: 100%; }
.stat-num { float: right; font-weight: 600; color: var(--accent); }
.th-ico { display: inline-block; width: 26px; height: 26px; vertical-align: middle; }
.th-ico svg { width: 100%; height: 100%; }

/* hero scene della guida */
.hero-scene { position: absolute; right: 0; bottom: 0; width: min(560px, 46%); z-index: 1; pointer-events: none; opacity: .95; mask-image: linear-gradient(90deg, transparent, #000 25%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%); }
.hero-scene svg { width: 100%; height: auto; }
.flick { transform-box: fill-box; transform-origin: 50% 90%; animation: flicker 2.2s ease-in-out infinite; }
.twinkle { animation: twink 3s ease-in-out infinite; }
@keyframes twink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* liste: boss, stagioni, ricette */
.boss-card { text-decoration: none; color: var(--text); --accent: var(--ember); padding: 0; gap: 0; overflow: hidden; }
.boss-card > *:not(.boss-art) { margin-left: 1.3rem; margin-right: 1.3rem; }
.boss-card h4 { margin-top: 1rem; margin-bottom: .6rem; }
.boss-card .card-tags { padding-bottom: 1.3rem; align-items: center; justify-content: space-between; }
.boss-card .more-link, .season .more-link { margin: 0; color: var(--accent, var(--ember-2)); }
.boss-art { height: 150px; overflow: hidden; }
.boss-art svg { width: 100%; height: 100%; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.boss-card:hover .boss-art svg, .link-card:hover .boss-art svg { transform: scale(1.1); }
.boss-card:hover { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 20%, transparent); }

.seasons { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.season { display: block; padding: 0; overflow: hidden; text-decoration: none; background: var(--night-2); color: var(--text); border: 1px solid var(--line); transition: transform .3s, border-color .3s; }
.season:hover { transform: translateY(-5px); }
.season-art { height: 170px; overflow: hidden; }
.season-art svg { width: 100%; height: 100%; transition: transform .6s; }
.season:hover .season-art svg { transform: scale(1.08); }
.season-body { padding: 1.2rem 1.4rem 1.4rem; }
.season h4 { font-size: 1.7rem; }
.season .len { opacity: .8; }
.season.autumn { background: var(--night-2); border-color: #c9672a; } .season.winter { background: var(--night-2); border-color: #8fb6c9; }
.season.spring { background: var(--night-2); border-color: #7fb070; } .season.summer { background: var(--night-2); border-color: #e0a850; }
.season ul { color: #d5cab3; }
.season .more-link { display: inline-block; margin-top: .8rem; }

.dish-cell a { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--text); }
.dish-cell a:hover strong { color: var(--ember-2); }
.dish-thumb { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex: none; border: 2px solid var(--line); }
.dish-thumb svg { width: 100%; height: 100%; }

/* pagine di dettaglio */
.char-grid-2.even { grid-template-columns: 1fr 1fr; margin-top: 1.2rem; }
.facts { margin: 0 0 1.2rem; display: grid; gap: .6rem; }
.facts div { padding: .7rem 1rem; border-radius: 10px; background: rgba(0,0,0,.22); border-left: 3px solid var(--accent); }
.facts dt { font: 600 .7rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.facts dd { margin: .1rem 0 0; }
.mini { font: 600 .8rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 1.4rem 0 .6rem; }
.ticks, .steps { margin: 0; padding: 0; list-style: none; display: grid; gap: .6rem; }
.ticks li { position: relative; padding-left: 1.7rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .45em; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); transform: rotate(45deg); }
.steps { counter-reset: st; }
.steps li { counter-increment: st; position: relative; padding: .2rem 0 .2rem 2.6rem; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); font: 600 .9rem var(--serif-sc); }
.link-card { display: flex; flex-direction: column; text-decoration: none; color: var(--text); padding: 0; overflow: hidden; --accent: var(--ember); }
.link-card .boss-art { height: 170px; }
.link-card > div:last-child { padding: 1.3rem 1.6rem; }
.link-card small { color: var(--muted); } .link-card h3 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; margin: .1rem 0 .4rem; }
.tip-line { border-left: 3px solid var(--accent, var(--ember)); }

@media (max-width: 900px) {
  .hero-scene { display: none; }
  .char-grid-2.even { grid-template-columns: 1fr; }
}
/* ================= V4: menu a gruppi, strumenti, enciclopedia, articoli, accessibilità ================= */

/* accessibilità */
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 200; padding: .7rem 1.1rem; border-radius: 10px; background: var(--ember); color: var(--ink); font-weight: 600; text-decoration: none; transition: top .2s; }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--ember-2); outline-offset: 3px; border-radius: 4px; }
button, [role="button"] { font-family: inherit; }
main:focus { outline: none; }

/* menu a gruppi */
.nav { gap: .2rem; align-items: center; }
.nav > a, .nav-trigger { color: var(--muted); font: 500 .95rem var(--sans); text-decoration: none; padding: .5rem .8rem; border-radius: 8px; background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; }
.nav > a:hover, .nav-trigger:hover, .nav-group.open .nav-trigger { color: var(--text); background: rgba(255,255,255,.05); }
.nav-trigger::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.nav-group { position: relative; }
.nav-group.current .nav-trigger, .nav > a[aria-current="page"] { color: var(--ember-2); }
.nav-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px; padding: .4rem; border-radius: 12px; background: var(--night-2); border: 1px solid var(--line); box-shadow: var(--shadow); display: none; flex-direction: column; z-index: 60; }
.nav-menu a { padding: .55rem .8rem; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .93rem; }
.nav-menu a:hover, .nav-menu a:focus-visible { background: rgba(224,116,43,.14); }
.nav-menu a[aria-current="page"] { color: var(--ember-2); }
.nav-group:hover .nav-menu, .nav-group:focus-within .nav-menu, .nav-group.open .nav-menu { display: flex; }
.nav-group:hover .nav-trigger::after, .nav-group.open .nav-trigger::after { transform: rotate(225deg) translateY(-2px); }
@media (max-width: 1150px) { .header-search { display: none; } }
@media (max-width: 900px) {
  .nav { align-items: stretch; max-height: 75vh; overflow-y: auto; }
  .nav > a, .nav-trigger { width: 100%; padding: .9rem 1.5rem; border-radius: 0; border-top: 1px solid var(--line); justify-content: space-between; }
  .nav-menu { position: static; display: flex; box-shadow: none; border: 0; border-radius: 0; background: rgba(0,0,0,.18); padding: 0; min-width: 0; }
  .nav-menu a { padding: .75rem 2.4rem; border-radius: 0; }
  .nav-trigger::after { display: none; }
}

/* footer a colonne */
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.6rem; text-align: left; max-width: 900px; margin: 0 auto 2rem; }
.footer-cols h5 { margin: 0 0 .6rem; font: 600 .75rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ember-2); }
.footer-cols a { display: block; padding: .2rem 0; color: var(--muted); text-decoration: none; font-size: .9rem; }
.footer-cols a:hover { color: var(--text); }

/* home raggruppata */
.hub-groups { display: grid; gap: 2.8rem; }
.hub-group h3 { font-family: var(--serif-sc); font-weight: 400; font-size: 1.6rem; margin: 0 0 1rem; color: var(--ember-2); display: flex; align-items: center; gap: .9rem; }
.hub-group h3::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.hub-groups .hub-card:nth-child(n) { --accent: var(--ember); }
.hub-group:nth-child(2) .hub-card { --accent: #d4574a; } .hub-group:nth-child(3) .hub-card { --accent: #8fc06a; } .hub-group:nth-child(4) .hub-card { --accent: #b48ae0; }

.tool-section { max-width: 1240px; margin: 0 auto; }
.page-hero { --accent: var(--ember); }
.page-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--accent), transparent 60%); z-index: 2; }

/* calcolatore */
.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.2rem; margin-bottom: 1.4rem; align-items: start; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin: 1rem 0; }
.slot { aspect-ratio: 1; border-radius: 16px; border: 2px dashed var(--line); background: rgba(0,0,0,.28); color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; padding: .4rem; transition: transform .2s, border-color .2s, background .2s; }
.slot:hover { border-color: var(--ember); }
.slot.filled { border-style: solid; border-color: var(--ember); background: rgba(224,116,43,.1); animation: pop .25s ease; }
.slot svg { width: 70%; height: 70%; }
.slot small { font-size: .65rem; line-height: 1.1; text-align: center; color: var(--text); }
.slot-n { font: 400 2rem var(--serif-sc); opacity: .35; }
@keyframes pop { from { transform: scale(.85); } to { transform: scale(1); } }
.calc-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.calc-result { margin-top: .5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); min-height: 160px; }
.dish-result { display: grid; grid-template-columns: 130px 1fr; gap: 1.2rem; align-items: center; animation: rise-in .4s ease; }
.dish-art { width: 130px; height: 130px; border-radius: 50%; overflow: hidden; border: 3px solid var(--ember); box-shadow: 0 0 30px rgba(224,116,43,.3); }
.dish-art svg { width: 100%; height: 100%; }
.dish-result small { color: var(--muted); } .dish-result h3 { font-family: var(--serif); font-weight: 400; font-size: 1.8rem; margin: .1rem 0 .6rem; }
.calc-result .bar i { transform: scaleX(var(--v)); }
.ing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; margin-top: 1rem; }
.ing { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .7rem .4rem; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); color: var(--text); cursor: pointer; transition: transform .2s, border-color .2s, background .2s; }
.ing:hover { transform: translateY(-3px); border-color: var(--ember); background: rgba(224,116,43,.08); }
.ing span { width: 54px; height: 54px; } .ing svg { width: 100%; height: 100%; }
.ing small { font-size: .74rem; text-align: center; line-height: 1.15; }

/* quiz */
#quiz-app { max-width: 760px; margin: 0 auto; }
.quiz-card { background: var(--night-2); border: 1px solid var(--line); border-radius: 20px; padding: 2.4rem clamp(1.2rem, 4vw, 2.6rem); text-align: center; animation: rise-in .4s ease; }
.quiz-card h2 { font-family: var(--serif-sc); font-weight: 400; font-size: clamp(1.7rem, 4vw, 2.4rem); margin: .6rem 0 1.4rem; }
.quiz-art { width: 110px; height: 110px; margin: 0 auto 1rem; } .quiz-art svg { width: 100%; height: 100%; }
.quiz-progress { height: 8px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; margin-bottom: .8rem; }
.quiz-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--ember-2)); transition: width .4s; }
.quiz-card small { color: var(--muted); }
.quiz-options { display: grid; gap: .7rem; text-align: left; }
.quiz-opt { padding: 1rem 1.3rem; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text); font: 500 1rem var(--sans); cursor: pointer; transition: transform .2s, border-color .2s, background .2s; }
.quiz-opt:hover { border-color: var(--ember); background: rgba(224,116,43,.1); transform: translateX(4px); }
.quiz-result { --accent: var(--ember); }
.quiz-portrait { display: grid; place-items: center; margin: 1rem 0 .4rem; }
.quiz-portrait .emblem.xl { width: 190px; height: 190px; }
.quiz-also { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.4rem; }
.quiz-also a { display: flex; align-items: center; gap: .6rem; padding: .4rem 1rem .4rem .4rem; border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; font-family: var(--serif); }
.quiz-also a:hover { border-color: var(--accent); }
.quiz-result .btn { margin: .6rem 0 1.4rem; }

/* calendario */
#cal-app { display: grid; gap: 1.4rem; }
.cal-controls { display: grid; gap: 1rem; }
.cal-controls label { display: flex; align-items: center; gap: .8rem; font-weight: 500; }
.cal-controls input[type="number"] { width: 90px; padding: .5rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--ink); color: var(--text); font: 500 1rem var(--sans); }
.cal-controls input[type="range"] { width: 100%; accent-color: var(--ember); }
.cal-controls fieldset { border: 1px solid var(--line); border-radius: 12px; display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: center; padding: 1rem 1.2rem; }
.cal-controls legend { padding: 0 .5rem; color: var(--muted); font-size: .85rem; }
.cal-controls fieldset input { width: 70px; }
.cal-now { display: grid; grid-template-columns: 200px 1fr; gap: 1.6rem; align-items: center; background: var(--night-2); border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line)); border-radius: 18px; padding: 1.2rem; animation: rise-in .4s ease; }
.cal-art { height: 170px; border-radius: 14px; overflow: hidden; } .cal-art svg { width: 100%; height: 100%; }
.cal-now small { color: var(--muted); } .cal-now h3 { font-family: var(--serif-sc); font-weight: 400; font-size: 2.2rem; margin: .1rem 0 .4rem; color: var(--accent); }
.cal-now p { margin: .2rem 0; }
.cal-bar { position: relative; display: flex; height: 42px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.cal-bar span { background: color-mix(in srgb, var(--accent) 70%, #000); display: grid; place-items: center; font-size: .75rem; font-weight: 600; color: #1a120a; min-width: 0; overflow: hidden; }
.cal-bar em { font-style: normal; white-space: nowrap; }
.cal-bar i { position: absolute; top: -3px; bottom: -3px; width: 4px; margin-left: -2px; background: #fff; border-radius: 2px; box-shadow: 0 0 10px #fff; transition: left .3s; }

/* enciclopedia */
.card-pad { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .5rem; }
.creature-card, .biome-card { padding: 0; overflow: hidden; gap: 0; }
.creature-card h4, .biome-card h4 { margin: .3rem 0 0; }
.creature-card .boss-art { height: 130px; }
.boss-art.tall { height: 180px; }
.creature-card:hover, .biome-card:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.creature-card.g-hostile .tag { background: rgba(163,57,43,.25); color: #e8806f; }
.creature-card.g-neutral .tag { background: rgba(224,164,67,.2); color: #e8b858; }
.creature-card.g-passive .tag { background: rgba(125,147,88,.25); color: #a6c27a; }
.creature-card dl { grid-template-columns: 1fr; gap: .1rem; } .creature-card dt { margin-top: .5rem; }
.creature-card a { color: var(--ember-2); }
.card .mini { margin: 1rem 0 .4rem; }

/* articoli */
.art-hero { padding-bottom: 4rem; }
.article-art { position: absolute; right: clamp(1rem, 8vw, 7rem); top: 50%; transform: translateY(-50%); width: 190px; height: 190px; z-index: 1; opacity: .95; animation: float 5s ease-in-out infinite; filter: drop-shadow(0 0 30px color-mix(in srgb, var(--accent) 50%, transparent)); }
.article-art svg { width: 100%; height: 100%; }
@media (max-width: 900px) { .article-art { display: none; } }
.article .bio { max-width: 70ch; }
.article .ticks, .article .steps { margin-bottom: 1rem; max-width: 70ch; }
.article .ticks li::before { background: var(--accent); }
.article .steps li::before { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.code { margin: 1rem 0; padding: 1rem 1.2rem; border-radius: 12px; background: #0f0c09; border: 1px solid var(--line); overflow-x: auto; font: 500 .85rem/1.6 ui-monospace, "SF Mono", Menlo, monospace; color: #f2d9a8; }
.toc nav a.active { border-left-color: var(--accent, var(--ember)); color: var(--accent, var(--ember-2)); }

@media (max-width: 900px) {
  .calc-layout, .cal-now { grid-template-columns: 1fr; }
  .dish-result { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .slots { gap: .45rem; }
}

.section-head h1 { font-family: var(--serif-sc); font-weight: 400; font-size: clamp(2rem, 4vw, 2.8rem); margin: 0 0 .4rem; }
.section-head h1::after { content: ""; display: block; width: 64px; height: 3px; margin-top: .6rem; border-radius: 3px; background: linear-gradient(90deg, var(--ember), transparent); }

/* colore di accento predefinito (le singole sezioni lo ridefiniscono) */
:root { --accent: var(--ember); }

/* ---- Pagine singole: creature, biomi, equipaggiamento ---- */
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.link-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .65rem .9rem; border-radius: 12px; background: var(--night-2); border: 1px solid var(--line); border-left: 3px solid var(--accent, var(--ember)); transition: transform .2s, border-color .2s; }
.link-list li:hover { transform: translateX(4px); border-color: color-mix(in srgb, var(--accent, var(--ember)) 60%, transparent); }
.link-list a { color: var(--text, inherit); text-decoration: none; font-weight: 600; }
.link-list small { color: var(--muted); }
.craft-card .more-link, .creature-card .more-link, .biome-card .more-link { margin-top: .4rem; display: inline-block; color: var(--accent, var(--ember-2)); }

/* ---- Transizione tra pagine e pagine ingrediente ---- */
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
main.page-in { animation: page-in .28s ease both; }
@media (prefers-reduced-motion: reduce) { main.page-in { animation: none; } }
a.mat { text-decoration: none; color: inherit; transition: transform .2s, border-color .2s; }
a.mat:hover { transform: translateY(-2px); }
.ing-links { margin-top: 1.2rem; }

/* Blocchi singoli sotto la griglia nelle pagine di dettaglio (creature che vivono nel bioma, bioma della creatura) */
.char-body > .char-block, .char-body > .link-card { margin-top: 1.2rem; }

/* ---- Installazione come app ---- */
.footer-app { margin: .6rem 0 0; }
.install-btn[hidden] { display: none; }
.article .btn + small { margin-left: .6rem; color: var(--muted); }

/* Mobile: l'indice delle sezioni (molti link in fila) non deve allargare la pagina */
.guide-layout > * { min-width: 0; }
@media (max-width: 900px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .toc, .toc nav { min-width: 0; max-width: 100%; }
  .toc nav { -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .toc nav::-webkit-scrollbar { display: none; }
}
.guide-content { overflow-wrap: anywhere; }
.guide-content .code { overflow-wrap: normal; }

/* ---- Scelta dell'icona dell'app ---- */
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .7rem; margin: 1rem 0; }
.icon-opt { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .7rem .4rem; border-radius: 14px; background: var(--night-2); border: 1px solid var(--line); color: inherit; font: inherit; font-size: .78rem; cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s; }
.icon-opt:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.icon-opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.icon-opt i { display: block; width: 60px; height: 60px; border-radius: 14px; overflow: hidden; background: color-mix(in srgb, var(--accent) 30%, #16120e); }
.icon-opt i svg, .icon-opt i img { width: 100%; height: 100%; display: block; }
.icon-opt span { text-align: center; line-height: 1.2; }
.icon-picker .note { grid-column: 1 / -1; margin: 0; min-height: 1.4em; }

/* ---- Community: stati vuoti ---- */
.news .empty, .servers .empty, .tips .empty { color: var(--muted); font-style: italic; list-style: none; background: none; border: 0; box-shadow: none; transform: none; }
.news .empty a { color: var(--ember-2); }
.tips .empty.note { font-size: .82rem; }

/* ---- Dati dal vivo ---- */
.live-panel { margin-bottom: 1.2rem; }
.stat-live-row { display: flex; flex-wrap: wrap; gap: 2rem; margin: .4rem 0 .6rem; }
.stat-live { display: flex; flex-direction: column; }
.stat-live b { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--ember-2); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-live span { color: var(--muted); font-size: .85rem; }
.news h5 a { color: inherit; text-decoration: none; }
.news h5 a:hover { color: var(--ember-2); text-decoration: underline; }
.news .source { font-size: .78rem; color: var(--muted); list-style: none; background: none; border: 0; padding-top: .4rem; }
.news .source a { color: var(--ember-2); }
.live-panel .note a { color: var(--ember-2); }

.render-error { margin: 1rem 0; padding: 1rem 1.2rem; border-radius: 12px; border: 1px dashed var(--line); color: var(--muted); font-style: italic; }

/* ---- Preferiti, progressi, impostazioni ---- */
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.fav-btn, .done-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); font: 500 .9rem var(--sans); cursor: pointer; transition: transform .2s, background .2s, border-color .2s; }
.fav-btn:hover, .done-btn:hover { transform: translateY(-2px); border-color: var(--ember-2); }
.fav-btn svg, .done-btn svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.fav-btn svg path { fill: none; }
.fav-btn[aria-pressed="true"] { background: color-mix(in srgb, #d6455d 22%, transparent); border-color: #d6455d; }
.fav-btn[aria-pressed="true"] svg { fill: #e0566d; stroke: #e0566d; }
.fav-btn[aria-pressed="true"] svg path { fill: #e0566d; }
.done-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--moss) 30%, transparent); border-color: var(--moss); }
.my-block { margin: 0 0 2.4rem; }
.my-block h2 { font-family: var(--serif-sc); font-weight: 400; font-size: 1.7rem; margin: 0 0 1rem; }
.my-block h3 { font-family: var(--serif); font-weight: 400; margin: 1.2rem 0 .6rem; }
.meter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.meter-card { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--night-2); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: transform .2s, border-color .2s; }
.meter-card:hover { transform: translateY(-3px); border-color: var(--ember-2); }
.meter-card strong { display: block; } .meter-card small { color: var(--muted); }
.done-list, .fav-grid { list-style: none; margin: 0; padding: 0; }
.done-list li { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .45rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.done-list li:last-child { border-bottom: 0; }
.done-list a { display: flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; }
.done-list a:hover span { color: var(--ember-2); }
.done-list .emblem, .fav-card .emblem { width: 38px; height: 38px; flex: none; }
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.fav-grid li { position: relative; }
.fav-card { display: flex; align-items: center; gap: .7rem; padding: .7rem 2.6rem .7rem .8rem; border-radius: 12px; background: var(--night-2); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: transform .2s, border-color .2s; }
.fav-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent, var(--ember)) 70%, transparent); }
.fav-x { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; display: grid; place-items: center; }
.fav-x svg { width: 1.2rem; height: 1.2rem; fill: #e0566d; }
.fav-x:hover { background: rgba(224,86,109,.18); }
.fav-group { margin-bottom: 1rem; }
.empty-state { color: var(--muted); font-style: italic; padding: 1rem 1.2rem; border: 1px dashed var(--line); border-radius: 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.set-row small { display: block; color: var(--muted); margin-top: .15rem; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { background: none; border: 0; color: var(--muted); font: 500 .9rem var(--sans); padding: .5rem 1rem; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ember); color: #1a1209; font-weight: 600; }
.switch { width: 3.2rem; height: 1.8rem; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.08); position: relative; cursor: pointer; padding: 0; transition: background .2s; }
.switch i { position: absolute; top: 50%; left: .2rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--text); transform: translateY(-50%); transition: left .2s; }
.switch[aria-checked="true"] { background: var(--ember); }
.switch[aria-checked="true"] i { left: calc(100% - 1.5rem); background: #1a1209; }
.set-preview { padding: .9rem 1.1rem; border-radius: 12px; background: var(--night-2); border: 1px solid var(--line); font-family: var(--serif); font-size: 1.1rem; }
.set-actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin: .8rem 0; }
.set-paste { display: block; margin: .8rem 0; } .set-paste span { display: block; color: var(--muted); font-size: .85rem; margin-bottom: .3rem; }
.set-paste textarea { width: 100%; padding: .7rem .9rem; border-radius: 10px; border: 1px solid var(--line); background: var(--night-2); color: var(--text); font: .85rem ui-monospace, Menlo, monospace; resize: vertical; }
.set-summary { color: var(--muted); }
.link-btn.danger { color: #e0566d; }
.nav-group .nav-menu a[href="my-space.html"] { white-space: nowrap; }

/* ---- Tema chiaro ---- */
html[data-theme="light"] { color-scheme: light; --ink: #f4ecd9; --night: #ece2cb; --night-2: #e4d8bd; --text: #2b2118; --muted: #62523d; --ember: #c25a14; --ember-2: #a84a0e; --line: rgba(43,33,24,.22); --shadow: 0 10px 30px rgba(60,40,10,.18); }
html[data-theme="light"] body { background-image: radial-gradient(circle at 20% 0%, rgba(224,116,43,.1), transparent 40%), radial-gradient(circle at 80% 30%, rgba(143,182,201,.12), transparent 40%); }
html[data-theme="light"] .topbar { background: rgba(244,236,217,.92); }
html[data-theme="light"] .btn-ghost, html[data-theme="light"] .golden-card, html[data-theme="light"] .ing, html[data-theme="light"] .quiz-opt, html[data-theme="light"] .mat, html[data-theme="light"] .fav-btn, html[data-theme="light"] .done-btn { background: rgba(43,33,24,.05); }
html[data-theme="light"] .bar, html[data-theme="light"] .quiz-progress, html[data-theme="light"] .switch { background: rgba(43,33,24,.14); }
html[data-theme="light"] .ring-prog circle, html[data-theme="light"] .gauge-ring .track { stroke: rgba(43,33,24,.15); }
html[data-theme="light"] .checklist label:hover, html[data-theme="light"] .data-table tr:hover td, html[data-theme="light"] .nav > a:hover, html[data-theme="light"] .nav-trigger:hover { background: rgba(43,33,24,.06); }
html[data-theme="light"] .facts div, html[data-theme="light"] .gauge-facts div, html[data-theme="light"] .slot, html[data-theme="light"] .nav-menu { background: rgba(43,33,24,.07); }
html[data-theme="light"] .seg button[aria-pressed="true"], html[data-theme="light"] .switch[aria-checked="true"] { background: var(--ember); color: #fff; }
html[data-theme="light"] .switch[aria-checked="true"] i { background: #fff; }
html[data-theme="light"] .switch i { background: #2b2118; }

/* ---- Contrasto alto ---- */
html.hc { --muted: #e8dfca; --line: rgba(255,255,255,.5); }
html.hc[data-theme="light"] { --muted: #2b2118; --line: rgba(0,0,0,.65); --ember-2: #8a3a05; }
html.hc a { text-decoration: underline; }
html.hc :focus-visible { outline: 3px solid #ffd24a; outline-offset: 2px; }
html.hc[data-theme="light"] :focus-visible { outline-color: #0a3d91; }

/* ---- Meno animazioni ---- */
html.no-motion { scroll-behavior: auto; }
html.no-motion *, html.no-motion *::before, html.no-motion *::after { animation: none !important; transition: none !important; }
html.no-motion .reveal { opacity: 1; transform: none; }
html[data-theme="light"] .pm-col.plus h3 { color: #4a6a1f; }
html[data-theme="light"] .pm-col.minus h3 { color: #9a2f22; }
