/* monia-online.com: one stylesheet for every page. Colours follow the game's theme (client/ui/theme.tres).
   No web fonts: the system's own (Thai included), like the game. */
:root {
  --bg: #12141c;
  --bg-2: #181a24;
  --panel: #1f212c;
  --panel-2: #292b38;
  --line: #4d5266;
  --gold: #edc261;
  --gold-hi: #ffe199;
  --gold-deep: #b8862e;
  --text: #ebebe6;
  --muted: #a8abb8;
  --red: #eb4d40;
  --green: #80eb80;
  --brown: #3d210d;
  --max: 1120px;
  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Sukhumvit Set", "Noto Sans Thai", "Leelawadee UI",
    "Thonburi", Tahoma, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--font);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-hi); }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 10; background: var(--gold); color: var(--bg); padding: 8px 12px; }

/* The pixel frame: notched corners like the game's panels. */
.frame {
  --n: 6px;
  background: var(--panel);
  border: 2px solid var(--line);
  clip-path: polygon(var(--n) 0, calc(100% - var(--n)) 0, 100% var(--n), 100% calc(100% - var(--n)),
    calc(100% - var(--n)) 100%, var(--n) 100%, 0 calc(100% - var(--n)), 0 var(--n));
}

/* Header */
.site-head {
  position: sticky; top: 0; z-index: 5;
  background: rgba(18, 20, 28, .92);
  border-bottom: 2px solid var(--panel-2);
}
@supports (backdrop-filter: blur(6px)) { .site-head { backdrop-filter: blur(6px); background: rgba(18, 20, 28, .78); } }
.site-head .wrap { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
.brand img { width: 32px; height: 32px; border-radius: 7px; }
.brand span { white-space: nowrap; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 10px; font-size: 15px; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--gold); }
.nav .lang {
  color: var(--text); border: 2px solid var(--line); padding: 4px 10px; margin-left: 4px; font-weight: 700; font-size: 14px;
}
.nav .lang:hover { border-color: var(--gold); }
@media (max-width: 420px) { .nav .hide-sm { display: none; } .brand span { font-size: 15px; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px;
  background: var(--gold); color: #2a1a05; font-weight: 800; text-decoration: none;
  border: 0; box-shadow: inset 0 -4px 0 var(--gold-deep), inset 0 2px 0 var(--gold-hi);
}
.btn:hover { background: var(--gold-hi); color: #2a1a05; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }

/* Hero */
.hero { position: relative; isolation: isolate; overflow: hidden; border-bottom: 2px solid var(--panel-2); }
.hero-bg { position: absolute; inset: 0; z-index: -2; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(18,20,28,.55) 0%, rgba(18,20,28,.35) 40%, rgba(18,20,28,.92) 88%, var(--bg) 100%);
}
.hero .wrap { padding-top: 28px; padding-bottom: 40px; text-align: center; }
.hero-logo { width: min(560px, 92%); margin: 0 auto; filter: drop-shadow(0 6px 0 rgba(0,0,0,.35)); }
.tagline { font-size: clamp(18px, 4.6vw, 24px); font-weight: 700; margin: 8px auto 6px; max-width: 34em; text-shadow: 0 2px 0 #000; }
.sub { color: #d6d7dd; max-width: 38em; margin: 0 auto 18px; text-shadow: 0 1px 0 #000; }
.badges { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.badges a, .badges .badge { display: block; line-height: 0; }

/* Store badges at one visible height. The files are the official ones, unmodified: the Google Play PNGs carry
   transparent clear space, which the box below trims by overflow (no pixel of the badge changes). */
.badge-apple img { height: 48px; width: auto; }
.badge-gp { height: 48px; overflow: hidden; display: block; }
.badge-gp img { max-width: none; }
.badge-gp.en { width: 161px; }
.badge-gp.en img { height: 71.4px; width: auto; margin: -11.7px 0 0 -11.7px; }
.badge-gp.th { width: 161px; }
.badge-gp.th img { height: 62.5px; width: auto; margin: -7.25px 0 0 0; }
.soon-note { color: var(--muted); font-size: 14px; margin-top: 10px; }

/* Sections */
section { padding: 48px 0; }
.section-title { text-align: center; font-size: clamp(24px, 6vw, 34px); color: var(--gold); text-shadow: 0 3px 0 var(--brown); }
.section-lead { text-align: center; color: var(--muted); max-width: 40em; margin: 0 auto 28px; }

.features { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .features { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(4, 1fr); } }
.feature { padding: 20px 18px 18px; }
.feature .art { height: 72px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; margin-bottom: 12px; }
.feature .art img { width: auto; }
.feature .art .x2 { height: 64px; }
.feature .art .x3 { height: 64px; } /* whole-number scales only: 32 px art x2, 64 px art x1 */
.feature h3 { color: var(--gold); font-size: 19px; text-align: center; }
.feature p { color: #cfd0d7; font-size: 15px; margin: 0; }

.gallery { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .gallery { grid-template-columns: 1fr 1fr; } .gallery .wide { grid-column: 1 / -1; } }
.shot { margin: 0; padding: 6px; }
.shot img { width: 100%; }
.shot figcaption { color: var(--muted); font-size: 14px; padding: 8px 6px 2px; }

.cta { text-align: center; }
.cta .frame { padding: 28px 18px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.cta img.icon { width: 88px; height: 88px; border-radius: 20px; margin: 0 auto 12px; }

/* Text pages (terms, privacy, support) */
.page { padding: 32px 0 56px; }
.page .wrap { max-width: 820px; }
.page h1 { font-size: clamp(26px, 7vw, 38px); color: var(--gold); text-shadow: 0 3px 0 var(--brown); }
.page h2 { font-size: 21px; color: var(--gold); margin-top: 1.8em; padding-top: .4em; border-top: 2px solid var(--panel-2); }
.page h3 { font-size: 17px; margin-top: 1.3em; }
.page li { margin-bottom: .35em; }
.page ul, .page ol { padding-left: 1.3em; }
.meta { color: var(--muted); font-size: 14px; }
.note { background: var(--panel); border-left: 4px solid var(--gold); padding: 12px 14px; margin: 16px 0; }
.toc { padding: 14px 18px; margin: 20px 0; }
.toc ol { margin: 0; }
.table-wrap { overflow-x: auto; margin: 12px 0 18px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--panel-2); }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; min-height: 32px; margin-bottom: 12px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px;
  background: var(--gold); color: #2a1a05; font-weight: 800; display: grid; place-items: center;
}
.cards { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 18px 0; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { padding: 16px; }
.card h3 { margin-top: 0; color: var(--gold); }
.mail { font-size: 19px; font-weight: 700; word-break: break-all; }

/* Download / coming soon / 404 */
.center-page { min-height: 62vh; display: grid; place-items: center; text-align: center; padding: 40px 0; }
.center-page .icon { width: 112px; height: 112px; border-radius: 24px; margin: 0 auto 18px; }
.center-page h1 { color: var(--gold); text-shadow: 0 3px 0 var(--brown); font-size: clamp(26px, 7vw, 36px); }
.center-page .sprite { height: 96px; width: auto; margin: 0 auto 12px; }
.redirecting { color: var(--muted); }
[hidden] { display: none !important; }

/* Footer */
.site-foot { border-top: 2px solid var(--panel-2); background: var(--bg-2); padding: 28px 0 36px; color: var(--muted); font-size: 14px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: center; justify-content: space-between; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot a { color: var(--text); text-decoration: none; }
.site-foot a:hover { color: var(--gold); }
.studio { display: flex; align-items: center; gap: 10px; }
.studio img { width: 40px; height: auto; }
.legal-small { width: 100%; font-size: 12px; color: #7d8090; margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a, .badges a { transition: transform .12s, background-color .12s, color .12s; }
  .badges a:hover { transform: translateY(-2px); }
}

/* Thai has no spaces between words: a phrase in .nw never breaks inside (the browser's own Thai breaks can split
   a word such as ผจญ|ภัย in a centred heading). Keep each .nw phrase short enough for a 358px line. */
.nw { white-space: nowrap; display: inline-block; }

@media (min-width: 900px) {
  .hero .wrap { padding-top: 56px; padding-bottom: 72px; }
  .hero-logo { width: 600px; }
}
