/* Moss & Mallow website - cozy wood + cream, matching the in-game UI kit.
   Mobile first; every page works from 320px phones to wide desktops. */
:root {
  --cream: #fff4e6;
  --cream-2: #fbe9cc;
  --paper: #fffaf0;
  --wood: #8a5a2b;
  --wood-dark: #4a2a12;
  --brown: #74351c;
  --ink: #3c2b09;
  --muted: #7a5a3a;
  --leaf: #7cc04b;
  --leaf-dark: #4f9a2e;
  --rose: #e04a5f;
  --sky: #4a78b8;
  --radius: 16px;
  --shadow: 0 6px 0 rgba(74, 42, 18, 0.25), 0 10px 24px rgba(74, 42, 18, 0.18);
  --font: "Noto Sans Thai", "Leelawadee UI", "Tahoma", system-ui, sans-serif;
  --display: "Mitr", "Noto Sans Thai", system-ui, sans-serif;
}

* { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: #cfe7a9 url("../img/leaf-pattern.svg");
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brown); }
h1, h2, h3 { font-family: var(--display); line-height: 1.25; margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3.6vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

/* Language switch: show only the active language. */
[data-lang="th"] .en, [data-lang="en"] .th { display: none !important; }

.wrap { width: min(1100px, 100% - 32px); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(#9a6634, var(--wood));
  border-bottom: 4px solid var(--wood-dark);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; margin-right: auto; }
.brand img { height: 44px; width: auto; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  color: var(--cream); text-decoration: none; font-weight: 600; padding: 8px 12px;
  border-radius: 10px; white-space: nowrap;
}
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255, 244, 230, 0.16); }
.lang-btn {
  font: 600 14px var(--font); color: var(--ink); background: var(--cream);
  border: 2px solid var(--wood-dark); border-radius: 999px; padding: 6px 12px; cursor: pointer;
  min-height: 44px; min-width: 52px;
}
.menu-btn { display: none; }

@media (max-width: 860px) {
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--wood-dark);
    background: var(--cream); font-size: 22px; cursor: pointer;
  }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--wood); border-bottom: 4px solid var(--wood-dark);
    display: none; padding: 8px 16px 14px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 17px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 26px; border-radius: 14px;
  font: 600 18px var(--display); text-decoration: none; cursor: pointer;
  border: 3px solid var(--wood-dark); box-shadow: 0 4px 0 var(--wood-dark);
}
@media (prefers-reduced-motion: no-preference) { .btn { transition: transform 0.08s, box-shadow 0.08s; } }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--wood-dark); }
.btn-play { background: linear-gradient(#9bd66a, var(--leaf)); color: #1e3d0b; }
.btn-wood { background: linear-gradient(#ffe7a8, #f2c46d); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--cream);
  min-height: min(82vh, 760px); display: grid; place-items: center; text-align: center;
  padding: 48px 0 64px;
}
.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  object-position: 60% 50%;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(28, 16, 4, 0.35), rgba(28, 16, 4, 0.6));
}
.hero .wrap { position: relative; z-index: 1; }
.hero-logo { width: min(640px, 92%); height: auto; margin: 0 auto 6px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35)); }
.hero p.lead {
  font-size: clamp(1.05rem, 2.6vw, 1.35rem); max-width: 40em; margin: 0 auto 22px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); font-weight: 500;
}
.hero .beta-note {
  display: inline-block; margin: 14px auto 0; padding: 6px 14px; border-radius: 999px;
  background: rgba(43, 27, 12, 0.78); border: 1px solid #ffe7a8; color: var(--cream); font-size: 14px; line-height: 1.5;
}
.hero .beta-note b { color: #ffe7a8; letter-spacing: 0.05em; margin-right: 4px; }
.hero small { display: block; margin-top: 14px; opacity: 0.9; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }

/* ---------- sections & cards ---------- */
.section { padding: 56px 0; }
.section.alt { background: rgba(255, 244, 230, 0.55); }
.section-title { text-align: center; margin-bottom: 28px; }
.section-title p { color: var(--muted); max-width: 36em; margin: 0 auto; }

.panel {
  background: var(--cream); border: 3px solid var(--wood); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.feature img { border-radius: 12px; border: 2px solid var(--wood); margin-bottom: 14px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: #fff; }
.feature h3 { color: var(--brown); }
.tag {
  display: inline-block; font-size: 14px; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  background: var(--cream-2); border: 1.5px solid var(--wood); color: var(--brown); margin: 0 4px 6px 0;
}
.tag.soon { background: #e8e1f5; border-color: #8a6fbf; color: #4b3384; }

.split { display: grid; gap: 28px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 860px) { .split { grid-template-columns: 1.1fr 0.9fr; } .split.flip > :first-child { order: 2; } }
.split img { border-radius: var(--radius); border: 3px solid var(--wood); box-shadow: var(--shadow); background: #fff; }

.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }
.mallow-card { text-align: center; }
.mallow-card img { width: auto; height: 128px; max-width: 100%; object-fit: contain; margin: 0 auto 8px; }
.split .mallow-card img { border: 0; box-shadow: none; background: none; border-radius: 0; }
.mallow-card .theme { color: var(--muted); font-size: 14px; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; position: relative; padding: 14px 16px 14px 62px; }
.steps li::before {
  content: counter(s); position: absolute; left: 14px; top: 14px;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--leaf); color: #1e3d0b; font: 700 17px var(--display); border: 2px solid var(--leaf-dark);
}

table { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: 12px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--cream-2); vertical-align: top; }
th { background: var(--cream-2); font-family: var(--display); font-weight: 600; }
.table-scroll { overflow-x: auto; border-radius: 12px; border: 2px solid var(--wood); }
kbd {
  display: inline-block; min-width: 1.9em; text-align: center; padding: 1px 7px;
  border: 2px solid var(--wood); border-bottom-width: 3px; border-radius: 7px; background: var(--paper);
  font: 600 14px var(--font);
}

details.faq { padding: 0; overflow: hidden; }
details.faq + details.faq { margin-top: 12px; }
details.faq summary {
  cursor: pointer; padding: 16px 48px 16px 18px; font-weight: 600; list-style: none; position: relative;
  font-family: var(--display); font-size: 1.05rem;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; position: absolute; right: 18px; top: 12px; font-size: 24px; color: var(--brown); }
details.faq[open] summary::after { content: "–"; }
details.faq > div { padding: 0 18px 16px; }

.note {
  background: #eaf6dc; border: 2px solid var(--leaf-dark); border-radius: 12px; padding: 12px 16px;
}
.cta { text-align: center; }
.cta .panel { padding: 34px 22px; }

.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { margin-top: 1.4em; }
.update { border-left: 6px solid var(--leaf); }
.update .date { color: var(--muted); font-size: 14px; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 40px; background: var(--wood-dark); color: var(--cream-2); padding: 34px 0 40px; font-size: 15px;
}
.site-footer a { color: var(--cream); }
.site-footer .wrap { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h3 { color: var(--cream); font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer .fine { grid-column: 1 / -1; opacity: 0.85; font-size: 14px; }

/* ---------- accessibility ---------- */
/* Visible keyboard focus everywhere (cream ring + dark halo shows on wood and on cream). */
:focus-visible { outline: 3px solid #fff4e6; outline-offset: 2px; box-shadow: 0 0 0 6px #4a2a12; border-radius: 6px; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--cream); color: var(--ink); padding: 10px 16px; border-radius: 10px;
  border: 2px solid var(--wood-dark); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn-nav { min-height: 44px; padding: 6px 16px; font-size: 16px; }a.card-link { display: block; text-decoration: none; color: var(--ink); }
a.card-link small { display: block; color: var(--leaf-dark); font-weight: 600; margin-top: 4px; }
a.card-link:hover { border-color: var(--leaf-dark); }
