/* ==========================================================================
   Best CoC Layouts — public site design system
   --------------------------------------------------------------------------
   60-30-10 colour rule
     60%  Night ink   — page backgrounds          (--bg, --bg-soft)
     30%  Royal indigo — header, cards, panels,    (--surface*, --elixir)
                         footer, chips
     10%  Crest gold  — primary CTAs, active state, (--gold)
                         key numbers, focus ring
   No framework, no web fonts (system stack = zero font requests, no CLS).
   ========================================================================== */

:root {
  --bg: #0b0d1a;
  --bg-soft: #0f1224;
  --surface: #161a2f;
  --surface-2: #1d2240;
  --surface-3: #262c52;
  --line: rgba(160, 170, 230, 0.13);
  --line-strong: rgba(160, 170, 230, 0.24);

  --text: #f3f4fb;
  --text-2: #b6bbd8;
  --text-3: #8d93b5;

  --gold: #ffc23d;
  --gold-2: #ffd977;
  --gold-3: #e9a412;
  --gold-ink: #1f1500;
  --gold-soft: rgba(255, 194, 61, 0.12);

  --elixir: #a78bfa;
  --elixir-2: #c4b5fd;
  --elixir-soft: rgba(167, 139, 250, 0.14);

  --green: #3ddc97;
  --green-soft: rgba(61, 220, 151, 0.14);
  --red: #ff7a7a;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.75);
  --shadow-gold: 0 14px 34px -14px rgba(255, 194, 61, 0.55);
  --container: 1200px;
  --header-h: 64px;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  color-scheme: dark;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  overflow-x: clip;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
::selection { background: rgba(255, 194, 61, 0.35); color: var(--text); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100; padding: 10px 16px;
  background: var(--gold); color: var(--gold-ink); font-weight: 700; border-radius: var(--r-sm);
}
.skip-link:focus { top: 12px; }

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.gold { color: var(--gold); }
.nowrap { white-space: nowrap; }
.icon { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }

/* Ambient page glow — subtle, GPU-cheap, purely decorative */
.page-glow {
  position: fixed; inset: 0 0 auto; height: 620px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 320px at 15% -5%, rgba(167, 139, 250, 0.16), transparent 70%),
    radial-gradient(520px 300px at 90% 0%, rgba(255, 194, 61, 0.09), transparent 70%);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  font-weight: 650; font-size: 15px; line-height: 1; white-space: nowrap;
  border: 1px solid transparent; transition: transform .15s ease, background-color .15s ease,
    border-color .15s ease, box-shadow .2s ease, color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-gold {
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, var(--gold-3));
  color: var(--gold-ink); box-shadow: var(--shadow-gold), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-gold:hover { box-shadow: 0 18px 40px -14px rgba(255, 194, 61, 0.75), inset 0 1px 0 rgba(255,255,255,.6); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-elixir { background: var(--elixir-soft); color: var(--elixir-2); border-color: rgba(167,139,250,.28); }
.btn-elixir:hover { background: rgba(167, 139, 250, 0.22); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 16.5px; }
.btn-block { width: 100%; }
.btn.is-done { background: var(--green-soft); color: var(--green); box-shadow: none; border-color: rgba(61,220,151,.35); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(11, 13, 26, 0.82);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-row { height: 100%; display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px;
  letter-spacing: -0.02em; flex: none; }
.brand img { width: 30px; height: 36px; }
.brand b { color: var(--gold); font-weight: 800; }

.main-nav { display: none; align-items: center; gap: 2px; }
.main-nav a, .nav-menu > summary {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px;
  border-radius: 999px; color: var(--text-2); font-weight: 550; font-size: 14.5px;
  cursor: pointer; list-style: none; transition: color .15s, background-color .15s;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.main-nav a:hover, .nav-menu > summary:hover, .nav-menu[open] > summary { color: var(--text); background: var(--surface); }
.main-nav a[aria-current="page"] { color: var(--gold); }
.nav-menu { position: relative; }
.nav-menu .icon { transition: transform .2s; }
.nav-menu[open] .icon { transform: rotate(180deg); }
.nav-panel {
  position: absolute; top: calc(100% + 10px); left: 0; width: 460px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.nav-panel .nav-label { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-3);
  margin: 4px 6px 10px; font-weight: 700; }
.th-mini-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.th-mini {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px;
  border-radius: var(--r-sm); background: var(--bg-soft); border: 1px solid var(--line);
  font-weight: 750; font-size: 13.5px; transition: border-color .15s, background-color .15s;
}
.th-mini img { width: 34px; height: 34px; object-fit: contain; }
.th-mini small { font-size: 11px; font-weight: 500; color: var(--text-3); }
.th-mini:hover { border-color: rgba(255, 194, 61, 0.5); background: var(--surface-2); }

.header-search { position: relative; margin-left: auto; flex: 1; max-width: 360px; display: none; }
.search-field {
  display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
  transition: border-color .15s, box-shadow .15s;
}
.search-field:focus-within { border-color: rgba(255, 194, 61, 0.6); box-shadow: 0 0 0 4px rgba(255, 194, 61, 0.12); }
.search-field .icon { color: var(--text-3); font-size: 17px; }
.search-field input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; font-size: 15px; }
.search-field input::placeholder { color: var(--text-3); }
.search-field kbd { font: 600 11px/1 var(--font); color: var(--text-3); padding: 4px 6px;
  border: 1px solid var(--line-strong); border-radius: 6px; }
.search-field input::-webkit-search-cancel-button { display: none; }

.menu-btn { margin-left: auto; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line-strong); font-size: 20px; }

.mobile-nav {
  position: fixed; inset: var(--header-h) 0 0; z-index: 49; overflow-y: auto; padding: 18px 16px 40px;
  background: var(--bg); border-top: 1px solid var(--line);
}
.mobile-nav .nav-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--text-3);
  margin: 22px 2px 10px; }
.mobile-nav .th-mini-grid { grid-template-columns: repeat(4, 1fr); }
.mobile-links { display: grid; gap: 6px; }
.mobile-links a { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font-weight: 600; }

@media (min-width: 900px) {
  .main-nav { display: flex; }
  .header-search { display: block; }
  .menu-btn, .mobile-nav { display: none !important; }
}

/* ---------- Search suggest ---------- */
.suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  box-shadow: var(--shadow); max-height: 70vh; overflow-y: auto;
}
.suggest a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm);
  font-size: 14.5px; color: var(--text-2); }
.suggest a b { color: var(--text); font-weight: 600; }
.suggest a[aria-selected="true"], .suggest a:hover { background: var(--surface-2); color: var(--text); }
.suggest .tag { margin-left: auto; flex: none; white-space: nowrap; font-size: 11.5px; font-weight: 700; color: var(--gold); }
.suggest-empty { padding: 12px; font-size: 14px; color: var(--text-3); }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { padding-top: 20px; font-size: 13.5px; color: var(--text-3); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; padding: 0; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; color: var(--line-strong); }
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs a:hover { color: var(--gold); }
.breadcrumbs [aria-current] { color: var(--text-3); max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Sections ---------- */
.section { padding-block: 40px; }
.section-tight { padding-block: 24px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; }
.section-head p { margin-top: 6px; color: var(--text-2); max-width: 64ch; font-size: 15px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750;
  letter-spacing: .14em; text-transform: uppercase; color: var(--elixir-2); margin-bottom: 8px; }
.link-more { display: inline-flex; align-items: center; gap: 6px; flex: none; font-weight: 650; font-size: 14px;
  color: var(--gold); padding: 8px 0; }
.link-more:hover { color: var(--gold-2); }
.link-more .icon { transition: transform .15s; }
.link-more:hover .icon { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero { padding: 44px 0 28px; }
.hero-grid { display: grid; gap: 34px; align-items: center; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 850; letter-spacing: -0.035em; line-height: 1.02; }
.hero h1 .gold-grad, .gold-grad {
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 50%, var(--gold-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { margin-top: 16px; font-size: clamp(16px, 1.6vw, 18.5px); color: var(--text-2); max-width: 56ch; }
.hero-search { margin-top: 26px; max-width: 560px; position: relative; }
.hero-search .search-field { height: 56px; padding: 0 8px 0 18px; background: var(--surface); }
.hero-search .search-field input { font-size: 16.5px; }
.hero-search .btn { min-height: 42px; }
.hero-quick { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; color: var(--text-3); }
.hero-art { position: relative; display: none; aspect-ratio: 4 / 3.3; }
.hero-art figure { position: absolute; overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); background: var(--surface); }
.hero-art figure img { width: 100%; height: 100%; object-fit: cover; }
.hero-art figcaption { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; }
.hero-art .a1 { inset: 0 18% 26% 0; z-index: 1; }
.hero-art .a2 { inset: 30% 0 4% 34%; z-index: 2; box-shadow: 0 30px 60px -20px rgba(0,0,0,.9); }
.hero-art .a3 { width: 38%; aspect-ratio: 4/3; left: 4%; bottom: 0; z-index: 3; }
@media (min-width: 980px) {
  .hero { padding: 64px 0 40px; }
  .hero-grid { grid-template-columns: 1.05fr 1fr; }
  .hero-art { display: block; }
}

/* ---------- Stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 26px; max-width: 620px; }
.stat { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.stat b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--gold); }
.stat span { font-size: 12.5px; color: var(--text-2); }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; flex: none; height: 38px; padding: 0 14px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--text-2); font-size: 14px; font-weight: 600; transition: all .15s;
}
.chip:hover { color: var(--text); border-color: rgba(167, 139, 250, 0.5); background: var(--surface-2); }
.chip .count { font-size: 12px; font-weight: 700; color: var(--text-3); }
.chip.is-active, .chip[aria-current="page"] { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.chip.is-active .count, .chip[aria-current="page"] .count { color: rgba(31, 21, 0, 0.7); }
.chip-sm { height: 30px; padding: 0 11px; font-size: 13px; }
.filter-bar {
  position: sticky; top: var(--header-h); z-index: 30; margin-inline: -16px; padding: 10px 16px;
  background: rgba(11, 13, 26, 0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 1232px) { .filter-bar { margin-inline: 0; border-radius: 0 0 var(--r) var(--r); } }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.badge-th { background: var(--gold); color: var(--gold-ink); }
.badge-type { background: var(--elixir-soft); color: var(--elixir-2); border: 1px solid rgba(167,139,250,.25); }
.badge-glass { background: rgba(11, 13, 26, 0.72); color: var(--text); border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.badge-new { background: var(--green-soft); color: var(--green); }

/* ---------- Town Hall tiles ---------- */
.th-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .th-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; } }
.th-tile {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 18px 10px 14px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  border-radius: var(--r-lg); text-align: center; transition: transform .18s ease, border-color .18s, box-shadow .2s;
}
.th-tile img { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0,0,0,.55)); }
@media (max-width: 480px) { .th-tile { padding: 14px 6px 12px; } .th-tile img { width: 56px; height: 56px; } .th-tile strong { font-size: 15px; } .th-tile span { font-size: 11.5px; } }
.th-tile strong { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.th-tile span { font-size: 12.5px; color: var(--text-3); }
.th-tile:hover { transform: translateY(-3px); border-color: rgba(255, 194, 61, 0.55); box-shadow: var(--shadow); }
.th-tile:hover strong { color: var(--gold); }
.th-tile .ribbon { position: absolute; top: 10px; right: 10px; }

/* ---------- Layout cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: transform .18s ease, border-color .18s, box-shadow .2s;
  content-visibility: auto; contain-intrinsic-size: auto 360px;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.card-media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-media .badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.card-media .fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 850;
  color: rgba(255, 194, 61, .5); background: linear-gradient(135deg, var(--surface-2), var(--bg-soft)); }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 14px; flex: 1; }
.card-title { font-size: 15.5px; font-weight: 650; line-height: 1.35; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-title a:hover { color: var(--gold); }
.card-meta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-3); }
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-actions { display: flex; gap: 8px; margin-top: auto; position: relative; z-index: 2; }
.card-actions .btn { flex: 1; }

/* ---------- Pager ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.pager a, .pager span { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 650; font-size: 14px; }
.pager a:hover { border-color: rgba(255, 194, 61, 0.5); }
.pager [aria-current="page"] { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.pager .gap { background: none; border: 0; color: var(--text-3); }
.load-more-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 26px; }

/* ---------- Page header (hubs) ---------- */
.page-head { padding: 18px 0 8px; }
.page-head-row { display: flex; align-items: center; gap: 18px; }
.page-head-img { width: 92px; height: 92px; flex: none; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-strong); border-radius: 24px; }
.page-head-img img { width: 76px; height: 76px; object-fit: contain; }
.page-head h1 { font-size: clamp(28px, 4.4vw, 46px); font-weight: 850; letter-spacing: -0.03em; }
.page-head .lead { margin-top: 14px; max-width: 76ch; color: var(--text-2); font-size: 16.5px; }
.page-head .lead strong { color: var(--text); }
.meta-line { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--text-3); }
.meta-line span { display: inline-flex; align-items: center; gap: 6px; }
.meta-line b { color: var(--text-2); font-weight: 650; }
@media (max-width: 560px) { .page-head-img { width: 68px; height: 68px; border-radius: 18px; } .page-head-img img { width: 56px; height: 56px; } }

/* ---------- Answer box (AEO) ---------- */
.answer {
  margin-top: 18px; padding: 16px 18px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.10), rgba(167, 139, 250, 0.04));
  border: 1px solid rgba(167, 139, 250, 0.25); max-width: 860px;
}
.answer h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--elixir-2); margin-bottom: 6px; }
.answer p { color: var(--text); font-size: 15.5px; }
.answer a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,194,61,.4); }

/* ---------- Guide panel ---------- */
.guide { display: grid; gap: 14px; }
.guide-card { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.guide-card h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 750; margin-bottom: 10px; }
.guide-card h3 .icon { color: var(--gold); font-size: 18px; }
.guide-card ul { padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); font-size: 15px; }
.guide-card li::marker { color: var(--gold); }
.guide-card p { color: var(--text-2); font-size: 15px; }
@media (min-width: 860px) { .guide { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Type cards (categories) ---------- */
.type-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.type-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.type-card:hover { border-color: rgba(255, 194, 61, 0.5); transform: translateY(-2px); }
.type-card strong { font-size: 17px; font-weight: 750; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.type-card strong em { font-style: normal; font-size: 13px; color: var(--gold); font-weight: 700; }
.type-card span { font-size: 14px; color: var(--text-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 560px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 700; background: var(--bg-soft); }
table.data tr:last-child td { border-bottom: 0; }
table.data td a { color: var(--gold); font-weight: 650; }
table.data td.num { font-variant-numeric: tabular-nums; }

/* ---------- Steps ---------- */
.steps { display: grid; gap: 12px; counter-reset: step; }
.step { position: relative; padding: 18px 18px 18px 64px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 18px; top: 18px;
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; font-weight: 800;
  background: var(--gold); color: var(--gold-ink); }
.step h3 { font-size: 16px; font-weight: 700; }
.step p { margin-top: 4px; color: var(--text-2); font-size: 14.5px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; max-width: 900px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px;
  cursor: pointer; font-weight: 650; font-size: 15.5px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--gold); transition: transform .2s; font-size: 18px; }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq details > div { padding: 0 18px 16px; color: var(--text-2); font-size: 15px; }
.faq details[open] { border-color: var(--line-strong); }

/* ---------- Link hub ---------- */
.link-hub { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.link-hub section { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.link-hub h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: 10px; }
.link-hub ul { list-style: none; padding: 0; display: grid; gap: 4px; }
.link-hub a { display: block; padding: 6px 0; color: var(--text-2); font-size: 14.5px; }
.link-hub a:hover { color: var(--gold); }

/* ---------- Layout detail ---------- */
.detail { display: grid; gap: 26px; padding-top: 18px; }
.gallery-main { position: relative; display: block; overflow: hidden; border-radius: var(--r-lg);
  border: 1px solid var(--line-strong); background: var(--bg-soft); cursor: zoom-in; width: 100%; padding: 0; }
.gallery-main img { width: 100%; height: auto; }
.gallery-main .zoom { position: absolute; right: 12px; bottom: 12px; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumbs button { flex: none; width: 92px; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; border: 2px solid transparent; opacity: .7; }
.thumbs button[aria-current="true"] { border-color: var(--gold); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail-info h1 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 850; letter-spacing: -0.03em; margin-top: 12px; }
.detail-info .badges { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-info .badges a.badge:hover { filter: brightness(1.08); }
.byline { margin-top: 10px; font-size: 14px; color: var(--text-3); }
.byline b { color: var(--text-2); font-weight: 600; }
.desc { margin-top: 16px; color: var(--text-2); font-size: 15.5px; }
.cta-panel { margin-top: 20px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-strong); }
.cta-panel .btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cta-panel .btn-row .btn-gold { flex: 1 1 100%; }
.cta-panel .btn-row [data-clipboard] { flex: 1 1 auto; }
.cta-panel .btn-row [data-share] { flex: 0 0 54px; padding: 0; }
.cta-note { margin-top: 10px; font-size: 13px; color: var(--text-3); display: flex; gap: 6px; align-items: center; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 18px; }
.facts div { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 700; }
.facts dd { margin-top: 2px; font-weight: 700; font-size: 15.5px; }
.facts dd a { color: var(--gold); }
@media (min-width: 560px) { .facts { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width: 980px) { .detail { grid-template-columns: 1.25fr 1fr; align-items: start; }
  .detail-media { position: sticky; top: calc(var(--header-h) + 16px); } }

.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(11, 13, 26, 0.94); border-top: 1px solid var(--line-strong);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transform: translateY(110%); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
.sticky-cta.is-visible { transform: none; visibility: visible; transition: transform .25s ease, visibility 0s; }
.sticky-cta .btn { width: 100%; }
@media (min-width: 980px) { .sticky-cta { display: none; } }

/* ---------- Lightbox ---------- */
dialog.lightbox { margin: auto; padding: 0; border: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 92vh; }
dialog.lightbox::backdrop { background: rgba(5, 6, 14, 0.88); backdrop-filter: blur(4px); }
dialog.lightbox img { max-height: 86vh; width: auto; border-radius: var(--r); }
dialog.lightbox .close { position: absolute; top: 10px; right: 10px; }

/* ---------- Prose (blog + static) ---------- */
.prose { max-width: 74ch; color: var(--text-2); font-size: 17px; line-height: 1.75; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { color: var(--text); font-size: 26px; font-weight: 800; margin-top: 1.8em; }
.prose h3 { color: var(--text); font-size: 20px; font-weight: 750; margin-top: 1.5em; }
.prose a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,194,61,.4); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--gold); }
.prose strong { color: var(--text); }
.prose img { border-radius: var(--r); border: 1px solid var(--line); }
.prose blockquote { border-left: 3px solid var(--elixir); padding-left: 16px; color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.article-head { max-width: 860px; padding: 18px 0 8px; }
.article-head h1 { font-size: clamp(30px, 4.6vw, 48px); font-weight: 850; letter-spacing: -0.03em; }
.article-cover { margin: 22px 0 10px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); max-width: 1000px; }
.post-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; position: relative; }
.post-card img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.post-card div { padding: 16px; display: grid; gap: 8px; }
.post-card h2 { font-size: 18px; font-weight: 750; }
.post-card h2 a::after { content: ""; position: absolute; inset: 0; }
.post-card p { color: var(--text-2); font-size: 14.5px; }

/* ---------- Notices / empty ---------- */
.notice { padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px dashed var(--line-strong); text-align: center; }
.notice h2 { font-size: 20px; }
.notice p { margin-top: 6px; color: var(--text-2); }
.notice .btn { margin-top: 14px; }

/* ---------- Ads (reserved space = zero CLS) ---------- */
.ad-slot { display: grid; place-items: center; min-height: 120px; margin-block: 8px; border-radius: var(--r);
  background: repeating-linear-gradient(135deg, var(--bg-soft) 0 12px, rgba(22,26,47,.6) 12px 24px); }
.ad-slot::before { content: "Advertisement"; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.ad-slot.is-filled::before { content: none; }

/* ---------- Newsletter ---------- */
.newsletter { display: flex; gap: 8px; margin-top: 16px; max-width: 420px; }
.newsletter input { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border-radius: 999px; background: var(--bg-soft);
  border: 1px solid var(--line-strong); outline: 0; }
.newsletter input:focus { border-color: rgba(255,194,61,.6); }
.form-msg { margin-top: 8px; font-size: 13.5px; }
.form-msg.ok { color: var(--green); }
.form-msg.err { color: var(--red); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 56px; border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--bg-soft), var(--bg)); }
.footer-grid { display: grid; gap: 30px; padding: 44px 0 30px; grid-template-columns: 1fr; }
.footer-grid .nav-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--text-3); margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: 7px; font-size: 14.5px; }
.footer-grid ul a { color: var(--text-2); }
.footer-grid ul a:hover { color: var(--gold); }
.footer-th { grid-template-columns: repeat(3, 1fr) !important; }
.footer-about p { margin-top: 12px; color: var(--text-2); font-size: 14.5px; max-width: 40ch; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; padding: 18px 0 28px;
  border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); }
.footer-bottom a:hover { color: var(--text); }
.footer-bottom nav { display: flex; gap: 16px; flex-wrap: wrap; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .footer-grid { grid-template-columns: 1.5fr 1.2fr 1fr 1fr; } }

/* ---------- Error page ---------- */
.error-hero { padding: 70px 0 30px; text-align: center; }
.error-hero .code { font-size: clamp(72px, 14vw, 140px); font-weight: 900; line-height: 1; }
.error-hero h1 { margin-top: 10px; font-size: clamp(24px, 3.4vw, 34px); }
.error-hero p { margin: 10px auto 0; max-width: 54ch; color: var(--text-2); }
.error-hero .hero-search { margin: 24px auto 0; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-strong);
  font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow); transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
body.has-sticky-cta .toast { bottom: 92px; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* JS on: "Load more" replaces numbered pages (pager stays in HTML for crawlers / no-JS) */
.js .load-more-wrap:has([data-load-more]) .pager { display: none; }
main:focus { outline: none; }
