/* 미니게임 공통 — 벽돌깨기와 같은 결(시스템 글꼴, 밝은 회색 바탕 + 흰 판, 파랑 하나) */
:root {
  --bg: #f2f2f7; --card: #ffffff; --label: #1d1d1f; --secondary: #6e6e73; --hair: rgba(0,0,0,.10);
  --fill: rgba(120,120,128,.12); --fill-press: rgba(120,120,128,.22); --scrim: rgba(0,0,0,.28);
  --blue: #007aff; --green: #34c759; --red: #ff3b30; --orange: #ff9500;
  --tile: #ffffff; --tile-edge: rgba(0,0,0,.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --card: #1c1c1e; --label: #f5f5f7; --secondary: #98989d; --hair: rgba(255,255,255,.14);
    --fill: rgba(120,120,128,.24); --fill-press: rgba(120,120,128,.36); --scrim: rgba(0,0,0,.55);
    --blue: #0a84ff; --green: #30d158; --red: #ff453a; --orange: #ff9f0a;
    --tile: #2c2c2e; --tile-edge: rgba(255,255,255,.08);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #1c1c1e; --label: #f5f5f7; --secondary: #98989d; --hair: rgba(255,255,255,.14);
  --fill: rgba(120,120,128,.24); --fill-press: rgba(120,120,128,.36); --scrim: rgba(0,0,0,.55);
  --blue: #0a84ff; --green: #30d158; --red: #ff453a; --orange: #ff9f0a;
  --tile: #2c2c2e; --tile-edge: rgba(255,255,255,.08);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--label); font-family: var(--font); -webkit-font-smoothing: antialiased;
  overscroll-behavior: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(16px, env(safe-area-inset-left, 0px));
}
button { font: inherit; color: inherit; }
button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }
.app { height: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; padding-block: 14px; }
.hud { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.hud .k { font-size: 12px; color: var(--secondary); letter-spacing: .02em; }
.hud .v { font-size: 28px; font-weight: 700; line-height: 1.1; }
.hud .r { text-align: right; }
.pill { border: 0; border-radius: 999px; background: var(--fill); padding: 8px 14px; font-weight: 600; font-size: 14px; cursor: pointer; }
.pill:active { background: var(--fill-press); }
.primary { border: 0; border-radius: 14px; background: var(--blue); color: #fff; padding: 14px; font-size: 17px; font-weight: 600; cursor: pointer; width: 100%; }

/* 시작·끝 시트 */
.scrim { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet {
  background: var(--card); width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; gap: 10px;
  padding: 22px max(20px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
}
.sheet h1 { margin: 0; font-size: 24px; }
.sheet p { margin: 0; line-height: 1.5; }
.sheet ul { margin: 0; padding-left: 20px; line-height: 1.6; font-size: 15px; }
.ov-k { color: var(--secondary); font-size: 14px; }
.ov-s { font-size: 52px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ov-s span { font-size: 18px; font-weight: 600; margin-left: 4px; color: var(--secondary); }
.ov-b { color: var(--secondary); }
.ov-b .new { color: var(--orange); }
.ov-n { font-size: 13px; color: var(--secondary); }
.rank { list-style: none; margin: 4px 0; padding: 0; font-size: 15px; font-variant-numeric: tabular-nums; max-height: 34vh; overflow: auto; }
.rank li { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--hair); }
.rank li span:first-child { width: 1.6em; color: var(--secondary); }
.rank li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank li.me { font-weight: 700; color: var(--blue); }
.again { border: 0; border-radius: 14px; background: var(--blue); color: #fff; padding: 14px; font-size: 17px; font-weight: 600; cursor: pointer; margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
