:root {
  --sky-top: #0b2a4a;
  --sky-mid: #1e6fb8;
  --ink: #f4f8ff;
  --accent: #6fd3ff;
  --warn: #ff6b6b;
  --gold: #ffd166;
  --panel: rgba(8, 24, 44, 0.82);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--sky-top); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden;
  -webkit-user-select: none; user-select: none; touch-action: none; }
#stage { position: fixed; inset: 0; }
canvas { display: block; width: 100%; height: 100%; }
.panel { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; padding: 24px 16px; text-align: center;
  background: var(--panel); backdrop-filter: blur(3px); }
.panel.show { display: flex; }
#over { justify-content: flex-start; justify-content: safe center; overflow-y: auto; touch-action: pan-y; }
#over > * { flex-shrink: 0; }
h1 { font-size: clamp(42px, 9vw, 96px); line-height: .9; margin: 0; letter-spacing: .04em; }
h1 span { color: var(--accent); }
h2 { font-size: clamp(32px, 6vw, 60px); margin: 0; }
.tag { font-size: clamp(16px, 2.6vw, 24px); margin: 0; opacity: .9; }
.how { text-align: left; font-size: clamp(15px, 2.2vw, 20px); margin: 4px 0; padding-left: 1.4em; }
.how li { margin: 4px 0; }
button { font: inherit; color: inherit; cursor: pointer; }
.big { font-size: clamp(20px, 3.4vw, 32px); font-weight: 800; padding: 14px 40px; border-radius: 999px;
  border: 0; background: var(--accent); color: #062037; box-shadow: 0 6px 0 #2a8fbf; }
.big:active { transform: translateY(4px); box-shadow: 0 2px 0 #2a8fbf; }
.big.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); box-shadow: none; }
#play { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
#hud { position: absolute; top: 0; left: 0; right: 0; display: none; justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px; font-weight: 800;
  font-size: clamp(18px, 3vw, 30px); text-shadow: 0 2px 4px rgba(0,0,0,.5); pointer-events: none; }
#hud.show { display: flex; }
#h-combo { color: var(--gold); min-width: 4em; text-align: right; }
.board { width: min(420px, 100%); border-collapse: collapse; font-size: clamp(15px, 2.2vw, 20px); }
.board td { padding: 4px 8px; border-bottom: 1px solid rgba(255,255,255,.15); }
.board td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.board tr.me td { color: var(--gold); font-weight: 800; }
#initials { display: flex; gap: 10px; justify-content: center; }
.ini { width: 64px; height: 76px; font-size: 44px; font-weight: 800; border-radius: 12px;
  background: #fff; color: #062037; border: 0; }
.hint { font-size: 14px; opacity: .7; margin: 0; }
#final { font-size: clamp(18px, 3vw, 28px); margin: 0; }
#share-line { font-size: clamp(16px, 2.2vw, 20px); margin: 0; user-select: text;
  -webkit-user-select: text; touch-action: auto; }
#copy-share { min-height: 64px; padding: 12px 24px; border: 2px solid var(--accent);
  border-radius: 12px; background: transparent; color: var(--ink); font-size: 16px; font-weight: 800; }
#share-status { font-size: 15px; margin: 0; }
#share-status:empty { display: none; }
#staff { position: absolute; right: 8px; bottom: 8px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.08); opacity: .35; font-size: 18px; }
#staffmenu label { font-size: 18px; }
#staffmenu select { font-size: 18px; }
#takeaway { display: flex; gap: 16px; align-items: center; justify-content: center; text-align: left;
  max-width: 520px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.06); }
#card-qr { width: 132px; height: 132px; border-radius: 8px; background: #fff; flex-shrink: 0; }
#takeaway .take-head { margin: 0 0 4px; font-size: clamp(18px, 2.6vw, 22px); font-weight: 800; color: var(--gold); }
#takeaway .hint { margin-bottom: 10px; }
#save-card, #save-card-2 { min-height: 64px; padding: 12px 20px; border: 2px solid var(--gold);
  border-radius: 12px; background: transparent; color: var(--ink); font-size: 16px; font-weight: 800; }
#cardview { justify-content: flex-start; justify-content: safe center; overflow-y: auto; touch-action: pan-y;
  background: var(--sky-top); }
#cardview > * { flex-shrink: 0; }
#card-img { width: min(420px, 86vw, 52vh); height: auto; border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
  -webkit-touch-callout: default; user-select: auto; -webkit-user-select: auto; touch-action: auto; }
