:root {
  --bg: #0b0d17;
  --bg-2: #11142280;
  --surface: #151829;
  --surface-2: #1c2036;
  --line: #262b47;
  --text: #eef0fa;
  --muted: #9aa0bf;
  --primary: #ffc53d;
  --primary-ink: #1a1300;
  --violet: #7c5cff;
  --cyan: #2ee6d6;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Prompt", var(--font);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(124, 92, 255, .22), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(46, 230, 214, .10), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--font-head); padding: 12px 20px; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 20px rgba(255, 197, 61, .25); }
.btn-primary:hover { background: #ffd56b; }
.btn-ghost { border-color: var(--line); background: rgba(255,255,255,.03); }
.btn-ghost:hover { border-color: #3a4170; background: rgba(255,255,255,.06); }
.btn-sm { padding: 9px 14px; font-size: 14px; }
.btn-lg { padding: 16px 28px; font-size: 17px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 23, .82); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(38, 43, 71, .7);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 22px var(--font-head); letter-spacing: .5px; }
.brand b { color: var(--primary); font-weight: 700; }
.main-nav { display: flex; gap: 4px; margin-left: 12px; }
.main-nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.main-nav a:hover, .main-nav a.active { color: var(--text); background: rgba(255,255,255,.05); }
.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.nav-toggle { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: transparent; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; }

/* Hero */
.hero { padding: 56px 0 24px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; background: rgba(46, 230, 214, .08); color: var(--cyan);
  border: 1px solid rgba(46, 230, 214, .25);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(46,230,214,.18); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(46,230,214,0); } }
.hero h1 { font-size: clamp(34px, 5vw, 56px); margin: 18px 0 14px; }
.grad { background: linear-gradient(90deg, var(--primary), #ff8a3d 50%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 17px; max-width: 540px; }

.search {
  display: flex; align-items: center; gap: 8px; margin: 26px 0 14px; max-width: 560px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 14px;
  box-shadow: var(--shadow);
}
.search svg, .filter svg { width: 20px; height: 20px; fill: var(--muted); flex: none; }
.search input, .filter input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text);
  font: 500 16px var(--font); padding: 10px 4px;
}
.search input::placeholder, .filter input::placeholder { color: #6f7598; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-tags a { font-size: 13px; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.hero-tags a:hover { color: var(--text); border-color: #3a4170; }

.hero-art { position: relative; height: 420px; }
.hero-art .tile {
  position: absolute; width: 150px; aspect-ratio: 1; border-radius: 26px; overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,.5); border: 2px solid rgba(255,255,255,.08);
  animation: float 6s ease-in-out infinite;
}
.hero-art .tile img { width: 100%; height: 100%; object-fit: cover; }
.hero-art .t0 { left: 6%;  top: 8%;  transform: rotate(-8deg); }
.hero-art .t1 { left: 38%; top: 0;   width: 170px; animation-delay: -1s; }
.hero-art .t2 { right: 2%; top: 14%; transform: rotate(9deg); animation-delay: -2s; }
.hero-art .t3 { left: 0;   bottom: 6%; width: 160px; transform: rotate(6deg); animation-delay: -3s; }
.hero-art .t4 { left: 34%; bottom: 0;  width: 180px; transform: rotate(-4deg); animation-delay: -4s; }
.hero-art .t5 { right: 6%; bottom: 10%; transform: rotate(-10deg); animation-delay: -5s; }
.hero-art .glow { position: absolute; inset: 20% 15%; background: radial-gradient(circle, rgba(124,92,255,.55), transparent 70%); filter: blur(30px); z-index: -1; }
@keyframes float { 50% { translate: 0 -10px; } }

/* Features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.feature { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.feature .ficon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 22px; border-radius: 12px; background: var(--surface-2); }
.feature .ficon svg { width: 22px; height: 22px; fill: var(--primary); }
.feature b { display: block; font-family: var(--font-head); font-weight: 600; }
.feature span { color: var(--muted); font-size: 13px; }

/* Sections */
.section { padding-top: 56px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); margin: 0; }
.section-head small { font-size: 15px; font-family: var(--font); font-weight: 400; }
.eyebrow { display: block; font: 700 12px var(--font-head); letter-spacing: 2px; color: var(--primary); margin-bottom: 6px; }
.filter { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 2px 12px; width: 280px; max-width: 100%; }

/* Game grid */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.game-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.game-card:hover { transform: translateY(-4px); border-color: rgba(255,197,61,.6); box-shadow: 0 14px 30px rgba(0,0,0,.4); }
.game-thumb { aspect-ratio: 1; background: linear-gradient(135deg, #22264a, #151829); display: grid; place-items: center; overflow: hidden; }
.game-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.game-card:hover .game-thumb img { transform: scale(1.06); }
.game-fallback { font: 700 34px var(--font-head); color: transparent; background: linear-gradient(135deg, var(--primary), var(--violet)); -webkit-background-clip: text; background-clip: text; }
.game-meta { padding: 10px 12px 12px; }
.game-name { display: block; font-weight: 600; font-size: 14px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.7em; }
.game-sub { font-size: 12px; color: var(--muted); }
.game-grid.featured { grid-template-columns: repeat(6, 1fr); }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.steps .num { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: var(--primary-ink); font: 700 18px var(--font-head); margin-bottom: 12px; }
.steps b { display: block; font-family: var(--font-head); font-size: 17px; }
.steps p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 0 0 14px; color: var(--muted); }

/* CTA */
.cta {
  margin-top: 56px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 32px; border-radius: 22px; border: 1px solid rgba(124,92,255,.35);
  background: linear-gradient(120deg, rgba(124,92,255,.25), rgba(255,197,61,.12));
}
.cta h2 { margin: 0 0 4px; }
.cta p { margin: 0; color: var(--muted); }

/* Soon page */
.soon { padding: 56px 16px; }
.soon-card { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 28px; }
.soon-card.center { grid-template-columns: 1fr; text-align: center; }
.game-thumb.big { border-radius: 18px; }
.soon-info { color: var(--muted); padding-left: 18px; }

/* Footer */
.site-footer { margin-top: 72px; border-top: 1px solid var(--line); background: rgba(0,0,0,.2); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; padding-top: 40px; padding-bottom: 24px; }
.footer-grid h4 { font-size: 15px; margin-bottom: 10px; }
.footer-grid a:not(.brand) { display: block; color: var(--muted); padding: 3px 0; font-size: 14px; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--line); padding-top: 16px; padding-bottom: 24px; color: var(--muted); font-size: 13px; }

/* Responsive */
@media (max-width: 1024px) {
  .game-grid.featured { grid-template-columns: repeat(4, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; margin: 0; padding: 12px 16px 16px;
    background: rgba(11,13,23,.97); border-bottom: 1px solid var(--line); display: none;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px; }
  .hero { padding-top: 28px; }
  .hero-inner { grid-template-columns: 1fr; gap: 8px; }
  .hero-art { height: 260px; order: -1; }
  .hero-art .tile { width: 96px; border-radius: 18px; }
  .hero-art .t1 { width: 110px; } .hero-art .t3 { width: 100px; } .hero-art .t4 { width: 116px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .soon-card { grid-template-columns: 1fr; }
  .soon-card .game-thumb.big { max-width: 200px; }
}
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .game-grid, .game-grid.featured { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .game-meta { padding: 8px; }
  .game-name { font-size: 12.5px; }
  .features { grid-template-columns: 1fr 1fr; gap: 10px; }
  .feature { flex-direction: column; align-items: flex-start; padding: 14px; }
  .steps { grid-template-columns: 1fr; }
  .search .btn { padding: 10px 14px; }
  .filter { width: 100%; }
  .cta { padding: 22px; }
  .brand { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
