:root {
  --accent: #6ee7a8;
  --accent2: #ffd166;
  --ink: #eafff2;
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; background: #0d1a14; color: var(--ink); }
canvas { display: block; position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; }

/* HUD */
#hud { position: fixed; top: 0; left: 0; right: 0; padding: 14px 16px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; z-index: 5; }
.hud-left { text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
#hud-score { font-size: 44px; font-weight: 900; letter-spacing: -1px; line-height: 1; }
#hud-best { font-size: 14px; font-weight: 700; opacity: 0.7; margin-top: 2px; }
.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#hud-lives { font-size: 20px; letter-spacing: 2px; text-shadow: 0 2px 8px rgba(0,0,0,0.6); min-height: 24px; }
#mute { pointer-events: auto; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); color: #fff; font-size: 18px; width: 40px; height: 40px; border-radius: 12px; cursor: pointer; }

#toast { position: fixed; top: 30%; left: 50%; transform: translate(-50%,-50%) scale(0.6); z-index: 6; font-size: clamp(26px, 8vw, 52px); font-weight: 900; letter-spacing: -1px; opacity: 0; pointer-events: none; text-shadow: 0 4px 20px rgba(0,0,0,0.6); }
#toast.show { animation: pop 1s ease-out; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%,-50%) scale(0.6); } 20% { opacity: 1; transform: translate(-50%,-50%) scale(1.1); } 80% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; transform: translate(-50%,-60%) scale(1); } }

/* Overlays */
.overlay { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto;
  background: radial-gradient(120% 90% at 50% -10%, rgba(110,231,168,0.26), transparent 55%), rgba(6,15,11,0.86); backdrop-filter: blur(6px); }
.overlay.hidden { display: none; }
.panel { width: 100%; max-width: 420px; background: rgba(16,32,25,0.94); border: 1px solid rgba(255,255,255,0.1); border-radius: 24px; padding: 26px 22px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); text-align: center; }
.panel.small { max-width: 360px; }

.title { font-size: clamp(38px, 11vw, 60px); font-weight: 900; letter-spacing: -2px; margin: 0 0 4px; line-height: 0.95; }
.title span { color: var(--accent); }
.tagline { margin: 0 0 18px; opacity: 0.72; font-weight: 600; font-size: 15px; }

.stats { display: flex; gap: 12px; margin-bottom: 16px; }
.stats > div { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 10px; }
.stats b { display: block; font-size: 24px; font-weight: 900; }
.stats small { font-size: 11px; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.5px; }

input#name { width: 100%; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); border-radius: 12px; color: #fff; padding: 12px 14px; font-size: 15px; text-align: center; margin-bottom: 14px; font-family: inherit; }
input#name:focus { outline: none; border-color: var(--accent); }

.play { width: 100%; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 75%, white), var(--accent)); color: #0a1a12; border: none; border-radius: 14px; padding: 16px; font-size: 19px; font-weight: 900; letter-spacing: 0.3px; cursor: pointer; box-shadow: 0 10px 26px rgba(110,231,168,0.4); font-family: inherit; }
.play:active { transform: translateY(2px); }

.col { margin-top: 18px; text-align: left; }
.col h3 { font-size: 14px; margin: 0 0 8px; opacity: 0.85; }
.leaderboard { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.leaderboard li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.leaderboard li:nth-child(odd) { background: rgba(255,255,255,0.04); }
.leaderboard li .rk { opacity: 0.5; width: 26px; }
.leaderboard li .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leaderboard li .sc { font-weight: 800; color: var(--accent2); }
.leaderboard li.me { background: rgba(110,231,168,0.22); }
.lb-empty { opacity: 0.5; justify-content: center !important; }

.hint { font-size: 12px; opacity: 0.5; margin: 16px 0 0; line-height: 1.5; }

.privacy { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.08); }
.privacy p { font-size: 11px; opacity: 0.45; line-height: 1.5; margin: 0 0 8px; }
.privacy button, .copy-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); color: #fff; border-radius: 10px; padding: 8px 14px; font-size: 13px; cursor: pointer; font-family: inherit; }

.col-sub { font-weight: 600; opacity: 0.5; font-size: 11px; }
.shop { display: grid; gap: 8px; }
.shop-item { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 9px 11px; color: #fff; cursor: pointer; font-family: inherit; }
.shop-item:disabled { cursor: default; }
.shop-item.cant { opacity: 0.55; }
.shop-item.maxed { border-color: rgba(110,231,168,0.5); background: rgba(110,231,168,0.12); }
.shop-item:not(:disabled):active { transform: translateY(1px); }
.si-ic { font-size: 22px; width: 26px; text-align: center; }
.si-main { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.si-main b { font-size: 14px; font-weight: 800; }
.si-main small { font-size: 11px; opacity: 0.62; line-height: 1.25; }
.si-pips { font-size: 11px; letter-spacing: 2px; color: var(--accent); margin-top: 2px; }
.si-cost { font-size: 13px; font-weight: 800; color: var(--accent2); white-space: nowrap; }
.shop-item.maxed .si-cost { color: var(--accent); }

.goals { display: grid; gap: 9px; }
.goal { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 9px 12px; }
.g-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.g-rw { color: var(--accent2); }
.g-bar { height: 7px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.g-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 4px; }
.g-sub { font-size: 10px; opacity: 0.5; text-align: right; margin-top: 3px; }

.go-earn { font-size: 22px; font-weight: 900; color: var(--accent2); margin: -4px 0 12px; }

.tag { font-size: 16px; font-weight: 800; opacity: 0.7; text-transform: uppercase; letter-spacing: 1px; }
.big { font-size: 72px; font-weight: 900; letter-spacing: -3px; margin: 4px 0 10px; line-height: 1; }
.go-row { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; opacity: 0.8; margin-bottom: 16px; }
.copy-btn { width: 100%; margin-top: 10px; }
