:root { --bg:#0c1018; --fg:#eef2f8; --dim:#9aa6b8; --accent:#7ff0a8; --accent2:#4cc9f0; --panel:rgba(14,19,30,.88); }
* { box-sizing:border-box; }
html,body { margin:0; height:100%; overflow:hidden; background:var(--bg); color:var(--fg); font:16px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; user-select:none; -webkit-user-select:none; }
#stage { position:fixed; inset:0; touch-action:none; }
#stage canvas { display:block; width:100%; height:100%; }
.hidden { display:none !important; }

.screen { position:fixed; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; text-align:center; padding:24px;
  background:radial-gradient(ellipse at 50% 30%, #1d2a44 0%, #0b0f18 70%); z-index:10; }
#overlay { background:rgba(5,8,14,.55); backdrop-filter:blur(4px); z-index:20; }
h1 { font-size:clamp(40px,9vw,92px); margin:0; letter-spacing:.02em; font-weight:800;
  background:linear-gradient(180deg,#fff 0%,#9ff5c4 55%,#3fd0a0 100%); -webkit-background-clip:text; background-clip:text; color:transparent; filter:drop-shadow(0 6px 18px rgba(63,208,160,.35)); }
h2 { margin:0 0 6px; font-size:clamp(26px,4vw,40px); }
.sub { color:var(--dim); max-width:34em; margin:0 0 10px; font-size:clamp(15px,2.2vw,19px); }
.small { color:var(--dim); font-size:13px; margin-top:6px; }
#goo-logo { width:min(34vw,200px); height:auto; filter:drop-shadow(0 12px 24px rgba(0,0,0,.5)); }

button { font:inherit; color:inherit; cursor:pointer; border:0; }
button.big { padding:14px 42px; font-size:22px; font-weight:700; border-radius:999px; color:#06241a; background:linear-gradient(180deg,#b6ffd3,#4fe3a0); box-shadow:0 8px 26px rgba(79,227,160,.35), inset 0 -3px 0 rgba(0,0,0,.15); transition:transform .12s; }
button.big:hover { transform:translateY(-2px) scale(1.03); }
button.ghost { padding:10px 20px; border-radius:999px; background:rgba(255,255,255,.08); }
button.ghost:hover { background:rgba(255,255,255,.16); }

.loadbar { width:min(70vw,420px); height:10px; border-radius:99px; background:rgba(255,255,255,.1); overflow:hidden; }
#loadfill { height:100%; width:0; background:linear-gradient(90deg,var(--accent2),var(--accent)); transition:width .15s; }
#loadtext { color:var(--dim); margin:0; }

#level-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:14px; width:min(1000px,100%); max-height:68vh; overflow:auto; padding:4px; }
.card { position:relative; padding:16px; border-radius:16px; background:var(--panel); border:1px solid rgba(255,255,255,.08); text-align:left; transition:transform .12s, border-color .12s; }
.card:not(.locked):hover { transform:translateY(-3px); border-color:var(--accent); }
.card.locked { opacity:.45; cursor:not-allowed; }
.card .num { color:var(--accent); font-weight:800; font-size:13px; letter-spacing:.1em; }
.card .name { font-size:20px; font-weight:700; margin:2px 0; }
.card .meta { color:var(--dim); font-size:13px; }
.card .stars { margin-top:8px; font-size:20px; letter-spacing:3px; color:#ffd24a; }
.card .stars .off { color:rgba(255,255,255,.2); }

#hud { position:fixed; inset:0; pointer-events:none; z-index:5; }
.hud-left,.hud-right { position:absolute; top:14px; display:flex; gap:12px; align-items:stretch; }
.hud-left { left:14px; } .hud-right { right:14px; }
.meter { position:relative; width:min(40vw,280px); height:38px; border-radius:12px; background:var(--panel); overflow:hidden; border:1px solid rgba(255,255,255,.1); }
#bar { height:100%; width:0; background:linear-gradient(90deg,#2fb98a,#9ff5c4); transition:width .2s; }
#pct { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-weight:700; text-shadow:0 1px 3px #000; }
.stat { padding:4px 14px; border-radius:12px; background:var(--panel); border:1px solid rgba(255,255,255,.1); display:flex; flex-direction:column; justify-content:center; min-width:76px; }
.stat small { color:var(--dim); font-size:11px; text-transform:uppercase; letter-spacing:.08em; }
.stat b { font-size:17px; font-variant-numeric:tabular-nums; }
button.icon { pointer-events:auto; width:44px; border-radius:12px; background:var(--panel); border:1px solid rgba(255,255,255,.1); font-size:18px; }
button.icon:hover { background:rgba(40,52,78,.95); }
#tip { position:absolute; left:50%; bottom:9%; transform:translateX(-50%); max-width:min(92vw,560px); padding:12px 20px; border-radius:14px; background:var(--panel); border:1px solid rgba(255,255,255,.12); text-align:center; animation:tipin .4s; }
#tip b { color:var(--accent); display:block; margin-bottom:2px; }
@keyframes tipin { from { opacity:0; transform:translate(-50%,10px); } }

.panel { width:min(92vw,460px); padding:28px; border-radius:22px; background:var(--panel); border:1px solid rgba(255,255,255,.1); box-shadow:0 24px 60px rgba(0,0,0,.5); display:flex; flex-direction:column; gap:12px; }
.panel h2 { font-size:32px; }
.panel .stars { font-size:38px; letter-spacing:6px; color:#ffd24a; }
.panel .stars .off { color:rgba(255,255,255,.18); }
.panel .rows { display:grid; grid-template-columns:1fr auto; gap:4px 18px; text-align:left; color:var(--dim); }
.panel .rows b { color:var(--fg); }
.panel .btns { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-top:8px; }
@media (max-width:560px) { .stat small { display:none; } .stat { min-width:60px; } }

#title { background:linear-gradient(rgba(6,9,16,.55),rgba(6,9,16,.8)), url(../assets/comics/cover.jpg) center/cover no-repeat; }
#logo { width:min(70vw,420px); filter:drop-shadow(0 6px 20px rgba(0,0,0,.6)); }
#comic { background:#05070c; gap:10px; z-index:30; cursor:pointer; }
#comic-img { width:min(calc(100vw - 32px),calc((100vh - 70px) * 4 / 3)); height:auto; border-radius:10px; box-shadow:0 20px 60px rgba(0,0,0,.7); animation:tipin .5s; }
#comic-img { transform:none; }

.medal { font-size:1.15em; } .medal.off { opacity:.25; }
.stat b.low { color:#ff6b6b; }
.panel .stars .medal { font-size:56px; }

.packs { display:flex; gap:14px; flex-wrap:wrap; justify-content:center; }
button.big.alt { background:linear-gradient(180deg,#ffe3a8,#ffb347); color:#3a2200; box-shadow:0 8px 26px rgba(255,179,71,.35), inset 0 -3px 0 rgba(0,0,0,.15); line-height:1.1; }
button.big small { display:block; font-size:13px; font-weight:600; opacity:.75; letter-spacing:.06em; }

#helper { position:absolute; left:50%; top:50%; width:44px; height:44px; margin:-22px 0 0 -22px; display:flex; align-items:center; justify-content:center; font-size:34px; color:#ffe27a; text-shadow:0 0 10px rgba(255,200,60,.9),0 2px 4px #000; animation:pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity:.45; } }
