:root {
  --bg1: #08111f;
  --bg2: #12304f;
  --panel: rgba(10, 18, 30, 0.72);
  --line: rgba(255,255,255,0.12);
  --text: #eef6ff;
  --muted: rgba(238,246,255,0.72);
  --accent: #77d6ff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; background: radial-gradient(circle at top, #18456e 0%, var(--bg1) 65%); color: var(--text); }
body { min-height: 100vh; min-height: 100dvh; }
#app { position: relative; width: 100%; height: 100%; }
.screen { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 24px; }
.screen.active { display: flex; }
.panel { width: min(92vw, 420px); padding: 28px 24px; border: 1px solid var(--line); border-radius: 24px; background: var(--panel); backdrop-filter: blur(20px); box-shadow: 0 18px 60px rgba(0,0,0,0.28); text-align: center; }
.panel.compact { width: min(82vw, 320px); }
.eyebrow { margin: 0 0 8px; font-size: 12px; letter-spacing: 0.22em; color: var(--muted); }
h1, h2 { margin: 0 0 12px; }
.desc, .tip, .panel p { color: var(--muted); line-height: 1.55; }
.primary-btn { margin-top: 10px; width: 100%; border: 0; border-radius: 16px; padding: 16px 18px; font-size: 17px; font-weight: 700; color: #052238; background: linear-gradient(180deg, #95e5ff, var(--accent)); box-shadow: 0 12px 30px rgba(119,214,255,0.3); }
.countdown { margin-top: 14px; font-size: 46px; font-weight: 800; }
#game-screen { padding: 0; flex-direction: column; }
.hud { position: absolute; top: env(safe-area-inset-top, 0); left: 0; right: 0; z-index: 2; padding: 16px; display: flex; justify-content: space-between; gap: 12px; }
.hud-item { min-width: 88px; padding: 10px 12px; border: 1px solid var(--line); background: rgba(8,17,31,0.45); backdrop-filter: blur(10px); border-radius: 14px; }
.compact-indicator { min-width: 76px; }
.label { display:block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
#game-canvas { display: block; width: 100vw; height: 100vh; height: 100dvh; }
.overlay-countdown { position: absolute; left: 50%; top: 28%; transform: translate(-50%, -50%); z-index: 3; font-size: 84px; font-weight: 900; color: rgba(255,255,255,0.88); text-shadow: 0 10px 40px rgba(0,0,0,0.35); opacity: 0; pointer-events: none; transition: opacity 0.18s ease; }
.overlay-countdown.visible { opacity: 1; }
.hint { position: absolute; bottom: calc(22px + env(safe-area-inset-bottom, 0)); left: 50%; transform: translateX(-50%); padding: 10px 14px; border-radius: 999px; background: rgba(8,17,31,0.45); border: 1px solid var(--line); color: var(--muted); font-size: 13px; white-space: nowrap; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 4px; }
.result-grid div { border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px; background: rgba(255,255,255,0.03); }
.result-grid span { display:block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.result-grid strong { font-size: 24px; }
.result-remark { margin: 12px 0 0; color: var(--muted); }
