/* WORD RUN public pages: player guide, privacy notice, terms of use (2026-10-28).
   Candy style of the game (UiStyle colours), Itim from this folder, no external requests.
   Every page holds Thai and English; docs.js shows one (html[data-lang]). */
@font-face { font-family: 'Itim'; src: url('Itim-Regular.ttf') format('truetype'); font-display: swap; }
:root {
  --ink: #4a3b5c; --muted: #7b6d88; --orange: #ff7a00; --orange-dark: #b55600; --pink: #ff94b8; --pink-strong: #ff5f97;
  --light-pink: #ffd6e0; --cream: #fff9ed; --line: #f1d9e3; --green: #5cb86b; --page: #fff1f6; --card: #ffffff;
  --warn-bg: #fff3c4; --warn-line: #f2c94c; --shadow: 0 3px 0 rgba(181, 86, 0, .18), 0 6px 18px rgba(74, 59, 92, .08);
  --body-font: 'Itim', system-ui, -apple-system, 'Thonburi', 'Leelawadee UI', 'Noto Sans Thai', sans-serif;
  --text-font: system-ui, -apple-system, 'Thonburi', 'Leelawadee UI', 'Noto Sans Thai', 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--body-font); font-size: 18px; line-height: 1.65;
  background-image: radial-gradient(circle at 10% 0%, #ffe3ef 0, transparent 40%), radial-gradient(circle at 95% 10%, #fff0d6 0, transparent 35%); }
body.legal { font-family: var(--text-font); font-size: 16.5px; line-height: 1.75; }
/* one language at a time */
html[data-lang="th"] .L[lang="en"], html[data-lang="en"] .L[lang="th"] { display: none !important; }
a { color: #c8457a; text-underline-offset: 3px; }
a:hover { color: var(--orange); }
img { max-width: 100%; height: auto; }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; background: rgba(255, 241, 246, .94); backdrop-filter: blur(6px); border-bottom: 2px solid var(--line); }
.top-in { max-width: 980px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--orange); font-family: 'Itim', sans-serif; font-size: 22px; letter-spacing: .5px; white-space: nowrap; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.nav { display: flex; gap: 4px 14px; flex-wrap: wrap; font-family: 'Itim', sans-serif; font-size: 17px; flex: 1; }
.nav a { text-decoration: none; color: var(--ink); padding: 2px 4px; border-radius: 8px; }
.nav a[aria-current="page"] { color: var(--orange); border-bottom: 3px solid var(--orange); border-radius: 0; }
.langs { display: inline-flex; background: #fff; border: 2px solid var(--line); border-radius: 99px; padding: 2px; }
.langs button { font-family: 'Itim', sans-serif; font-size: 16px; border: 0; background: transparent; color: var(--ink); border-radius: 99px; padding: 4px 13px; cursor: pointer; }
.langs button[aria-pressed="true"] { background: var(--pink-strong); color: #fff; }
.play { font-family: 'Itim', sans-serif; font-size: 17px; text-decoration: none; color: #fff; background: var(--orange); border-radius: 99px; padding: 6px 18px; box-shadow: 0 3px 0 var(--orange-dark); white-space: nowrap; }
.play:hover { color: #fff; filter: brightness(1.06); }

/* page */
main { max-width: 980px; margin: 0 auto; padding: 18px 16px 40px; }
.hero { display: flex; gap: 22px; align-items: center; background: var(--card); border-radius: 26px; padding: 22px; box-shadow: var(--shadow); border: 2px solid var(--line); margin-bottom: 18px; }
.hero img.key { width: 46%; max-width: 420px; border-radius: 18px; }
.hero h1 { margin: 0 0 6px; }
h1, h2, h3 { font-family: 'Itim', sans-serif; font-weight: normal; line-height: 1.3; }
h1 { font-size: 36px; color: var(--orange); margin: 6px 0 10px; }
h2 { font-size: 27px; color: var(--pink-strong); margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
h2 img { width: 44px; height: auto; }
h3 { font-size: 21px; color: var(--ink); margin: 16px 0 6px; }
.lead { font-size: 19px; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: 22px; padding: 18px 22px; margin: 0 0 16px; box-shadow: var(--shadow); scroll-margin-top: 80px; }
.card > :last-child { margin-bottom: 0; }
p { margin: 0 0 10px; }
ul, ol { margin: 0 0 10px; padding-left: 24px; }
li { margin: 3px 0; }
.toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; padding: 0; list-style: none; font-family: 'Itim', sans-serif; }
.toc a { text-decoration: none; display: block; background: var(--cream); border-radius: 12px; padding: 6px 12px; border: 1.5px solid var(--line); color: var(--ink); }
.toc a:hover { border-color: var(--orange); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 8px 0 12px; }
.tile { background: var(--cream); border: 1.5px solid var(--line); border-radius: 18px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; }
.tile img { flex: none; width: 64px; height: 64px; object-fit: contain; }
.tile b { display: block; font-size: 19px; color: var(--orange); font-weight: normal; }
.tile p { margin: 0; font-size: 16.5px; line-height: 1.55; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps > li { counter-increment: s; position: relative; padding: 4px 0 8px 46px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 4px; width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; text-align: center; line-height: 34px; font-family: 'Itim', sans-serif; font-size: 19px; }
.kids { background: #fff7d6; border: 2.5px solid #ffc94d; border-radius: 18px; padding: 10px 16px; margin: 10px 0 12px; font-size: 1.05em; }
.kids b:first-child { display: block; font-family: 'Itim', sans-serif; font-size: 21px; font-weight: normal; color: var(--orange); margin-bottom: 2px; }
.kids ul { margin: 4px 0 0; }
.nw { white-space: nowrap; }
.note { background: var(--cream); border-left: 5px solid var(--pink); border-radius: 10px; padding: 8px 14px; margin: 8px 0 12px; }
.kbd, kbd { font-family: var(--text-font); font-size: .88em; background: #fff; border: 1.5px solid #d9c7d3; border-bottom-width: 3px; border-radius: 7px; padding: 0 6px; white-space: nowrap; }
table { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: .95em; }
th, td { text-align: left; vertical-align: top; padding: 7px 8px; border-bottom: 1.5px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.coins { display: inline-flex; gap: 4px; vertical-align: middle; }
.coins img { width: 28px; height: 28px; }
.shot { margin: 10px 0 14px; border: 2.5px dashed var(--pink); border-radius: 18px; background: repeating-linear-gradient(45deg, #fff, #fff 12px, #fff6fa 12px, #fff6fa 24px);
  min-height: 150px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 14px; color: var(--muted); font-size: 16px; }
.shot img { display: block; border-radius: 12px; }
.shot:has(img) { border: 0; background: none; padding: 0; min-height: 0; }
details { background: var(--cream); border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 14px; margin: 0 0 8px; }
summary { cursor: pointer; font-family: 'Itim', sans-serif; font-size: 18px; color: var(--ink); }
details[open] summary { color: var(--orange); margin-bottom: 4px; }
.draft { background: var(--warn-bg); border: 2.5px solid var(--warn-line); border-radius: 16px; padding: 10px 16px; margin: 0 0 16px; font-family: 'Itim', sans-serif; font-size: 19px; text-align: center; }
.placeholder { background: #ffe9a8; border-radius: 6px; padding: 0 5px; font-family: var(--text-font); font-weight: 600; }
.meta { color: var(--muted); font-size: 15px; }

/* footer */
footer { border-top: 2px solid var(--line); background: #fff7fa; }
.foot-in { max-width: 980px; margin: 0 auto; padding: 16px 16px 26px; display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; font-family: 'Itim', sans-serif; font-size: 16px; color: var(--muted); }
.foot-in nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-in a { color: var(--ink); }

@media (max-width: 640px) {
  body { font-size: 17px; }
  body.legal { font-size: 16px; }
  h1 { font-size: 29px; }
  h2 { font-size: 23px; }
  h2 img { width: 36px; }
  .hero { flex-direction: column; padding: 16px; }
  .hero img.key { width: 100%; }
  .card { padding: 14px 15px; border-radius: 18px; }
  .nav { order: 3; flex-basis: 100%; font-size: 16px; }
  .top-in { gap: 6px 10px; }
  .brand { font-size: 20px; flex: 1; }
  .grid { grid-template-columns: 1fr; }
  /* data tables become one card per row (labels from the header row, set by docs.js) */
  table.stack tr:first-child { display: none; }
  table.stack tr { display: block; border: 1.5px solid var(--line); border-radius: 14px; padding: 6px 10px; margin: 0 0 10px; background: var(--cream); }
  table.stack td { display: block; border: 0; padding: 3px 0; }
  table.stack td::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
  .toc { grid-template-columns: 1fr 1fr; gap: 6px; font-size: 15.5px; }
  .toc a { padding: 5px 9px; }
  .langs button { padding: 4px 10px; font-size: 15px; }
  .play { padding: 6px 13px; font-size: 16px; }
}
@media print {
  .top, footer, .langs, .play { display: none; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}
