* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #fff; overflow: hidden; overscroll-behavior: none;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #111; user-select: none; -webkit-user-select: none; touch-action: none; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
#stage { position: relative; flex: 1; min-height: 0; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
#topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 8px) 10px 0; pointer-events: none; }
#topbar .tb { pointer-events: auto; width: 44px; height: 44px; border-radius: 10px; border: 2px solid #2aa52a; background: rgba(255,255,255,.85);
  font-size: 22px; color: #1d7a1d; }
#trackTitle { font-weight: 700; font-size: 16px; color: #333; }
#pad { flex: 0 0 auto; height: calc(150px + env(safe-area-inset-bottom)); padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; gap: 10px; background: #fff; border-top: 2px solid #2aa52a; }
#pad .grp { display: flex; gap: 8px; flex: 1; }
#pad .key { flex: 1; border: 2px solid #2aa52a; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #1d7a1d; background: #f3fbf3; }
#pad .key span { font-size: 34px; line-height: 1; }
#pad .key small { font-size: 12px; margin-top: 4px; color: #3a8a3a; }
#pad .key.big { flex: 1.35; }
#pad .key.on { background: #2aa52a; color: #fff; }
#pad .key.on small { color: #e6ffe6; }
.screen { position: absolute; inset: 0; background: #fff; display: flex; flex-direction: column; align-items: center; overflow-y: auto;
  padding: calc(env(safe-area-inset-top) + 24px) 16px 24px; touch-action: pan-y; }
.logo { text-align: center; margin: 8px 0 18px; }
.logo1, .logo2 { font-weight: 900; font-size: 44px; letter-spacing: 6px; line-height: 1; color: #fff;
  -webkit-text-stroke: 2px #1d7a1d; text-shadow: 3px 3px 0 #2aa52a; }
.logo2 { color: #2aa52a; -webkit-text-stroke: 0; text-shadow: none; }
.sub { margin-top: 8px; color: #777; font-size: 13px; }
#tabs { display: flex; gap: 6px; margin-bottom: 12px; }
#tabs button, .row button { border: 2px solid #2aa52a; background: #fff; color: #1d7a1d; border-radius: 10px; padding: 9px 14px; font-size: 15px; font-weight: 600; }
#tabs button.sel, .row button.primary { background: #2aa52a; color: #fff; }
#list { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; }
.trk { display: flex; justify-content: space-between; align-items: center; border: 2px solid #cfe9cf; border-radius: 12px; padding: 12px 14px; background: #fafffa; }
.trk b { font-size: 17px; }
.trk .num { color: #2aa52a; font-weight: 800; margin-right: 10px; }
.trk .bt { font-variant-numeric: tabular-nums; color: #555; font-size: 14px; }
.trk.locked { opacity: .45; }
.hint { color: #888; font-size: 12px; margin-top: 16px; text-align: center; }
.dlg { background: rgba(255,255,255,.35); justify-content: flex-start; padding-top: calc(env(safe-area-inset-top) + 70px); }
.card { background: #fff; border: 3px solid #2aa52a; border-radius: 16px; padding: 20px; text-align: center; min-width: 280px; box-shadow: 0 6px 24px rgba(0,0,0,.12); }
#resTitle { font-size: 26px; font-weight: 900; color: #1d7a1d; }
#resTitle.crash { color: #c62828; }
#resTime { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 8px 0 2px; }
#resBest { color: #666; font-size: 14px; margin-bottom: 14px; min-height: 18px; }
.row { display: flex; gap: 8px; justify-content: center; }
