/* Spiritlands Online (Spirits of the Five Lands): official site.
   Modern dark UI: night-sky base, glass panels, sunset gradients from the key art, and the game's
   near-future tech layer as a 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 {
  --bg: #0D0A15;
  --bg-2: #141022;
  --surface: rgba(255, 244, 222, 0.045);
  --surface-2: rgba(255, 244, 222, 0.08);
  --line: rgba(255, 236, 200, 0.12);
  --line-strong: rgba(255, 236, 200, 0.24);
  --text: #F6EBD2;
  --muted: #BDB1A2;
  --gold: #F2CC6B;
  --gold-deep: #D6A331;
  --ember: #F07A63;
  --kumkum: #D8442F;
  --violet: #8C7BD6;
  --sunset: linear-gradient(100deg, #FFE3A3 0%, #F2CC6B 28%, #F07A63 62%, #C77BD6 100%);
  --sunset-btn: linear-gradient(100deg, #F7D57E 0%, #F2A35E 55%, #EE7C66 100%);
  /* The tech glow: the Spirit Device's light ring, the Spirit Centers' LED seams, the lighthouse coils. */
  --tech: #7FD4FF;
  --tech-deep: #38B6F0;
  --tech-soft: rgba(127, 212, 255, 0.14);
  --tech-line: rgba(127, 212, 255, 0.45);
  --tech-glow: 0 0 14px rgba(127, 212, 255, 0.55), 0 0 34px rgba(56, 182, 240, 0.25);

  --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: 18px;
  --radius-lg: 28px;
  --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:
    radial-gradient(1200px 600px at 85% -10%, rgba(140, 123, 214, 0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(240, 122, 99, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  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(--gold); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(242, 204, 107, 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 */

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 14px;
}
:lang(ta) .eyebrow { letter-spacing: 0.04em; font-size: 0.9rem; }
.eyebrow::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: var(--tech); box-shadow: var(--tech-glow); }
.center .eyebrow::after { content: ""; width: 28px; height: 2px; border-radius: 2px; background: var(--tech); box-shadow: var(--tech-glow); }
.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: 999px;
  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(240, 122, 99, 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, 227, 163, 0.4), 0 12px 40px -10px rgba(240, 122, 99, 0.8); }
.btn-glass {
  background: rgba(255, 244, 222, 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(255, 244, 222, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 227, 163, 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(13, 10, 21, 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(13, 10, 21, 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: 999px; 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(13, 10, 21, 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; }
}

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative; min-height: 100svh; min-height: 100vh; display: grid; align-items: end;
  padding: calc(var(--header-h) + 40px) 0 clamp(72px, 12vh, 140px); overflow: hidden; isolation: isolate;
}
@supports (min-height: 100svh) { .hero { min-height: 100svh; } }
.hero-art { position: absolute; inset: 0; z-index: -2; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; transform: scale(1.06); animation: heroZoom 26s var(--ease) both; will-change: transform; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(13, 10, 21, 0.55) 0%, rgba(13, 10, 21, 0) 22%, rgba(13, 10, 21, 0) 42%, rgba(13, 10, 21, 0.75) 72%, var(--bg) 100%),
    linear-gradient(90deg, rgba(13, 10, 21, 0.7) 0%, rgba(13, 10, 21, 0.15) 55%, rgba(13, 10, 21, 0) 100%);
}
@keyframes heroZoom { from { transform: scale(1.14); } to { transform: scale(1.04); } }
.fireflies { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero-inner { position: relative; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px 7px 12px; border-radius: 999px;
  background: rgba(13, 10, 21, 0.5); box-shadow: inset 0 0 0 1px var(--line-strong); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-weight: 700; font-size: 0.92rem; margin-bottom: 22px;
}
.hero-kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tech); box-shadow: 0 0 0 0 rgba(127, 212, 255, 0.6); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(127, 212, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(127, 212, 255, 0); } }

.wordmark { margin: 0 0 18px; display: grid; gap: 4px; }
.wm-hero { justify-self: start; }
.wm-hero .wm-main { font-size: clamp(2.7rem, 11.4vw, 8.2rem); line-height: 0.9; filter: drop-shadow(0 6px 30px rgba(240, 122, 99, 0.35)); }
.wm-hero .wm-sub { font-size: clamp(1.05rem, 3.3vw, 2.35rem); margin-top: 0.18em; letter-spacing: 0.72em; margin-right: -0.72em; }
.wordmark-rule {
  display: block; width: min(320px, 62%); height: 3px; margin: 14px 0 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--tech), rgba(127, 212, 255, 0)); box-shadow: var(--tech-glow);
}
.wordmark-sub { font: 600 clamp(1rem, 1.8vw, 1.25rem)/1.3 var(--font-body); letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); margin-top: 6px; }
:lang(ta) .wordmark-sub { letter-spacing: 0.06em; }
.hero-tagline { max-width: 560px; font-size: clamp(1.1rem, 1.7vw, 1.35rem); color: #EFE4CC; margin-bottom: 28px; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6); }
.hero-facts { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-weight: 700; font-size: 0.95rem; }
.hero-facts li { display: inline-flex; align-items: center; gap: 10px; }
.hero-facts li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); flex: none; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; translate: -50% 0; width: 28px; height: 44px; border-radius: 14px;
  box-shadow: inset 0 0 0 2px rgba(246, 235, 210, 0.5);
}
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 9px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--text); animation: cue 1.8s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(-3px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }
@media (max-width: 700px) { .scroll-cue { display: none; } }

/* The three partners stand on the road in the key art, like a game title screen. */
.hero-spirits {
  position: absolute; right: clamp(16px, 6vw, 110px); bottom: clamp(56px, 11vh, 120px);
  display: flex; align-items: end; gap: clamp(4px, 1vw, 16px);
}
.hero-spirit { --size: clamp(110px, 11vw, 170px); position: relative; }
.hero-spirit:nth-child(2) { --size: clamp(130px, 13vw, 200px); margin-bottom: 18px; }
.hero-spirit a { display: grid; justify-items: center; text-decoration: none; color: var(--text); border-radius: 50%; }
.hero-spirit a::before {
  content: ""; position: absolute; left: 50%; bottom: 2px; width: 62%; height: 14%; translate: -50% 0; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent); z-index: -1;
}
.hero-spirit a::after {
  content: ""; position: absolute; inset: 12% 10% 18%; border-radius: 50%; z-index: -2;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--type) 55%, transparent), transparent);
  opacity: 0.55; transition: opacity 0.3s;
}
.hero-spirit { animation: spiritIn 0.7s var(--ease) both; animation-delay: calc(0.5s + var(--i) * 0.15s); }
.hero-spirit img {
  width: var(--size); height: auto; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.25));
  animation: spiritBob 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -1.1s);
}
.hero-spirit-name {
  position: absolute; bottom: -14px; padding: 3px 12px; border-radius: 999px; white-space: nowrap;
  font: 700 0.85rem/1.4 var(--font-head); background: rgba(13, 10, 21, 0.75); box-shadow: inset 0 0 0 1px var(--type);
  opacity: 0; translate: 0 6px; transition: opacity 0.2s, translate 0.25s var(--ease);
}
.hero-spirit a:hover img, .hero-spirit a:focus-visible img { animation: spiritHop 0.5s var(--ease); }
.hero-spirit a:hover::after, .hero-spirit a:focus-visible::after { opacity: 1; }
.hero-spirit a:hover .hero-spirit-name, .hero-spirit a:focus-visible .hero-spirit-name { opacity: 1; translate: 0 0; }
@keyframes spiritIn { from { opacity: 0; transform: translateY(24px) scale(0.9); } to { opacity: 1; transform: none; } }
@keyframes spiritBob { 50% { transform: translateY(-7px); } }
@keyframes spiritHop { 0% { transform: translateY(0); } 40% { transform: translateY(-22px) scale(1.06); } 70% { transform: translateY(0) scale(1.02, 0.96); } 100% { transform: none; } }
@media (max-width: 1100px) { .hero-spirits { right: 12px; opacity: 0.9; } .hero-spirit { --size: clamp(90px, 10vw, 120px); } .hero-spirit:nth-child(2) { --size: clamp(100px, 11vw, 140px); } }
@media (max-width: 860px) { .hero-spirits { display: none; } }

/* ------------------------------------------------------------------ ticker */

.ticker { overflow: hidden; border-block: 1px solid var(--line); background: rgba(255, 244, 222, 0.025); padding: 16px 0; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: flex; width: max-content; gap: 56px; animation: ticker 48s linear infinite; }
.ticker-item { display: inline-flex; align-items: baseline; gap: 12px; white-space: nowrap; font-family: var(--font-head); font-size: 1.35rem; }
.ticker-item b { color: var(--land); font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.ticker-item i { font-style: normal; color: var(--muted); font-family: var(--font-body); font-size: 1rem; }
.ticker-item::after { content: "✦"; color: var(--line-strong); margin-left: 44px; font-size: 0.9rem; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ------------------------------------------------------------------ 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: 999px;
  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(13, 10, 21, 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: 999px;
  background: rgba(13, 10, 21, 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(255, 244, 222, 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; }
@keyframes panelIn { from { opacity: 0; 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.14em; text-transform: uppercase; 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(13, 10, 21, 0.45); box-shadow: inset 0 0 0 1px var(--line); }
.land-facts dt { font-size: 0.78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
: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(13, 10, 21, 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(255, 244, 222, 0.05), rgba(255, 244, 222, 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 { opacity: 0; 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(255, 244, 222, 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(242, 204, 107, 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: 999px; 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.14em; text-transform: uppercase; 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(13, 10, 21, 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(255, 236, 200, 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(242, 204, 107, 0.1); box-shadow: inset 0 0 0 1px rgba(242, 204, 107, 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: 999px; 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; }

/* ------------------------------------------------------------------ bento */

.bento { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .bento { grid-template-columns: repeat(3, 1fr); } .tile-wide { grid-column: span 2; } }
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 260px; overflow: hidden;
  padding: 28px; border-radius: var(--radius-lg); background: linear-gradient(160deg, rgba(255, 244, 222, 0.07), rgba(255, 244, 222, 0.02)); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
}
.tile:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--line-strong), 0 30px 60px -30px rgba(0, 0, 0, 0.9); }
.tile h3 { font-size: 1.4rem; margin-bottom: 6px; }
.tile p { color: #DCD0BA; margin: 0; }
.tile-body { position: relative; z-index: 1; }
.tile-media { min-height: 340px; }
.tile-media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; transition: transform 0.8s var(--ease); }
.tile-media:hover > img { transform: scale(1.04); }
.tile-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13, 10, 21, 0) 30%, rgba(13, 10, 21, 0.92) 85%); }
.tile-big { font: 800 clamp(4rem, 8vw, 6.5rem)/0.9 var(--font-head); margin: 0 0 auto; background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tile-center { background: radial-gradient(120% 90% at 50% 0%, rgba(127, 212, 255, 0.16), transparent 60%), linear-gradient(160deg, rgba(255, 244, 222, 0.07), rgba(255, 244, 222, 0.02)); }
.tile-building { width: 78%; margin: 0 auto auto; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.45)); transition: transform 0.5s var(--ease); }
.tile-center:hover .tile-building { transform: translateY(-4px) scale(1.02); }
.tile-link { color: inherit; text-decoration: none; }
.tile-link::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: var(--radius-lg); }
.tile-link:hover { color: inherit; }
.tile-accent { background: radial-gradient(120% 100% at 100% 0%, rgba(240, 122, 99, 0.25), transparent 60%), linear-gradient(160deg, rgba(255, 244, 222, 0.07), rgba(255, 244, 222, 0.02)); }

/* ------------------------------------------------------------------ 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: 999px; background: rgba(242, 204, 107, 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(240, 122, 99, 0.18), transparent 70%), radial-gradient(700px 360px at 90% 10%, rgba(140, 123, 214, 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(13, 10, 21, 0.3), var(--bg) 96%), linear-gradient(90deg, rgba(13, 10, 21, 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(255, 244, 222, 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; font-style: italic; text-transform: uppercase; 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: 999px; 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(255, 244, 222, 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(240, 122, 99, 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.14em; text-transform: uppercase; }
: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(13, 10, 21, 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.14em; text-transform: uppercase; 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; text-transform: uppercase; letter-spacing: 0.04em; }
.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(20, 16, 34, 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)); animation: float 5s ease-in-out infinite; }
.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.14em; font-size: 0.8rem; text-transform: uppercase; }
: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); animation: cxGrow 0.8s var(--ease) both; }
@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.1em; text-transform: uppercase; }
: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(242, 204, 107, 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.12em; text-transform: uppercase; 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); text-transform: uppercase; 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(255, 244, 222, 0.07); }
.cx-chart tbody tr:hover > th { box-shadow: inset 0 0 0 999px rgba(255, 244, 222, 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(255, 244, 222, 0.07); }
.cx-chart tbody td:hover { box-shadow: inset 0 0 0 999px rgba(255, 244, 222, 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(13, 10, 21, 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(240, 122, 99, 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: 999px; 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: #0D0A15; 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(240, 122, 99, 0.28), transparent 70%),
    radial-gradient(600px 300px at 100% 100%, rgba(140, 123, 214, 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(8, 6, 13, 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.24em; text-transform: uppercase; 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.14em; text-transform: uppercase; 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: 999px; 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(255, 244, 222, 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(255, 244, 222, 0.14); box-shadow: inset 0 0 0 2px rgba(255, 244, 222, 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(13, 10, 21, 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(240, 122, 99, 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.1em; text-transform: uppercase; 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(13, 10, 21, 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.04em; text-transform: uppercase;
  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(140, 123, 214, 0.25), transparent 70%), rgba(13, 10, 21, 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(255, 244, 222, 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.16em; text-transform: uppercase; 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: 999px; background: rgba(13, 10, 21, 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: 999px; 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(255, 244, 222, 0.06), rgba(255, 244, 222, 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(8, 6, 13, 0.45);
}
[data-time="night"] .arena-art { background: radial-gradient(70% 60% at 50% 62%, rgba(56, 182, 240, 0.2), transparent 75%), rgba(4, 4, 12, 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: 999px; font: 700 0.8rem/1.4 var(--font-body); letter-spacing: 0.12em; text-transform: uppercase;
  background: rgba(13, 10, 21, 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.08em; text-transform: uppercase; }
.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(255, 244, 222, 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.14em; text-transform: uppercase; 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: 999px; 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(240, 122, 99, 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(13, 10, 21, 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(8, 6, 13, 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(4, 4, 12, 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(8, 6, 13, 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(255, 244, 222, 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: 999px; 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: 999px; 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(20, 16, 34, 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(240, 122, 99, 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(240, 122, 99, 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; text-transform: uppercase; letter-spacing: 0.14em; }
.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(255, 244, 222, 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: 999px; font-weight: 700; background: rgba(255, 244, 222, 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: 999px; background: rgba(255, 244, 222, 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%; }

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

.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@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; }
}
