@font-face {
  font-family: "Noto Sans Thai";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/noto-sans-thai-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Noto Sans Thai";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/noto-sans-thai-thai.woff2") format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

:root {
  color-scheme: light;
  --bg: #f3ecdf;
  --ink: #241c14;
  --muted: #5c5348;
  --paper: #fffaf3;
  --line: #e4d8c4;
  --header: #1a2744;
  --header-ink: #f7f1e4;
  --hero: #1a2744;
  --hero-ink: #f7f1e4;
  --accent: #e4c57a;
  --accent-ink: #1a1408;
  --link: #1a3f86;
  --gold: #8a6928;
  --rule: #e4c57a;
  --stat: #fffaf3;
  --focus: #ffbf47;
  --shadow: 0 12px 30px rgba(36, 28, 20, 0.06);
}

body.theme-pink {
  --bg: #fff1f6;
  --paper: #ffffff;
  --line: #f3d0df;
  --header: #a3185c;
  --header-ink: #ffffff;
  --hero: #a3185c;
  --hero-ink: #ffffff;
  --accent: #a3185c;
  --accent-ink: #ffffff;
  --hero-button: #ffffff;
  --hero-button-ink: #a3185c;
  --link: #8e184e;
  --gold: #8e184e;
  --rule: #ffffff;
  --stat: #ffffff;
}

body.theme-purple {
  --bg: #f7f2fb;
  --ink: #24182e;
  --paper: #ffffff;
  --line: #e4d4f2;
  --header: #4b1d78;
  --header-ink: #f7f1e4;
  --hero: #4b1d78;
  --hero-ink: #f7f1e4;
  --accent: #e4c57a;
  --accent-ink: #2a123f;
  --link: #4b1d78;
  --gold: #6f5420;
  --rule: #e4c57a;
  --stat: #ffffff;
}

body.theme-emerald {
  --bg: #f1faf6;
  --ink: #10241c;
  --paper: #ffffff;
  --line: #cfe7dc;
  --header: #0d6a4e;
  --header-ink: #f7f1e4;
  --hero: #0d6a4e;
  --hero-ink: #f7f1e4;
  --accent: #e4c57a;
  --accent-ink: #10241c;
  --link: #0b5a41;
  --gold: #6f5420;
  --rule: #e4c57a;
  --stat: #ffffff;
}

body.theme-black {
  color-scheme: dark;
  --bg: #121212;
  --ink: #f4efe4;
  --muted: #d9cbb3;
  --paper: #1c1c1c;
  --line: #3a3428;
  --header: #0d0d0d;
  --header-ink: #f7f1e4;
  --hero: #0d0d0d;
  --hero-ink: #f7f1e4;
  --accent: #e4c57a;
  --accent-ink: #1a1408;
  --link: #f0d48a;
  --gold: #e4c57a;
  --rule: #e4c57a;
  --stat: #1c1c1c;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

body.theme-black-warm {
  color-scheme: dark;
  --bg: #16130f;
  --ink: #f7f1e4;
  --muted: #e2d3b8;
  --paper: #221e18;
  --line: #4a3f2c;
  --header: #100e0b;
  --header-ink: #f7f1e4;
  --hero: #100e0b;
  --hero-ink: #f7f1e4;
  --accent: #f0d48a;
  --accent-ink: #1a1408;
  --link: #f0d48a;
  --gold: #f0d48a;
  --rule: #f0d48a;
  --stat: #221e18;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

body.theme-sky {
  --bg: #f3f9fd;
  --ink: #102433;
  --muted: #3d5566;
  --paper: #ffffff;
  --line: #d3e6f2;
  --header: #0b6ea8;
  --header-ink: #ffffff;
  --hero: #0b6ea8;
  --hero-ink: #ffffff;
  --accent: #0b6ea8;
  --accent-ink: #ffffff;
  --hero-button: #ffffff;
  --hero-button-ink: #0b6ea8;
  --link: #075a8a;
  --gold: #075a8a;
  --rule: #ffffff;
  --stat: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.75;
}

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

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  line-height: 1.3;
  font-weight: 700;
}

h1 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3.3rem);
}

h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

h3 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}

p {
  margin: 0 0 0.8rem;
}

a {
  color: var(--link);
}

a:hover {
  text-decoration-thickness: 2px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 40;
  background: #ffffff;
  color: #1a1408;
  padding: 0.6rem 1rem;
  border-radius: 8px;
}

.skip:focus {
  top: 0.7rem;
}

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header);
  color: var(--header-ink);
  border-bottom: 3px solid var(--rule);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1.25rem;
  padding: 0.7rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.brand-kicker {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.brand-name {
  display: block;
  font-size: 1.02rem;
  line-height: 1.25;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.28em;
}

.hero {
  background: var(--hero);
  color: var(--hero-ink);
}

.hero-grid {
  display: grid;
  gap: 1.5rem;
  padding: 2.4rem 0 2.8rem;
}

.eyebrow {
  margin: 0;
  font-weight: 700;
  color: var(--hero-ink);
}

.lede {
  max-width: 42rem;
  font-size: 1.125rem;
}

.gold-rule {
  width: 4.5rem;
  height: 4px;
  margin: 0.9rem 0 1rem;
  background: var(--rule);
  border: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.1rem;
}

.seal {
  width: min(100%, 230px);
  aspect-ratio: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  border: 2px dashed var(--rule);
  border-radius: 50%;
  padding: 1.2rem;
}

.seal p {
  margin: 0;
}

.seal-num {
  font-size: 4rem;
  font-weight: 700;
  line-height: 0.95;
}

.seal-eq {
  font-weight: 700;
}

a.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.hero a.button:not(.button-ghost) {
  background: var(--hero-button, var(--accent));
  color: var(--hero-button-ink, var(--accent-ink));
}

a.button-ghost {
  background: transparent;
  color: var(--hero-ink);
  box-shadow: inset 0 0 0 1.5px currentColor;
}

.stats {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: -1.3rem;
}

.stat,
.step,
.rule,
.contest,
.bot-card,
.note,
.faq details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.stat {
  padding: 0.9rem 1rem;
}

.stat strong {
  display: block;
  font-size: 1.28rem;
  line-height: 1.3;
}

.stat span {
  color: var(--muted);
  font-size: 0.95rem;
}

.block {
  padding: 1.6rem 0 0.4rem;
}

.section-head p {
  max-width: 68ch;
  color: var(--muted);
}

.step-grid,
.rule-grid,
.bot-grid,
.split {
  display: grid;
  gap: 0.85rem;
}

.step,
.rule,
.contest,
.note {
  padding: 1rem 1.05rem 1.1rem;
}

.step-no {
  margin: 0 0 0.25rem;
  color: var(--gold);
  font-weight: 700;
}

.bot-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-band {
  padding: 0.85rem 1.05rem 0.95rem;
  background: var(--card, var(--header));
  color: var(--card-ink, var(--header-ink));
}

.card-band p,
.card-band h3 {
  margin: 0;
}

.card-kicker {
  font-size: 0.88rem;
  font-weight: 700;
}

.card-band a {
  color: inherit;
  text-decoration: none;
}

.card-band a:hover {
  text-decoration: underline;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex: 1;
  padding: 1rem 1.05rem 1.1rem;
}

.card-body p {
  margin: 0;
  flex: 1;
}

.card-body .button {
  align-self: flex-start;
}

.theme-navy {
  --card: #1a2744;
  --card-ink: #f7f1e4;
}

.theme-pink {
  --card: #a3185c;
  --card-ink: #ffffff;
}

.theme-purple {
  --card: #4b1d78;
  --card-ink: #f7f1e4;
}

.theme-emerald {
  --card: #0d6a4e;
  --card-ink: #f7f1e4;
}

.theme-black,
.theme-black-warm {
  --card: #111111;
  --card-ink: #f0d48a;
}

.theme-sky {
  --card: #0b6ea8;
  --card-ink: #ffffff;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.45rem;
  margin: 0;
  padding: 0.95rem 0 0;
  list-style: none;
  color: var(--muted);
}

.crumbs a {
  color: inherit;
}

.crumbs li:not(:last-child)::after {
  content: "/";
  margin-inline-start: 0.45rem;
}

.toc {
  margin: 0;
  padding-left: 1.2rem;
}

.toc a {
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  color: var(--ink);
}

caption {
  text-align: left;
  font-weight: 700;
  padding-bottom: 0.45rem;
}

th,
td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.faq details {
  padding: 0.35rem 1rem;
  margin-bottom: 0.7rem;
}

.faq summary {
  cursor: pointer;
  min-height: 48px;
  display: flex;
  align-items: center;
  font-weight: 700;
}

.faq summary h2 {
  margin: 0;
  font-size: 1.08rem;
}

.faq details p:last-child {
  margin-bottom: 0.85rem;
}

.handle {
  font-weight: 700;
}

a.external::after {
  content: "↗";
  font-size: 0.8em;
  margin-inline-start: 0.28em;
}

.site-footer {
  margin-top: 2.4rem;
  padding: 2rem 0;
  background: var(--header);
  color: var(--header-ink);
}

.site-footer a {
  color: inherit;
}

.footer-grid {
  display: grid;
  gap: 1.2rem;
}

.footer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-list a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.fine {
  color: inherit;
  opacity: 0.85;
  font-size: 0.95rem;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

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

@media (min-width: 720px) {
  .step-grid,
  .rule-grid,
  .bot-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: 1.45fr 0.55fr;
    align-items: center;
  }

  .stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .split {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr;
  }
}

@media (min-width: 1040px) {
  .bot-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (forced-colors: active) {
  a.button {
    border: 1px solid ButtonText;
  }
}
