/* KhmerAutoJX2 landing page.
   Colors mirror the app's Wuxia skin (AutoClickNPC/Utils/Theme/WuxiaPalette.cs): lacquered wood,
   antique-gold trim, parchment pages in ink and cinnabar seals. */

:root {
  --night: #17120f;
  --lacquer: #1e1712;
  --lacquer-raised: #2d221a;
  --parchment: #f1e5c9;
  --gold: #c9a45c;
  --gold-bright: #f1d48e;
  --gold-deep: #8a6935;
  --ink: #2e2218;
  --ink-muted: #5e4c38;
  --text: #ecdfc3;
  --text-muted: #a8977a;
  --seal-text: #fff1d6;
  --cinnabar: #a83329;
  --amber: #f2a65a;

  --font-display: "Cinzel", Georgia, "Times New Roman", serif;
  --font-body: "Kantumruy Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 8px;
  --header-h: 68px;
  color-scheme: dark;
}

/* ---------- 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;
  background: var(--night);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg .fill { fill: currentColor; stroke: none; }

a { color: var(--gold-bright); text-decoration: none; }
a:hover { color: #fff3cf; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, p { margin: 0; }

[hidden] { display: none !important; }

[lang="km"] { line-height: 1.7; }

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--gold-bright);
  color: var(--ink);
  border-radius: 6px;
  font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--ink); }

/* ---------- Buttons: the app's plaques, gold end-dots included ---------- */

.btn {
  --btn-h: 54px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: var(--btn-h);
  padding: 0 34px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .25s ease, filter .2s ease, background .25s ease, color .2s ease;
}
.btn svg { width: 20px; height: 20px; flex: none; stroke-width: 2.2; }
.btn::before, .btn::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 5px; height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 6px rgb(241 212 142 / .8);
}
.btn::before { left: 11px; }
.btn::after { right: 11px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--seal {
  color: var(--seal-text);
  background: linear-gradient(180deg, #d65445 0%, var(--cinnabar) 52%, #7d221a 100%);
  border: 1px solid rgb(241 212 142 / .75);
  box-shadow:
    inset 0 0 0 2px rgb(23 18 15 / .5),
    inset 0 0 0 3px rgb(241 212 142 / .28),
    0 14px 34px -14px rgb(203 72 56 / .8),
    0 2px 0 rgb(0 0 0 / .4);
  text-shadow: 0 1px 0 rgb(0 0 0 / .35);
}
.btn--seal:hover {
  color: #fff;
  filter: brightness(1.08) saturate(1.05);
  box-shadow:
    inset 0 0 0 2px rgb(23 18 15 / .5),
    inset 0 0 0 3px rgb(241 212 142 / .35),
    0 18px 44px -14px rgb(203 72 56 / .95),
    0 2px 0 rgb(0 0 0 / .4);
}

.btn--wood {
  color: var(--gold-bright);
  background: linear-gradient(180deg, #3d2e22 0%, var(--lacquer) 100%);
  border: 1px solid rgb(201 164 92 / .7);
  box-shadow:
    inset 0 0 0 2px rgb(23 18 15 / .6),
    inset 0 0 0 3px rgb(201 164 92 / .2),
    0 12px 28px -16px rgb(0 0 0 / .9);
}
.btn--wood:hover {
  color: #fff3cf;
  background: linear-gradient(180deg, #4d3a2b 0%, var(--lacquer-raised) 100%);
}

.btn--sm {
  --btn-h: 40px;
  gap: 8px;
  padding: 0 24px;
  font-size: .8rem;
}
.btn--sm svg { width: 16px; height: 16px; }
.btn--sm::before { left: 9px; }
.btn--sm::after { right: 9px; }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color .3s ease, border-color .3s ease;
}
.site-header.is-scrolled {
  background: rgb(23 18 15 / .86);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom-color: rgb(201 164 92 / .22);
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}
.site-header .btn { margin-left: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: .02em;
}
.brand img {
  width: 42px; height: 42px;
  filter: drop-shadow(0 2px 6px rgb(0 0 0 / .6));
}
/* Wordmark colored like the emblem's lettering, so the three words read apart in Cinzel's small caps */
.brand__name > span:nth-child(1) { color: var(--gold-bright); }
.brand__name > span:nth-child(2) { color: #f8ecd0; }
.brand__name > span:nth-child(3) { color: var(--amber); }
.brand:hover .brand__name > span { color: #fff3cf; }
@media (max-width: 479px) {
  .site-header .brand__name { display: none; }
}

.site-nav { display: none; }

@media (min-width: 720px) {
  .site-nav {
    display: flex;
    gap: 28px;
    margin-left: auto;
  }
  .site-nav a {
    position: relative;
    padding: 6px 0;
    color: #cdbd9c;
    font-weight: 500;
    font-size: .95rem;
  }
  .site-nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform .25s ease;
  }
  .site-nav a:hover { color: var(--gold-bright); }
  .site-nav a:hover::after { transform: scaleX(1); }
  .site-header .btn { margin-left: 8px; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: calc(var(--header-h) + 24px) var(--gutter) 104px;
  overflow: hidden;
  text-align: center;
}

.hero__art,
.hero__art img,
.hero__veil,
.hero__embers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero__art { z-index: -3; }
.hero__art img {
  object-fit: cover;
  object-position: 50% 42%;
  animation: hero-drift 24s cubic-bezier(.2, .6, .2, 1) both;
}
@keyframes hero-drift {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

.hero__veil {
  z-index: -2;
  background:
    radial-gradient(ellipse 58% 40% at 50% 74%, rgb(12 8 6 / .7), transparent 72%),
    linear-gradient(180deg, rgb(23 18 15 / .62) 0%, rgb(23 18 15 / 0) 18%, rgb(23 18 15 / 0) 56%, rgb(23 18 15 / .86) 88%, var(--night) 100%);
}
.hero__embers { z-index: -1; pointer-events: none; }

.hero__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 780px;
}

.hero__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: inherit;
}
/* The 5th anniversary (October 2026): a lacquer plaque above the logo */
.hero__anniversary {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 7px 18px;
  color: var(--gold-bright);
  font: 700 .78rem/1 var(--font-display);
  letter-spacing: .14em;
  text-transform: uppercase;
  background: linear-gradient(180deg, rgb(61 46 34 / .9), rgb(30 23 18 / .9));
  border: 1px solid rgb(201 164 92 / .75);
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgb(23 18 15 / .6), 0 8px 24px -10px rgb(0 0 0 / .9);
}
.hero__anniversary span + span::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  margin: 0 .9em;
  vertical-align: .2em;
  background: #e0604f;
  transform: rotate(45deg);
}
@media (max-width: 520px) {
  .hero__anniversary { margin-bottom: 6px; padding: 6px 14px; font-size: .7rem; }
}

/* Sized like the logo, so the firelight behind it scales with it. --mark-vh caps it by screen height. */
.hero__mark {
  --mark-vh: 42;
  position: relative;
  width: min(72vw, var(--mark-vh) * 1vh, 320px);
  margin-bottom: 14px;
}
@media (min-width: 700px) {
  .hero__mark {
    width: clamp(240px, min(34vw, var(--mark-vh) * 1vh), 420px);
    width: clamp(240px, min(34vw, var(--mark-vh) * 1svh), 420px);
  }
}
/* While the plaque shows, short screens give the logo a little less height, so the download button stays in view */
@media (max-height: 760px) {
  .hero__anniversary + .hero__title .hero__mark { --mark-vh: 37; }
}
/* Orange firelight behind the logo, as in the key art. Screen blending only ever lightens the art. */
.hero__mark::before {
  content: "";
  position: absolute;
  inset: -36% -38% -26%;
  z-index: -1;
  background: radial-gradient(closest-side,
    rgb(255 192 98),
    rgb(255 148 50 / .85) 46%,
    rgb(246 106 26 / .52) 60%,
    rgb(210 68 14 / .2) 76%,
    rgb(210 68 14 / 0));
  mix-blend-mode: screen;
  pointer-events: none;
  animation: emblem-glow 6s ease-in-out infinite;
}
@keyframes emblem-glow {
  0%, 100% { opacity: .82; transform: scale(.97); }
  50% { opacity: 1; transform: scale(1.03); }
}
/* Animated fire (site.js) takes over from the glow once it is running. Taller than the logo, so the
   flames have room to rise. */
.hero__fire {
  position: absolute;
  left: -45%;
  top: -70%;
  width: 190%;
  height: 185%;
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.hero__mark.is-burning .hero__fire { opacity: 1; }
.hero__mark.is-burning::before {
  opacity: 0;
  animation: none;
  transition: opacity 1.4s ease;
}
.hero__emblem {
  width: 100%;
  /* Rim light that follows the swords and wings */
  filter: drop-shadow(0 0 22px rgb(255 124 32 / .7));
  animation: emblem-float 8s ease-in-out infinite;
}
@keyframes emblem-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* Khmer, so a Khmer display face (Cinzel has no Khmer). Koulen has one weight, and Khmer takes no letter-spacing. */
.hero__tagline {
  font-family: "Koulen", var(--font-body);
  font-weight: 400;
  font-size: clamp(1.7rem, 1.2rem + 2.4vw, 3rem);
  line-height: 1.45;
  color: #f8ecd0;
  text-shadow: 0 2px 20px rgb(0 0 0 / .85), 0 0 2px rgb(0 0 0 / .6);
  text-wrap: balance;
}
/* Break only between the three phrases */
.hero__tagline > span { display: inline-block; }

.hero__lede {
  max-width: 36rem;
  margin-top: 14px;
  color: #ebdfc4;
  font-size: clamp(1rem, .95rem + .3vw, 1.15rem);
  /* A tight shadow keeps the letters crisp where they cross the bright lightning in the art */
  text-shadow: 0 1px 2px rgb(0 0 0 / .95), 0 0 6px rgb(0 0 0 / .8), 0 1px 14px rgb(0 0 0 / .95);
  text-wrap: pretty;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 18px;
  color: #d3c4a5;
  font-size: .88rem;
  text-shadow: 0 1px 8px rgb(0 0 0 / .95);
}
.hero__meta span + span::before {
  content: "◆";
  margin: 0 .7em;
  color: var(--gold);
  font-size: .6em;
  vertical-align: .2em;
}

.hero__scroll {
  position: absolute;
  bottom: 76px;
  left: 50%;
  width: 40px; height: 40px;
  margin-left: -20px;
  display: none;
  place-items: center;
  color: var(--gold-bright);
  opacity: .75;
  animation: scroll-cue 2.4s ease-in-out infinite;
}
.hero__scroll svg { width: 28px; height: 28px; stroke-width: 2; }
.hero__scroll:hover { opacity: 1; }
/* Where the arrow shows, the hero keeps room below its content for it (76px up, 40px tall) */
@media (min-width: 700px) and (min-height: 760px) {
  .hero { padding-bottom: 120px; }
  .hero__scroll { display: grid; }
}
@keyframes scroll-cue {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

@media (max-width: 520px) {
  .hero__actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 340px; }
}
/* Too narrow for both notes on one line: stack them without a stray separator */
@media (max-width: 359px) {
  .hero__meta span:last-child { flex-basis: 100%; }
  .hero__meta span:last-child::before { display: none; }
}

/* ---------- Highlights strip ---------- */

.stats {
  position: relative;
  z-index: 3;
  margin-top: -72px;
}
.stats__panel {
  padding: 6px;
  background: linear-gradient(180deg, rgb(45 34 26 / .95), rgb(30 23 18 / .97));
  border: 1px solid rgb(201 164 92 / .5);
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 4px var(--lacquer),
    inset 0 0 0 5px rgb(201 164 92 / .2),
    0 30px 70px -30px rgb(0 0 0 / .95);
}
.stats__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: rgb(201 164 92 / .16);
}
@media (min-width: 760px) { .stats__grid { grid-template-columns: repeat(3, 1fr); } }

.stat {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 14px;
  align-content: start;
  padding: 20px;
  background: #221a14;
}
.stat__icon {
  grid-row: span 2;
  width: 36px; height: 36px;
  margin-top: 2px;
  color: var(--gold);
  stroke-width: 1.5;
}
.stat__title {
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.04rem;
  line-height: 1.35;
}
.stat__text { color: var(--text-muted); font-size: .9rem; line-height: 1.5; }

/* ---------- Sections ---------- */

.section {
  position: relative;
  padding: clamp(80px, 10vw, 132px) 0;
}
.section--tight { padding-top: clamp(8px, 2vw, 24px); }
/* The section after it supplies the gap */
.section--flush { padding-bottom: 0; }

.section-head {
  max-width: 760px;
  margin: 0 auto clamp(40px, 6vw, 60px);
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
}
.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 30px; height: 1px;
  background: linear-gradient(90deg, transparent, currentColor);
}
.eyebrow::after { transform: scaleX(-1); }

.section-title {
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 1.25rem + 2.5vw, 3.05rem);
  line-height: 1.12;
  letter-spacing: .015em;
  text-wrap: balance;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .section-title {
    background: linear-gradient(180deg, #fff3d2 0%, var(--gold-bright) 40%, var(--gold) 78%, #a8813f 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.section-lede {
  max-width: 40rem;
  margin: 18px auto 0;
  color: var(--text-muted);
  font-size: clamp(1rem, .96rem + .25vw, 1.12rem);
  text-wrap: pretty;
}

/* ---------- PK windows: screenshots rendered from the app ---------- */

.section--screens { padding: clamp(64px, 8vw, 104px) 0 0; }

/* Two columns that end level: the shorter column's cards grow and keep their window centered */
.screens {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.screens__col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
@media (min-width: 900px) {
  .screens { flex-direction: row; }
  .screens__col { flex: 1 1 0; min-width: 0; }
}
.screen {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0;
  padding: clamp(18px, 2.6vw, 30px);
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, rgb(201 164 92 / .1), transparent 70%),
    linear-gradient(180deg, #251c16, #1b1511);
  border: 1px solid rgb(201 164 92 / .25);
  border-radius: var(--radius);
}
/* Shots are 1.75x renders shown at 1.2x the app's size, so they stay sharp on most screens */
.screen img {
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / .5), 0 26px 50px -22px rgb(0 0 0 / .95);
}
.screen figcaption {
  max-width: 30rem;
  color: var(--text-muted);
  font-size: .94rem;
  line-height: 1.55;
  text-align: center;
  text-wrap: pretty;
}
.screen__name {
  display: block;
  margin-bottom: 2px;
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
}

/* ---------- Get started: a hanging scroll ---------- */

.scroll {
  position: relative;
  padding: clamp(44px, 6vw, 72px) clamp(20px, 5vw, 64px);
  color: var(--ink);
  background-color: var(--parchment);
  background-image:
    radial-gradient(120% 70% at 50% 0%, rgb(255 255 255 / .35), transparent 60%),
    radial-gradient(110% 90% at 50% 105%, rgb(140 100 50 / .2), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .3 0 0 0 0 .16 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px rgb(138 105 53 / .35),
    inset 0 0 70px rgb(138 105 53 / .28),
    0 40px 90px -40px rgb(0 0 0 / .95);
}
.scroll::before,
.scroll::after {
  content: "";
  position: absolute;
  left: -16px; right: -16px;
  height: 20px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 10px 50%, var(--gold-bright) 0 4px, var(--gold-deep) 5px 8px, transparent 9px),
    radial-gradient(circle at calc(100% - 10px) 50%, var(--gold-bright) 0 4px, var(--gold-deep) 5px 8px, transparent 9px),
    linear-gradient(180deg, #6b5038 0%, #3a2b20 48%, #1e1712 100%);
  box-shadow: 0 6px 14px rgb(0 0 0 / .55), inset 0 1px 0 rgb(255 255 255 / .16);
}
.scroll::before { top: -10px; }
.scroll::after { bottom: -10px; }

.eyebrow--ink { color: var(--cinnabar); }

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.step h3 {
  margin: 18px 0 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.28rem;
}
.step p { color: var(--ink-muted); }
.step strong { color: var(--ink); }
.step__btn { margin-top: 18px; }

.seal {
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  color: var(--parchment);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1;
  background: radial-gradient(circle at 35% 30%, #d0503f, var(--cinnabar) 55%, #7a2219);
  border-radius: 6px;
  transform: rotate(-5deg);
  box-shadow:
    inset 0 0 0 3px rgb(241 229 201 / .85),
    inset 0 0 0 5px var(--cinnabar),
    0 2px 0 rgb(106 26 20 / .35);
}
.step:nth-child(2) .seal { transform: rotate(4deg); }
.step:nth-child(3) .seal { transform: rotate(-2deg); }

/* ---------- Features: the app's tab control ---------- */

/* Drawn like the app's skin (WuxiaPainter.DrawTab and DrawCheckBox): lacquer plaque tabs, the selected one
   cut from a parchment page with a cinnabar rule on top, and ticked boxes as cinnabar seals */
.tabs {
  --page: #f9f2e2;
  --page-line: #dbc89f;
  --bronze: #9b7844;
  max-width: 1060px;
  margin-inline: auto;
}

.tabs__list {
  display: flex;
  gap: 4px;
  padding: 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs__list::-webkit-scrollbar { display: none; }

.tabs__tab {
  flex: none;
  position: relative;
  margin: 0 0 -1px;
  padding: 11px 22px 10px;
  color: var(--gold-bright);
  font: 600 1rem/1.3 var(--font-body);
  background: linear-gradient(180deg, var(--lacquer-raised), var(--lacquer));
  border: 1px solid var(--gold-deep);
  border-bottom-color: var(--gold);
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.tabs__tab:hover {
  color: #fff3cf;
  background: linear-gradient(180deg, #5a432e, var(--lacquer));
  border-color: var(--gold);
}
.tabs__tab[aria-selected="true"] {
  z-index: 1;
  color: var(--ink);
  background: var(--page);
  border-color: var(--gold);
  border-bottom-color: var(--page);
  box-shadow: inset 0 2px 0 #cb4838;
}
.tabs__tab [lang="km"] { line-height: inherit; }
.tabs__tab:focus-visible { outline-offset: -5px; }
/* Premium's diamond, after the app's "💎 Premium 💎" menu */
.tabs__tab--premium::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 9px;
  vertical-align: .14em;
  background: currentColor;
  transform: rotate(45deg);
}
.tabs__tab--premium[aria-selected="true"]::before { background: var(--cinnabar); }
/* Too narrow for one row of seven: rows of plaques above the page, all of them in view, Premium the widest */
@media (max-width: 759px) {
  .tabs__list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 10px;
    padding: 0;
  }
  .tabs__tab {
    margin: 0;
    padding: 10px 6px;
    border-bottom-color: var(--gold-deep);
    border-radius: 6px;
  }
  .tabs__tab[aria-selected="true"] { border-bottom-color: var(--gold); }
  .tabs__tab--premium { grid-column: span 2; }
}
@media (max-width: 559px) {
  .tabs__list { grid-template-columns: repeat(3, 1fr); }
  .tabs__tab--premium { grid-column: 1 / -1; }
}

.tabs__panels {
  position: relative;
  padding: clamp(18px, 3.4vw, 34px);
  color: var(--ink);
  background: var(--page);
  border: 1px solid var(--gold);
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 1px rgb(138 105 53 / .45),
    inset 0 0 60px rgb(138 105 53 / .16),
    0 40px 90px -40px rgb(0 0 0 / .95);
}
.tabs__panel:focus-visible { outline-color: var(--cinnabar); outline-offset: 6px; }
/* Without the script the pages simply stack, each under its own heading */
.tabs:not(.is-ready) .tabs__panel + .tabs__panel {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--page-line);
}
.tabs__title {
  margin-bottom: 4px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.3rem;
}
.tabs__title [lang="km"] { font-family: var(--font-body); }
.tabs.is-ready .tabs__title {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.tabs__intro { margin-bottom: 18px; color: var(--ink-muted); }

.features {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--page-line);
}
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .features { grid-template-columns: repeat(3, 1fr); } }
.features li {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: start;
  column-gap: 12px;
  padding: 11px 2px;
  line-height: 1.5;
  border-bottom: 1px solid var(--page-line);
}
.features li::before {
  content: "";
  width: 20px; height: 20px;
  margin-top: 2px;
  border-radius: 4px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.6 10.4l3.8 4.2 7.2-9' fill='none' stroke='%23fff1d6' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat,
    linear-gradient(180deg, #cb4838, var(--cinnabar) 55%, #6a1a14);
  box-shadow: inset 0 0 0 1px rgb(255 241 214 / .3), 0 1px 0 rgb(106 26 20 / .25);
}
.features [lang="km"] { line-height: inherit; }
.features__name { color: var(--ink); font-weight: 500; }
.features__options {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}
.features__options > span {
  padding: 1px 8px;
  color: var(--ink-muted);
  font-size: .82rem;
  background: #fffaf0;
  border: 1px solid var(--page-line);
  border-radius: 4px;
}

.tabs__also {
  margin-top: 20px;
  color: var(--ink-muted);
  font-size: .95rem;
}
/* The tab's buttons, as the app's small plaques */
.tabs__also span {
  display: inline-block;
  margin: 6px 4px 0 0;
  padding: 3px 12px;
  color: var(--gold-bright);
  font-size: .85rem;
  font-weight: 600;
  background: linear-gradient(180deg, #3d2e22, var(--lacquer));
  border: 1px solid var(--gold-deep);
  border-radius: 4px;
}

/* Premium rows take gold seals with a lock. Combo + Support SM Premium, sold in the app, shows plainly on a
   full-width row; the rest show only their first rows with the names blurred, under a card that sends
   players to the admin (that list and the card share one grid cell). */
.features--premium li::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M7 9.4V7.2a3 3 0 0 1 6 0v2.2' fill='none' stroke='%23fff1d6' stroke-width='1.9' stroke-linecap='round'/%3E%3Crect x='4.8' y='9' width='10.4' height='7.4' rx='1.6' fill='%23fff1d6'/%3E%3C/svg%3E") center / 16px no-repeat,
    linear-gradient(180deg, #c79a4a, var(--gold-deep) 55%, #4f3a1f);
  box-shadow: inset 0 0 0 1px rgb(255 241 214 / .3), 0 1px 0 rgb(79 58 31 / .25);
}
.features.features--wide { grid-template-columns: 1fr; }
.features__note {
  grid-column: 2;
  margin-top: 8px;
  color: var(--ink-muted);
  font-size: .9rem;
}
.locked { display: grid; }
.locked > * { grid-area: 1 / 1; }
.features + .locked > .locked__list { border-top: 0; }
/* Two columns at most, with taller rows, so the card sits inside the list with rows showing above and below */
@media (min-width: 640px) { .locked__list li { padding-block: 15px; } }
@media (min-width: 980px) { .locked__list { grid-template-columns: repeat(2, 1fr); } }
.locked__list { user-select: none; }
.locked__list .features__name {
  filter: blur(6px);
  opacity: .8;
}
.locked__card {
  z-index: 1;
  place-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100% - 32px, 25rem);
  padding: 18px 22px 20px;
  text-align: center;
  background: #fffaf0;
  border: 1px solid var(--gold);
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 1px rgb(138 105 53 / .3),
    0 0 22px 10px rgb(249 242 226 / .85),
    0 22px 46px -18px rgb(46 34 24 / .55);
}
.locked__title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.3;
}
.locked__title::before, .locked__title::after {
  content: "";
  width: 7px; height: 7px;
  background: var(--gold-deep);
  transform: rotate(45deg);
}
.locked__text {
  margin: 4px 0 14px;
  color: var(--ink-muted);
  font-size: .95rem;
  line-height: 1.5;
  text-wrap: balance;
}
/* Small phones: keep the title on one line */
@media (max-width: 419px) {
  .locked__card { width: calc(100% - 24px); padding-inline: 14px; }
  .locked__title { gap: 8px; font-size: 1.05rem; }
}

/* ---------- Community ---------- */

.socials {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 820px) { .socials { grid-template-columns: repeat(3, 1fr); } }
.social {
  --brand-rgb: 241 212 142;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  color: var(--text);
  background: linear-gradient(180deg, #251c16, #1b1511);
  border: 1px solid rgb(201 164 92 / .25);
  border-radius: var(--radius);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.social:hover {
  color: var(--text);
  transform: translateY(-3px);
  border-color: rgb(var(--brand-rgb) / .6);
  box-shadow: 0 22px 50px -26px rgb(var(--brand-rgb) / .7);
}
.social__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  color: rgb(var(--brand-rgb));
  background: rgb(var(--brand-rgb) / .13);
  border: 1px solid rgb(var(--brand-rgb) / .4);
  border-radius: 50%;
}
.social__icon svg { width: 26px; height: 26px; }
.social__text { display: flex; flex-direction: column; min-width: 0; }
.social__name {
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
}
.social__handle { color: var(--text-muted); font-size: .88rem; overflow-wrap: anywhere; }
.social__arrow {
  flex: none;
  width: 22px; height: 22px;
  margin-left: auto;
  color: var(--gold);
  transition: transform .25s ease;
}
.social:hover .social__arrow { transform: translateX(4px); }

/* ---------- Footer ---------- */

.site-footer {
  padding: 44px 0 40px;
  color: var(--text-muted);
  font-size: .92rem;
  background: #110d0a;
  border-top: 1px solid rgb(201 164 92 / .2);
}
.site-footer__inner {
  display: grid;
  gap: 24px;
  align-items: center;
}
@media (min-width: 860px) { .site-footer__inner { grid-template-columns: auto 1fr auto; gap: 40px; } }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
@media (min-width: 860px) { .footer-nav { justify-content: center; } }
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--gold-bright); }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  color: var(--gold);
  border: 1px solid rgb(201 164 92 / .35);
  border-radius: 50%;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.footer-social a:hover { color: var(--gold-bright); border-color: var(--gold); background: rgb(201 164 92 / .1); }
.footer-social svg { width: 18px; height: 18px; }
.legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  margin-top: 28px;
  padding-top: 20px;
  font-size: .84rem;
  border-top: 1px solid rgb(201 164 92 / .12);
}

/* ---------- 404 ---------- */

.lost {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px var(--gutter);
  text-align: center;
  background:
    radial-gradient(circle at 50% 38%, rgb(241 212 142 / .14), transparent 45%),
    var(--night);
}
.lost__emblem { width: min(260px, 62vw); margin: 0 auto 6px; }
.lost .section-lede { margin-bottom: 30px; }

/* ---------- Reveal on scroll ---------- */

.js [data-reveal] { opacity: 0; }
.js [data-reveal].is-visible {
  animation: reveal .9s cubic-bezier(.2, .65, .2, 1) var(--delay, 0s) both;
}
@keyframes reveal {
  from { opacity: 0; translate: 0 28px; }
  to { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__art img,
  .hero__emblem,
  .hero__mark::before,
  .hero__scroll { animation: none; }
  .js [data-reveal] { opacity: 1; }
  .js [data-reveal].is-visible { animation: none; }
  .btn, .social { transition: none; }
}
