:root {
  --bg: #07060f;
  --panel: rgba(18, 14, 36, 0.82);
  --ink: #f6f3ff;
  --muted: #b7adc9;
  --cyan: #3dfff2;
  --magenta: #ff2bd6;
  --violet: #8b6cff;
  --gold: #ffc857;
  --display: "Noto Sans Thai", "Segoe UI", sans-serif;
  --ui: "Noto Sans Thai", "Segoe UI", sans-serif;
  --mark: "Orbitron", Impact, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { overflow-x: clip; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 1.125rem;
  font-weight: 600;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 15% -10%, rgba(255, 43, 214, 0.28), transparent 42%),
    radial-gradient(ellipse at 90% 0%, rgba(61, 255, 242, 0.16), transparent 36%),
    radial-gradient(ellipse at 50% 110%, rgba(139, 108, 255, 0.22), transparent 40%),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: auto, auto, auto, 48px 48px, 48px 48px;
}

.mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.top, main, .foot { position: relative; z-index: 1; }

::selection { background: var(--magenta); color: white; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

button, input { font: inherit; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  background: var(--cyan);
  color: #071018;
  padding: 8px 12px;
  border-radius: 999px;
}

.skip:focus { top: 12px; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  background: #07060f;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.boot.is-done { opacity: 0; visibility: hidden; }

.boot-brand {
  margin: 0;
  font-family: var(--mark);
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: 0.14em;
  color: white;
  text-shadow: 0 0 24px rgba(61, 255, 242, 0.8);
}

.boot-sub {
  margin: 0;
  color: var(--cyan);
  font-family: var(--mark);
  font-size: 0.72rem;
  letter-spacing: 0.42em;
}

.boot-bar {
  width: min(280px, 70vw);
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.boot-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
  animation: load 0.9s ease forwards;
}

@keyframes load { from { transform: translateX(-120%); } to { transform: translateX(280%); } }

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 22px;
  background: rgba(7, 6, 15, 0.78);
  border-bottom: 1px solid rgba(61, 255, 242, 0.22);
  backdrop-filter: blur(16px);
}

.brand {
  color: white;
  font-family: var(--mark);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand span { color: var(--cyan); }

.brand-note, .top-meta, .foot-copy, .foot-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search {
  display: flex;
  flex: 1 1 240px;
  margin-left: auto;
  overflow: hidden;
  border: 1px solid rgba(139, 108, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(61, 255, 242, 0.08);
}

.search:focus-within { box-shadow: 0 0 0 1px var(--cyan), 0 0 22px rgba(61, 255, 242, 0.25); }

.search input {
  width: 100%;
  min-width: 0;
  padding: 0.72rem 1rem;
  border: 0;
  background: transparent;
  color: white;
  font-size: 1.05rem;
}

.search input:focus { outline: none; }

.search-go, .chip, .btn-play, .btn-ghost, .game-open, .drawer-close {
  cursor: pointer;
}

.lang {
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(61, 255, 242, 0.45);
  border-radius: 999px;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0.45rem 0.7rem;
  font-family: var(--mark);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.lang-btn.is-on {
  background: var(--cyan);
  color: #071018;
}

.search-go {
  border: 0;
  padding: 0 1.1rem;
  background: linear-gradient(90deg, var(--magenta), var(--violet));
  color: white;
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.stage {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 36px;
  align-items: center;
  min-height: calc(100vh - 78px);
  padding: 28px 0 20px;
}

.pill, .kicker {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 0.25rem 0.7rem;
  border: 1px solid rgba(61, 255, 242, 0.45);
  border-radius: 999px;
  color: var(--cyan);
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stage h1, .rack-head h2, .drawer h2, .game h3, .machine h2 {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-transform: uppercase;
}

.stage h1 {
  font-size: clamp(2.7rem, 5.6vw, 4.6rem);
  text-shadow: 0 0 28px rgba(139, 108, 255, 0.35);
}

.stage h1 em {
  font-style: normal;
  color: var(--cyan);
  text-shadow: 0 0 22px rgba(61, 255, 242, 0.55);
}

.lede, .machine p, .game-blurb, .drawer-about {
  color: var(--muted);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.45;
}

.lede { max-width: 38ch; margin: 16px 0 0; }

.stage-actions { display: flex; gap: 12px; margin-top: 22px; }

.btn-play, .game-open, .btn-spin {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff2bd6, #7a5cff 55%, #3dfff2);
  color: white;
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 0 24px rgba(255, 43, 214, 0.4);
}

.btn-play { display: inline-flex; padding: 0.95rem 1.3rem; }

.btn-play:hover, .game-open:hover, .btn-spin:hover { filter: brightness(1.12); }

.meters {
  display: flex;
  gap: 22px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.meters strong {
  display: block;
  color: var(--gold);
  font-family: var(--mark);
  font-size: 1.7rem;
}

.meters span {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.machine {
  padding: 3px;
  border-radius: 30px;
  background: linear-gradient(140deg, var(--cyan), var(--violet) 45%, var(--magenta));
  box-shadow: 0 0 48px rgba(139, 108, 255, 0.35), 0 30px 70px rgba(0, 0, 0, 0.45);
}

.machine-inner {
  padding: 18px 18px 16px;
  border-radius: 27px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 200, 87, 0.16), transparent 42%),
    linear-gradient(180deg, #1c1636, #0d0b16 70%);
}

.lights {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.lights i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: blink 1.2s ease-in-out infinite;
}

.lights i:nth-child(odd) { animation-delay: 0.4s; background: var(--magenta); box-shadow: 0 0 10px var(--magenta); }

@keyframes blink { 50% { opacity: 0.35; } }

.machine-label {
  margin: 0 0 10px;
  color: var(--gold);
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-align: center;
}

.reels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.reel {
  container-type: inline-size;
  aspect-ratio: 1 / 1.92;
  height: auto;
  overflow: hidden;
  padding-top: 8px;
  border: 1px solid rgba(255, 200, 87, 0.45);
  border-radius: 14px;
  background: #090712;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.65);
}

.reel-track {
  display: flex;
  flex-direction: column;
  animation: roll 7s linear infinite;
  will-change: transform;
}

.reel:nth-child(2) .reel-track { animation-duration: 9s; animation-direction: reverse; }
.reel:nth-child(3) .reel-track { animation-duration: 6s; }

.reel img {
  display: block;
  width: calc(100% - 16px);
  height: calc(100cqi - 16px);
  margin: 0 8px 10px;
  border: 2px solid rgba(255, 214, 120, 0.75);
  border-radius: 12px;
  object-fit: contain;
  object-position: center;
  background: #140e22;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

@keyframes roll { to { transform: translateY(-50%); } }

.machine h2 {
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  text-align: center;
}

.machine p { margin: 8px 0 0; text-align: center; font-size: 1rem; }

.btn-spin {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 0.85rem 1rem;
}

.rack-section { padding: 10px 0 64px; scroll-margin-top: 96px; }

.rack-head h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }

.chip {
  border: 1px solid rgba(139, 108, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  padding: 0.4rem 0.85rem;
  font-family: var(--display);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chip.is-on, .chip:hover {
  border-color: transparent;
  background: linear-gradient(90deg, rgba(255, 43, 214, 0.9), rgba(61, 255, 242, 0.85));
  color: #100818;
}

.rack-status {
  min-height: 1.2em;
  margin: 0 0 14px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.92rem;
}

.lobby {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.game {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(139, 108, 255, 0.35);
  border-radius: 22px;
  background: rgba(16, 12, 32, 0.9);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.game:hover {
  transform: translateY(-8px);
  border-color: var(--cyan);
  box-shadow: 0 18px 40px rgba(61, 255, 242, 0.16), 0 0 0 1px rgba(61, 255, 242, 0.4);
}

.cover {
  position: relative;
  height: 188px;
  overflow: hidden;
}

.game .cover {
  height: auto;
  aspect-ratio: 1;
}

.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game .cover img {
  object-fit: contain;
  object-position: center;
  background: #120e22;
}

.badge {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 10px;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(7, 6, 15, 0.72);
  color: var(--gold);
  font-family: var(--display);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.game-body { display: flex; flex: 1; flex-direction: column; padding: 12px 12px 14px; }

.game h3 { font-size: 0.95rem; line-height: 1.25; }

.game-line {
  display: flex;
  justify-content: space-between;
  margin: 6px 0 10px;
  color: var(--cyan);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-open {
  margin-top: auto;
  padding: 0.55rem 0.4rem;
  font-size: 0.66rem;
}

.cover-mahjong { background: radial-gradient(circle at 50% 30%, #ff5d73, #6d1230 70%); }
.cover-tiger { background: radial-gradient(circle at 50% 30%, #ffb703, #c2410c 68%); }
.cover-ox { background: radial-gradient(circle at 50% 30%, #fde68a, #b45309 70%); }
.cover-bandito { background: radial-gradient(circle at 50% 30%, #fb7185, #7c2d12 70%); }
.cover-aztec { background: radial-gradient(circle at 50% 30%, #5eead4, #0f766e 72%); }
.cover-neko { background: radial-gradient(circle at 50% 30%, #f9a8d4, #9d174d 70%); }
.cover-qilin { background: radial-gradient(circle at 50% 30%, #86efac, #166534 72%); }
.cover-caishen { background: radial-gradient(circle at 50% 30%, #fca5a5, #991b1b 72%); }
.cover-cocktail { background: radial-gradient(circle at 50% 30%, #d8b4fe, #6b21a8 72%); }
.cover-dragon { background: radial-gradient(circle at 50% 30%, #fdba74, #9a3412 72%); }
.cover-ganesha { background: radial-gradient(circle at 50% 30%, #fcd34d, #7c3aed 74%); }
.cover-rabbit { background: radial-gradient(circle at 50% 30%, #fecdd3, #be185d 72%); }

.empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px;
  border: 1px dashed rgba(61, 255, 242, 0.45);
  border-radius: 18px;
  color: var(--muted);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.foot-brand { margin-right: auto; }

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.foot-nav a,
.subnav a {
  color: var(--cyan);
  font-size: 0.98rem;
  text-decoration: none;
}

.foot-nav a:hover,
.subnav a:hover { color: white; }

.sub {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

body[data-page] .lang { margin-left: auto; }

.sub h1 {
  margin: 0 0 18px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.15;
}

.sheet {
  display: grid;
  gap: 14px;
}

.article-meta {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.article-lead {
  margin: 0 0 22px;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.7;
}

.sheet section,
.contact-card {
  display: grid;
  gap: 10px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(139, 108, 255, 0.35);
  border-radius: 18px;
  background: rgba(16, 12, 32, 0.88);
}

.sheet h2 {
  margin: 0;
  font-size: 1.25rem;
}

.sheet p,
.sheet li,
.contact-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.65;
}

.sheet ul,
.sheet ol {
  margin: 0;
  padding-left: 1.15rem;
}

.sheet li + li { margin-top: 6px; }

.more-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.more-links a {
  color: var(--cyan);
  font-weight: 700;
  text-decoration: none;
}

.more-links a:hover { color: white; }

html[lang="en"] .sub h1 {
  font-family: var(--mark);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 18px;
}

.subnav a[aria-current="page"] { color: white; }

.contact-card { margin-top: 14px; }

.contact-form {
  display: grid;
  gap: 12px;
}

.contact-form label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.95rem;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(61, 255, 242, 0.35);
  border-radius: 12px;
  background: rgba(7, 6, 15, 0.65);
  color: white;
  font: inherit;
}

.contact-form textarea { min-height: 140px; resize: vertical; }

.form-note {
  min-height: 1.4em;
  margin: 0;
  color: var(--cyan);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(4, 2, 12, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.scrim.is-open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(420px, 100%);
  overflow: auto;
  background: #120e22;
  color: var(--ink);
  border-left: 1px solid rgba(61, 255, 242, 0.35);
  box-shadow: -24px 0 80px rgba(139, 108, 255, 0.25);
  transform: translateX(104%);
  transition: transform 0.28s ease;
}

.drawer.is-open { transform: translateX(0); }

.drawer-art { height: 180px; }

.drawer-art.cover svg { width: 110px; height: 110px; }

.drawer-body { padding: 18px 18px 32px; }

.drawer-top { display: flex; justify-content: flex-end; }

.drawer-close {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: transparent;
  color: white;
  padding: 0.35rem 0.75rem;
  font-family: var(--display);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.drawer h2 { margin: 10px 0; font-size: clamp(1.5rem, 4vw, 2rem); }

.receipt { margin: 16px 0; }

.receipt div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; color: var(--gold); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

.tags li {
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(61, 255, 242, 0.35);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toast {
  position: fixed;
  bottom: 16px;
  left: 50%;
  z-index: 70;
  width: min(420px, calc(100% - 24px));
  padding: 12px 14px;
  transform: translateX(-50%) translateY(140%);
  border: 1px solid rgba(61, 255, 242, 0.5);
  border-radius: 16px;
  background: #161228;
  color: white;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease;
}

.toast.is-on { transform: translateX(-50%) translateY(0); }

body.lock { overflow: hidden; }

@media (max-width: 980px) {
  .stage { grid-template-columns: 1fr; min-height: 0; padding-top: 18px; }
  .lobby { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
  .brand-note { display: none; }
  .search { flex: 1 1 100%; margin-left: 0; order: 3; }
  .lobby { grid-template-columns: repeat(2, 1fr); }
  .stage h1 { font-size: 2.5rem; }
  .rack-section { scroll-margin-top: 132px; }
  .foot { flex-direction: column; align-items: flex-start; }
}

html[lang="th"] .boot-sub,
html[lang="th"] .pill,
html[lang="th"] .kicker,
html[lang="th"] .chip,
html[lang="th"] .btn-play,
html[lang="th"] .btn-spin,
html[lang="th"] .game-open,
html[lang="th"] .search-go,
html[lang="th"] .drawer-close,
html[lang="th"] .machine-label,
html[lang="th"] .stage h1,
html[lang="th"] .rack-head h2,
html[lang="th"] .game h3,
html[lang="th"] .machine h2,
html[lang="th"] .drawer h2 {
  letter-spacing: 0;
  text-transform: none;
  font-family: "Noto Sans Thai", sans-serif;
}

html[lang="en"] .stage h1,
html[lang="en"] .rack-head h2,
html[lang="en"] .machine h2,
html[lang="en"] .drawer h2,
html[lang="en"] .game h3 {
  font-family: var(--mark);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .boot { display: none; }
}
