/* The page shell shared by the four December games: header, Coming Soon, Event Ended, login, messages,
   result popup, How to Play / Prize List / Terms. Each game page adds its own stage styles.
   Brand colours come in as --brand-1 / --brand-2 (from /api/config); the night-sky look is the default. */
:root {
  --night: #0a1530; --night-2: #13254d; --ink: #f5efe1; --muted: #a9b7d6; --gold: #f5c451; --holly: #d4313f; --pine: #1f8a4c;
  --line: rgba(245, 239, 225, 0.14); --panel: rgba(255, 255, 255, 0.06);
  --brand-1: var(--night-2); --brand-2: var(--night);
  --font-display: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --font: 'Mulish', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Thai', 'Noto Sans Bengali', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--night); }
body {
  color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; min-height: 100vh;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px));
  background: radial-gradient(120% 60% at 50% 0%, var(--brand-1), var(--brand-2) 70%) fixed;
  overflow-x: hidden;
}
main { max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
button { font: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.topbar { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.logo { height: 34px; max-width: 120px; object-fit: contain; }
.logo-text { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.06em; color: var(--gold); font-size: 15px; }
.topbar .spacer { flex: 1; }
.seg { display: flex; gap: 3px; padding: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.seg button { border: 0; border-radius: 9px; padding: 5px 10px; cursor: pointer; font-weight: 800; font-size: 13px; color: var(--muted); background: transparent; min-width: 40px; }
.seg button[aria-pressed="true"] { background: var(--gold); color: #2a1a00; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font-size: 17px; }

h1.title { margin: 6px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.1; text-align: center; text-wrap: balance; }
.lede { margin: 0; color: var(--muted); text-align: center; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.panel.center { text-align: center; align-items: center; }
.scene-emoji { font-size: 54px; line-height: 1; }
label.field { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 14px; }
input[type=text], input[type=tel] {
  width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(6, 12, 30, 0.6);
  color: var(--ink); font-size: 16px;
}
.tick { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.tick input { width: 20px; height: 20px; accent-color: var(--gold); }
.linkish { background: none; border: 0; color: var(--gold); text-decoration: underline; cursor: pointer; padding: 0; font-weight: 700; }
.btn {
  border: 0; border-radius: 14px; padding: 13px 28px; cursor: pointer; width: 100%;
  font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: 0.04em;
  background: linear-gradient(180deg, #ffe08a, #e2a92a); color: #2a1a00; box-shadow: 0 5px 0 #9c6a12;
}
.btn:active { transform: translateY(2px); box-shadow: 0 3px 0 #9c6a12; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn.red { background: linear-gradient(180deg, #e8344f, #b30d28); color: #fff; box-shadow: 0 5px 0 #6d0719; }
.btn.ghost { background: rgba(255, 255, 255, 0.08); color: var(--ink); box-shadow: none; border: 1px solid var(--line); font-size: 15px; padding: 10px 14px; }
.row { display: flex; gap: 8px; width: 100%; }
.row > * { flex: 1; }
.err { color: #ffb4b4; font-weight: 700; font-size: 14px; min-height: 1.2em; margin: 0; text-align: center; }

.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.countdown div { background: rgba(6, 12, 30, 0.55); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; }
.countdown b { display: block; font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; }
.countdown span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--gold); animation: spin 0.9s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); display: grid; place-items: center; padding: 18px; z-index: 50; }
.mbox {
  width: 100%; max-width: 340px; max-height: 88vh; overflow: auto; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center;
  background: linear-gradient(180deg, #1c3263, #10224a); border: 1.5px solid var(--gold); border-radius: 20px; padding: 22px 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}
.mbox .k { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); font-weight: 800; }
.mbox h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 25px; line-height: 1.15; text-wrap: balance; }
.mbox .amt {
  font-family: var(--font-display); font-weight: 800; font-size: 50px; line-height: 1; margin: 4px 0;
  background: linear-gradient(180deg, #fff6d0, #f5c451 55%, #d08a12); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--gold);
}
.mbox p { margin: 0; color: var(--muted); font-size: 14px; }
.mbox ol, .mbox ul { text-align: left; margin: 4px 0; padding-left: 20px; font-size: 14px; display: grid; gap: 6px; color: var(--ink); }
.mbox .prize-list { list-style: none; padding: 0; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mbox .prize-list li { background: rgba(6, 12, 30, 0.5); border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--gold); }
.mbox .btn { margin-top: 6px; }
.foot { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 13px; }
