:root {
  --bg: #0b2822;
  --bg-2: #123a30;
  --panel: #173c32;
  --line: rgba(235, 171, 57, .28);
  --gold: #ebab39;
  --gold-2: #e0be6e;
  --cream: #faefd3;
  --text: #ede4cc;
  --muted: #a9bdb1;
  --ink: #173c32;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(235, 171, 57, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(46, 120, 96, .25), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 17px/1.7 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans CJK SC", "Noto Sans KR", sans-serif;
}

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

a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--cream); }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ---- header */
.top { border-bottom: 1px solid var(--line); background: rgba(11, 40, 34, .85); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-weight: 700; white-space: nowrap; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.top nav { display: flex; gap: 18px; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--cream); }

/* ---- language menu */
.lang { position: relative; flex: none; }
.lang summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { color: var(--cream); border-color: var(--gold); }
.lang ul { position: absolute; right: 0; top: calc(100% + 8px); margin: 0; padding: 6px; list-style: none; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, .4); min-width: 150px; }
.lang li a { display: block; padding: 6px 12px; border-radius: 8px; color: var(--text); text-decoration: none; white-space: nowrap; }
.lang li a:hover { background: rgba(235, 171, 57, .14); color: var(--cream); }
.lang li a[aria-current] { color: var(--gold); font-weight: 600; }

/* ---- hero */
.hero { padding: 56px 0 40px; }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1fr 1.15fr; } }
.eyebrow { color: var(--gold); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; margin: 0 0 10px; }
h1 { font-family: Georgia, "Noto Serif", "Noto Serif CJK SC", serif; color: var(--cream); font-size: clamp(34px, 6vw, 56px); line-height: 1.08; margin: 0 0 18px; letter-spacing: -.01em; }
.lead { font-size: 19px; color: var(--text); margin: 0 0 22px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.facts li { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; color: var(--muted); }
.badge { display: inline-block; }
.badge img { height: 72px; width: auto; margin-left: -10px; }
.hero-shot { border-radius: 20px; border: 2px solid var(--gold-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }

/* ---- sections */
section { padding: 56px 0; }
section + section { border-top: 1px solid rgba(235, 171, 57, .12); }
h2 { font-family: Georgia, "Noto Serif", "Noto Serif CJK SC", serif; color: var(--cream); font-size: clamp(26px, 4vw, 36px); line-height: 1.2; margin: 0 0 12px; }
h3 { color: var(--cream); font-size: 20px; margin: 0 0 8px; }
.section-lead { color: var(--muted); max-width: 720px; margin: 0 0 32px; }

/* ---- game cards (the app's lobby, on the web) */
.games { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.game { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 18px 12px 16px; background: var(--cream); color: var(--ink); border-radius: var(--radius); border-top: 6px solid var(--gold); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.game:hover { color: var(--ink); transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, .35); }
.game img { width: 112px; height: 112px; }
.game strong { font-size: 18px; line-height: 1.2; }
.game span { font-size: 13px; color: #5e7264; line-height: 1.35; }

/* ---- asian classics */
.split { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1.1fr 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.chips a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border: 1px solid var(--line); border-radius: 999px; color: var(--cream); text-decoration: none; background: rgba(23, 60, 50, .6); }
.chips a:hover { border-color: var(--gold); }
.chips img { width: 30px; height: 30px; }
.chips small { color: var(--muted); }

/* ---- screenshots */
.shots { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 240px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 18px; margin: 0 -4px; }
.shots figure { margin: 0; scroll-snap-align: start; }
.shots img { border-radius: 16px; border: 1px solid var(--line); }
.shots figcaption { color: var(--muted); font-size: 14px; text-align: center; margin-top: 8px; }

/* ---- features */
.features { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature { background: rgba(23, 60, 50, .65); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature p { margin: 0; color: var(--muted); font-size: 16px; }

/* ---- faq */
.faq { max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; color: var(--cream); font-weight: 600; font-size: 18px; }
.faq details p { color: var(--muted); margin: 10px 0 0; }

/* ---- game page */
.crumbs { font-size: 14px; color: var(--muted); padding-top: 24px; }
.crumbs a { color: var(--muted); }
.game-hero { display: grid; gap: 36px; padding: 28px 0 8px; }
@media (min-width: 900px) { .game-hero { grid-template-columns: 1.25fr .75fr; align-items: start; } }
.title-row { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; }
.title-row img { width: 96px; height: 96px; flex: none; }
.title-row h1 { margin: 0; font-size: clamp(30px, 5vw, 46px); }
.aka { color: var(--gold); font-weight: 600; margin: 4px 0 0; }
.phone { max-width: 320px; margin: 0 auto; border-radius: 24px; border: 2px solid var(--gold-2); box-shadow: 0 30px 70px rgba(0, 0, 0, .45); overflow: hidden; }
.rules { margin: 0; padding-left: 1.2rem; }
.rules li { margin: 8px 0; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; padding: 0; list-style: none; }
.meta li { background: rgba(235, 171, 57, .14); color: var(--cream); border-radius: 8px; padding: 3px 10px; font-size: 14px; }
.more { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.more a { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--text); text-decoration: none; font-size: 15px; padding: 12px 6px; border-radius: 14px; }
.more a:hover { background: rgba(23, 60, 50, .7); color: var(--cream); }
.more img { width: 72px; height: 72px; }

/* ---- detailed rules */
.detail-link { margin: 14px 0 0; font-weight: 600; }
.detail { max-width: 820px; }
.detail h3 { margin-top: 32px; }
.detail p { margin: 0 0 12px; }
.diagram { margin: 18px 0 22px; max-width: 520px; background: var(--cream); border-radius: var(--radius); padding: 14px; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram figcaption { color: #4c5e52; font-size: 15px; line-height: 1.55; margin-top: 10px; }
.legend { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.legend li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.legend svg { flex: none; background: var(--cream); border-radius: 6px; }
.table-wrap { overflow-x: auto; margin: 12px 0 8px; }
.detail table { border-collapse: collapse; width: 100%; font-size: 15px; }
.detail th, .detail td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.detail th { color: var(--cream); font-weight: 600; }
.detail td { color: var(--text); }

/* ---- cta + footer */
.cta { text-align: center; }
.cta .badge img { margin: 0 auto; }
footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
footer p { margin: 0; }

/* ---- per-language type: CJK glyphs differ by locale, and Georgia has no CJK, Thai or full Vietnamese */
html:lang(zh-Hans) body { font-family: system-ui, -apple-system, "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif; }
html:lang(zh-Hant) body { font-family: system-ui, -apple-system, "PingFang TC", "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif; }
html:lang(ja) body { font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans CJK JP", "Yu Gothic", "Meiryo", sans-serif; }
html:lang(ko) body { font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", sans-serif; }
html:lang(th) body { font-family: system-ui, -apple-system, "Noto Sans Thai", "Leelawadee UI", "Thonburi", sans-serif; line-height: 1.8; }
html:not(:lang(en)) h1, html:not(:lang(en)) h2 { font-family: inherit; font-weight: 700; letter-spacing: 0; }
html:not(:lang(en)) .eyebrow { text-transform: none; letter-spacing: .02em; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .top nav { display: none; }
  .lang summary span { display: none; }
  .hero { padding-top: 32px; }
  .lead { font-size: 17px; }
  .games { grid-template-columns: repeat(2, 1fr); }
  .game img { width: 88px; height: 88px; }
  .title-row img { width: 72px; height: 72px; }
}
