/* cnb8 益智游戏 — site styles */
:root {
  --bg: #fafaff;
  --bg-soft: #f3f2fb;
  --card: #ffffff;
  --line: #e6e4f5;
  --text: #1c1b2e;
  --muted: #6f6e85;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --gold: #f59e0b;
  --radius: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Noto Sans Thai", "Noto Sans SC", -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 250, 255, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 900; font-size: 1.25rem; letter-spacing: .02em; display: flex; align-items: center; gap: 10px; }
.brand .logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.05rem; color: #fff; font-weight: 900;
}
.nav { display: flex; gap: 26px; font-size: .92rem; color: var(--muted); }
.nav a { transition: color .15s; }
.nav a:hover, .nav a.active { color: var(--text); }
.nav .btn-cta {
  color: #fff; background: var(--accent); padding: 8px 18px; border-radius: 999px; font-weight: 700;
}
.nav .btn-cta:hover { background: var(--accent-2); }

/* hero */
.hero { position: relative; padding: 88px 0 64px; overflow: hidden; text-align: center; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(560px 360px at 15% 10%, rgba(79, 70, 229, .12), transparent 60%),
              radial-gradient(520px 360px at 88% 30%, rgba(245, 158, 11, .14), transparent 60%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--muted); font-size: .85rem; padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}
.badge b { color: var(--accent); font-weight: 700; }
h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); line-height: 1.18; font-weight: 900; letter-spacing: -.01em; }
h1 .hl { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { color: var(--muted); font-size: 1.08rem; max-width: 640px; margin: 18px auto 30px; }
.store-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.store-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--text); color: #fff; padding: 12px 24px; border-radius: 14px; font-weight: 700;
  transition: transform .12s, background .15s;
}
.store-btn:hover { transform: translateY(-1px); background: #333150; }
.store-btn .s-ico { font-size: 1.4rem; line-height: 1; }
.store-btn small { display: block; font-size: .68rem; font-weight: 500; color: #c9c9dd; }
.hero-stats { display: flex; gap: 48px; justify-content: center; margin-top: 50px; flex-wrap: wrap; }
.hero-stats div b { display: block; font-size: 1.6rem; font-weight: 900; }
.hero-stats div span { color: var(--muted); font-size: .88rem; }

/* sections */
section { padding: 72px 0; }
.section-head { margin-bottom: 36px; text-align: center; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 900; }
.section-head p { color: var(--muted); margin-top: 8px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* game grid */
.game-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.game-card {
  border-radius: var(--radius); overflow: hidden; background: var(--card);
  border: 1px solid var(--line); transition: transform .15s, box-shadow .15s;
}
.game-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(79, 70, 229, .10); }
.game-tile { height: 130px; display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.t1 { background: linear-gradient(135deg, #eef1ff, #e3d9ff); }
.t2 { background: linear-gradient(135deg, #fff5e6, #ffe8c9); }
.t3 { background: linear-gradient(135deg, #e9fff5, #d2f7e8); }
.t4 { background: linear-gradient(135deg, #ffeef3, #ffe0ea); }
.game-card h3 { font-size: 1.05rem; font-weight: 800; padding: 16px 18px 4px; }
.game-card p { color: var(--muted); font-size: .88rem; padding: 0 18px 18px; }

/* features */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.feature .ico { font-size: 1.7rem; margin-bottom: 14px; }
.feature h3 { font-size: 1.02rem; font-weight: 800; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: .9rem; }

/* how it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; position: relative; }
.step .num {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 900; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.step h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: .92rem; }

/* faq */
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 22px; margin-bottom: 12px;
}
.faq summary { font-weight: 700; cursor: pointer; font-size: .98rem; }
.faq details p { color: var(--muted); margin-top: 10px; font-size: .93rem; }

/* cta band */
.band { background: linear-gradient(120deg, #241f4e, #3b2a7a); color: #fff; }
.band .section-head h2 { color: #fff; }
.band .section-head p { color: #c7c3e8; }

/* legal pages */
.legal { padding: 64px 0 80px; }
.legal h1 { font-size: 2rem; font-weight: 900; margin-bottom: 6px; }
.legal .updated { color: var(--muted); font-size: .88rem; margin-bottom: 34px; }
.legal h2 { font-size: 1.18rem; font-weight: 800; margin: 30px 0 10px; }
.legal p, .legal li { color: #45445c; font-size: .96rem; max-width: 760px; }
.legal ul { padding-left: 22px; margin-top: 8px; }
.legal li { margin-bottom: 6px; }
.legal .en { border-left: 3px solid var(--line); padding: 6px 0 6px 18px; margin-top: 18px; color: var(--muted); font-size: .9rem; }
.contact-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: flex; gap: 18px; align-items: flex-start; margin-bottom: 16px; max-width: 640px;
}
.contact-card .ico { font-size: 1.5rem; }
.contact-card b { display: block; margin-bottom: 4px; }
.contact-card a { color: var(--accent); font-weight: 600; }

/* footer */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 44px 0; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer .f-brand { font-weight: 900; color: var(--text); margin-bottom: 8px; font-size: 1rem; }
.site-footer .links { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer .links a:hover { color: var(--text); }
.site-footer .copy { width: 100%; color: #a09ebc; font-size: .82rem; margin-top: 18px; }

@media (max-width: 860px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .nav { display: none; }
  .hero { padding: 56px 0 44px; }
}
@media (max-width: 540px) {
  .game-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
}
