/* Spiritlands Online (Spirits of the Five Lands): official site.
   The game's own look (design/HOME_V2_DESIGN.md): dusk-blue night, the five land colours as bands with their
   terrain edges, in-game panels, dialogue boxes, route signposts and menu-slab buttons. The near-future tech
   layer is the light-blue glow (--tech). Body text pairs stay >= 4.5:1 on the backgrounds they sit on. */

@font-face {
  font-family: "Mukta Malar";
  src: url("../fonts/MuktaMalar-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Mukta Malar";
  src: url("../fonts/MuktaMalar-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Baloo Thambi 2";
  src: url("../fonts/BalooThambi2-wght.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  /* The game's palette: dusk blue, gold and ember from the crest, teal from the device, the five land colours. */
  --dusk: #1B1F45;
  --dusk-deep: #12152F;
  --woodland: #2E6A3A;
  --farmland: #C99A2E;
  --hills: #5B3F99;
  --shore: #1F5F99;
  --dry: #9E4024;
  --cream: #FFF6E3;
  --ink: #26190C;
  --wood: #7A4A24;
  --wood-dark: #4E2C12;
  --teal: #1E7C82;
  --panel: rgba(18, 21, 47, 0.86);
  --rim: inset 0 0 0 2px rgba(255, 246, 227, 0.22);

  --bg: var(--dusk-deep);
  --bg-2: var(--dusk);
  --surface: rgba(255, 246, 227, 0.05);
  --surface-2: rgba(255, 246, 227, 0.09);
  --line: rgba(255, 246, 227, 0.14);
  --line-strong: rgba(255, 246, 227, 0.26);
  --text: var(--cream);
  --muted: #C9C3D6;
  --gold: #F5B83D;
  --gold-deep: #B7741A;
  --ember: #E2662A;
  --kumkum: #D54A1B;
  --violet: #8C7BD6;
  --sunset: linear-gradient(100deg, #F5B83D, #E2662A);
  --sunset-btn: var(--gold);
  /* The tech glow: the Spirit Device's light ring, the Spirit Centers' LED seams, the lighthouse coils. */
  --tech: #6FD6FF;
  --tech-deep: #38B6F0;
  --tech-soft: rgba(111, 214, 255, 0.14);
  --tech-line: rgba(111, 214, 255, 0.45);
  --tech-glow: 0 0 14px rgba(111, 214, 255, 0.45);

  --land-kurinji: #A595F0;
  --land-mullai: #6BC077;
  --land-marutham: #B5DB72;
  --land-neithal: #5CC4CC;
  --land-paalai: #EE8A55;

  --font-body: "Mukta Malar", "Nirmala UI", "Latha", system-ui, sans-serif;
  --font-head: "Baloo Thambi 2", "Mukta Malar", "Nirmala UI", system-ui, sans-serif;

  --radius: 12px;
  --radius-lg: 14px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.55;
  overflow-x: hidden; overflow-x: clip;
}
:lang(ta) body, body:lang(ta) { line-height: 1.75; }
img { max-width: 100%; height: auto; display: block; }
.pixel { image-rendering: pixelated; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #FFE3A3; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
:lang(ta) h1, :lang(ta) h2, :lang(ta) h3 { line-height: 1.35; letter-spacing: 0; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--tech); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(251, 178, 57, 0.35); }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 780px; }
.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;
}
.plain-list { list-style: none; margin: 0; padding: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--gold); color: #1A1210; padding: 10px 16px; border-radius: 10px; font-weight: 700;
}
.skip-link:focus { top: 12px; }
main:focus { outline: none; }

/* ------------------------------------------------------------------ type helpers */

.display { font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 800; }
:lang(ta) .display { font-size: clamp(1.7rem, 3.8vw, 3rem); }
.grad {
  background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: #E7DCC6; }
.link-arrow { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.link-arrow::after { content: "→"; transition: transform 0.25s var(--ease); }
.link-arrow:hover::after { transform: translateX(4px); }
.link-arrow:lang(ta)::after, :lang(ta) .link-arrow::after { content: "→"; }

/* ------------------------------------------------------------------ buttons */

/* Author display rules (like .btn's inline-flex) would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }

.btn {
  --btn-bg: var(--sunset-btn);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 24px; border: 0; border-radius: 10px;
  background: var(--btn-bg); color: #1F130C; font: 700 1rem/1.2 var(--font-body);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), filter 0.2s;
}
.btn:hover { color: #1F130C; transform: translateY(-2px); box-shadow: 0 10px 30px -8px rgba(244, 107, 21, 0.6); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn-sm { min-height: 40px; padding: 8px 18px; font-size: 0.95rem; }
.btn-glow { box-shadow: 0 0 0 1px rgba(255, 220, 140, 0.4), 0 12px 40px -10px rgba(244, 107, 21, 0.8); }
.btn-glass {
  background: rgba(220, 235, 255, 0.08); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-glass:hover { color: var(--text); background: rgba(220, 235, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 220, 140, 0.5); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ------------------------------------------------------------------ header */

.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(6, 12, 26, 0.78); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s, border-color 0.3s;
}
.header-overlay .site-header { position: fixed; left: 0; right: 0; background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.header-overlay .site-header.is-scrolled,
.header-overlay.menu-open .site-header {
  background: rgba(6, 12, 26, 0.82); border-color: var(--line);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.header-bar { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand-text { display: flex; align-items: baseline; gap: 8px; }
/* The name: partials/wordmark.php draws SPIRITLANDS / ONLINE as text until a logo picture is set (config logo_image). */
.wm { display: inline-grid; justify-items: center; text-transform: uppercase; line-height: 1; }
.wm-main { font-family: var(--font-head); font-weight: 800; letter-spacing: 0.02em; background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wm-sub { font-family: var(--font-body); font-weight: 700; color: var(--tech); text-shadow: 0 0 10px rgba(127, 212, 255, 0.6); letter-spacing: 0.6em; margin-right: -0.6em; }
.wm-header .wm-main { font-size: 1.32rem; }
.wm-header .wm-sub { font-size: 0.6rem; margin-top: 2px; letter-spacing: 0.78em; margin-right: -0.78em; }
.wm-footer .wm-main { font-size: 1.75rem; }
.wm-footer .wm-sub { font-size: 0.72rem; margin-top: 4px; }
.wordmark-logo { display: block; }
.wordmark-logo img { display: block; width: auto; }
.wordmark-logo-header img { height: 62px; margin-block: 2px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5)); }
.wordmark-logo-footer img { height: 120px; }
.wordmark-logo-hero img { width: min(520px, 86vw); height: auto; filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55)); }
.brand:hover { color: var(--text); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.site-nav a:not(.btn) {
  display: block; padding: 8px 12px; border-radius: 10px; color: #E7DCC6; text-decoration: none; font-weight: 700; font-size: 0.97rem;
  transition: background 0.2s, color 0.2s;
}
.site-nav a { white-space: nowrap; }
/* Seven links plus the button: tighten them where the full bar is still shown, so it stays on one line. */
@media (min-width: 1021px) and (max-width: 1180px) {
  .site-nav a:not(.btn) { padding: 8px 9px; font-size: 0.92rem; }
  .site-nav ul { gap: 2px; }
}
.site-nav a:not(.btn):hover { background: var(--surface-2); color: #fff; }
.site-nav a[aria-current="page"]:not(.btn) { color: var(--tech); background: var(--tech-soft); box-shadow: inset 0 -2px 0 var(--tech-line); }
.nav-cta { margin-left: 8px; }
.menu-toggle { display: none; }

@media (max-width: 1020px) {
  .js .menu-toggle {
    display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; border: 0;
    background: var(--surface-2); color: var(--text); cursor: pointer;
  }
  .bars, .bars::before, .bars::after { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.25s var(--ease), opacity 0.2s; }
  .bars { position: relative; }
  .bars::before, .bars::after { content: ""; position: absolute; left: 0; }
  .bars::before { top: -6px; }
  .bars::after { top: 6px; }
  .menu-toggle[aria-expanded="true"] .bars { background: transparent; }
  .menu-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }

  .js .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    background: rgba(6, 12, 26, 0.97); border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter) 24px; transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0s 0.25s;
  }
  .js .site-nav.is-open { opacity: 1; transform: none; visibility: visible; transition: opacity 0.2s, transform 0.25s var(--ease); }
  .js .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .js .site-nav a:not(.btn) { padding: 14px 12px; font-size: 1.1rem; border-radius: 12px; }
  .js .nav-cta { margin: 12px 0 0; }
  .js .nav-cta .btn { width: 100%; min-height: 52px; }
  .no-js .header-bar { flex-wrap: wrap; height: auto; padding-block: 12px; }
  .no-js .site-header { height: auto; position: static; }
  .no-js .site-nav ul { flex-wrap: wrap; }
}

/* ------------------------------------------------------------------ quick tiles */

.quick-tiles { margin-top: clamp(28px, 5vw, 48px); }
.quick-tiles ul { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(10px, 1.6vw, 18px); }
.quick-tile {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 18px 12px 16px; border-radius: var(--radius);
  text-decoration: none; color: var(--text); overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, color-mix(in oklab, var(--type) 16%, transparent), var(--surface) 70%);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 -3px 0 color-mix(in oklab, var(--type) 55%, transparent);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.quick-tile::before {
  content: ""; position: absolute; left: 50%; top: 14px; width: 92px; height: 92px; translate: -50% 0; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--type) 45%, transparent), transparent);
}
.quick-tile-art img { width: 84px; height: 84px; transition: transform 0.3s var(--ease); }
.quick-tile-label { font: 800 1.1rem/1.2 var(--font-head); letter-spacing: 0.02em; }
.quick-tile-stat {
  position: absolute; top: 10px; right: 10px; min-width: 30px; padding: 1px 8px; border-radius: 10px;
  font: 800 0.8rem/1.6 var(--font-head); color: #1A1210; background: var(--gold);
}
.quick-tile:hover, .quick-tile:focus-visible {
  transform: translateY(-5px);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--type) 60%, transparent), inset 0 -3px 0 var(--type), 0 16px 30px -12px color-mix(in oklab, var(--type) 55%, transparent);
}
.quick-tile:hover img, .quick-tile:focus-visible img { animation: spiritHop 0.5s var(--ease); }
@media (max-width: 760px) {
  .quick-tiles ul { grid-template-columns: repeat(5, minmax(96px, 1fr)); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .quick-tiles li { scroll-snap-align: start; }
  .quick-tile-art img { width: 64px; height: 64px; }
  .quick-tile::before { width: 72px; height: 72px; }
  .quick-tile-label { font-size: 0.95rem; }
}

.land-kurinji { --land: var(--land-kurinji); }
.land-mullai { --land: var(--land-mullai); }
.land-marutham { --land: var(--land-marutham); }
.land-neithal { --land: var(--land-neithal); }
.land-paalai { --land: var(--land-paalai); }

/* ------------------------------------------------------------------ sections */

.section { padding: clamp(72px, 11vw, 140px) 0; position: relative; }
.section + .section { padding-top: 0; }
.section-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.center { margin-inline: auto; }
.section-head.split { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.section-head.split .display { margin-bottom: 0; }
.section-more { margin-top: 36px; }

/* story */
.story-grid { display: grid; grid-template-columns: 1fr; gap: 48px; align-items: center; }
@media (min-width: 960px) { .story-grid { grid-template-columns: 1fr 1.05fr; gap: 72px; } }
.story-art { position: relative; }
.shot-tilt {
  margin: 0; border-radius: var(--radius-lg); overflow: hidden; transform: rotate(-2deg);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--line-strong);
}
.shot-tilt img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: pixelated; }
.tech-ring { position: absolute; width: clamp(120px, 18vw, 190px); right: -18px; bottom: -48px; color: var(--tech); filter: drop-shadow(0 0 10px rgba(127, 212, 255, 0.7)) drop-shadow(0 0 26px rgba(56, 182, 240, 0.35)); }
.tech-ring .ring-a, .tech-ring .ring-c { stroke-dasharray: 540; stroke-dashoffset: 0; transition: stroke-dashoffset 2.2s var(--ease); }
.js .tech-ring:not(.is-in) .ring-a, .js .tech-ring:not(.is-in) .ring-c { stroke-dashoffset: 540; }
.tech-ring .ring-c { transition-delay: 0.4s; }
.tech-ring .ring-b { transform-origin: 100px 100px; animation: ringSpin 14s linear infinite; opacity: 0.8; }
.tech-ring .ring-tick { opacity: 0.7; }
.tech-ring .ring-core { animation: heart 3s ease-in-out infinite; transform-origin: 100px 100px; }
@keyframes ringSpin { to { transform: rotate(360deg); } }
@keyframes heart { 50% { transform: scale(1.5); opacity: 0.7; } }

/* ------------------------------------------------------------------ land explorer */

.explorer { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 1000px) { .explorer { grid-template-columns: 1.55fr 1fr; align-items: stretch; } }
.explorer-map {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; align-self: start;
  box-shadow: 0 0 0 1px var(--line-strong), 0 30px 70px -30px rgba(0, 0, 0, 0.9);
}
.explorer-map > img { width: 100%; filter: saturate(1.05) contrast(1.04); }
.explorer-map::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(6, 12, 26, 0.55)); }
.explorer-pins { position: absolute; inset: 0; z-index: 2; }
.pin {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border: 0; border-radius: 10px;
  background: rgba(6, 12, 26, 0.78); color: var(--text); font: 700 0.95rem/1.2 var(--font-body); cursor: pointer;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--land) 70%, transparent), 0 8px 20px -6px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: transform 0.25s var(--ease), background 0.2s;
}
.pin:hover { transform: translate(-50%, -50%) scale(1.06); }
.pin-dot { position: relative; width: 14px; height: 14px; border-radius: 50%; background: var(--land); }
.pin-dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--land); opacity: 0; }
.pin[aria-selected="true"] { background: var(--land); color: #140F1C; transform: translate(-50%, -50%) scale(1.08); }
.pin[aria-selected="true"] .pin-dot { background: #140F1C; }
.pin[aria-selected="true"] .pin-dot::after { border-color: #140F1C; animation: ping 1.6s var(--ease) infinite; }
@keyframes ping { 0% { opacity: 0.9; transform: scale(0.6); } 100% { opacity: 0; transform: scale(1.8); } }
@media (max-width: 600px) {
  .pin { padding: 5px; }
  .pin .pin-label { display: none; }
  .pin[aria-selected="true"] .pin-label { display: inline; padding-right: 6px; }
}

.explorer-panels { display: grid; gap: 16px; }
.js .land-panel[data-hidden] { display: none; }
.land-panel {
  position: relative; padding: clamp(24px, 3vw, 36px); border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--land) 16%, transparent), rgba(220, 235, 255, 0.03) 55%), var(--bg-2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--land) 35%, transparent);
}
.js .land-panel { animation: panelIn 0.5s var(--ease) both; }
/* Entrance motion is movement only: if an animation never runs (a background tab, a slow device), nothing is left invisible. */
@keyframes panelIn { from { transform: translateY(10px); } }
.land-panel::before {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--land) 40%, transparent), transparent 70%); pointer-events: none;
}
.land-kicker { color: var(--land); font-weight: 700; letter-spacing: 0.01em; font-size: 0.82rem; margin-bottom: 6px; }
:lang(ta) .land-kicker { letter-spacing: 0.03em; font-size: 0.95rem; }
.land-panel h3 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; }
.land-panel h3 span { color: var(--muted); font-size: 0.6em; font-weight: 700; margin-left: 8px; }
.land-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }
.land-facts div { padding: 12px; border-radius: 14px; background: rgba(6, 12, 26, 0.45); box-shadow: inset 0 0 0 1px var(--line); }
.land-facts dt { font-size: 0.78rem; color: var(--muted); font-weight: 700; letter-spacing: 0.01em; }
:lang(ta) .land-facts dt { letter-spacing: 0; font-size: 0.85rem; }
.land-facts dd { margin: 2px 0 0; font-weight: 700; line-height: 1.3; }
@media (max-width: 480px) { .land-facts { grid-template-columns: 1fr; } }
.land-spirits { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.land-spirits li { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 92px; padding: 8px 4px; border-radius: 14px; background: rgba(6, 12, 26, 0.45); font-size: 0.85rem; font-weight: 700; text-align: center; }
.land-spirits img { width: 64px; height: 64px; }

/* ------------------------------------------------------------------ spirit showcase */

.showcase {
  display: grid; gap: 28px; padding: clamp(20px, 3vw, 40px); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(220, 235, 255, 0.05), rgba(220, 235, 255, 0.015)); box-shadow: inset 0 0 0 1px var(--line);
}
.showcase-stage { display: grid; gap: 24px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 820px) { .showcase-stage { grid-template-columns: minmax(280px, 420px) 1fr; } }
.stage-ring { grid-area: 1 / 1; justify-self: center; width: min(100%, 380px); aspect-ratio: 1; border-radius: 50%; position: relative;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--type, var(--gold)) 38%, transparent) 0%, transparent 62%);
}
.stage-ring::before, .stage-ring::after {
  content: ""; position: absolute; inset: 6%; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--type, var(--gold)) 55%, transparent);
  animation: spin 40s linear infinite;
}
.stage-ring::after { inset: 18%; border-style: dotted; border-width: 3px; animation-direction: reverse; animation-duration: 28s; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage-img { grid-area: 1 / 1; justify-self: center; width: min(72%, 288px); height: auto; position: relative; z-index: 1; animation: float 5s ease-in-out infinite; filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.55)); }
.stage-img.is-swapping { animation: swapIn 0.45s var(--ease) both; }
@keyframes float { 50% { transform: translateY(-10px); } }
@keyframes swapIn { from { transform: scale(0.85) translateY(10px); } }
.stage-info { grid-column: 1; }
@media (min-width: 820px) { .stage-info { grid-column: 2; grid-row: 1; } }
.spirit-no { font: 700 0.95rem/1 var(--font-body); color: var(--muted); letter-spacing: 0.1em; margin-bottom: 6px; }
.stage-name { font: 800 clamp(2.4rem, 5vw, 4rem)/1 var(--font-head); margin-bottom: 14px; }
.stage-look { font-size: 1.12rem; color: #E7DCC6; max-width: 46ch; }
.spirit-land { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); margin: 0; }
.land-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--land, var(--gold)); }
.showcase-rail { position: relative; list-style: none; margin: 0; padding: 4px 2px; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.rail-btn {
  width: 84px; height: 84px; display: grid; place-items: center; border: 0; border-radius: 20px; cursor: pointer; scroll-snap-align: start;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--type) 30%, transparent), rgba(220, 235, 255, 0.04) 70%);
  box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.rail-btn img { width: 64px; height: 64px; }
.rail-btn:hover { transform: translateY(-3px); }
.rail-btn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--gold), 0 10px 24px -10px rgba(251, 178, 57, 0.6); }

/* first partner: Paati's three spirits, the visitor picks one */
.partners-quote { margin: 0 auto; max-width: 56ch; color: #E7DCC6; font-size: clamp(1.05rem, 1.5vw, 1.2rem); font-style: italic; }
.partners-quote p { margin: 0 0 6px; }
.partners-quote p::before { content: "“"; } .partners-quote p::after { content: "”"; }
.partners-quote footer { font-style: normal; font-weight: 700; color: var(--gold); }
.partners-quote footer::before { content: "— "; }
.partner-list { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .partner-list { grid-template-columns: repeat(3, 1fr); } }
.partner-card {
  position: relative; height: 100%; display: flex; flex-direction: column; padding: 22px 22px 20px; border-radius: var(--radius-lg); overflow: hidden;
  background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--type) 26%, transparent), transparent 70%), var(--bg-2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--type) 30%, var(--line));
  transition: transform 0.35s var(--ease), opacity 0.35s, filter 0.35s, box-shadow 0.35s;
}
.partner-stage { position: relative; display: grid; place-items: center; height: clamp(190px, 22vw, 230px); margin-bottom: 6px; }
.partner-ring { position: absolute; width: min(92%, 220px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--type) 34%, transparent), transparent 64%); }
.partner-ring::before { content: ""; position: absolute; inset: 4%; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--type) 55%, transparent); animation: spin 40s linear infinite; }
.partner-img { position: relative; width: min(80%, 200px); animation: float 5s ease-in-out infinite; filter: drop-shadow(0 16px 16px rgba(0, 0, 0, 0.55)); }
.partner:nth-child(2) .partner-img { animation-delay: -1.6s; }
.partner:nth-child(3) .partner-img { animation-delay: -3.2s; }
.partner-name { font-size: clamp(1.8rem, 3vw, 2.3rem); font-weight: 800; margin-bottom: 8px; }
.partner-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.partner-role { font-size: 0.85rem; font-weight: 700; color: var(--muted); padding: 2px 10px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.partner-line { color: #E7DCC6; font-style: italic; }
.partner-line::before { content: "“"; } .partner-line::after { content: "”"; }
.cx-stats.partner-stats { margin-bottom: 18px; }
.partner-label { margin: 0 0 8px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.01em; color: var(--muted); }
:lang(ta) .partner-label { letter-spacing: 0.02em; font-size: 0.9rem; }
.partner-evo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.partner-evo li { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; background: rgba(6, 12, 26, 0.45); font-size: 0.82rem; font-weight: 700; text-align: center; line-height: 1.25; }
.partner-evo img { width: 56px; height: 56px; transition: filter 0.6s var(--ease); }
.partner-evo small { color: var(--muted); font-size: 0.75rem; }
.partner-evo li + li::before { content: "›"; position: absolute; left: -8px; top: 30px; transform: translateX(-50%); color: var(--muted); }
.partner-evo span { position: relative; }
/* Until revealed, later forms are shadows, as on the Codex's "Who's that spirit?" */
.partners.is-secret .partner:not(.is-chosen) .is-later img { filter: brightness(0) drop-shadow(0 0 1px rgba(210, 228, 255, 0.5)); }
.partners.is-secret .partner:not(.is-chosen) .is-later span { color: transparent; }
.partners.is-secret .partner:not(.is-chosen) .is-later span::after { content: "???" / ""; position: absolute; inset: 0; color: var(--muted); }
.partner-actions { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.partner-choose { --btn-bg: color-mix(in srgb, var(--type) 85%, #fff); }
.partner-choose[aria-pressed="true"] { --btn-bg: var(--sunset-btn); }
.partner-chosen { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; font-weight: 700; color: var(--gold); background: rgba(251, 178, 57, 0.1); box-shadow: inset 0 0 0 1px rgba(251, 178, 57, 0.35); animation: panelIn 0.5s var(--ease) both; }
.partner-chosen::before { content: "✦ "; }
.partners .partner.is-chosen .partner-card { transform: translateY(-6px); box-shadow: inset 0 0 0 2px var(--gold), 0 24px 60px -24px color-mix(in srgb, var(--type) 80%, transparent); }
.partner.is-chosen .partner-ring::before { border-color: var(--gold); animation-duration: 8s; }
.partner.is-chosen .partner-img { animation: float 5s ease-in-out infinite, chosenHop 0.6s var(--ease); }
@keyframes chosenHop { 30% { transform: translateY(-26px) scale(1.06); } }
.partners.has-choice .partner:not(.is-chosen) .partner-card { opacity: 0.6; filter: saturate(0.55); }
.partners.has-choice .partner:not(.is-chosen) .partner-card:hover, .partners.has-choice .partner:not(.is-chosen) .partner-card:focus-within { opacity: 1; filter: none; }
.partners-reveal .when-on, .partners-reveal[data-on] .when-off { display: none; }
.partners-reveal[data-on] .when-on { display: inline; }

/* type colours */
.types { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.type { display: inline-block; padding: 3px 12px; border-radius: 10px; font-size: 0.82rem; font-weight: 700; line-height: 1.5; background: var(--type); color: #16100C; }
.type-normal, .type-bg-normal { --type: #B5AFA8; }
.type-fire, .type-bg-fire { --type: #F07A3C; }
.type-water, .type-bg-water { --type: #4C9BEA; }
.type-grass, .type-bg-grass { --type: #62C25C; }
.type-electric, .type-bg-electric { --type: #F4CF3A; }
.type-earth, .type-bg-earth { --type: #C99560; }
.type-sky, .type-bg-sky { --type: #8FD3F0; }
.type-fighting, .type-bg-fighting { --type: #E86A6A; }
.type-dark, .type-bg-dark { --type: #8E7FB0; }
.type-ghost, .type-bg-ghost { --type: #B49BF0; }
.type-song, .type-bg-song { --type: #EE79B5; }

/* ------------------------------------------------------------------ screenshots */

.shot-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(78vw, 560px); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px max(var(--gutter), calc((100vw - 1240px) / 2 + var(--gutter))) 20px; scroll-padding-inline: max(var(--gutter), calc((100vw - 1240px) / 2 + var(--gutter)));
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.shot-strip li { scroll-snap-align: start; }
.shot { margin: 0; }
.shot a { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 1px var(--line-strong); }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; image-rendering: pixelated; transition: transform 0.6s var(--ease); }
.shot a:hover img { transform: scale(1.04); }
.shot figcaption { margin-top: 10px; color: var(--muted); font-size: 0.95rem; }
.shot-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }

/* ------------------------------------------------------------------ news */

.news-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.news-card a {
  display: flex; flex-direction: column; height: 100%; border-radius: var(--radius-lg); overflow: hidden; color: var(--text); text-decoration: none;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.news-card a:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--line-strong), 0 24px 50px -25px rgba(0, 0, 0, 0.9); }
.news-thumb { aspect-ratio: 16 / 9; overflow: hidden; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.news-body { padding: 22px 24px 26px; }
.news-body h2, .news-body h3 { font-size: 1.3rem; }
.news-body p:last-child { color: var(--muted); margin: 0; }
.news-meta { display: flex; align-items: center; gap: 12px; font-size: 0.88rem; color: var(--muted); margin-bottom: 10px; }
.news-tag { padding: 2px 10px; border-radius: 10px; background: rgba(251, 178, 57, 0.14); color: var(--gold); font-weight: 700; }

/* ------------------------------------------------------------------ inner pages */

.page-hero { position: relative; padding: clamp(56px, 9vw, 110px) 0 clamp(32px, 5vw, 56px); overflow: hidden; isolation: isolate; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(800px 360px at 15% 0%, rgba(244, 107, 21, 0.18), transparent 70%), radial-gradient(700px 360px at 90% 10%, rgba(43, 110, 200, 0.2), transparent 70%);
}
.page-hero .display { font-size: clamp(2.4rem, 6vw, 4.6rem); max-width: 18ch; }
:lang(ta) .page-hero .display { font-size: clamp(2rem, 4.6vw, 3.6rem); }
.page-hero .lead { max-width: 62ch; }
.page-hero.has-art { min-height: 52vh; display: grid; align-items: end; }
.page-hero-art { position: absolute; inset: 0; z-index: -2; }
.page-hero-art img { width: 100%; height: 100%; object-fit: cover; opacity: 0.55; image-rendering: pixelated; }
.page-hero.has-art::before { background: linear-gradient(180deg, rgba(6, 12, 26, 0.3), var(--bg) 96%), linear-gradient(90deg, rgba(6, 12, 26, 0.85), transparent 70%); }

.prose { max-width: 70ch; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-top: 1.8em; }
.prose h3 { font-size: 1.3rem; margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line-strong); }
.prose figcaption { color: var(--muted); font-size: 0.95rem; margin-top: 8px; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--gold); font-size: 1.2rem; color: #EFE4CC; }

.card {
  padding: clamp(22px, 3vw, 32px); border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.card h3 { font-size: 1.3rem; }
.card > :last-child { margin-bottom: 0; }
.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.two-col { display: grid; gap: clamp(32px, 5vw, 64px); }
@media (min-width: 920px) { .two-col { grid-template-columns: 1.2fr 1fr; align-items: start; } }

.cast { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.cast .card { position: relative; overflow: hidden; }
.cast .card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--sunset); }
.cast-role { color: var(--gold); font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }

/* land rows (lands page) */
.land-rows { display: grid; gap: 22px; }
.land-row {
  display: grid; gap: 24px; padding: clamp(22px, 3vw, 36px); border-radius: var(--radius-lg); position: relative; overflow: hidden;
  background: linear-gradient(120deg, color-mix(in srgb, var(--land) 14%, transparent), rgba(220, 235, 255, 0.02) 60%), var(--bg-2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--land) 30%, transparent);
}
@media (min-width: 900px) { .land-row { grid-template-columns: 1.3fr 1fr; align-items: center; } }
.land-row h2 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; color: var(--land); margin-bottom: 4px; }
.land-row h2 span { color: var(--muted); font-size: 0.55em; margin-left: 10px; }

/* ------------------------------------------------------------------ spirit codex */
/* Cards and entries carry two type colours: the outer element's type-bg-<first type> is kept as --t1,
   the inner one's type-bg-<second type> as --t2 (custom properties inherit their computed value). */

.cx-hero, .cx-list, .cx-dialog, .cx-page { --cx-panel: #1A1530; --cx-cut: 16px; }
.cx-title, .cx-land-tab, .cx-no, .cx-big-no, .cx-tag, .cx-block > h2, .cx-arrow-btn {
  font-family: var(--font-head); font-weight: 800; letter-spacing: 0.01em;
}
:lang(ta) .cx-title, :lang(ta) .cx-land-tab, :lang(ta) .cx-tag, :lang(ta) .cx-block > h2, :lang(ta) .cx-arrow-btn { font-style: normal; text-transform: none; letter-spacing: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 16px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--surface-2); color: var(--text); font: 700 0.95rem/1.2 var(--font-body); box-shadow: inset 0 0 0 1px var(--line);
}
.chip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--type, var(--sunset)); }
.chip:hover { background: rgba(220, 235, 255, 0.14); }
.chip[aria-pressed="true"] { background: var(--type, var(--gold)); color: #16100C; box-shadow: none; }
.chip[aria-pressed="true"]::before { background: #16100C; }

/* hero */
.cx-hero {
  position: relative; overflow: hidden; padding: clamp(40px, 7vw, 72px) 0 clamp(24px, 4vw, 40px);
  background:
    radial-gradient(60% 80% at 85% 30%, rgba(244, 107, 21, 0.2), transparent 60%),
    radial-gradient(50% 70% at 60% 80%, rgba(107, 192, 119, 0.14), transparent 60%),
    radial-gradient(40% 60% at 100% 90%, rgba(92, 196, 204, 0.16), transparent 60%);
}
.cx-hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 24px; }
.cx-title { font-size: clamp(3rem, 8vw, 6.2rem); line-height: 0.95; margin: 4px 0 14px; }
.cx-title span { display: block; padding-right: 0.1em; background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent; }
:lang(ta) .cx-title { font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 1.2; }
.cx-hero .lead { max-width: 36ch; margin: 0 0 22px; }
.cx-tally { display: inline-flex; margin: 0; background: var(--cx-panel); clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }
.cx-tally div { display: flex; flex-direction: column-reverse; padding: 10px 28px 10px 18px; }
.cx-tally div + div { border-left: 1px solid var(--line); }
.cx-tally dd { margin: 0; font: 800 1.6rem/1 var(--font-head); }
.cx-tally dt { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.01em; }
:lang(ta) .cx-tally dt { letter-spacing: 0; font-size: 0.85rem; }
.cx-trio { position: relative; height: 380px; }
.cx-trio img { position: absolute; width: 56%; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.55)); animation: float 5s ease-in-out infinite; }
.cx-trio img:nth-child(1) { left: 0; top: 18%; animation-delay: -1.2s; }
.cx-trio img:nth-child(2) { left: 44%; top: 30%; animation-delay: -2.6s; }
.cx-trio img:nth-child(3) { left: 22%; top: -4%; width: 62%; z-index: 1; }
.cx-trio::after { content: ""; position: absolute; inset: auto 6% 2% 6%; height: 40px; border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, 0.6), transparent 70%); }

/* controls (shown by site.js) */
.cx-controls { position: sticky; top: var(--header-h); z-index: 10; padding: 16px 0 12px; background: linear-gradient(var(--bg) 72%, rgba(6, 12, 26, 0)); }
.cx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cx-row + .cx-row { margin-top: 12px; }
.cx-search { flex: 1 1 260px; position: relative; }
.cx-search svg { position: absolute; left: 14px; top: 13px; opacity: 0.6; pointer-events: none; }
.cx-search input { width: 100%; height: 46px; padding: 0 16px 0 44px; background: var(--cx-panel); color: var(--text); font: inherit; border: 1px solid var(--line); border-radius: 12px; }
.cx-ctl { height: 46px; padding: 0 16px; background: var(--cx-panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font: 700 1rem var(--font-body); display: inline-flex; align-items: center; gap: 8px; }
.cx-ctl[aria-pressed="true"] { background: var(--text); color: #16100C; }
.cx-lands { flex-wrap: nowrap; gap: 0; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.cx-lands::-webkit-scrollbar, .cx-types::-webkit-scrollbar { display: none; }
.cx-land-tab {
  flex: none; height: 44px; padding: 0 20px 0 24px; margin-right: -4px; border: 0; cursor: pointer; font-size: 0.95rem; line-height: 1;
  background: var(--cx-panel); color: var(--muted); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.cx-land-tab small { display: block; margin-top: 3px; font: 700 0.62rem/1 var(--font-body); letter-spacing: 0.14em; opacity: 0.8; }
:lang(ta) .cx-land-tab small { letter-spacing: 0; font-size: 0.7rem; }
.cx-land-tab:hover { color: var(--text); }
.cx-land-tab[aria-pressed="true"] { background: var(--land, var(--gold)); color: #16100C; }
.cx-types { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-bottom: 4px; }
.cx-types .chip { flex: none; min-height: 34px; padding: 4px 14px; font-size: 0.9rem; }
.cx-count { color: var(--muted); margin: 6px 0 0; font-size: 0.92rem; }

/* grid + cards */
.cx-grid { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.cx-grid li[hidden] { display: none; }
.cx-card { --t1: var(--type); display: block; color: var(--text); text-decoration: none; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35)); transition: transform 0.18s ease, filter 0.18s ease; }
.cx-card-in {
  --t2: var(--type); position: relative; display: block; aspect-ratio: 4 / 5; padding: 14px; overflow: hidden;
  clip-path: polygon(0 0, calc(100% - var(--cx-cut)) 0, 100% var(--cx-cut), 100% 100%, var(--cx-cut) 100%, 0 calc(100% - var(--cx-cut)));
  background:
    radial-gradient(70% 55% at 50% 42%, color-mix(in oklab, var(--t1) 55%, transparent), transparent 70%),
    linear-gradient(165deg, color-mix(in oklab, var(--t2) 26%, #1A1530), #120E1E 75%);
}
.cx-card-in::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1.4px); background-size: 9px 9px; -webkit-mask: linear-gradient(transparent 30%, #000); mask: linear-gradient(transparent 30%, #000); }
.cx-no { position: relative; font-size: 1.05rem; line-height: 1; color: rgba(255, 255, 255, 0.6); }
.cx-rar { position: absolute; top: 12px; right: 18px; font-size: 0.7rem; letter-spacing: 0.01em; font-weight: 700; color: var(--gold); }
:lang(ta) .cx-rar { letter-spacing: 0; }
.cx-card img { position: absolute; left: 50%; top: 40%; width: 62%; transform: translate(-50%, -50%); transition: transform 0.25s ease, filter 0.25s ease; }
.cx-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 14px; background: linear-gradient(transparent, rgba(12, 9, 20, 0.92) 45%); }
.cx-card-name { position: relative; display: block; font: 800 1.3rem/1.05 var(--font-head); margin-bottom: 7px; }
.cx-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 0; }
.cx-meta .type { padding: 2px 9px; font-size: 0.72rem; border-radius: 6px; letter-spacing: 0.01em; }
.cx-card:hover, .cx-card:focus-visible { transform: translateY(-6px); filter: drop-shadow(0 16px 26px color-mix(in oklab, var(--t1) 45%, transparent)); outline-offset: 6px; }
.cx-card:hover img, .cx-card:focus-visible img { transform: translate(-50%, -56%) scale(1.08); animation: cxHop 0.5s var(--ease); }
@keyframes cxHop { 0% { transform: translate(-50%, -50%); } 40% { transform: translate(-50%, -66%) scale(1.1); } 70% { transform: translate(-50%, -54%) scale(1.1, 1.02); } }
.cx-empty { text-align: center; color: var(--muted); padding: 60px 0; margin: 0; }

/* "Who's that spirit?": cards stay silhouettes until clicked once */
.cx-list.is-shadow .cx-card:not(.is-shown) img { filter: brightness(0) drop-shadow(0 0 1px rgba(255, 255, 255, 0.5)); }
.cx-list.is-shadow .cx-card:not(.is-shown) .cx-card-name { color: transparent; }
.cx-list.is-shadow .cx-card:not(.is-shown) .cx-card-name::before { content: attr(data-unknown); position: absolute; color: var(--text); }
.cx-list.is-shadow .cx-card:not(.is-shown) .cx-pills { visibility: hidden; }
.cx-card.is-pop img { animation: cxPop 0.45s ease; }
@keyframes cxPop { 0% { transform: translate(-50%, -50%) scale(0.8); } 60% { transform: translate(-50%, -50%) scale(1.15); } }

/* entry: a pop-up sheet on the Codex, a page of its own at spirits/<name> */
html.cx-lock { overflow: hidden; }
.cx-dialog { width: min(1180px, 100vw - 24px); max-width: none; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 0; border: 0; color: var(--text); background: transparent; overflow: visible; }
.cx-dialog::backdrop { background: rgba(6, 4, 12, 0.78); backdrop-filter: blur(6px); }
.cx-sheet { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; background: var(--bg-2); clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px)); }
.cx-page .cx-entry { background: var(--bg-2); clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px)); }
.cx-entry { --t1: var(--type); }
.cx-top { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: rgba(10, 20, 42, 0.92); }
.cx-sheet .cx-top { position: sticky; top: 0; z-index: 3; backdrop-filter: blur(8px); }
.cx-nb { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--cx-panel); color: var(--text); text-decoration: none; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.cx-nb span { color: var(--muted); font-weight: 400; }
.cx-nb:hover { border-color: var(--line-strong); color: var(--gold); }
.cx-close { margin-left: auto; }
.cx-body { display: grid; grid-template-columns: 1fr 1.12fr; }
.cx-stage {
  --t2: var(--type); position: relative; min-height: 520px; overflow: hidden; display: grid; place-items: center;
  background:
    radial-gradient(60% 50% at 50% 46%, color-mix(in oklab, var(--t1) 60%, transparent), transparent 70%),
    linear-gradient(170deg, color-mix(in oklab, var(--t2) 30%, #16112A), #0F0B1A 80%);
}
.cx-big-no { position: absolute; top: 4px; left: 18px; font-size: 7.5rem; line-height: 1; color: rgba(255, 255, 255, 0.07); }
.cx-stage img { position: relative; z-index: 1; width: 74%; max-width: 420px; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.55)); }
.cx-ground { position: absolute; bottom: 13%; width: 62%; height: 46px; border-radius: 50%; background: radial-gradient(color-mix(in oklab, var(--land) 55%, transparent), transparent 70%); }
.cx-tags { position: absolute; left: 18px; right: 18px; bottom: 18px; z-index: 2; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.cx-tag { font-size: 0.82rem; line-height: 1.2; padding: 9px 16px 8px; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.cx-tag b { color: var(--land); }
.cx-info { padding: 26px 30px 34px; min-width: 0; }
.cx-no-line { margin: 0; color: var(--muted); font-weight: 700; letter-spacing: 0.01em; font-size: 0.8rem; }
:lang(ta) .cx-no-line { letter-spacing: 0.02em; }
.cx-name { font-size: clamp(2.4rem, 4.6vw, 3.6rem); font-weight: 800; line-height: 1; margin: 4px 0 12px; }
.cx-info > .cx-pills .type { padding: 4px 14px; font-size: 0.85rem; }
.cx-flavour { margin: 14px 0 8px; color: #E7DCC6; font-size: 1.06rem; }
.cx-nature { margin: 0; color: var(--muted); }
.cx-nature span { color: var(--gold); font-weight: 700; margin-right: 6px; }
.cx-block { margin-top: 24px; }
.cx-block > h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 1rem; line-height: 1.2; letter-spacing: 0.06em; }
.cx-block > h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cx-stats { display: grid; grid-template-columns: auto 38px 1fr; gap: 9px 12px; align-items: center; margin: 0; }
.cx-stat { display: contents; }
.cx-stat-hp { --sc: #5BD68A; }
.cx-stat-atk { --sc: #FF7A45; }
.cx-stat-def { --sc: #5AA9FF; }
.cx-stat-spd { --sc: #F2CC6B; }
.cx-stats dt { color: var(--muted); font-weight: 700; font-size: 0.88rem; }
.cx-stats dd { margin: 0; font: 800 1.05rem/1 var(--font-head); }
.cx-stats .cx-bar { height: 12px; background: rgba(255, 255, 255, 0.06); clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.cx-bar i { display: block; height: 100%; width: var(--w); background: var(--sc); background-image: repeating-linear-gradient(90deg, transparent 0 10px, rgba(0, 0, 0, 0.28) 10px 12px); }
@keyframes cxGrow { from { width: 0; } }
.cx-total { margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; }
.cx-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cx-box { padding: 14px 16px; background: var(--cx-panel); border: 1px solid var(--line); border-radius: 12px; }
.cx-box p { margin: 0; color: var(--muted); font-size: 0.94rem; }
.cx-box .cx-box-title { margin-bottom: 4px; color: var(--text); font: 800 1.1rem/1.2 var(--font-head); }
.cx-box .cx-pills { margin: 6px 0 10px; }
.cx-box .cx-pills:last-child { margin-bottom: 0; }
.cx-label { margin: 0; color: var(--muted); font: 700 0.78rem/1.3 var(--font-body); letter-spacing: 0.01em; }
:lang(ta) .cx-label { letter-spacing: 0; font-size: 0.85rem; text-transform: none; }
.cx-x4 { color: var(--ember); font-size: 0.8rem; margin-left: -2px; }
.cx-evo { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cx-evo-card { display: grid; justify-items: center; gap: 4px; width: 116px; padding: 10px 6px 8px; background: var(--cx-panel); border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 0.9rem; text-align: center; }
a.cx-evo-card:hover { border-color: var(--line-strong); }
.cx-evo-card[aria-current] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 22px rgba(251, 178, 57, 0.25); }
.cx-evo-card img { width: 72px; height: 72px; object-fit: contain; }
.cx-unknown { display: grid; place-items: center; width: 72px; height: 72px; color: var(--muted); font: 800 2rem/1 var(--font-head); }
.cx-evo-lv { display: grid; justify-items: center; min-width: 46px; color: var(--gold); font: 800 0.78rem/1.1 var(--font-head); }
.cx-evo-lv::before { content: "➜"; font-size: 1.3rem; }
.cx-table-wrap { overflow-x: auto; }
.cx-moves { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.cx-moves th { text-align: left; color: var(--muted); font-size: 0.74rem; letter-spacing: 0.01em; padding: 0 8px 8px; white-space: nowrap; }
:lang(ta) .cx-moves th { letter-spacing: 0; font-size: 0.82rem; }
.cx-moves td { padding: 8px; border-top: 1px solid var(--line); }
.cx-moves td:first-child { width: 54px; color: var(--gold); font: 800 1rem/1 var(--font-head); }
.cx-moves .type { padding: 1px 9px; font-size: 0.7rem; border-radius: 6px; white-space: nowrap; }
.cx-find { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 26px; padding: 16px 18px; border-radius: 14px; background: linear-gradient(90deg, color-mix(in oklab, var(--land) 28%, var(--cx-panel)), var(--cx-panel)); }
.cx-find p { flex: 1 1 240px; margin: 0; }
.cx-find b { color: var(--land); }
.cx-arrow-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 28px 0 18px; background: var(--gold); color: #1A1210; text-decoration: none; font-size: 0.95rem; line-height: 1.1;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}
.cx-arrow-btn:hover { background: #FFE08F; }

@media (max-width: 900px) {
  .cx-hero-grid { grid-template-columns: 1fr; }
  .cx-trio { height: 260px; max-width: 420px; }
  /* On small screens the filter block is too tall to pin; it scrolls away with the page. */
  .cx-controls { position: static; background: none; }
  .cx-row > .cx-sort, .cx-row > .cx-ctl { flex: 1 1 auto; }
  .cx-sort .cx-ctl { width: 100%; }
  .cx-body { grid-template-columns: 1fr; }
  .cx-stage { min-height: 340px; }
  .cx-two { grid-template-columns: 1fr; }
  .cx-info { padding: 20px 18px 28px; }
}
@media (max-width: 520px) {
  .cx-grid { gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-card-name { font-size: 1.05rem; }
  .cx-top { padding: 10px 12px; gap: 6px; }
  .cx-top .cx-nb span { display: none; }
  .cx-nb { padding: 0 10px; font-size: 0.85rem; }
  /* Room is short: names shrink with an ellipsis, and Close keeps its label for screen readers only. */
  .cx-top .cx-nb:not(.cx-close) { display: block; min-width: 0; line-height: 38px; overflow: hidden; text-overflow: ellipsis; }
  .cx-close { flex-shrink: 0; }
  .cx-close b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cx-tally div { padding: 8px 20px 8px 14px; }
  .cx-big-no { font-size: 5rem; }
  .cx-stage { min-height: 0; padding: 44px 0 124px; }
  .cx-stage img { width: 64%; }
}

/* type matchup chart (Codex page, below the grid) */
.cx-chart-box { margin: 28px auto 0; max-width: 1040px; background: var(--cx-panel); border: 1px solid var(--line); border-radius: var(--radius); }
.cx-chart-box > summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 16px 20px; cursor: pointer; list-style: none; border-radius: var(--radius);
}
.cx-chart-box > summary::-webkit-details-marker { display: none; }
.cx-chart-box > summary::before { content: "▸"; color: var(--gold); transition: transform 0.18s ease; }
.cx-chart-box[open] > summary::before { transform: rotate(90deg); }
.cx-chart-box > summary b { font: 800 1.1rem/1.2 var(--font-head); letter-spacing: 0.01em; }
:lang(ta) .cx-chart-box > summary b { text-transform: none; letter-spacing: 0; }
.cx-chart-box > summary span { color: var(--muted); font-size: 0.92rem; }
.cx-chart-box > summary:hover b { color: var(--gold); }
.cx-chart-box > summary:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.cx-chart-intro { margin: 0; padding: 0 20px 14px; color: var(--muted); font-size: 0.95rem; }
.cx-chart-wrap { overflow-x: auto; margin: 0 12px; padding-bottom: 6px; max-width: 100%; }
.cx-chart-wrap:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.cx-chart { border-collapse: separate; border-spacing: 0; margin: 0 auto; font-size: 0.9rem; text-align: center; }
.cx-chart th, .cx-chart td { padding: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cx-chart thead :is(th, td) { border-top: 0; }
.cx-chart tr > :first-child { border-left: 0; }
.cx-chart thead th { padding: 6px 3px 8px; vertical-align: bottom; background: var(--cx-panel); }
.cx-chart tbody th { position: sticky; left: 0; z-index: 1; padding: 0 10px 0 8px; text-align: left; white-space: nowrap; background: var(--cx-panel); box-shadow: 1px 0 0 var(--line); }
.cx-chart .type { padding: 1px 8px; font-size: 0.72rem; border-radius: 6px; white-space: nowrap; }
.cx-chart td { min-width: 46px; height: 38px; font: 800 0.95rem/1 var(--font-head); }
.cx-chart-corner { min-width: 0; }
.cx-chart td.cx-m-2 { background: rgba(98, 194, 92, 0.24); color: #8FE68A; }
.cx-chart td.cx-m-half { background: rgba(232, 106, 106, 0.14); color: #E89A8C; }
.cx-chart td.cx-m-0 { background: #07050C; color: var(--muted); }
/* Row and column highlight on hover or keyboard focus (columns need :has(); rows work everywhere). */
.cx-chart tbody tr:hover > * { box-shadow: inset 0 0 0 999px rgba(220, 235, 255, 0.07); }
.cx-chart tbody tr:hover > th { box-shadow: inset 0 0 0 999px rgba(220, 235, 255, 0.07), 1px 0 0 var(--line); }
.cx-chart:has(tbody td:nth-child(2):hover) :is(th, td):nth-child(2),
.cx-chart:has(tbody td:nth-child(3):hover) :is(th, td):nth-child(3),
.cx-chart:has(tbody td:nth-child(4):hover) :is(th, td):nth-child(4),
.cx-chart:has(tbody td:nth-child(5):hover) :is(th, td):nth-child(5),
.cx-chart:has(tbody td:nth-child(6):hover) :is(th, td):nth-child(6),
.cx-chart:has(tbody td:nth-child(7):hover) :is(th, td):nth-child(7),
.cx-chart:has(tbody td:nth-child(8):hover) :is(th, td):nth-child(8),
.cx-chart:has(tbody td:nth-child(9):hover) :is(th, td):nth-child(9),
.cx-chart:has(tbody td:nth-child(10):hover) :is(th, td):nth-child(10),
.cx-chart:has(tbody td:nth-child(11):hover) :is(th, td):nth-child(11),
.cx-chart:has(tbody td:nth-child(12):hover) :is(th, td):nth-child(12) { box-shadow: inset 0 0 0 999px rgba(220, 235, 255, 0.07); }
.cx-chart tbody td:hover { box-shadow: inset 0 0 0 999px rgba(220, 235, 255, 0.16); }
.cx-chart-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0; padding: 12px 20px 18px; color: var(--muted); font-size: 0.88rem; }
.cx-chart-legend li { display: inline-flex; align-items: center; gap: 8px; }
.cx-key { display: inline-grid; place-items: center; min-width: 32px; height: 24px; border: 1px solid var(--line); border-radius: 6px; font: 800 0.8rem/1 var(--font-head); }
.cx-key.cx-m-2 { background: rgba(98, 194, 92, 0.24); color: #8FE68A; }
.cx-key.cx-m-half { background: rgba(232, 106, 106, 0.14); color: #E89A8C; }
.cx-key.cx-m-0 { background: #07050C; color: var(--muted); }
@media (max-width: 520px) {
  .cx-chart-box > summary { padding: 14px 16px; }
  .cx-chart-intro { padding: 0 16px 12px; }
  .cx-chart-legend { padding: 12px 16px 16px; }
  .cx-chart-wrap { margin: 0 8px; }
}

/* ------------------------------------------------------------------ faq */

.faq { display: grid; gap: 12px; }
.faq details { border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: background 0.2s; }
.faq details[open] { background: var(--surface-2); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 56px 20px 24px; position: relative; font: 700 1.12rem/1.4 var(--font-head);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(45deg); transition: transform 0.25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq .answer { padding: 0 24px 22px; color: #DCD0BA; }
.faq .answer > :last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ forms */

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label, .field legend { font-weight: 700; }
.field .hint { color: var(--muted); font-size: 0.92rem; margin: 0; }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px; border: 0;
  background: rgba(6, 12, 26, 0.6); color: var(--text); font: 400 1rem/1.4 var(--font-body);
  box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow 0.2s;
}
textarea { min-height: 160px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 44px; }
input::placeholder, textarea::placeholder { color: #8F8576; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--gold); }
[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--ember) !important; }
.field-error, .form-error { color: #FF9C88; font-weight: 700; margin: 0; font-size: 0.95rem; }
.form-error { padding: 12px 16px; border-radius: 12px; background: rgba(216, 68, 47, 0.14); box-shadow: inset 0 0 0 1px rgba(244, 107, 21, 0.4); }
.form-note { color: var(--muted); font-size: 0.9rem; margin: 10px 0 0; }
.field-inline { display: flex; gap: 10px; flex-wrap: wrap; }
.field-inline input { flex: 1 1 220px; min-height: 52px; border-radius: 10px; padding-inline: 22px; }
.field-inline .btn { min-height: 52px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--gold); flex: none; }
.success {
  display: flex; gap: 14px; align-items: flex-start; padding: 20px 22px; border-radius: var(--radius);
  background: rgba(107, 192, 119, 0.12); box-shadow: inset 0 0 0 1px rgba(107, 192, 119, 0.45);
}
.success::before { content: "✓"; display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: #6BC077; color: #060C1A; font-weight: 800; }
.success p { margin: 0; }
.success strong { display: block; font-family: var(--font-head); font-size: 1.15rem; }

/* ------------------------------------------------------------------ signup band + footer */

.signup-band { padding: 0 0 clamp(64px, 9vw, 110px); }
.signup-inner {
  display: grid; gap: 24px; align-items: center; padding: clamp(28px, 5vw, 56px); border-radius: var(--radius-lg); position: relative; overflow: hidden;
  background:
    radial-gradient(600px 300px at 0% 0%, rgba(244, 107, 21, 0.28), transparent 70%),
    radial-gradient(600px 300px at 100% 100%, rgba(43, 110, 200, 0.3), transparent 70%),
    var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.signup-band .signup-inner { max-width: calc(1240px - 2 * var(--gutter)); margin-inline: auto; width: calc(100% - 2 * var(--gutter)); }
@media (min-width: 900px) { .signup-inner { grid-template-columns: 1fr 1.1fr; } }
.signup-inner h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight: 800; }
.signup-inner p { color: #E2D7C1; margin: 0; }
.signup-inner::after {
  content: ""; position: absolute; right: -50px; top: -50px; width: 220px; height: 220px; opacity: 0.35; border-radius: 50%;
  background: radial-gradient(closest-side, transparent 58%, rgba(127, 212, 255, 0.6) 60%, transparent 62%, transparent 76%, rgba(127, 212, 255, 0.35) 78%, transparent 80%);
  pointer-events: none;
}

.site-footer { border-top: 1px solid var(--line); background: rgba(4, 9, 20, 0.6); padding: 56px 0 28px; }
.footer-grid { display: grid; gap: 36px; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1fr 1.6fr; } }
.footer-logo { font: 800 1.9rem/1 var(--font-head); letter-spacing: 0.03em; margin-bottom: 12px; }
.footer-logo .footer-tagline { display: block; margin-top: 14px; font: 700 0.78rem/1.3 var(--font-body); letter-spacing: 0.01em; color: var(--gold); }
.footer-brand p.muted { max-width: 40ch; }
.footer-nav { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.footer-head { font-weight: 700; color: var(--gold); font-size: 0.85rem; letter-spacing: 0.01em; margin-bottom: 10px; }
:lang(ta) .footer-head { letter-spacing: 0.02em; font-size: 0.95rem; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-nav a { color: #DCD0BA; text-decoration: none; }
.footer-nav a:hover { color: var(--gold); text-decoration: underline; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.footer-base p { margin: 0; }

/* ------------------------------------------------------------------ lightbox */

.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; color: var(--text); }
.lightbox::backdrop { background: rgba(5, 4, 9, 0.9); backdrop-filter: blur(6px); }
.lightbox-inner { width: 100%; height: 100%; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 20px; gap: 12px; }
.lightbox-img { max-width: min(1280px, 100%); max-height: calc(100vh - 120px); object-fit: contain; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7); }
.lightbox-img.is-pixel { image-rendering: pixelated; box-shadow: none; }
.lightbox-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.lightbox-caption { margin: 0; font-weight: 700; }
.lightbox-actions { display: flex; gap: 8px; }
.lightbox-actions button { min-width: 46px; min-height: 46px; padding: 8px 16px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text); font: 700 1rem var(--font-body); cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-strong); }
.lightbox-actions button:hover { background: rgba(220, 235, 255, 0.16); }

/* ------------------------------------------------------------------ trailer placeholder, misc */

.trailer {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; display: grid; place-items: center;
  box-shadow: 0 0 0 1px var(--line-strong), 0 40px 80px -40px rgba(0, 0, 0, 0.9);
}
.trailer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.55) saturate(1.1); }
.trailer-badge { position: relative; display: grid; justify-items: center; gap: 14px; text-align: center; padding: 20px; }
.trailer-badge .play { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: rgba(220, 235, 255, 0.14); box-shadow: inset 0 0 0 2px rgba(220, 235, 255, 0.6); backdrop-filter: blur(8px); }
.trailer-badge .play::before { content: ""; margin-left: 6px; border-left: 22px solid var(--text); border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
.trailer-badge p { margin: 0; font: 700 1.2rem var(--font-head); }

.downloads { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.download { display: flex; flex-direction: column; gap: 10px; }
.download img { border-radius: 12px; background: rgba(6, 12, 26, 0.6); aspect-ratio: 16 / 9; object-fit: contain; box-shadow: inset 0 0 0 1px var(--line); }
.facts-table { width: 100%; border-collapse: collapse; }
.facts-table th, .facts-table td { text-align: left; padding: 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts-table th { color: var(--muted); font-weight: 700; width: 36%; padding-right: 16px; }

.not-found { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 80px 0; }
.not-found .big { font: 800 clamp(6rem, 20vw, 12rem)/0.9 var(--font-head); background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0; }
.post-meta { display: flex; gap: 12px; align-items: center; color: var(--muted); margin-bottom: 18px; }
.post-cover { margin: 0 0 40px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 0 0 1px var(--line-strong); }
.post-cover img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; image-rendering: pixelated; }
.back-link { display: inline-block; margin-bottom: 20px; font-weight: 700; text-decoration: none; }

.section-tight { padding: clamp(28px, 5vw, 56px) 0 clamp(56px, 8vw, 96px); }
.section-tight + .section { padding-top: 0; }
.btn-row.center { justify-content: center; }
.not-found .btn-row { margin-top: 28px; }
.land-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: var(--land, var(--gold)); vertical-align: 0.05em; }
.land-dot.land-kurinji { --land: var(--land-kurinji); }
.land-dot.land-mullai { --land: var(--land-mullai); }
.land-dot.land-marutham { --land: var(--land-marutham); }
.land-dot.land-neithal { --land: var(--land-neithal); }
.land-dot.land-paalai { --land: var(--land-paalai); }

/* lands page: map, towns, paths */
.map-img { width: 100%; height: auto; }
.land-row .land-spirits { margin-top: 18px; }
.town-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.town { position: relative; padding-top: 28px; }
.town h3 { font-size: 1.4rem; margin-bottom: 2px; }
.town-no {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 50%;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); font: 800 1rem/1 var(--font-head); color: var(--gold);
}
.town-no.story { background: var(--sunset-btn); color: #16100C; box-shadow: none; }
.town-no.final { background: var(--sunset); color: #16100C; box-shadow: 0 0 24px rgba(244, 107, 21, 0.45); }
.town-sub { color: var(--gold); font-weight: 700; margin-bottom: 6px; }
.town-tag { color: var(--muted); font-size: 0.92rem; margin-bottom: 12px; }
.town p:last-child { margin-bottom: 0; color: #DCD0BA; }
.path-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.path-list li { display: flex; gap: 14px; align-items: baseline; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.path-no { flex: none; min-width: 74px; color: var(--gold); font-weight: 700; font-size: 0.9rem; white-space: nowrap; }

/* lands page, game-menu look: land tiles under the hero, a land stripe on each row, spirits on glowing ground,
   land-coloured town cards and paths as route signs */
.land-tiles { margin-top: clamp(-36px, -3vw, -20px); position: relative; z-index: 1; }
.land-tiles .quick-tile { --type: var(--land); }
.quick-tile-sub { margin-top: -6px; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em; text-align: center; }
:lang(ta) .quick-tile-sub { letter-spacing: 0; }
.land-row { scroll-margin-top: 90px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--land) 30%, transparent), inset 5px 0 0 var(--land); }
.land-row .land-spirits { gap: 12px; }
.land-row .land-spirits li { width: auto; padding: 0; background: none; }
.land-row .land-spirits a {
  position: relative; display: grid; justify-items: center; gap: 4px; width: 104px; padding: 12px 6px 10px; border-radius: var(--radius);
  color: var(--text); text-decoration: none; isolation: isolate;
  background: linear-gradient(180deg, color-mix(in oklab, var(--type) 18%, transparent), rgba(6, 12, 26, 0.55) 75%);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 -3px 0 color-mix(in oklab, var(--type) 55%, transparent);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.land-row .land-spirits a::before {
  content: ""; position: absolute; left: 50%; top: 58px; width: 64px; height: 14px; translate: -50% 0; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--type) 60%, transparent), transparent);
}
.land-row .land-spirits img { width: 72px; height: 72px; }
.land-row .land-spirits a:hover, .land-row .land-spirits a:focus-visible {
  transform: translateY(-4px);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--type) 60%, transparent), inset 0 -3px 0 var(--type), 0 14px 26px -12px color-mix(in oklab, var(--type) 60%, transparent);
}
.land-row .land-spirits a:hover img, .land-row .land-spirits a:focus-visible img { animation: spiritHop 0.5s var(--ease); }
.town { overflow: hidden; }
.town[class*="land-"] { box-shadow: inset 0 0 0 1px var(--line), inset 0 3px 0 var(--land); background: linear-gradient(180deg, color-mix(in srgb, var(--land) 10%, transparent), transparent 45%), var(--surface); }
.town-no { transition: transform 0.25s var(--ease); }
.town:hover .town-no { transform: translateY(-3px) rotate(-6deg); }
.path-list li { position: relative; align-items: center; padding-left: 14px; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.path-list li:hover { transform: translateX(4px); box-shadow: inset 0 0 0 1px var(--line-strong), inset 3px 0 0 var(--gold); }
.path-no {
  min-width: 0; padding: 4px 10px; border-radius: 8px; background: var(--gold); color: #1A1210;
  font: 800 0.8rem/1.2 var(--font-head); letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 2px rgba(26, 18, 16, 0.35), 0 3px 0 rgba(0, 0, 0, 0.35);
}
:lang(ta) .path-no { letter-spacing: 0; text-transform: none; }
.quick-tile { height: 100%; align-content: start; }
@media (max-width: 760px) { .land-tiles { margin-top: 20px; } .land-tiles ul { grid-template-columns: repeat(5, minmax(118px, 1fr)); } .quick-tile-sub { letter-spacing: 0.04em; font-size: 0.66rem; } .land-row .land-spirits a { width: 92px; } .land-row .land-spirits img { width: 60px; height: 60px; } .land-row .land-spirits a::before { top: 50px; } }

/* media + posts */
.shot-grid .shot-tall { grid-row: span 2; }
.shot-tall .shot { display: flex; flex-direction: column; height: 100%; }
.shot-tall .shot a { flex: 1; min-height: 0; }
.shot-tall .shot img { height: 100%; aspect-ratio: auto; object-position: center top; }
.prose .figure-tall { max-width: 420px; margin-inline: auto; }
.prose .figure-tall img { width: 100%; height: auto; image-rendering: pixelated; }
.post-title { max-width: 22ch; }
.post-nav { display: grid; gap: 14px; margin-top: 56px; }
@media (min-width: 700px) { .post-nav { grid-template-columns: 1fr 1fr; } .post-nav-next { grid-column: 2; text-align: right; } }
.post-nav a { display: grid; gap: 4px; color: var(--text); text-decoration: none; transition: box-shadow 0.25s, transform 0.25s var(--ease); }
.post-nav a:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line-strong); }
.post-nav strong { font-family: var(--font-head); font-size: 1.15rem; }

/* contact + press */
.hint { color: var(--muted); font-size: 0.92rem; margin: 0; }
.contact-press { position: relative; overflow: hidden; }
.contact-press::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--sunset); }
.press-hero { display: grid; gap: 20px; }
@media (min-width: 860px) { .press-hero { grid-template-columns: 1fr 1fr; align-items: stretch; } }
.press-hero figure { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.press-hero figure a { display: block; border-radius: 14px; overflow: hidden; flex: 1; }
.press-hero figure img { width: 100%; height: 100%; object-fit: cover; }
.press-hero figcaption { color: var(--muted); font-size: 0.95rem; }
.press-logo a { display: grid; place-items: center; padding: clamp(20px, 4vw, 44px); background: radial-gradient(circle at 50% 40%, rgba(43, 110, 200, 0.25), transparent 70%), rgba(6, 12, 26, 0.7); }
.press-logo img { object-fit: contain; height: auto; }
.files-head { font-size: 1.2rem; margin: 32px 0 14px; color: var(--gold); }
.files-head:first-of-type { margin-top: 0; }
.download a { font-weight: 700; word-break: break-all; }
.prose .facts-table { margin: 0 0 1.4em; }

/* ------------------------------------------------------------------ arenas */

/* home: the eight crests in a row */
.crest-rail { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr)); }
.crest-rail a {
  display: grid; justify-items: center; gap: 2px; padding: 18px 10px 16px; border-radius: var(--radius); text-align: center; text-decoration: none; color: var(--text);
  background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 16%, transparent), rgba(220, 235, 255, 0.02)); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}
.crest-rail a:hover, .crest-rail a:focus-visible { transform: translateY(-4px); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 70%, transparent), 0 0 24px -6px var(--accent); color: var(--text); }
.crest-rail img { width: 84px; height: 84px; margin-bottom: 8px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)); }
.crest-no { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em; color: var(--muted); }
.crest-name { font: 700 1rem/1.25 var(--font-head); }
.crest-town { font-size: 0.85rem; color: var(--muted); }

/* arenas page */
.crest-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; }
.crest-row a { display: block; border-radius: 50%; transition: transform 0.25s var(--ease), filter 0.25s; }
.crest-row a:hover, .crest-row a:focus-visible { transform: translateY(-3px) scale(1.06); filter: drop-shadow(0 0 12px var(--accent)); }
.crest-row img { width: clamp(46px, 7vw, 64px); height: auto; }
.daynight { display: inline-flex; gap: 4px; margin-top: 26px; padding: 4px; border-radius: 10px; background: rgba(6, 12, 26, 0.6); box-shadow: inset 0 0 0 1px var(--line-strong); }
.daynight[hidden] { display: none; }
.daynight-btn { white-space: nowrap; min-height: 40px; padding: 6px 16px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 700 0.95rem/1 var(--font-body); cursor: pointer; }
.daynight-btn[aria-pressed="true"] { background: var(--tech-soft); color: var(--tech); box-shadow: inset 0 0 0 1px var(--tech-line), var(--tech-glow); }
.arena-night { display: none; }
[data-time="night"] .arena-night { display: block; }
[data-time="night"] .arena-day { display: none; }

.arena-list { display: grid; gap: clamp(20px, 3vw, 28px); }
.arena-card {
  display: grid; gap: 0; overflow: hidden; border-radius: var(--radius-lg); position: relative;
  background: linear-gradient(160deg, rgba(220, 235, 255, 0.06), rgba(220, 235, 255, 0.015)); box-shadow: inset 0 0 0 1px var(--line);
}
.arena-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); box-shadow: 0 0 18px var(--accent); }
@media (min-width: 860px) { .arena-card { grid-template-columns: minmax(300px, 0.9fr) 1.1fr; } }
.arena-art {
  position: relative; display: grid; place-items: center; padding: clamp(22px, 4vw, 40px); min-height: 240px;
  background: radial-gradient(70% 60% at 50% 62%, color-mix(in oklab, var(--accent) 26%, transparent), transparent 75%), rgba(4, 9, 20, 0.45);
}
[data-time="night"] .arena-art { background: radial-gradient(70% 60% at 50% 62%, rgba(56, 182, 240, 0.2), transparent 75%), rgba(2, 6, 16, 0.75); }
.arena-art img { width: 100%; max-width: 400px; height: auto; filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.55)); }
.arena-no {
  position: absolute; left: 16px; top: 16px; padding: 4px 12px; border-radius: 10px; font: 700 0.8rem/1.4 var(--font-body); letter-spacing: 0.01em;
  background: rgba(6, 12, 26, 0.7); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 60%, transparent); color: var(--text);
}
.arena-body { padding: clamp(22px, 3.4vw, 40px); align-self: center; }
.arena-body h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.arena-town { display: flex; align-items: center; gap: 0; margin-bottom: 6px; color: var(--muted); font-weight: 700; font-size: 0.92rem; letter-spacing: 0.01em; }
.arena-facts { display: grid; gap: 12px; margin: 20px 0 0; grid-template-columns: 1fr 1fr; }
.arena-facts > div { padding: 12px 14px; border-radius: 14px; background: rgba(220, 235, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line); }
.arena-facts .arena-master { grid-column: 1 / -1; }
.arena-facts dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.01em; color: var(--tech); margin-bottom: 4px; }
.arena-facts dd { margin: 0; }
.arena-master b { font-family: var(--font-head); font-size: 1.15rem; display: block; }
.arena-master span { color: #DCD0BA; }
.arena-facts .types { display: flex; flex-wrap: wrap; gap: 6px; }
.arena-emblem dd { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.arena-emblem img { width: 36px; height: 36px; }
.page-hero + .arena-section, .centers-hero + .section { padding-top: clamp(16px, 3vw, 32px); }
@media (max-width: 480px) { .arena-facts { grid-template-columns: 1fr; } }

.town-arena { margin: 12px 0 0; }
.town-arena a { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 10px; font-weight: 700; font-size: 0.92rem; text-decoration: none; color: var(--tech); background: var(--tech-soft); box-shadow: inset 0 0 0 1px var(--tech-line); }
.town-arena a:hover { color: #fff; box-shadow: inset 0 0 0 1px var(--tech), var(--tech-glow); }
.town-arena img { width: 28px; height: 28px; }

/* ------------------------------------------------------------------ spirit center + supply shop */

.centers-hero::before {
  background: radial-gradient(800px 380px at 80% 20%, rgba(127, 212, 255, 0.16), transparent 70%), radial-gradient(700px 360px at 10% 0%, rgba(244, 107, 21, 0.16), transparent 70%);
}
.centers-hero-grid { display: grid; gap: 36px; align-items: center; }
@media (min-width: 980px) { .centers-hero-grid { grid-template-columns: 1fr 1fr; } }
.nurse-quote {
  display: flex; align-items: center; gap: 16px; margin: 28px 0 0; padding: 14px 20px 14px 14px; border-radius: var(--radius);
  background: rgba(6, 12, 26, 0.55); box-shadow: inset 0 0 0 1px var(--tech-line), var(--tech-glow); max-width: 560px;
}
.nurse-quote img { width: 88px; height: auto; flex: none; border-radius: 14px; background: radial-gradient(closest-side, rgba(127, 212, 255, 0.25), transparent); }
.nurse-quote p { margin: 0 0 4px; font-size: 1.05rem; color: #EFE4CC; }
.nurse-quote footer { font-size: 0.88rem; color: var(--tech); font-weight: 700; }
.center-pair { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; align-items: end; gap: 8px; padding: 24px 16px 70px; border-radius: var(--radius-lg);
  background: radial-gradient(80% 70% at 50% 70%, rgba(127, 212, 255, 0.14), transparent 75%), rgba(4, 9, 20, 0.4); box-shadow: inset 0 0 0 1px var(--line); }
[data-time="night"].center-pair { background: radial-gradient(80% 70% at 50% 70%, rgba(56, 182, 240, 0.22), transparent 75%), rgba(2, 6, 16, 0.8); }
.center-building { margin: 0; }
.center-building img { width: 100%; height: auto; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.5)); }
.center-building.is-shop { padding-bottom: 4px; }
.center-pair .daynight { position: absolute; left: 50%; bottom: 16px; translate: -50% 0; margin: 0; }

.split-feature { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (min-width: 960px) { .split-feature { grid-template-columns: 1fr 1.1fr; } .split-feature.is-flipped > :first-child { order: 2; } }
.feature-list { display: grid; gap: 12px; margin-top: 24px; }
.feature-list li { padding: 16px 18px 16px 22px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); position: relative; }
.feature-list li::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; border-radius: 3px; background: var(--tech); box-shadow: var(--tech-glow); }
.feature-list h3 { font-size: 1.15rem; margin-bottom: 2px; }
.feature-list p { margin: 0; color: #DCD0BA; }
.room-shot { margin: 0; }
.room-shot img { width: 100%; height: auto; border-radius: var(--radius-lg); background: rgba(4, 9, 20, 0.5); }
.items-head { font-size: 1.1rem; margin-top: 26px; color: var(--tech); letter-spacing: 0.06em; }
.item-list { display: grid; gap: 8px; margin: 10px 0 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.item-list > div { padding: 12px 14px; border-radius: 14px; background: rgba(255, 186, 82, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 186, 82, 0.2); }
.item-list dt { font-weight: 700; font-family: var(--font-head); }
.item-list dd { margin: 2px 0 0; font-size: 0.93rem; color: #DCD0BA; }
.nurse-list { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .nurse-list { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .nurse-list { grid-template-columns: repeat(8, 1fr); } }
.nurse { display: grid; justify-items: center; gap: 8px; padding: 18px 10px 14px; border-radius: var(--radius); text-align: center;
  background: linear-gradient(180deg, rgba(56, 226, 200, 0.12), rgba(220, 235, 255, 0.02)); box-shadow: inset 0 0 0 1px var(--line); }
.nurse img { width: 100%; max-width: 132px; height: auto; }
.nurse span { font: 700 1.05rem/1.2 var(--font-head); }

/* ------------------------------------------------------------------ player accounts + wishlist */

.header-actions { display: flex; align-items: center; gap: 10px; }
.account-link { font-weight: 700; font-size: 0.95rem; color: #E7DCC6; text-decoration: none; padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
.account-link:hover, .account-link[aria-current] { color: var(--tech); background: var(--tech-soft); }
.account-menu { position: relative; }
.account-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px 4px 4px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--surface-2); color: var(--text); font: 700 0.95rem/1 var(--font-body); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.account-toggle::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); opacity: 0.7; }
.account-toggle[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--tech-line), var(--tech-glow); }
.account-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--sunset); color: #1F130C; font-family: var(--font-head); font-weight: 800; }
.account-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-list {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; margin: 0; padding: 6px; list-style: none; z-index: 60;
  border-radius: 16px; background: rgba(10, 20, 42, 0.97); box-shadow: inset 0 0 0 1px var(--line-strong), 0 24px 48px -18px rgba(0, 0, 0, 0.8);
}
.account-list[hidden], .account-menu[hidden], .account-link[hidden] { display: none; }
.account-list a, .account-list button {
  display: block; width: 100%; padding: 10px 14px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer;
  color: var(--text); font: 700 0.95rem/1.2 var(--font-body); text-decoration: none;
}
.account-list a:hover, .account-list button:hover { background: var(--tech-soft); color: var(--tech); }
.btn-wish { gap: 8px; white-space: nowrap; }
.btn-wish .wish-star { color: #8A3B12; font-size: 1.05em; }
.btn-wish.is-on { background: var(--tech-soft); color: var(--tech); box-shadow: inset 0 0 0 1px var(--tech-line), var(--tech-glow); }
.btn-wish.is-on .wish-star { color: var(--tech); }
.btn-wish.is-busy { opacity: 0.6; pointer-events: none; }
.btn-wish-hero { font-size: 1.08rem; padding-inline: 26px; }
.wish-count { margin: 16px 0 0; font-weight: 700; color: var(--tech); text-shadow: 0 0 12px rgba(127, 212, 255, 0.45); }
.wish-count[hidden] { display: none; }
.nav-account-mobile { display: none; }
.nav-signout { display: block; width: 100%; padding: 14px 12px; border: 0; border-radius: 12px; background: none; color: #E7DCC6; font: 700 1.1rem/1.2 var(--font-body); text-align: left; cursor: pointer; }
@media (max-width: 1020px) {
  .js .nav-account-mobile:not([hidden]) { display: block; }
  .js [data-account-out].nav-account-mobile:not([hidden]), .js [data-account-in].nav-account-mobile:not([hidden]) { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
  .js .nav-account-mobile:not([hidden]) + .nav-account-mobile { border-top: 0; margin-top: 0; padding-top: 0; }
  .header-actions .account-link, .header-actions .account-menu { display: none; }
  .header-actions { margin-left: auto; }
}
@media (min-width: 1021px) and (max-width: 1240px) {
  .site-nav a:not(.btn) { padding: 8px 8px; font-size: 0.9rem; }
  .header-bar { gap: 12px; }
}
@media (max-width: 400px) { .header-actions .btn-wish { padding-inline: 12px; } }

/* log in, sign up, reset: a glass card with a small "why" panel beside it */
.auth-page { padding-top: clamp(40px, 7vw, 80px); }
.auth-wrap { display: grid; gap: clamp(24px, 4vw, 48px); align-items: start; max-width: 1040px; }
@media (min-width: 900px) { .auth-wrap { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); } }
.auth-card {
  padding: clamp(24px, 4vw, 44px); border-radius: var(--radius-lg); position: relative; overflow: hidden;
  background: radial-gradient(500px 260px at 0% 0%, rgba(244, 107, 21, 0.16), transparent 70%), radial-gradient(500px 260px at 100% 100%, rgba(127, 212, 255, 0.1), transparent 70%), var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 40px 80px -40px rgba(0, 0, 0, 0.9);
}
.auth-card[hidden], .account-in[hidden], .account-loading[hidden], [data-reset-step][hidden], .auth-form[hidden], .auth-done[hidden] { display: none; }
.auth-card .display { font-size: clamp(2rem, 4.4vw, 3rem); }
.auth-card .lead { margin-bottom: 24px; }
.auth-form input:not([type="radio"]):not([type="checkbox"]) { width: 100%; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-busy="true"] { opacity: 0.65; cursor: progress; transform: none; }
.auth-msg { margin: 0; padding: 12px 16px; border-radius: 12px; font-weight: 700; font-size: 0.95rem; }
.auth-msg[hidden] { display: none; }
.auth-msg.is-error { color: #FF9C88; background: rgba(216, 68, 47, 0.14); box-shadow: inset 0 0 0 1px rgba(244, 107, 21, 0.4); }
.auth-msg.is-ok { color: var(--tech); background: var(--tech-soft); box-shadow: inset 0 0 0 1px var(--tech-line); }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; letter-spacing: 0.01em; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.hint.center { text-align: center; }
.auth-switch { margin: 22px 0 0; color: var(--muted); }
.auth-done { margin-top: 8px; }
.auth-side { padding: clamp(22px, 3vw, 32px); border-radius: var(--radius-lg); background: rgba(220, 235, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); }
.auth-side h2 { font-size: 1.4rem; }
.auth-trio { display: flex; justify-content: center; align-items: end; gap: 4px; margin-bottom: 14px; }
.auth-trio li { width: 31%; max-width: 120px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45)); animation: spiritBob 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -1.1s); }
.auth-trio li:nth-child(2) { width: 36%; }
.auth-perks { display: grid; gap: 10px; margin: 0 0 16px; }
.auth-perks li { position: relative; padding-left: 26px; color: #DCD0BA; }
.auth-perks li::before { content: "\2605"; position: absolute; left: 0; top: 0; color: var(--tech); text-shadow: 0 0 10px rgba(127, 212, 255, 0.6); }
.auth-side .muted { font-size: 0.92rem; margin: 0; }

/* account page */
.account-wrap { max-width: 1040px; }
.account-loading { text-align: center; }
.account-head { margin-bottom: clamp(24px, 4vw, 40px); }
.account-head .display { font-size: clamp(2rem, 4.6vw, 3.2rem); }
.account-head .lead { margin: 0; }
.account-grid { display: grid; gap: 18px; }
@media (min-width: 860px) { .account-grid { grid-template-columns: 1.2fr 1fr; align-items: start; } }
.account-grid .card { display: grid; gap: 16px; }
.account-grid .card h2 { margin: 0; font-size: 1.5rem; }
.account-wish { background: radial-gradient(420px 220px at 100% 0%, rgba(127, 212, 255, 0.14), transparent 70%), var(--surface); }
.wish-status { margin: 0; font-weight: 700; }
.btn-wish-big { width: 100%; }
.btn-wish-big.is-on { background: var(--tech-soft); color: var(--tech); box-shadow: inset 0 0 0 1px var(--tech-line), var(--tech-glow); }
.wish-platform { border: 0; margin: 0; padding: 0; min-width: 0; }
.wish-platform legend { margin-bottom: 8px; font-weight: 700; }
.wish-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wish-chip { position: relative; cursor: pointer; }
.wish-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.wish-chip span { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 16px; border-radius: 10px; font-weight: 700; background: rgba(220, 235, 255, 0.05); box-shadow: inset 0 0 0 1px var(--line-strong); }
.wish-chip input:checked + span { color: var(--tech); background: var(--tech-soft); box-shadow: inset 0 0 0 1px var(--tech-line), var(--tech-glow); }
.wish-chip input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 700; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { flex: none; width: 46px; height: 26px; border-radius: 10px; background: rgba(220, 235, 255, 0.12); box-shadow: inset 0 0 0 1px var(--line-strong); position: relative; transition: background 0.2s; }
.switch-track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform 0.25s var(--ease); }
.switch input:checked + .switch-track { background: var(--tech-deep); box-shadow: var(--tech-glow); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--gold); outline-offset: 2px; }
.account-rule { border: 0; height: 1px; background: var(--line); margin: 4px 0; width: 100%; }
.account-profile input { width: 100%; }

/* ------------------------------------------------------------------ Spiritdex (moves, abilities, items, types, stats, team) */

/* icons for the tools, as simple glyphs */
.dex-tab-icon::before, .dex-tool-icon::before { font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", system-ui, sans-serif; }
.dex-icon-spirits::before { content: "\25C9"; }
.dex-icon-stats::before { content: "\2630"; }
.dex-icon-moves::before { content: "\26A1"; }
.dex-icon-abilities::before { content: "\2726"; }
.dex-icon-items::before { content: "\2B22"; }
.dex-icon-types::before { content: "\25D0"; }
.dex-icon-team::before { content: "\2B21"; }
.dex-icon-random::before { content: "\2684"; }

/* the tab bar under the header */
.dex-tabs { border-bottom: 1px solid var(--line); background: rgba(6, 12, 26, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); position: relative; z-index: 5; }
.dex-tabs ul { display: flex; gap: 4px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); }
.dex-tabs ul::-webkit-scrollbar { display: none; }
.dex-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; white-space: nowrap; color: #DCD0BA; text-decoration: none; font-weight: 700; font-size: 0.92rem; }
.dex-tabs a:hover { background: var(--surface-2); color: #fff; }
.dex-tabs a[aria-current] { color: var(--tech); background: var(--tech-soft); box-shadow: inset 0 0 0 1px var(--tech-line); }
.dex-tab-icon { width: 1.1em; text-align: center; opacity: 0.85; }
.dex-hero { padding-bottom: clamp(16px, 3vw, 28px); }
.dex-hero .display { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.dex-section { padding-top: 0; }

/* search + filters above a table or list */
.dex-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; position: sticky; top: calc(var(--header-h) + 8px); z-index: 4;
  padding: 10px; border-radius: 18px; background: rgba(10, 20, 42, 0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line-strong); }
.dex-controls[hidden] { display: none; }
.dex-search { flex: 1 1 240px; }
.dex-search input { width: 100%; min-height: 44px; border-radius: 10px; padding-inline: 18px; }
.dex-controls select { min-height: 44px; }
.dex-count { margin: 0 0 0 auto; color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.dex-empty { text-align: center; color: var(--muted); padding: 30px 0; }
@media (max-width: 700px) { .dex-controls { position: static; } .dex-count { margin-left: 0; width: 100%; } .dex-controls label:not(.dex-search) { flex: 1 1 140px; } .dex-controls select { width: 100%; } }

/* tables */
.dex-table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); background: rgba(220, 235, 255, 0.025); }
.dex-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.dex-table th, .dex-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dex-table thead th { position: sticky; top: 0; background: #0E1A33; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.01em; white-space: nowrap; z-index: 1; }
.dex-table thead th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.dex-table thead th button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.dex-table thead th[data-sort] button::after { content: "\2195"; opacity: 0.35; font-size: 0.9em; }
.dex-table thead th[aria-sort="ascending"] button::after { content: "\2191"; opacity: 1; color: var(--tech); }
.dex-table thead th[aria-sort="descending"] button::after { content: "\2193"; opacity: 1; color: var(--tech); }
.dex-table thead th[aria-sort] { color: var(--tech); }
.dex-table tbody tr { transition: background 0.15s; }
.dex-table tbody tr:hover { background: rgba(127, 212, 255, 0.05); }
.dex-table tbody tr[hidden] { display: none; }
.dex-table tbody th { font-weight: 700; white-space: nowrap; }
.dex-table a { color: var(--text); text-decoration: none; font-weight: 700; }
.dex-table a:hover { color: var(--tech); text-decoration: underline; }
.dex-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dex-table thead th.num, .dex-table thead th[data-num] { text-align: right; }
.dex-col-desc { color: #DCD0BA; min-width: 260px; font-size: 0.9rem; }
.dex-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.dex-cat::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }
.dex-cat-attack::before { background: var(--ember); transform: rotate(45deg); }
.dex-cat-status::before { background: var(--tech); border-radius: 50%; box-shadow: 0 0 8px var(--tech); }
@media (max-width: 860px) { .dex-moves .dex-col-desc { display: none; } }

/* stats table */
.stats-name { display: inline-flex; align-items: center; gap: 10px; }
.stats-name img { width: 44px; height: 44px; margin: -6px 0; }
.stats-types { white-space: nowrap; }
.stats-types .type { font-size: 0.75rem; padding: 2px 9px; }
.stat-cell { position: relative; min-width: 84px; }
.stat-cell span { position: relative; z-index: 1; }
.stat-cell i { position: absolute; right: 12px; bottom: 6px; height: 3px; width: calc(var(--w) * 0.6); max-width: 60%; border-radius: 3px; opacity: 0.7; }
.stat-hp i { background: #6BC077; } .stat-atk i { background: #F07A63; } .stat-def i { background: #5CA8F0; } .stat-spd i { background: #F2CC6B; }
.stats-total { font-weight: 800; color: var(--tech); }

/* one move */
.dex-crumb { margin: 0 0 16px; }
.dex-crumb a { font-weight: 700; text-decoration: none; }
.move-card { display: grid; gap: 24px; padding: clamp(24px, 4vw, 40px); border-radius: var(--radius-lg); position: relative; overflow: hidden;
  background: radial-gradient(600px 300px at 0% 0%, color-mix(in srgb, var(--type) 22%, transparent), transparent 70%), var(--bg-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--type) 40%, transparent); }
@media (min-width: 860px) { .move-card { grid-template-columns: 1.4fr 1fr; align-items: center; } }
.move-head .display { margin-bottom: 8px; }
.move-tags { display: flex; gap: 10px; align-items: center; margin: 0 0 12px; }
.move-head .lead { margin: 0; }
.move-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; }
.move-stats div { padding: 14px 16px; border-radius: 14px; background: rgba(6, 12, 26, 0.5); box-shadow: inset 0 0 0 1px var(--line); }
.move-stats dt { font-size: 0.75rem; letter-spacing: 0.01em; color: var(--muted); font-weight: 700; }
.move-stats dd { margin: 4px 0 0; font: 800 1.6rem/1.1 var(--font-head); }
.move-stats .move-how { font: 700 0.95rem/1.35 var(--font-body); }
.move-block { margin-top: clamp(28px, 4vw, 44px); }
.move-block h2 { font-size: 1.5rem; }
.move-matchups { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.move-matchup { padding: 16px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.move-matchup h3 { font-size: 1rem; margin-bottom: 10px; }
.move-matchup p { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.move-matchup .type { text-decoration: none; }
.move-matchup-2 { box-shadow: inset 3px 0 0 #6BC077, inset 0 0 0 1px var(--line); }
.move-matchup-05 { box-shadow: inset 3px 0 0 #F07A63, inset 0 0 0 1px var(--line); }
.move-matchup-0 { box-shadow: inset 3px 0 0 #8E7FB0, inset 0 0 0 1px var(--line); }
.learner-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 130px), 1fr)); }
.learner-grid a { display: grid; justify-items: center; gap: 2px; padding: 12px 8px; border-radius: var(--radius); text-align: center; text-decoration: none; color: var(--text);
  background: linear-gradient(180deg, color-mix(in srgb, var(--type) 18%, transparent), rgba(220, 235, 255, 0.02)); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.25s var(--ease); }
.learner-grid a:hover { transform: translateY(-3px); color: var(--text); }
.learner-grid img { width: 88px; height: 88px; }
.learner-name { font-weight: 700; }
.learner-lv { font-size: 0.82rem; color: var(--tech); font-weight: 700; }

/* abilities */
.ability-list { display: grid; gap: 12px; }
.ability-card { display: grid; gap: 14px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); scroll-margin-top: calc(var(--header-h) + 90px); }
.ability-card[hidden] { display: none; }
.ability-card:target { box-shadow: inset 0 0 0 1px var(--tech-line), var(--tech-glow); }
@media (min-width: 860px) { .ability-card { grid-template-columns: 1fr 1.1fr; align-items: center; } }
.ability-text h2 { font-size: 1.25rem; margin-bottom: 4px; }
.ability-text p { margin: 0; color: #DCD0BA; }
.ability-spirits { display: flex; flex-wrap: wrap; gap: 8px; }
.ability-spirits a { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px; border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 0.88rem;
  background: color-mix(in srgb, var(--type) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--type) 35%, transparent); }
.ability-spirits a:hover { color: #fff; background: color-mix(in srgb, var(--type) 28%, transparent); }
.ability-spirits img { width: 36px; height: 36px; }

/* items */
.items-group { font-size: 1.4rem; margin: 30px 0 14px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.items-group:first-child { margin-top: 0; }
.items-group .muted { font: 400 1rem var(--font-body); }
.item-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.item-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); scroll-margin-top: calc(var(--header-h) + 60px); }
.item-card:target { box-shadow: inset 0 0 0 1px var(--tech-line), var(--tech-glow); }
.item-card h3 { font-size: 1.1rem; margin-bottom: 4px; }
.item-card p { margin: 0; color: #DCD0BA; font-size: 0.93rem; }
.item-icon { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: rgba(6, 12, 26, 0.55); box-shadow: inset 0 0 0 1px var(--line-strong); }
.item-icon img { width: 48px; height: 48px; }
.item-icon-blank { width: 26px; height: 26px; border-radius: 8px; background: var(--tech-soft); box-shadow: inset 0 0 0 2px var(--tech-line); }
.item-seal .item-icon { box-shadow: inset 0 0 0 1px var(--tech-line), var(--tech-glow); }
.item-price { margin-top: 8px !important; color: var(--gold) !important; font-weight: 700; }

/* types */
.type-calc { display: grid; gap: 14px; }
.type-calc[hidden] { display: none; }
.type-calc h2 { margin: 0; }
.type-calc > .muted { margin: 0; }
.type-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.type-btn { border: 0; cursor: pointer; font: inherit; font-size: 0.92rem; font-weight: 700; padding: 8px 16px; opacity: 0.55; transition: opacity 0.2s, transform 0.2s var(--ease), box-shadow 0.2s; }
.type-btn:hover { opacity: 0.85; }
.type-btn[aria-pressed="true"] { opacity: 1; transform: translateY(-2px); box-shadow: 0 0 0 2px #fff, 0 0 18px var(--type); }
.type-result-head { font-weight: 700; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.type-result-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.type-result-group { padding: 14px; border-radius: 14px; background: rgba(6, 12, 26, 0.5); box-shadow: inset 0 0 0 1px var(--line); }
.type-result-group h3 { font-size: 0.95rem; margin-bottom: 8px; }
.type-result-group p { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.type-result-4, .type-result-2 { box-shadow: inset 3px 0 0 #F07A63, inset 0 0 0 1px var(--line); }
.type-result-05, .type-result-025 { box-shadow: inset 3px 0 0 #6BC077, inset 0 0 0 1px var(--line); }
.type-result-0 { box-shadow: inset 3px 0 0 #8E7FB0, inset 0 0 0 1px var(--line); }
.type-result-spirits { margin-top: 6px; }
.type-result-spirits h3 { font-size: 1rem; }
.type-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); margin-top: 18px; }
.type-card { padding: 18px; border-radius: var(--radius); scroll-margin-top: calc(var(--header-h) + 60px);
  background: linear-gradient(160deg, color-mix(in srgb, var(--type) 16%, transparent), rgba(220, 235, 255, 0.02)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--type) 30%, transparent); }
.type-card:target { box-shadow: inset 0 0 0 2px var(--type), 0 0 24px -6px var(--type); }
.type-card h3 { display: flex; align-items: center; gap: 10px; font-size: 1rem; margin-bottom: 12px; }
.type-card h3 .type { font-size: 1rem; padding: 4px 14px; }
.type-card h3 .muted { font: 700 0.85rem var(--font-body); }
.type-card dl { display: grid; gap: 8px; margin: 0; }
.type-card dt { font-size: 0.75rem; letter-spacing: 0.01em; color: var(--muted); font-weight: 700; }
.type-card dd { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 4px; }
.type-card dd .type { font-size: 0.75rem; padding: 2px 9px; }

/* team builder */
.team-builder [data-team][hidden] { display: none; }
.team-slots { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); margin-bottom: 14px; }
@media (min-width: 640px) { .team-slots { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1040px) { .team-slots { grid-template-columns: repeat(6, 1fr); } }
.team-slot { position: relative; display: grid; justify-items: center; gap: 4px; padding: 12px 8px 14px; border-radius: var(--radius); min-height: 190px; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--type, #888) 20%, transparent), rgba(220, 235, 255, 0.02)); box-shadow: inset 0 0 0 1px var(--line); }
.team-slot.is-empty { place-items: center; background: rgba(220, 235, 255, 0.02); box-shadow: inset 0 0 0 2px var(--line); border: 0; outline: 2px dashed var(--line-strong); outline-offset: -8px; }
.team-slot-empty { color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.team-slot-art img { width: 104px; height: 104px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45)); }
.team-slot-name { font-weight: 800; font-family: var(--font-head); }
.team-slot-types { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.team-slot-types .type { font-size: 0.72rem; padding: 1px 8px; }
.team-remove { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer; background: rgba(6, 12, 26, 0.7); color: var(--text); font-size: 1.1rem; line-height: 1; box-shadow: inset 0 0 0 1px var(--line-strong); }
.team-remove:hover { background: #D8442F; }
.team-picker { display: grid; gap: 8px; margin-bottom: 14px; position: relative; }
.team-picker[hidden] { display: none; }
.team-picker input { width: 100%; }
.team-results { display: grid; gap: 6px; }
.team-result { width: 100%; display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; border: 0; border-radius: 14px; cursor: pointer; text-align: left; font: inherit; color: var(--text); background: rgba(220, 235, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line); }
.team-result:hover, .team-result:focus-visible { background: var(--tech-soft); box-shadow: inset 0 0 0 1px var(--tech-line); }
.team-result img { width: 44px; height: 44px; }
.team-result-name { font-weight: 700; flex: 1; }
.team-none { padding: 8px 4px; }
.team-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 26px; }
.team-note { font-size: 0.9rem; }
.team-analysis[hidden] { display: none; }
.team-analysis h2 { font-size: 1.5rem; margin-top: 10px; }
.team-verdict { font-weight: 700; padding: 12px 16px; border-radius: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.team-verdict.is-bad { color: #FFB4A4; background: rgba(216, 68, 47, 0.14); box-shadow: inset 0 0 0 1px rgba(244, 107, 21, 0.4); }
.team-verdict.is-good { color: var(--tech); background: var(--tech-soft); box-shadow: inset 0 0 0 1px var(--tech-line); }
.team-table th .type { font-size: 0.75rem; padding: 2px 9px; }
.team-th-img { width: 40px; height: 40px; margin: -6px auto; }
.team-table thead th { text-align: center; }
.team-cell { text-align: center !important; font-weight: 800; }
.team-cell.is-weak { color: #FFB4A4; background: rgba(216, 68, 47, 0.18); }
.team-cell.is-resist { color: #9BDDFF; background: rgba(56, 182, 240, 0.12); }
.team-cell.is-immune { color: #C9B8FF; background: rgba(6, 12, 26, 0.7); }
.team-sum { font-weight: 800; color: var(--muted); }
.team-sum.is-bad { color: #FF9C88; }
.team-sum.is-good { color: var(--tech); }
.team-stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin: 0; }
.team-stats div { padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.team-stats dt { font-size: 0.75rem; letter-spacing: 0.01em; color: var(--muted); font-weight: 700; }
.team-stats dd { margin: 4px 0 0; font: 800 1.5rem/1.1 var(--font-head); }
.team-stats .team-stats-wide dd { font-size: 1.1rem; }

/* home: spirit of the day + tools */
.dex-home-grid { display: grid; gap: 18px; }
@media (min-width: 960px) { .dex-home-grid { grid-template-columns: 0.9fr 1.1fr; align-items: stretch; } }
.sotd { position: relative; display: grid; justify-items: center; gap: 6px; padding: 26px 24px; border-radius: var(--radius-lg); text-align: center; overflow: hidden;
  background: radial-gradient(420px 300px at 50% 20%, color-mix(in srgb, var(--type) 28%, transparent), transparent 70%), var(--bg-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--type) 40%, transparent); }
.sotd-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 14px; border-radius: 10px; font-weight: 700; font-size: 0.85rem; background: rgba(6, 12, 26, 0.55); box-shadow: inset 0 0 0 1px var(--tech-line); color: var(--tech); }
.sotd-kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tech); box-shadow: var(--tech-glow); animation: pulse 2.2s infinite; }
.sotd-stage { position: relative; display: grid; place-items: center; width: 220px; height: 220px; }
.sotd-stage img { position: relative; width: 190px; height: 190px; animation: spiritBob 3.2s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45)); }
.sotd-name { font-size: 2rem; margin: 0; }
.sotd-types { margin: 0; display: flex; gap: 6px; }
.sotd-look { color: #DCD0BA; max-width: 40ch; margin: 4px 0; }
.sotd-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0 14px; width: 100%; max-width: 420px; }
.sotd-stats div { padding: 8px 4px; border-radius: 12px; background: rgba(6, 12, 26, 0.5); box-shadow: inset 0 0 0 1px var(--line); }
.sotd-stats dt { font-size: 0.68rem; letter-spacing: 0.01em; color: var(--muted); font-weight: 700; }
.sotd-stats dd { margin: 2px 0 0; font: 800 1.15rem/1.1 var(--font-head); }
.sotd-total dd { color: var(--tech); }
.sotd .btn-row { justify-content: center; }
.dex-tools { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); align-content: start; }
.dex-tool { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px; align-items: center; height: 100%; padding: 16px 18px; border-radius: var(--radius);
  text-decoration: none; color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.dex-tool:hover, .dex-tool:focus-visible { transform: translateY(-3px); color: var(--text); box-shadow: inset 0 0 0 1px var(--tech-line), var(--tech-glow); }
.dex-tool-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; font-size: 1.3rem; color: var(--tech); background: var(--tech-soft); box-shadow: inset 0 0 0 1px var(--tech-line); }
.dex-tool-name { font: 700 1.1rem/1.2 var(--font-head); }
.dex-tool-name b { margin-left: 4px; font-size: 0.8rem; padding: 1px 8px; border-radius: 10px; background: var(--sunset); color: #1F130C; vertical-align: 2px; }
.dex-tool-text { color: var(--muted); font-size: 0.9rem; line-height: 1.4; }

/* header: Spiritdex drop-down + search */
.nav-drop { position: relative; }
.nav-drop-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: #E7DCC6; font: 700 0.97rem/1.4 var(--font-body); white-space: nowrap; }
.nav-drop-toggle::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); opacity: 0.7; }
.nav-drop-toggle:hover { background: var(--surface-2); color: #fff; }
.nav-drop-toggle[data-current] { color: var(--tech); background: var(--tech-soft); box-shadow: inset 0 -2px 0 var(--tech-line); }
.nav-sub { list-style: none; margin: 0; padding: 6px; }
.nav-sub a { display: flex !important; align-items: center; gap: 10px; }
@media (min-width: 1021px) {
  .site-nav .nav-sub { display: none; position: absolute; left: 50%; top: calc(100% + 8px); translate: -50% 0; min-width: 220px; border-radius: 16px; z-index: 60;
    background: rgba(10, 20, 42, 0.97); box-shadow: inset 0 0 0 1px var(--line-strong), 0 24px 48px -18px rgba(0, 0, 0, 0.8); }
  .site-nav .nav-drop:hover .nav-sub, .site-nav .nav-drop:focus-within .nav-sub, .site-nav .nav-drop-toggle[aria-expanded="true"] + .nav-sub { display: block; animation: dropIn 0.18s var(--ease); }
  @keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } }
  .nav-drop::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }
  .nav-sub a { border-radius: 10px !important; padding: 9px 12px !important; }
  .nav-sub a:hover { background: var(--tech-soft) !important; color: var(--tech) !important; }
}
@media (max-width: 1020px) {
  .nav-drop-toggle { display: none; }
  .js .site-nav .nav-sub { display: block; padding: 0; }
  .js .site-nav .nav-sub a { font-size: 1.05rem; }
}
.search-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer; color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); flex: none; }
.search-toggle:hover, .search-toggle[aria-expanded="true"] { color: var(--tech); box-shadow: inset 0 0 0 1px var(--tech-line), var(--tech-glow); }
.site-search { position: absolute; left: 0; right: 0; top: 100%; padding: 14px 0 18px; background: rgba(6, 12, 26, 0.97); border-bottom: 1px solid var(--line); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9); }
.site-search[hidden] { display: none; }
.site-search input { width: 100%; min-height: 54px; border-radius: 10px; padding-inline: 22px; font-size: 1.1rem; }
.site-search-list { display: grid; gap: 4px; margin-top: 10px; max-width: 760px; }
.site-search-list a { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; border-radius: 12px; text-decoration: none; color: var(--text); }
.site-search-list a:hover, .site-search-list a.is-active { background: var(--tech-soft); box-shadow: inset 0 0 0 1px var(--tech-line); color: var(--text); }
.search-pic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(220, 235, 255, 0.05); }
.search-pic img { width: 40px; height: 40px; object-fit: contain; }
.search-pic-move::before { content: "\26A1"; color: var(--gold); }
.search-pic-ability::before { content: "\2726"; color: var(--tech); }
.search-pic-page::before { content: "\2192"; color: var(--muted); }
.search-name { font-weight: 700; }
.search-kind { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.search-none { color: var(--muted); padding: 8px 4px; }
.site-search-hint { margin: 10px 0 0; font-size: 0.85rem; }
@media (max-width: 1020px) { .site-search-hint { display: none; } }
.cx-box-title a { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--tech-line); }
.cx-box-title a:hover { color: var(--tech); }
.cx-moves a { color: var(--text); text-decoration: none; font-weight: 700; }
.cx-moves a:hover { color: var(--tech); text-decoration: underline; }

/* home: the game in numbers */
.numbers { border-top: 1px solid var(--line); background: linear-gradient(90deg, rgba(244, 107, 21, 0.08), rgba(127, 212, 255, 0.08), rgba(43, 110, 200, 0.08)); }
.numbers-list { display: grid; grid-template-columns: repeat(5, 1fr); }
.numbers-list a { display: grid; justify-items: center; gap: 2px; padding: 18px 8px; text-decoration: none; color: var(--muted); text-align: center; border-right: 1px solid var(--line); transition: background 0.2s; }
.numbers-list li:last-child a { border-right: 0; }
.numbers-list a:hover { background: var(--tech-soft); color: var(--text); }
.numbers-list b { font: 800 clamp(1.6rem, 3.4vw, 2.4rem)/1 var(--font-head); background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent; }
.numbers-list span { font-size: 0.85rem; font-weight: 700; }
@media (max-width: 640px) { .numbers-list { grid-template-columns: repeat(3, 1fr); } .numbers-list li:nth-child(3) a { border-right: 0; } .numbers-list li:nth-child(n+4) a { border-top: 1px solid var(--line); } }
.home-faq-grid { display: grid; gap: 24px; }
@media (min-width: 960px) { .home-faq-grid { grid-template-columns: 0.8fr 1.2fr; align-items: start; } }

/* ================================================================== the game's look (design/HOME_V2_DESIGN.md) */

.pixel, .px { image-rendering: pixelated; }
h1, h2, h3 { font-weight: 800; line-height: 1.05; text-wrap: balance; }
.display { font-size: clamp(2.2rem, 5vw, 3.815rem); }
.grad { background: none; color: var(--gold); }
.lead { color: inherit; opacity: 0.92; }

/* ---------- buttons: the in-game menu slab ---------- */
.btn {
  --face: var(--gold); --edge: #B7741A; --ink-on: var(--ink);
  min-height: 48px; padding: 0.85em 1.3em 0.75em; border-radius: 12px;
  background: var(--face); color: var(--ink-on); font: 800 1rem/1 var(--font-head);
  box-shadow: 0 4px 0 var(--edge), 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.btn:hover { color: var(--ink-on); transform: none; filter: brightness(1.06); box-shadow: 0 4px 0 var(--edge), 0 6px 18px rgba(0, 0, 0, 0.25); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.btn-sm { min-height: 40px; padding: 0.6em 1em 0.5em; font-size: 0.95rem; }
.btn-glow { box-shadow: 0 4px 0 var(--edge), 0 6px 18px rgba(0, 0, 0, 0.25); }
.btn-glass, .btn-ghost {
  --face: transparent; --edge: rgba(255, 246, 227, 0.35); --ink-on: var(--cream);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: inset 0 0 0 2px rgba(255, 246, 227, 0.55), 0 4px 0 var(--edge);
}
.btn-glass:hover, .btn-ghost:hover { color: var(--cream); background: rgba(255, 246, 227, 0.08); box-shadow: inset 0 0 0 2px rgba(255, 246, 227, 0.75), 0 4px 0 var(--edge); }
.btn-glass:active, .btn-ghost:active { box-shadow: inset 0 0 0 2px rgba(255, 246, 227, 0.75), 0 1px 0 var(--edge); }
.btn-ink { --face: var(--ink); --edge: #000; --ink-on: var(--cream); }
.btn-discord { --face: #5865F2; --edge: #3A44B8; --ink-on: #fff; }
.on-light .btn-glass, .on-light .btn-ghost { --ink-on: var(--ink); --edge: rgba(38, 25, 12, 0.35); box-shadow: inset 0 0 0 2px rgba(38, 25, 12, 0.6), 0 4px 0 var(--edge); }

/* ---------- panels: the in-game window ---------- */
.panel, .card {
  background: var(--panel); color: var(--cream); border-radius: 14px; padding: clamp(20px, 3vw, 28px);
  box-shadow: var(--rim), 0 10px 26px rgba(0, 0, 0, 0.22);
}
.card h3, .panel h3 { font-size: 1.5625rem; margin-bottom: 0.5rem; }
.cast .card::before { display: none; }

/* ---------- signpost: the in-game route sign, the page or place name on the plank ---------- */
.sign {
  position: relative; width: 236px; aspect-ratio: 512 / 384; margin: 0 0 1.25rem -10px; flex: none;
  background: url("../assets/ui/signpost.png") center / contain no-repeat;
  background-image: image-set(url("../assets/ui/signpost.webp") type("image/webp"), url("../assets/ui/signpost.png") type("image/png"));
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.28));
}
.sign__plank, .sign__sub { position: absolute; left: 10%; width: 80%; text-align: center; font-family: var(--font-head); }
.sign__plank { top: 29%; font-weight: 800; font-size: 1.5625rem; line-height: 1; color: #FFF3DC; text-shadow: 0 2px 0 var(--wood-dark), 0 0 6px rgba(0, 0, 0, 0.35); }
.sign--long .sign__plank { font-size: 1.2rem; top: 31%; }
.sign__sub { top: 50%; font-weight: 700; font-size: 0.8rem; line-height: 1.1; color: #F7E2BF; text-shadow: 0 1px 0 var(--wood-dark); }
@media (max-width: 520px) { .sign { width: 196px; } .sign__plank { font-size: 1.3rem; } .sign--long .sign__plank { font-size: 1rem; } .sign__sub { font-size: 0.72rem; } }

/* ---------- dialogue box: a character speaks ---------- */
.talk { display: grid; grid-template-columns: auto 1fr; align-items: end; margin: 0; }
.talk__face { width: clamp(110px, 14vw, 180px); margin-right: -1.25rem; position: relative; z-index: 1; image-rendering: pixelated; }
.talk--plain { grid-template-columns: 1fr; }
.talk__box {
  position: relative; margin: 0; background: var(--panel); border-radius: 14px; padding: 1.5rem 1.75rem 1.4rem 2.5rem;
  box-shadow: var(--rim), 0 12px 30px rgba(0, 0, 0, 0.25); color: var(--cream);
}
.talk--plain .talk__box { padding-left: 1.75rem; }
.talk__name {
  position: absolute; top: -0.95rem; left: 2.25rem; font: 800 0.8rem/1 var(--font-head); background: var(--teal); color: #fff;
  padding: 0.45em 0.9em; border-radius: 999px 999px 999px 4px;
}
.talk--plain .talk__name { left: 1.5rem; }
.talk__box p { font-size: 1.25rem; line-height: 1.45; margin: 0; max-width: 46ch; }
.talk__box p + p { margin-top: 0.6em; }
.talk__box::after { content: "\25BC"; position: absolute; right: 1.1rem; bottom: 0.7rem; font-size: 0.75rem; color: var(--gold); }
@media (max-width: 520px) { .talk__face { width: 92px; margin-right: -0.75rem; } .talk__box { padding: 1.4rem 1.1rem 1.2rem 1.6rem; } .talk__box p { font-size: 1.08rem; } }

/* ---------- land bands, each with its own terrain edge drawn over the band above ---------- */
.band-woodland { --band: var(--woodland); --edge-png: url("../assets/edges/woodland.png"); --edge-webp: url("../assets/edges/woodland.webp"); }
.band-farmland { --band: var(--farmland); --edge-png: url("../assets/edges/farmland.png"); --edge-webp: url("../assets/edges/farmland.webp"); color: var(--ink); }
.band-hills { --band: var(--hills); --edge-png: url("../assets/edges/hill_country.png"); --edge-webp: url("../assets/edges/hill_country.webp"); }
.band-shore { --band: var(--shore); --edge-png: url("../assets/edges/shoreland.png"); --edge-webp: url("../assets/edges/shoreland.webp"); }
.band-dry { --band: var(--dry); --edge-png: url("../assets/edges/dry_lands.png"); --edge-webp: url("../assets/edges/dry_lands.webp"); }
.band-night { --band: var(--dusk); }
.land-band { position: relative; background: var(--band); padding-block: 5.5rem 6rem; }
.land-band::before {
  content: ""; position: absolute; left: 0; right: 0; top: -66px; height: 70px; pointer-events: none;
  background: var(--edge-png) repeat-x left bottom / auto 70px;
  background-image: image-set(var(--edge-webp) type("image/webp"), var(--edge-png) type("image/png"));
  image-rendering: pixelated;
}
.night-band { position: relative; background: var(--dusk-deep); }
.night-band::before, .page-hero::after, .cx-hero::after {
  content: ""; position: absolute; left: 0; right: 0; height: 42px; background: var(--dusk-deep); pointer-events: none;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 340 42'><path d='M0 42V22l40 4 14-10 36 6 50-4 20 8 44-6 30 4 26-9 40 7 40-3V42z'/></svg>") repeat-x bottom / 340px 42px;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 340 42'><path d='M0 42V22l40 4 14-10 36 6 50-4 20 8 44-6 30 4 26-9 40 7 40-3V42z'/></svg>") repeat-x bottom / 340px 42px;
}
.night-band::before { top: -40px; }
.band-farmland a:not(.btn) { color: var(--ink); }
.band-farmland .panel a:not(.btn) { color: var(--cream); }
.band-farmland .panel .home-more { color: var(--gold); }
.footer-head, .footer-tagline { text-transform: none !important; letter-spacing: 0 !important; font-family: var(--font-head); }
.footer-head { font-size: 1rem; }
.band-farmland .muted { color: #45311A; }

/* ---------- inner pages: a slim art header in the page's land colour ---------- */
.page-hero, .cx-hero {
  position: relative; isolation: isolate; overflow: visible; min-height: 0;
  background: linear-gradient(transparent 66px, var(--band, var(--woodland)) 66px);
  padding: calc(66px + clamp(20px, 3vw, 36px)) 0 calc(42px + clamp(24px, 3vw, 40px));
}
.page-hero::before, .cx-hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 70px; z-index: -1; pointer-events: none;
  background: var(--edge-png, none) repeat-x left bottom / auto 70px;
  background-image: image-set(var(--edge-webp) type("image/webp"), var(--edge-png) type("image/png"));
  image-rendering: pixelated;
}
.page-hero::after, .cx-hero::after { bottom: -1px; }
.page-hero .wrap:has(> .sign) { display: grid; grid-template-columns: auto 1fr; column-gap: clamp(16px, 3vw, 36px); align-items: center; }
.page-hero .wrap > .sign { grid-row: 1 / span 3; margin: 0 0 0 -10px; align-self: center; }
.page-hero .wrap:has(> .sign) > :not(.sign) { grid-column: 2; }
.page-hero .display { font-size: clamp(2rem, 4.6vw, 3.4rem); max-width: 22ch; margin-bottom: 0.3em; }
.page-hero .lead { max-width: 62ch; margin-bottom: 0; font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: inherit; }
.page-hero.has-art { min-height: 0; display: block; }
.page-hero-art { display: none; }
.land-night .page-hero, .land-night .auth-page .page-hero { --band: var(--dusk); }
@media (max-width: 720px) {
  .page-hero .wrap:has(> .sign) { grid-template-columns: 1fr; }
  .page-hero .wrap > .sign { grid-row: auto; margin-bottom: 0.75rem; }
  .page-hero .wrap:has(> .sign) > :not(.sign) { grid-column: 1; }
}
/* the band takes the page's land: the body carries land-<name> (app/lib/router.php PAGE_LANDS) */
.land-woodland { --band: var(--woodland); --edge-png: url("../assets/edges/woodland.png"); --edge-webp: url("../assets/edges/woodland.webp"); }
.land-farmland { --band: var(--farmland); --edge-png: url("../assets/edges/farmland.png"); --edge-webp: url("../assets/edges/farmland.webp"); }
.land-hills { --band: var(--hills); --edge-png: url("../assets/edges/hill_country.png"); --edge-webp: url("../assets/edges/hill_country.webp"); }
.land-shore { --band: var(--shore); --edge-png: url("../assets/edges/shoreland.png"); --edge-webp: url("../assets/edges/shoreland.webp"); }
.land-dry { --band: var(--dry); --edge-png: url("../assets/edges/dry_lands.png"); --edge-webp: url("../assets/edges/dry_lands.webp"); }
.land-night { --band: var(--dusk); --edge-png: none; --edge-webp: none; }
.land-night .page-hero::before { display: none; }
.land-farmland .page-hero, .land-farmland .cx-hero { color: var(--ink); }
.land-farmland .page-hero a:not(.btn) { color: var(--ink); }

/* ---------- header ---------- */
.site-header { background: rgba(18, 21, 47, 0.94); border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.header-overlay .site-header { background: linear-gradient(180deg, rgba(18, 21, 47, 0.85), rgba(18, 21, 47, 0)); }
.header-overlay .site-header.is-scrolled, .header-overlay.menu-open .site-header { background: rgba(18, 21, 47, 0.96); backdrop-filter: none; -webkit-backdrop-filter: none; }
.site-nav a:not(.btn), .nav-drop-toggle { font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--cream); border-radius: 0; background: none; border-bottom: 2px solid transparent; }
.site-nav a:not(.btn):hover { background: none; color: var(--cream); border-color: var(--gold); }
.site-nav a[aria-current="page"]:not(.btn) { color: var(--gold); background: none; box-shadow: none; border-color: var(--gold); }
.account-link { font-family: var(--font-head); color: var(--cream); }
.account-link:hover, .account-link[aria-current] { background: none; color: var(--gold); }
.account-avatar { background: var(--gold); }
.btn-wish .wish-star { color: var(--ink); }
.btn-wish.is-on { --face: var(--teal); --edge: #0F4A4E; --ink-on: #fff; box-shadow: 0 4px 0 var(--edge); }
.btn-wish.is-on .wish-star { color: #fff; }
@media (max-width: 1020px) { .js .site-nav { background: rgba(18, 21, 47, 0.98); } .js .site-nav a:not(.btn) { border-bottom: 0; } }

/* the Trainer Card: who is logged in, and whether the game is on their wishlist */
.trainer-card { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 12px 14px 14px; margin-bottom: 6px;
  border-radius: 12px; background: linear-gradient(135deg, #2A3070, var(--dusk)); box-shadow: var(--rim); min-width: 240px; }
.trainer-card .account-avatar { grid-row: span 2; width: 42px; height: 42px; font-size: 1.2rem; }
.trainer-card__title { margin: 0; font: 800 0.72rem/1 var(--font-head); color: var(--gold); }
.trainer-card__name { margin: 0; font: 800 1.15rem/1.1 var(--font-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trainer-card__wish { grid-column: 1 / -1; margin: 6px 0 0; font-size: 0.9rem; color: var(--muted); }
.trainer-card__wish.is-on { color: var(--tech); }

/* ---------- the footer ---------- */
.site-footer { background: var(--dusk-deep); border-top: 1px solid var(--line); }
.signup-band .signup-inner { background: var(--panel); border-radius: 14px; box-shadow: var(--rim), 0 10px 26px rgba(0, 0, 0, 0.22); }

/* ---------- inner content in game style ---------- */
.prose blockquote { border: 0; padding: 1.1rem 1.5rem; border-radius: 14px; background: var(--panel); box-shadow: var(--rim); color: var(--cream); }
.section-head .display { font-size: clamp(1.9rem, 4vw, 3rem); }
.news-card { background: var(--panel); border-radius: 14px; box-shadow: var(--rim); }
.news-tag { border-radius: 6px; background: var(--teal); color: #fff; }
.type { border-radius: 6px; font-family: var(--font-head); font-weight: 800; padding: 3px 10px 1px; }
.chip { border-radius: 8px; }
input, select, textarea { font-family: var(--font-body); }
.field input, .field select, .field textarea, .dex-search input, .cx-search input {
  border-radius: 10px; border: 2px solid rgba(255, 246, 227, 0.3); background: rgba(0, 0, 0, 0.25); color: var(--cream);
}
.auth-card, .account-card { background: var(--panel); box-shadow: var(--rim), 0 10px 26px rgba(0, 0, 0, 0.22); border-radius: 14px; }

/* ---------- the Spiritdex: dense lists styled as in-game menus ---------- */
.dex-tabs { background: var(--dusk-deep); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 2px solid rgba(255, 246, 227, 0.12); }
.dex-tabs a { border-radius: 8px; font-family: var(--font-head); color: var(--cream); }
.dex-tabs a[aria-current] { color: var(--ink); background: var(--gold); box-shadow: 0 3px 0 #B7741A; }
.dex-controls, .cx-controls .wrap > .cx-row { border-radius: 12px; }
.dex-controls { background: var(--panel); box-shadow: var(--rim); backdrop-filter: none; -webkit-backdrop-filter: none; }
.cx-controls { background: linear-gradient(var(--bg) 72%, rgba(18, 21, 47, 0)); }
.dex-table-wrap { border-radius: 12px; background: var(--panel); box-shadow: var(--rim); }
.dex-table thead th { background: #232A63; color: var(--cream); font: 800 0.85rem/1.2 var(--font-head); letter-spacing: 0; text-transform: none; }
.dex-table tbody tr:nth-child(even) { background: rgba(255, 246, 227, 0.03); }
.dex-table tbody tr:hover, .dex-table tbody tr:focus-within { background: rgba(245, 184, 61, 0.12); box-shadow: inset 4px 0 0 var(--gold); }
.dex-table th, .dex-table td { border-bottom-color: rgba(255, 246, 227, 0.08); padding-block: 8px; }
.dex-table a:hover { color: var(--gold); }
.cx-card-in { border-radius: 12px; }

/* account pages stand in the night: a dusk band behind the card's top, closed by the night ridge */
.land-night .auth-page { position: relative; isolation: isolate; }
.land-night .auth-page::before { content: ""; position: absolute; inset: 0 0 auto; height: 240px; background: var(--dusk); z-index: -2; }
.land-night .auth-page::after {
  content: ""; position: absolute; left: 0; right: 0; top: 199px; height: 42px; background: var(--dusk-deep); z-index: -1;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 340 42'><path d='M0 42V22l40 4 14-10 36 6 50-4 20 8 44-6 30 4 26-9 40 7 40-3V42z'/></svg>") repeat-x bottom / 340px 42px;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 340 42'><path d='M0 42V22l40 4 14-10 36 6 50-4 20 8 44-6 30 4 26-9 40 7 40-3V42z'/></svg>") repeat-x bottom / 340px 42px;
}
.auth-card .sign, .account-head .sign { margin-top: -0.5rem; }

.post-hero .back-link { color: var(--cream); font-weight: 700; margin-bottom: 0.4rem; }
.post-hero .post-meta { margin: 0; opacity: 0.9; }
.post-body { padding-top: clamp(28px, 4vw, 48px); }

/* the World page's land jump links: one slab per land, in its colour */
.land-tiles .quick-tile { border-radius: 12px; background: var(--tile-band, var(--panel)); color: var(--cream); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35); }
.land-tiles .quick-tile::before { display: none; }
.land-tiles .quick-tile-sub { color: rgba(255, 246, 227, 0.85); }
.land-tiles .land-kurinji { --tile-band: var(--hills); } .land-tiles .land-mullai { --tile-band: var(--woodland); } .land-tiles .land-neithal { --tile-band: var(--shore); } .land-tiles .land-paalai { --tile-band: var(--dry); }
.land-tiles .land-marutham { --tile-band: var(--farmland); color: var(--ink); }
.land-tiles .land-marutham .quick-tile-sub { color: #45311A; }

/* review fixes: focus, shared panels, the spirit entry, phones */
.band-farmland :focus-visible, .land-farmland .page-hero :focus-visible { outline-color: var(--ink); }
.band-farmland .panel :focus-visible { outline-color: var(--tech); }
.gallery a:focus-visible { outline-offset: -4px; }
.cx-land-tab:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--tech); }
.link-arrow::after { content: none; }
.field-inline input { border-radius: 10px; }
.cx-card-in { clip-path: none; box-shadow: var(--rim); }
.cx-card-in::before { display: none; }
.cx-page .cx-entry, .cx-sheet { clip-path: none; border-radius: 14px; box-shadow: var(--rim); }
.cx-stage { align-self: start; }
.land-tiles .quick-tile-art { display: none; }
.land-tiles .quick-tile { min-height: 0; padding: 0.9rem 1rem 0.8rem; gap: 2px; }

/* the badge case: the Arena building of the Emblem under the pointer or focus (js/home.js) */
.case__preview { display: grid; grid-template-columns: 160px 1fr; gap: 1rem; align-items: center; margin: 1rem 0 0; }
.case__preview img { width: 160px; height: auto; aspect-ratio: 480 / 340; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35)); }
.case__preview .case__caption { margin: 0; }
.case__preview img[hidden] { display: none; }
.case__preview:has(img[hidden]) { grid-template-columns: 1fr; }
@media (max-width: 520px) { .case__preview { grid-template-columns: 110px 1fr; } .case__preview img { width: 110px; } }

/* the codex entry: the spirit stands on its own land's terrain */
.cx-entry .cx-stage::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 70px; z-index: 0; pointer-events: none; opacity: 0.9;
  background: var(--sight-png, none) repeat-x left bottom / auto 70px;
  background-image: image-set(var(--sight-webp) type("image/webp"), var(--sight-png) type("image/png"));
  image-rendering: pixelated;
}
.cx-entry.land-kurinji { --sight-png: url("../assets/edges/hill_country.png"); --sight-webp: url("../assets/edges/hill_country.webp"); }
.cx-entry.land-mullai { --sight-png: url("../assets/edges/woodland.png"); --sight-webp: url("../assets/edges/woodland.webp"); }
.cx-entry.land-marutham { --sight-png: url("../assets/edges/farmland.png"); --sight-webp: url("../assets/edges/farmland.webp"); }
.cx-entry.land-neithal { --sight-png: url("../assets/edges/shoreland.png"); --sight-webp: url("../assets/edges/shoreland.webp"); }
.cx-entry.land-paalai { --sight-png: url("../assets/edges/dry_lands.png"); --sight-webp: url("../assets/edges/dry_lands.webp"); }

.cx-eggs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.egg-group { display: inline-block; padding: 3px 10px 1px; border-radius: 8px; background: rgba(255, 246, 227, 0.1); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--cream); font: 800 0.82rem/1.5 var(--font-head); text-decoration: none; }
.egg-group:hover { color: var(--gold); }

/* ---------- v0.6 pages: the Nursery, the berry gardens, Team Blackout, the nurses ---------- */
/* a list of rules read like an in-game menu: the key on the left, what it means on the right */
.game-menu { display: grid; margin: 1.5rem 0; border-radius: 12px; background: var(--panel); box-shadow: var(--rim); overflow: hidden; }
.game-menu li { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: 0.85rem 1.25rem; border-bottom: 1px solid rgba(255, 246, 227, 0.08); }
.game-menu li:last-child { border-bottom: 0; }
.game-menu li:nth-child(even) { background: rgba(255, 246, 227, 0.03); }
.game-menu__key { font: 800 1rem/1.3 var(--font-head); color: var(--gold); }
@media (max-width: 560px) { .game-menu li { grid-template-columns: 1fr; gap: 0.2rem; } }
.talk + .talk { margin-top: 1.5rem; }
.talk + p { margin-top: 1.25rem; }
.two-col .talk { margin-top: 1.5rem; }
.nursery-art { display: grid; gap: 1rem; justify-items: center; }
.nursery-building { margin: 0; width: 100%; }
.nursery-building img { width: 100%; height: auto; image-rendering: pixelated; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.5)); }
.nursery-art .daynight { margin: 0; }
.nursery-room { margin-top: 1.5rem; }
.nursery-room img { image-rendering: pixelated; border-radius: 12px; }
.egg-strip { margin-top: 1.5rem; }
.egg-steps { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem 1.6rem; margin: 0.75rem 0 1rem; }
.egg-steps img { width: auto; height: 88px; image-rendering: pixelated; }
.egg-table .egg-row { display: flex; flex-wrap: wrap; gap: 2px; }
.egg-table .egg-row img { width: 48px; height: 48px; }
.egg-table th[scope="row"] { font-family: var(--font-head); }
/* the berry gardens */
.stage-panel h3 { margin-bottom: 0.75rem; }
.stage-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; margin: 0 0 1rem; text-align: center; }
.stage-row img { width: 100%; max-width: 96px; height: auto; margin: 0 auto 0.4rem; image-rendering: pixelated; }
.stage-row span { font: 700 0.85rem/1.2 var(--font-head); }
.berry-table .stats-name img { width: 40px; height: 40px; }
.berry-table .berry-ripe { width: 56px; height: 56px; image-rendering: pixelated; }
@media (max-width: 700px) { .berry-table .dex-col-desc { display: table-cell; min-width: 180px; } }
/* Team Blackout */
.blackout-emblem { display: grid; justify-items: center; gap: 1rem; margin: 0; text-align: center; }
.blackout-emblem__art { display: flex; align-items: center; gap: 2rem; }
.blackout-emblem__art img:first-child { width: 112px; height: auto; }
.blackout-emblem__art img:last-child { width: 128px; height: auto; }
.blackout-emblem figcaption { color: var(--muted); max-width: 32ch; }
.motto-line .talk__box p { font-family: var(--font-head); font-weight: 700; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; }
.trio__one h3 { font-size: 1.953rem; margin-bottom: 0.3rem; }
.trio__one > p { min-height: 4.5em; }
.trio .talk__face { width: clamp(96px, 9vw, 132px); }
.trio .talk__box p { font-size: 1.05rem; }
@media (max-width: 960px) { .trio { grid-template-columns: 1fr; } .trio__one > p { min-height: 0; } }
.grunt-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: center; gap: 1rem; }
.grunt-row img { width: 160px; height: auto; image-rendering: pixelated; }
.grunt-row .grunt-scooter { width: 192px; }
.land-night .page-hero .sign__sub { color: #F7E2BF; }
/* Spirit Centers: each sister's town, and how she heals */
.nurse small { color: var(--muted); font-size: 0.85rem; line-height: 1.2; }
.ritual-title { font-size: 1.953rem; margin: 3rem 0 0.5rem; }
.ritual { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; margin-top: 1.5rem; }
.ritual .talk__face { width: clamp(90px, 8vw, 120px); }
.ritual .talk__box p { font-size: 1.05rem; }
.ritual .talk + .talk { margin-top: 0; }
@media (max-width: 860px) { .ritual { grid-template-columns: 1fr; } }

/* ================================================================== home */

.home-hero { position: relative; isolation: isolate; background: linear-gradient(180deg, var(--dusk), #241F4A); }
.home-hero__art { position: relative; aspect-ratio: 2 / 1; max-height: 86vh; width: 100%; overflow: hidden; }
.home-hero__art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
.home-hero__crest { position: absolute; left: 50%; top: clamp(4.6rem, 7vw, 6.5rem); transform: translateX(-50%); width: clamp(190px, 22vw, 360px); z-index: 2; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.4)); }
.home-hero__crest img { width: 100%; height: auto; }
.home-hero .wrap { padding-block: 1.75rem 6.25rem; }
.home-hero__copy { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2.5rem; }
.home-hero__line { font: 700 1.5625rem/1.25 var(--font-head); max-width: 26ch; margin: 0; }
.home-acts { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.home-hero__note { font-size: 0.8rem; opacity: 0.85; margin: 0; }
.home-hero .wish-count { margin: 0; flex-basis: 100%; }
@media (max-width: 700px) {
  .home-hero__art { aspect-ratio: 4 / 3; }
  .home-hero__crest { width: 46vw; top: 4.6rem; }
  .home-hero__line { font-size: 1.25rem; }
}

/* the village notice board: the latest news, pinned */
.board { position: relative; margin: -1rem 0 5rem; padding: 2.2rem 2rem 1.8rem; border-radius: 14px;
  background: linear-gradient(180deg, #8A5426, #6B3D19); box-shadow: inset 0 0 0 3px var(--wood-dark), inset 0 4px 0 rgba(255, 255, 255, 0.15), 0 16px 34px rgba(0, 0, 0, 0.3); }
.board__title { font-size: 1.5625rem; color: #FFF1D6; text-shadow: 0 2px 0 var(--wood-dark); margin-bottom: 1.4rem; }
.notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.note { display: block; height: 100%; background: #F4E7C7; color: var(--ink); padding: 1.1rem 1.1rem 1.3rem; border-radius: 4px; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35); text-decoration: none; position: relative; }
.note:hover { color: var(--ink); background: #FFF3D8; }
.notes li:nth-child(1) .note { transform: rotate(-1.6deg); } .notes li:nth-child(2) .note { transform: rotate(1.2deg); } .notes li:nth-child(3) .note { transform: rotate(-0.6deg); }
.note::before { content: ""; position: absolute; top: -7px; left: 50%; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFD27A, #C27A1A); transform: translateX(-50%); }
.note time { font: 700 0.8rem/1 var(--font-head); color: #5C4A33; }
.note h3 { font-size: 1.25rem; margin: 0.4rem 0; }
.note p { font-size: 0.9rem; margin: 0; }
.board__all { display: inline-block; margin-top: 1.4rem; font: 800 1rem/1 var(--font-head); color: #FFF1D6; }
.board__all:hover { color: #fff; }
@media (max-width: 860px) { .notes { grid-template-columns: 1fr; } .note { transform: none !important; } .board { padding: 1.8rem 1.1rem 1.4rem; } }

/* woodland: Grandma and the three starters */
.starters { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: center; margin-top: 3rem; border: 0; padding: 0; }
.pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick label { display: grid; justify-items: center; cursor: pointer; padding-bottom: 0.8rem; position: relative; isolation: isolate; }
.pick img { width: 100%; max-width: 190px; transition: transform 0.2s; position: relative; z-index: 1; }
.pick label::before { content: ""; position: absolute; left: 11%; right: 11%; top: calc(100% - 3.6rem); height: 26px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, #8AC46A, #4F8A3C 60%, #2F5F2A); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.25), 0 6px 10px rgba(0, 0, 0, 0.25); z-index: 0; }
.pick span { font: 800 1.25rem/1 var(--font-head); margin-top: 0.5rem; }
.pick input:checked + label img { transform: translateY(-10px); }
.pick input:checked + label span { color: var(--gold); }
.pick input:focus-visible + label { outline: 3px solid var(--tech); outline-offset: 2px; border-radius: 10px; }
.starter-card { display: none; }
.starter-card h3 { font-size: 1.953rem; margin-bottom: 0.25rem; }
.starter-card .types { margin: 0.5rem 0 1rem; }
.starter-card .starter-lv { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.9rem; }
.starter-stats { display: grid; grid-template-columns: auto 1fr auto; gap: 0.35rem 0.8rem; align-items: center; font-size: 0.85rem; margin: 1rem 0 0; }
.starter-stats dt, .starter-stats dd { margin: 0; }
.starter-stats dd { display: contents; }
.starter-stats i { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); position: relative; }
.starter-stats i::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 1%); border-radius: inherit; background: var(--tech); }
.starter-stats b { font-variant-numeric: tabular-nums; text-align: right; }
.starter-card .link-arrow { margin-top: 1rem; color: var(--gold); }
/* without :has() (or without CSS picking), every card shows */
.starter-card:first-child { display: block; }
@supports selector(:has(*)) {
  .starter-card:first-child { display: none; }
  .starters:has(#s-0:checked) .starter-card:nth-child(1), .starters:has(#s-1:checked) .starter-card:nth-child(2), .starters:has(#s-2:checked) .starter-card:nth-child(3) { display: block; }
}
@supports not selector(:has(*)) { .starter-card { display: block; margin-bottom: 1rem; } }
@media (max-width: 860px) { .starters { grid-template-columns: 1fr; gap: 1.5rem; } }

/* farmland: spirits in the paddy */
.farm-grid { display: grid; grid-template-columns: 1fr 380px; gap: 3rem; align-items: start; }
.farm-grid > *, .mapzone > *, .case-zone > *, .night-grid > *, .starters > * { min-width: 0; }
.home-h2 { font-size: clamp(1.953rem, 5vw, 3.052rem); margin-bottom: 1rem; }
.today { display: grid; grid-template-columns: 96px 1fr; gap: 1rem; align-items: center; margin: 1rem 0 1.25rem; color: var(--cream); text-decoration: none; }
.today:hover { color: var(--gold); }
.today img { width: 96px; height: 96px; }
.today b { font: 800 1.25rem/1.1 var(--font-head); }
.today small { display: block; color: var(--muted); }
.today .types { margin: 0.35rem 0 0.2rem; }
.home-search { display: flex; gap: 0.5rem; margin: 0; }
.home-search input { flex: 1; min-width: 0; font: 400 1rem/1 var(--font-body); padding: 0.8em 1em; border-radius: 10px; border: 2px solid rgba(255, 246, 227, 0.3); background: rgba(0, 0, 0, 0.25); color: var(--cream); }
.home-search input::placeholder { color: #B9B3C8; }
.panel .home-more { display: inline-block; margin-top: 1rem; color: var(--gold); font-weight: 700; }
.paddy { position: relative; height: 218px; margin-top: 2.5rem; border-radius: 12px; overflow: hidden; background: #3F8A3A;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.12), 0 14px 30px rgba(0, 0, 0, 0.18); }
.paddy { list-style: none; padding: 0; }
.paddy__spot { position: absolute; z-index: 2; width: 104px; }
.paddy__spot a { display: block; position: relative; border-radius: 10px; }
.paddy__spot img { width: 100%; height: auto; image-rendering: pixelated; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.3)); }
.paddy__row { pointer-events: none; }
/* the name plate shows when you find a spirit (hover or focus); it stays in the accessibility tree */
.paddy__name { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); z-index: 4; white-space: nowrap;
  font: 800 0.8rem/1 var(--font-head); color: var(--cream); background: var(--panel); padding: 0.45em 0.7em; border-radius: 8px; box-shadow: var(--rim);
  clip-path: inset(50%); }
.paddy__spot a:hover .paddy__name, .paddy__spot a:focus-visible .paddy__name { clip-path: none; }
.paddy__spot a:focus-visible { outline-color: var(--cream); }
.paddy-hint { margin: 2rem 0 0; font: 700 1rem/1.3 var(--font-head); }
.paddy-hint + .paddy { margin-top: 0.75rem; }
.paddy__row { position: absolute; left: -20px; right: -20px; height: 114px; image-rendering: pixelated;
  background: url("../assets/ui/tallgrass-strip.png") repeat-x 0 0 / 576px 114px;
  background-image: image-set(url("../assets/ui/tallgrass-strip.webp") type("image/webp"), url("../assets/ui/tallgrass-strip.png") type("image/png")); }
.paddy__row--back { top: -60px; z-index: 1; filter: brightness(0.82); background-position: -96px 0; }
.paddy__row--front { top: 96px; z-index: 3; }
@media (max-width: 860px) { .farm-grid { grid-template-columns: 1fr; gap: 1.5rem; } .paddy { height: 200px; } .paddy__spot { width: 84px; } }
@media (max-width: 520px) { .paddy__spot:is(:nth-child(3), :nth-child(5), :nth-child(7), :nth-child(9)) { display: none; } }

/* hill country: the map */
.mapzone { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2.5rem; align-items: center; }
.home-map { position: relative; margin: 0; }
.home-map img { border-radius: 12px; box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35); width: 100%; height: auto; }
.home-map__spots { list-style: none; margin: 0; padding: 0; }
.home-map__spots button { position: absolute; transform: translate(-50%, -50%); font: 800 0.85rem/1 var(--font-head); color: var(--ink); background: var(--cream); border: 0; border-radius: 10px; padding: 0.55em 0.8em 0.45em; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); cursor: pointer; white-space: nowrap; }
.home-map__spots button[aria-pressed="true"] { background: var(--gold); }
.land-info dl { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 1rem 0 1.25rem; }
.land-info dt { font: 800 0.85rem/1.6 var(--font-head); opacity: 0.85; }
.land-info dd { margin: 0; }
.land-info .land-info__panel[hidden] { display: none; }
.land-info h3 { font-size: 1.5625rem; margin: 0 0 0.4rem; }
/* phones: the hotspots become a list of buttons under the map */
@media (max-width: 860px) {
  .mapzone { grid-template-columns: 1fr; }
  .home-map__spots { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
  .home-map__spots button { position: static; transform: none; padding: 0.7em 0.9em 0.6em; }
}
/* without JS every land's notes show, one after another */
.no-js .home-map__spots { display: none; }

/* shoreland: the gallery */
.shore-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.shore-head h2 { max-width: 16ch; margin: 0; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 160px; gap: 12px; list-style: none; margin: 0; padding: 0; }
.gallery figure { margin: 0; position: relative; height: 100%; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); }
.gallery a { display: block; height: 100%; color: var(--cream); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { position: absolute; left: 0.7rem; bottom: 0.7rem; font: 700 0.8rem/1.2 var(--font-head); background: var(--panel); padding: 0.5em 0.75em; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(255, 246, 227, 0.2); max-width: calc(100% - 1.4rem); color: var(--cream); }
.g-big { grid-column: span 2; grid-row: span 2; } .g-wide { grid-column: span 2; } .g-tall { grid-row: span 2; }
@media (max-width: 860px) { .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 130px; grid-auto-flow: dense; } .g-big, .g-wide { grid-column: span 2; } }

/* dry lands: the badge case, eight Emblems that link to their Arenas */
.case-zone { display: grid; grid-template-columns: 1fr 1.4fr; gap: 3rem; align-items: center; }
.case { position: relative; aspect-ratio: 1200 / 520; list-style: none; margin: 0; padding: 0;
  background: url("../assets/ui/badge-case.png") center / contain no-repeat;
  background-image: image-set(url("../assets/ui/badge-case.webp") type("image/webp"), url("../assets/ui/badge-case.png") type("image/png"));
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.35)); }
.case li { position: absolute; width: 13.5%; aspect-ratio: 1; transform: translate(-50%, -50%); }
.case li:nth-child(1) { left: 21.25%; top: 33.85%; } .case li:nth-child(2) { left: 40.33%; top: 33.85%; } .case li:nth-child(3) { left: 59.33%; top: 33.85%; } .case li:nth-child(4) { left: 78.42%; top: 33.85%; }
.case li:nth-child(5) { left: 21.25%; top: 69.23%; } .case li:nth-child(6) { left: 40.33%; top: 69.23%; } .case li:nth-child(7) { left: 59.33%; top: 69.23%; } .case li:nth-child(8) { left: 78.42%; top: 69.23%; }
.slot { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; text-decoration: none; }
.slot img { width: 92%; height: 92%; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5)); transition: transform 0.15s; }
.slot:hover img, .slot:focus-visible img { transform: scale(1.08); }
.case__caption { margin: 1rem 0 0; font: 700 1rem/1.3 var(--font-head); min-height: 1.3em; }
@media (max-width: 860px) { .case-zone { grid-template-columns: 1fr; gap: 1.5rem; } }

/* Grandma answers the starter you pick (CSS only; without :has() she just asks) */
.talk__react { display: none; color: var(--gold); }
@supports selector(:has(*)) {
  #woodland:has(#s-0:checked) .talk__react--0, #woodland:has(#s-1:checked) .talk__react--1, #woodland:has(#s-2:checked) .talk__react--2 { display: block; }
}
.talk__box .talk__react + .talk__react { margin-top: 0; }

/* the map: one spirit who lives in the chosen land */
.resident { display: inline-flex; align-items: center; gap: 0.75rem; margin: 0 0 1.25rem; padding: 0.35rem 1rem 0.35rem 0.35rem; border-radius: 12px;
  background: var(--panel); box-shadow: var(--rim); color: var(--cream); text-decoration: none; font: 700 1rem/1.2 var(--font-head); }
.resident img { width: 64px; height: 64px; }
.resident:hover { color: var(--gold); }
.gallery figcaption.is-step { color: var(--gold); }

/* the newest notice carries its picture; your starter's panel ends with the wishlist */
.note__pic { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; margin-bottom: 0.7rem; box-shadow: 0 0 0 4px #fff, 0 3px 6px rgba(0, 0, 0, 0.3); }
.starter-go { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.starter-go p { margin: 0; font: 700 1rem/1.3 var(--font-head); }
.talk--farewell { margin-top: 2.5rem; }
.talk--farewell .talk__face { width: clamp(96px, 10vw, 140px); }

/* the night: community and the email list */
.home-night { padding-block: 6rem 4rem; }
.night-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: start; }
.night-grid h2 { font-size: 2.441rem; margin-bottom: 1.5rem; }
.follow h3 { font-size: 1.5625rem; }
.follow .newsletter-form { margin-top: 1rem; }
.follow .field-inline { display: grid; gap: 0.75rem; }
@media (max-width: 860px) { .night-grid { grid-template-columns: 1fr; } }

/* the walker: the player's sprite walks down the road as you scroll (js/home.js) */
.walker { position: fixed; left: max(10px, calc((100vw - 1240px) / 2 - 70px)); top: 50vh; width: 38px; height: 52px; z-index: 30; pointer-events: none;
  background: url("../assets/game/player.png") 0 0 / 152px 208px no-repeat; background-position: -114px 0; image-rendering: pixelated; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.4)); }
.no-js .walker { display: none; }
@media (max-width: 1100px) { .walker { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .pick img, .slot img, .btn { transition: none; }
}

/* phones: tighter land bands, a single-column gallery (after the home rules so it wins) */
@media (max-width: 520px) {
  .land-band { padding-block: 3rem 4rem; }
  .home-hero .wrap { padding-bottom: 4rem; }
  .home-night { padding-top: 3rem; }
  .home-hero__crest { width: 38vw; top: 4.4rem; }
  .board { margin-bottom: 3rem; }
  .gallery { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .gallery li { grid-column: auto; grid-row: auto; }
  .gallery figure { height: auto; overflow: visible; box-shadow: none; }
  .gallery a { height: auto; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); }
  .gallery img { height: auto; aspect-ratio: 16 / 9; }
  .gallery figcaption { position: static; margin-top: 0.5rem; max-width: none; }
}

/* ------------------------------------------------------------------ reveal on scroll */

/* No decorative fade-ups: content sits still and is always visible. (.reveal stays on some markup, inert.) */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  html { scroll-behavior: auto; }
  .hero-art img { transform: none; }
  .ticker-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  .ticker-item:nth-child(n+6) { display: none; }
  .js .reveal { opacity: 1; transform: none; }
  .cx-trio img, .cx-stage img { animation: none; }
  .js .tech-ring:not(.is-in) .ring-a, .js .tech-ring:not(.is-in) .ring-c { stroke-dashoffset: 0; }
}

@media print {
  .site-header, .signup-band, .fireflies, .ticker, .scroll-cue { display: none; }
  body { background: #fff; color: #000; }
}
