:root {
  --navy: #233788; --gold: #BC9B18; --gold2: #f5c542; --cyan: #3de0ff; --bg: #070b22;
  --txt: #eef2ff; --mut: #a9b6e0; --glass: rgba(18, 28, 72, .78); --line: rgba(140, 170, 255, .25);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; cursor: pointer; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--txt); font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; }
canvas { position: fixed; inset: 0; display: block; }
#safe { position: fixed; top: 0; left: 0; width: 0; padding-top: var(--sat); padding-bottom: var(--sab); visibility: hidden; }
.hidden { display: none !important; }

#hud { position: fixed; top: calc(var(--sat) + 8px); left: 8px; right: 8px; display: flex; gap: 8px; align-items: center; z-index: 5; pointer-events: none; }
#hud > * { pointer-events: auto; }
.hud-btn { width: 44px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--glass); color: var(--txt); font-weight: 800; }
.chip { background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-weight: 700; }
.chip.score { margin-left: auto; color: var(--gold2); font-size: 18px; min-width: 80px; text-align: right; }

.boost { position: fixed; right: 8px; top: calc(var(--sat) + 56px); z-index: 5; width: 92px; height: 44px; border-radius: 14px; border: 1px solid var(--cyan); background: rgba(10, 30, 70, .8); color: var(--cyan); font-weight: 800; font-size: 13px; overflow: hidden; }
.boost span { position: relative; z-index: 1; }
.boost i { position: absolute; left: 0; bottom: 0; top: 0; width: 0; background: rgba(61, 224, 255, .28); transition: width .2s; }
.boost.ready { background: var(--cyan); color: #04122c; box-shadow: 0 0 18px var(--cyan); }

.screen { position: fixed; inset: 0; z-index: 10; display: flex; padding: calc(var(--sat) + 16px) 16px calc(var(--sab) + 16px); background: radial-gradient(circle at 50% 20%, rgba(35,55,136,.55), rgba(7,11,34,.96) 70%); overflow-y: auto; }
.card { margin: auto; width: 100%; max-width: 430px; background: var(--glass); border: 1px solid var(--line); border-radius: 24px; padding: 22px 20px; text-align: center; backdrop-filter: blur(8px); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.small-card { max-width: 340px; }
.logo { height: 34px; width: auto; margin-bottom: 4px; }
h1 { margin: 6px 0; font-size: 34px; background: linear-gradient(90deg, var(--cyan), var(--gold2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { margin: 2px 0 8px; font-size: 26px; color: var(--cyan); }
.lead { margin: 0 0 12px; color: var(--mut); font-size: 16px; }
.howto { text-align: left; padding-left: 20px; margin: 0 0 16px; font-size: 14px; line-height: 1.45; color: #d4dcf7; }
.howto li { margin-bottom: 5px; }
.btn { display: block; width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 8px 0; font-size: 18px; font-weight: 800; background: rgba(255,255,255,.08); color: var(--txt); }
.btn.primary { background: linear-gradient(90deg, var(--gold), var(--gold2)); color: #1a1400; border: 0; font-size: 20px; }
.btn.small { display: inline-block; width: auto; padding: 8px 14px; margin: 0; font-size: 14px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.best { font-weight: 700; color: var(--gold2); }
.foot { font-size: 12px; color: var(--mut); margin: 14px 0 0; }
.foot a { color: var(--cyan); }
.big { font-size: 50px; font-weight: 900; color: var(--gold2); }
.mut { color: var(--mut); margin: 4px 0 12px; }
.credits { font-size: 18px; margin-bottom: 10px; color: var(--gold2); }
.shop { display: grid; gap: 8px; margin-bottom: 8px; }
.item { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--txt); width: 100%; }
.item:disabled { opacity: .45; }
.item .ico { font-size: 24px; width: 32px; text-align: center; }
.item .txt { flex: 1; }
.item .txt b { display: block; font-size: 15px; }
.item .txt small { color: var(--mut); font-size: 12px; }
.item .cost { font-weight: 800; color: var(--gold2); white-space: nowrap; }
