/* Shared styles. Each location sets its colors with a theme class on <body>. */
:root { color-scheme: dark; }
.theme-chalks {
  --bg: #0a0504;
  --glow: radial-gradient(120% 70% at 50% -10%, #4a0f06 0%, #1a0603 45%, #0a0504 75%);
  --text: #fff3e4;
  --muted: #c7a48c;
  --accent: #ff5a1f;
  --accent-2: #ffc928;
  --on-accent: #1a0500;
  --title: linear-gradient(180deg, #ffe55a 0%, #ff9a1f 45%, #e8261b 100%);
  --title-stroke: #3a0800;
  --card: rgba(255, 110, 40, 0.08);
  --border: rgba(255, 140, 60, 0.28);
  --ready: #ffcf2e;
  --danger: #ff4a3d;
  --balls: #ffd400, #1858c9, #e3262b;
}
.theme-chill {
  --bg: #020a16;
  --glow: radial-gradient(120% 70% at 50% -10%, #0b4a8a 0%, #062547 40%, #020a16 75%);
  --text: #eaf8ff;
  --muted: #8fb8d6;
  --accent: #1fb8ff;
  --accent-2: #8eeaff;
  --on-accent: #001526;
  --title: linear-gradient(180deg, #e8fbff 0%, #6fd8ff 40%, #1488e6 100%);
  --title-stroke: #002244;
  --card: rgba(40, 170, 255, 0.08);
  --border: rgba(110, 200, 255, 0.28);
  --ready: #5ff2ff;
  --danger: #ff5a6e;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--glow), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
a { color: var(--accent-2); }
.hidden { display: none !important; }

.wrap { max-width: 480px; margin: 0 auto; padding: 16px 16px 40px; }
.logo { display: block; width: min(300px, 80%); margin: 8px auto 4px; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }

.title {
  font-weight: 900; font-size: clamp(28px, 8vw, 38px); line-height: 1.1; text-align: center; margin: 18px 0 6px;
  background: var(--title); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1px var(--title-stroke); paint-order: stroke fill; letter-spacing: -0.01em;
}
.sub { text-align: center; color: var(--muted); margin: 0 0 20px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 18px; margin: 14px 0; backdrop-filter: blur(6px); }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.card p:last-child { margin-bottom: 0; }

label { display: block; font-weight: 600; margin-bottom: 8px; }
input[type=text], input[type=tel], input[type=password], input[inputmode=numeric] {
  width: 100%; padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: rgba(0,0,0,.45);
  font-size: 20px; outline: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }

.btn {
  display: block; width: 100%; padding: 16px 18px; border: 0; border-radius: 14px; cursor: pointer;
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--on-accent);
  font-weight: 800; font-size: 19px; box-shadow: 0 6px 24px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .08s ease, filter .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { filter: grayscale(.6) brightness(.7); cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); box-shadow: none; font-weight: 600; }
.btn.small { display: inline-block; width: auto; padding: 10px 14px; font-size: 15px; }
.mt { margin-top: 12px; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 8px; display: block; margin: 18px auto 0; font-size: 15px; }
.notice { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; font-size: 15px; font-weight: 600; text-align: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text); }
.notice b { color: var(--accent-2); }
.text-line { justify-content: center; margin: 12px 0 0; }
.mt-s { display: block; margin-top: 14px; }
.opt { font-weight: 400; color: var(--muted); font-size: 14px; }
.hint { font-size: 14px !important; margin: 10px 0 0 !important; color: var(--muted); }
.card ol { margin: 0 0 12px; padding-left: 22px; color: var(--muted); font-size: 15px; }
.card ol li { margin: 4px 0; }
.card ol b, .card p b { color: var(--text); }
.steps-box { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid var(--border); }
.steps-box ol { margin-bottom: 0; }
body:not(.is-ios) .only-ios, body.is-ios .only-android { display: none; }
.error { color: var(--danger); min-height: 1.4em; margin: 8px 0 0; font-size: 15px; }

.position { text-align: center; margin: 10px 0; }
.position .num { font-size: 84px; font-weight: 900; line-height: 1; background: var(--title); -webkit-background-clip: text; background-clip: text; color: transparent; }
.position .lbl { color: var(--muted); }
.okline { display: flex; gap: 10px; align-items: center; color: var(--text); font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #3ddc84; flex: none; box-shadow: 0 0 10px #3ddc84; }

/* Pool-ball strip (Chill accent, subtle for Chalks) */
.balls { display: flex; justify-content: center; gap: 8px; margin: 26px 0 0; opacity: .85; }
.balls i { width: 14px; height: 14px; border-radius: 50%; display: block; box-shadow: inset -3px -3px 5px rgba(0,0,0,.45), inset 2px 2px 3px rgba(255,255,255,.35); }

.claim { text-align: center; margin: 4px 0 8px; color: var(--muted); }
.claim b { display: inline-block; margin-left: 8px; padding: 2px 12px; border-radius: 10px; border: 1px solid var(--border); color: var(--text); font-size: 24px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.claim span { display: block; font-size: 14px; margin-top: 4px; }

/* Table ready takeover */
.alarm {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; background: var(--bg); animation: flash 0.8s steps(2, jump-none) infinite;
}
.alarm.calm { animation: none; background: var(--glow), var(--bg); }
.alarm h1 { font-size: clamp(38px, 12vw, 64px); line-height: 1.05; margin: 0 0 8px; font-weight: 900; }
.alarm .count { font-size: clamp(64px, 22vw, 120px); font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; margin: 10px 0; }
.alarm .code-box { font-size: 18px; font-weight: 700; margin: 6px 0 4px; }
.alarm .code-box b { display: block; font-size: clamp(56px, 18vw, 96px); line-height: 1; letter-spacing: .1em; font-variant-numeric: tabular-nums;
  padding: 8px 22px; margin-top: 6px; border: 4px solid currentColor; border-radius: 18px; background: rgba(0,0,0,.08); }
.alarm .count { font-size: clamp(44px, 14vw, 72px) !important; }
.alarm p { font-size: 20px; margin: 0 0 22px; }
.alarm .btn { max-width: 340px; }
@keyframes flash {
  0% { background: var(--ready); color: #000; }
  100% { background: var(--bg); color: var(--text); }
}
@media (prefers-reduced-motion: reduce) { .alarm { animation-duration: 2s; } }

/* Home page */
.picks { display: grid; gap: 16px; margin-top: 20px; }
.pick { display: block; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 14px; text-align: center; }
.pick img { width: 100%; max-width: 320px; border-radius: 12px; display: block; margin: 0 auto 8px; }
.pick span { font-weight: 700; }
.pick.theme-chalks { --card: rgba(255,110,40,.08); --border: rgba(255,140,60,.3); }
.pick.theme-chill { --card: rgba(40,170,255,.08); --border: rgba(110,200,255,.3); }
.alarm .ack-done { font-size: 20px; font-weight: 800; background: rgba(255,255,255,.12); border-radius: 14px; padding: 14px 18px; max-width: 340px; margin: 0 auto 22px; }
.alarm .linkbtn { color: inherit; opacity: .8; font-size: 16px; }
