:root {
  color-scheme: dark;
  --bg: #0a0f1a;
  --surface: #0f1726;
  --text: #e6eefa;
  --muted: #7b8aa3;
  --line: #1c2840;
  --accent: #3b8bff;
  --accent-ink: #0a0f1a;
  --radius: 8px;
  padding-top: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #0b1a2e;
    --muted: #6b7a90;
    --line: #e3eaf3;
    --accent: #1d6fd6;
    --accent-ink: #ffffff;
  }
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Sarabun", "Noto Sans Thai", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
main { max-width: 440px; margin: 0 auto; padding: 56px 20px 32px; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--line); display: grid; place-items: center;
  font-size: 24px; color: var(--accent); margin: 0 auto 16px;
}
h1 { font-size: 20px; font-weight: 500; text-align: center; margin: 0; }
.role { text-align: center; color: var(--muted); margin: 4px 0 48px; font-size: 14px; }
.label { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.lead { font-size: 22px; font-weight: 500; line-height: 1.4; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 32px; }
.msg { color: var(--text); min-height: 20px; margin: 8px 0 12px; }

.list { list-style: none; margin: 0; padding: 0; }
.item, .game { padding: 20px 0; border-top: 1px solid var(--line); }
.list .item:last-child, .game:last-child { border-bottom: 1px solid var(--line); }
.item-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.item strong, .game strong { font-weight: 500; }
.item p, .game p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.price { font-size: 14px; white-space: nowrap; }

.actions { display: flex; gap: 8px; margin-top: 12px; }
.btn {
  min-height: 36px; padding: 6px 14px;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid var(--accent); border-radius: var(--radius);
  font: inherit; font-size: 14px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn.ghost { background: none; color: var(--muted); border-color: var(--line); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .tab:focus-visible, .contact a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.cta { margin-top: 8px; }
.contact { list-style: none; margin: 0; padding: 0; }
.contact li { padding: 14px 0; border-top: 1px solid var(--line); }
.contact a { color: var(--accent); text-decoration: none; }

.card-box {
  width: 96px; height: 144px; margin: 12px 0; border: 1px solid var(--line);
  border-radius: var(--radius); display: grid; place-items: center; font-size: 22px; color: var(--accent);
}
.card-box.coin { border-radius: 50%; width: 96px; height: 96px; }
.reels { display: flex; gap: 8px; margin: 12px 0; }
.reels span {
  width: 56px; height: 56px; border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; place-items: center; font-size: 22px;
}

dialog {
  width: min(420px, calc(100vw - 40px));
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
dialog::backdrop { background: rgb(0 0 0 / .45); }
dialog h3 { margin: 0 0 8px; font-size: 17px; font-weight: 500; }
dialog p { margin: 0 0 12px; color: var(--muted); }
dialog ul { margin: 0 0 20px; padding-left: 18px; color: var(--muted); font-size: 14px; }

nav.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--bg); border-top: 1px solid var(--line);
  padding: 4px 12px calc(4px + env(safe-area-inset-bottom, 0px));
}
.tabs { max-width: 440px; margin: 0 auto; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.tab {
  min-height: 44px; background: none; border: 0; border-radius: var(--radius);
  color: var(--muted); font: inherit; font-size: 13px; cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--text); font-weight: 500; }
.label { margin: 0 0 12px; }
