/* SpinRush — neon arcade UI, icon-first */
:root {
  --cyan: #2de2ff; --pink: #ff3df0; --gold: #ffc52e; --green: #3dff9a; --red: #ff4d6d;
  --ink: #e9f4ff; --panel: rgba(10, 14, 38, .88); --line: rgba(120, 200, 255, .25);
  --font: "Trebuchet MS", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --display: "Arial Black", "Segoe UI Black", "Impact", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #050816; color: var(--ink); font-family: var(--font);
  user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
canvas#game { position: fixed; inset: 0; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; }
.ico { width: 1.2em; height: 1.2em; display: inline-block; vertical-align: middle; flex: none; }
.ico.big { width: 1.8em; height: 1.8em; }
.ico.mid { width: 1.5em; height: 1.5em; }
.gem { width: 1.25em; height: 1.25em; vertical-align: middle; object-fit: contain; filter: drop-shadow(0 0 4px rgba(45,226,255,.6)); flex: none; }
.gem.big { width: 1.7em; height: 1.7em; }
b { font-family: var(--display); }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); z-index: 20; }
.screen.show { display: flex; animation: fadeIn .25s ease-out; }
#perk.show, #pause.show, #over.show, #upgrades.show, #howto.show { background: rgba(3, 5, 18, .62); backdrop-filter: blur(3px); }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.logo { font-family: var(--display); font-size: clamp(48px, 11vmin, 110px); font-style: italic; letter-spacing: 2px; line-height: .9;
  color: #fff; text-shadow: 0 0 18px var(--cyan), 0 4px 0 #0a3a6a, 0 8px 22px rgba(0,0,0,.6); transform: skewX(-8deg); }
.logo span { color: var(--pink); text-shadow: 0 0 18px var(--pink), 0 4px 0 #5a0a55, 0 8px 22px rgba(0,0,0,.6); }
#menu { justify-content: flex-end; padding-bottom: max(6vh, 26px); background: linear-gradient(transparent 45%, rgba(3,5,18,.75)); }
#menu .logo { position: absolute; top: max(5vh, 18px); }
.chips { display: flex; gap: 12px; }
.chip { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px 6px 10px; font-size: 22px; }
.chip.gold .ico { color: var(--gold); filter: drop-shadow(0 0 6px rgba(255,197,46,.6)); }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }

.btn { cursor: pointer; border: 0; border-radius: 16px; padding: 10px 22px; font-size: 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, #2a3570, #18204a); color: #fff; box-shadow: 0 0 0 2px var(--line) inset, 0 5px 0 #0a0f2a, 0 8px 18px rgba(0,0,0,.4);
  transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.2); transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 2px var(--line) inset, 0 2px 0 #0a0f2a; }
.btn .ico { width: 1.3em; height: 1.3em; }
.btn.sq { width: 68px; height: 60px; padding: 0; font-size: 26px; }
.btn.big { font-size: 40px; background: linear-gradient(180deg, #34f0ff, #0aa6d6); color: #04203a;
  box-shadow: 0 0 28px rgba(45,226,255,.6), 0 6px 0 #06607e, 0 10px 22px rgba(0,0,0,.4); }
.btn.round { width: 150px; height: 84px; border-radius: 42px; padding: 0; }
.btn.round .ico { width: 1.25em; height: 1.25em; margin-left: 6px; }
#bPlay { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); box-shadow: 0 0 44px rgba(45,226,255,.85), 0 6px 0 #06607e, 0 10px 22px rgba(0,0,0,.4); } }
.btn.small { padding: 6px 12px; font-size: 17px; min-width: 92px; }
.btn.off { filter: grayscale(.7) brightness(.7); }
.btn.ghost { background: transparent; box-shadow: 0 0 0 2px rgba(255,255,255,.25) inset; }
.btn.reward { background: linear-gradient(180deg, #ffd84d, #f0a000); color: #3a2200; box-shadow: 0 0 20px rgba(255,197,46,.5), 0 5px 0 #8a5a00; height: 64px; padding: 0 18px; font-size: 22px; }
.btn.reward .adic { width: 1.4em; height: 1.4em; color: #3a2200; }
.btn.reward .adic path { fill: #ffd84d; }
.btn:disabled { opacity: .5; pointer-events: none; }
.icon { position: fixed; z-index: 30; width: 46px; height: 46px; border-radius: 13px; border: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(10,14,38,.7); box-shadow: 0 0 0 2px var(--line) inset; color: #fff; padding: 0; }
.icon .ico { width: 24px; height: 24px; }
#bSound { top: max(10px, env(safe-area-inset-top)); right: 10px; }
#bPause { top: max(10px, env(safe-area-inset-top)); right: 64px; pointer-events: auto; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 22px 24px; display: flex; flex-direction: column;
  align-items: center; gap: 14px; max-width: min(560px, 94vw); max-height: 94vh; overflow-y: auto; box-shadow: 0 0 40px rgba(45,226,255,.15), 0 20px 60px rgba(0,0,0,.5); }
.panel.wide { max-width: min(720px, 96vw); width: 100%; }
.emblem .ico { width: 64px; height: 64px; color: var(--cyan); filter: drop-shadow(0 0 12px var(--cyan)); }
.badge { display: flex; gap: 4px; color: var(--gold); font-size: 30px; animation: pulse .8s infinite alternate; filter: drop-shadow(0 0 10px rgba(255,197,46,.7)); }
@keyframes pulse { to { transform: scale(1.12); } }

/* ---------- loading ---------- */
#loading { background: #050816; }
.lbar { width: min(320px, 70vw); height: 10px; border-radius: 6px; background: rgba(255,255,255,.1); overflow: hidden; }
.lbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); transform-origin: left; transform: scaleX(0.06); transition: transform .3s; }

/* ---------- how to ---------- */
#howMove { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.mv { display: flex; align-items: center; gap: 12px; font-size: 22px; }
.mv .or { opacity: .4; font-size: 26px; }
.mouse { width: 34px; height: 48px; }
.keys { display: inline-grid; grid-template-columns: repeat(3, 30px); gap: 4px; }
.keys kbd:first-child { grid-column: 2; grid-row: 1; }
.keys kbd:nth-child(n+2) { grid-row: 2; }
kbd { display: inline-grid; place-items: center; height: 30px; min-width: 30px; border-radius: 7px; background: linear-gradient(#2a3570, #141a40); box-shadow: 0 3px 0 #070a1e, 0 0 0 1.5px rgba(255,255,255,.3) inset;
  font-family: var(--display); font-size: 14px; color: #fff; }
.phone { width: 200px; height: 108px; }
.phone .joy { animation: joy 2s ease-in-out infinite; }
@keyframes joy { 0%, 100% { transform: translate(0, 0); } 33% { transform: translate(-9px, 6px); } 66% { transform: translate(4px, 10px); } }
.scrib { stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 2s ease-in-out infinite; }
.scrib-s { width: 84px; height: 48px; }
@keyframes draw { 0% { stroke-dashoffset: 100; } 60%, 100% { stroke-dashoffset: 0; } }
#howGlyphs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; }
.hg { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.05); color: var(--c);
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--c) 45%, transparent) inset; }
.hg .demo { width: 62px; height: 62px; flex: none; }
.hg .demo .ghost { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.hg .demo .ink { fill: none; stroke: var(--c); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: ink 2.2s linear infinite; animation-delay: var(--d); filter: drop-shadow(0 0 4px var(--c)); }
@keyframes ink { 0% { stroke-dashoffset: 100; } 60%, 100% { stroke-dashoffset: 0; } }
.hg .demo .dot { fill: #fff; filter: drop-shadow(0 0 4px #fff); }
.hg .arrow .ico { width: 16px; height: 16px; opacity: .45; color: #fff; }
.hg .res .ico { width: 40px; height: 40px; filter: drop-shadow(0 0 8px var(--c)); animation: pop 2.2s infinite; animation-delay: var(--d); }
@keyframes pop { 0%, 58% { transform: scale(.75); opacity: .35; } 66% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.hg .cost { margin-left: auto; display: flex; align-items: center; gap: 2px; font-size: 16px; }
.hg .cost .ico { width: 18px; height: 18px; }
.hg .kk { position: absolute; top: -8px; right: -6px; height: 24px; min-width: 24px; font-size: 12px; }
@media (max-width: 480px) { #howGlyphs { grid-template-columns: 1fr; } }

/* ---------- upgrades ---------- */
.phead { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.ptitle-ic .ico { width: 40px; height: 40px; color: var(--cyan); filter: drop-shadow(0 0 8px var(--cyan)); }
.sh { display: flex; align-items: center; gap: 6px; font-size: 26px; color: #fff; }
#upList { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.up { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.05); border-radius: 14px; padding: 10px; }
.uic { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.uic .ico { width: 32px; height: 32px; filter: drop-shadow(0 0 6px var(--c)); }
.uinfo { flex: 1; min-width: 0; }
.per { font-family: var(--display); font-size: 18px; color: var(--c); }
.pips { display: flex; gap: 3px; margin-top: 6px; }
.pips i { flex: 1; max-width: 18px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); }
.pips i.on { background: var(--c); box-shadow: 0 0 6px var(--c); }
#skinList { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.skin { cursor: pointer; border: 0; background: rgba(255,255,255,.05); border-radius: 16px; padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: 0 0 0 2px transparent inset; min-height: 110px; }
.skin canvas { width: 72px; height: 72px; }
.skin.sel { box-shadow: 0 0 0 2.5px var(--c) inset, 0 0 18px color-mix(in srgb, var(--c) 50%, transparent); }
.skin.sel small .ico { color: var(--green); }
.skin.off canvas { filter: grayscale(.8) brightness(.6); }
.skin small { display: flex; align-items: center; gap: 3px; font-family: var(--display); font-size: 14px; min-height: 20px; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------- perk ---------- */
.ptitle { display: flex; align-items: center; gap: 8px; font-size: 30px; color: var(--gold); filter: drop-shadow(0 0 8px rgba(255,197,46,.5)); }
#perkCards { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.card { cursor: pointer; width: min(200px, 28vw); min-width: 150px; border: 0; border-radius: 22px; padding: 22px 12px 18px; background: linear-gradient(180deg, #1c2660, #0e1436);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 40%, transparent) inset, 0 10px 30px rgba(0,0,0,.5); display: flex; flex-direction: column; align-items: center; gap: 14px;
  animation: cardIn .35s backwards cubic-bezier(.2,1.4,.4,1); transition: transform .12s; color: #fff; }
.card:hover { transform: translateY(-6px) scale(1.04); box-shadow: 0 0 0 2.5px var(--c) inset, 0 0 30px color-mix(in srgb, var(--c) 55%, transparent); }
.card.picked { transform: scale(1.12); box-shadow: 0 0 0 3px var(--gold) inset, 0 0 40px rgba(255,197,46,.6); }
.card .pic { width: 92px; height: 92px; display: grid; place-items: center; border-radius: 50%; color: var(--c);
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 35%, transparent), transparent 70%); }
.card .pic .ico { width: 58px; height: 58px; filter: drop-shadow(0 0 10px var(--c)); }
.fxs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.fx { display: inline-flex; align-items: center; gap: 4px; background: rgba(0,0,0,.35); border-radius: 999px; padding: 4px 10px 4px 6px; font-size: 18px; }
.fx .ico { color: var(--c); width: 22px; height: 22px; }
.plus { font-style: normal; opacity: .4; display: none; }
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) scale(.8); } }
@media (max-width: 560px) { .card { width: 100%; min-width: 0; flex-direction: row; justify-content: flex-start; padding: 12px 16px; } .card .pic { width: 64px; height: 64px; } .card .pic .ico { width: 40px; height: 40px; } #perkCards { flex-direction: column; width: 100%; } }

/* ---------- game over ---------- */
.ostats { display: flex; gap: 10px; }
.ostats > div { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.06); border-radius: 14px; padding: 8px 14px; font-size: 24px; }
.ostats .ico { color: var(--cyan); }
.ko-em, .win-em { position: relative; width: 150px; height: 130px; display: grid; place-items: center; }
.ko-em img { width: 120px; filter: grayscale(.85) brightness(.7); transform: rotate(-18deg); }
.ko-em span { position: absolute; font-family: var(--display); font-style: italic; font-size: 54px; color: var(--red); text-shadow: 0 0 18px rgba(255,77,109,.8), 0 4px 0 #4a0010; transform: rotate(-10deg); animation: ko .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes ko { from { transform: rotate(-10deg) scale(2.4); opacity: 0; } }
.win-em img { width: 120px; animation: spinwin 1.5s linear infinite; }
@keyframes spinwin { to { transform: rotate(360deg); } }
.win-em .crown { position: absolute; top: -14px; width: 64px; height: 64px; color: var(--gold); filter: drop-shadow(0 0 14px rgba(255,197,46,.8)); z-index: 1; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud .bars { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; width: min(300px, 48vw); display: flex; flex-direction: column; gap: 6px; }
.hrow { display: flex; align-items: center; gap: 6px; }
.hic .ico { width: 22px; height: 22px; display: block; }
.hic.heart { color: var(--green); filter: drop-shadow(0 0 5px var(--green)); }
.hic.bolt { color: var(--cyan); filter: drop-shadow(0 0 5px var(--cyan)); }
.hbar { position: relative; flex: 1; height: 18px; border-radius: 9px; background: rgba(0,0,0,.55); box-shadow: 0 0 0 2px rgba(255,255,255,.15) inset; overflow: hidden; }
.hbar i { position: absolute; inset: 2px; border-radius: 7px; transform-origin: left; transition: transform .12s; }
.hbar.spin i { background: linear-gradient(90deg, #ff4d6d, #ffb02e 40%, #3dff9a); }
.hbar.spin span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: bold; text-shadow: 0 1px 2px #000; }
.hbar.energy { height: 12px; }
.hbar.energy i { background: linear-gradient(90deg, #2de2ff, #b18cff); box-shadow: 0 0 10px var(--cyan); }
.hbar.energy em { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.45); }
.hbar.deny { animation: deny .45s; }
@keyframes deny { 0%, 100% { box-shadow: 0 0 0 2px rgba(255,255,255,.15) inset; } 30%, 70% { box-shadow: 0 0 0 2px var(--red) inset, 0 0 14px var(--red); transform: translateX(-3px); } 50% { transform: translateX(3px); } }
#hud.low .hbar.spin { animation: lowpulse .5s infinite alternate; }
@keyframes lowpulse { to { box-shadow: 0 0 0 2px var(--red) inset, 0 0 14px var(--red); } }
#hWave { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; font-size: 22px; text-shadow: 0 2px 6px #000; white-space: nowrap; }
#hWave .ico { color: var(--gold); }
#hWave small { opacity: .6; font-size: 15px; font-family: var(--display); }
#bossBar { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 36px); left: 50%; transform: translateX(-50%); width: min(460px, 56vw); display: flex; align-items: center; gap: 8px; }
#bossPic { width: 50px; height: 50px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 40%, transparent), rgba(0,0,0,.6) 70%); box-shadow: 0 0 0 2px var(--c), 0 0 16px var(--c); flex: none; }
.hbar.boss { height: 16px; }
.hbar.boss i { background: linear-gradient(90deg, var(--c, #ff3d6e), #ffffff); transition: transform .2s; }
@media (max-width: 640px) { #hWave { top: auto; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 4px); left: 12px; transform: none; font-size: 18px; }
  #bossBar { top: calc(max(12px, env(safe-area-inset-top)) + 54px); width: 72vw; } }

#ults { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); display: flex; gap: 8px; pointer-events: auto; }
.ult { position: relative; width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(8,12,34,.75); color: var(--c); display: grid; place-items: center; padding: 0;
  --fill: 0; opacity: .7; touch-action: none; }
.ult .ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--fill) * 360deg), rgba(255,255,255,.12) 0); -webkit-mask: radial-gradient(circle, transparent 27px, #000 28px); mask: radial-gradient(circle, transparent 27px, #000 28px); }
.ult .glyph { width: 32px; height: 32px; position: relative; }
.ult .key { position: absolute; top: -6px; right: -4px; font-size: 11px; font-weight: bold; background: #0a0f2a; border-radius: 6px; padding: 1px 5px; color: #fff; opacity: .75; }
.ult.ready { opacity: 1; box-shadow: 0 0 20px color-mix(in srgb, var(--c) 70%, transparent); }
.ult.ready .glyph { filter: drop-shadow(0 0 6px var(--c)); animation: rdy 1.2s ease-in-out infinite; }
@keyframes rdy { 50% { transform: scale(1.12); } }
.ult.fire { animation: fire .3s; }
@keyframes fire { 50% { transform: scale(1.25); } }
.ult.shake { animation: shake .3s; }
@media (pointer: coarse) { .ult .key { display: none; } .ult { width: 60px; height: 60px; } .ult .ring { -webkit-mask: radial-gradient(circle, transparent 25px, #000 26px); mask: radial-gradient(circle, transparent 25px, #000 26px); } }

#banner { position: fixed; left: 0; right: 0; top: 24%; display: flex; flex-direction: column; align-items: center; z-index: 15; pointer-events: none; opacity: 0; }
#banner.show { animation: banner 1.4s forwards; }
#banner.boss.show, #banner.zone.show { animation-duration: 1.8s; }
#banner .t { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-style: italic; font-size: clamp(56px, 13vmin, 110px); color: #fff; text-shadow: 0 0 24px var(--c), 0 5px 0 rgba(0,0,0,.4); }
#banner .t .ico { width: .8em; height: .8em; color: var(--gold); filter: drop-shadow(0 0 12px rgba(255,197,46,.7)); }
#banner .t .tc { width: 1.4em; height: 1.4em; color: var(--green); filter: drop-shadow(0 0 20px var(--green)); }
#banner .s { display: flex; align-items: center; gap: 6px; font-size: 28px; color: var(--c); }
#banner .zpic { width: clamp(120px, 26vmin, 200px); border-radius: 50%; box-shadow: 0 0 40px var(--c); margin-bottom: -40px; }
#banner .bpic { width: clamp(140px, 30vmin, 220px); filter: drop-shadow(0 0 30px var(--c)); animation: bossin 1.8s ease-out; }
#banner .bpic.rage { animation: rage .2s 5; }
#banner .warn { display: flex; gap: 10px; color: var(--c); }
#banner .warn .ico { width: 34px; height: 34px; filter: drop-shadow(0 0 8px var(--c)); animation: blink .3s infinite alternate; }
@keyframes blink { to { opacity: .3; } }
@keyframes bossin { from { transform: scale(2.2) rotate(-90deg); } 40% { transform: scale(1) rotate(0); } }
@keyframes rage { 50% { transform: translateX(8px) scale(1.06); } }
@keyframes banner { 0% { opacity: 0; transform: scale(1.6); } 15% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.95); } }
#cast { position: fixed; left: 50%; top: 30%; z-index: 15; pointer-events: none; opacity: 0; color: var(--c); transform: translate(-50%, -50%); }
#cast .ico { width: clamp(90px, 18vmin, 150px); height: clamp(90px, 18vmin, 150px); filter: drop-shadow(0 0 22px var(--c)) drop-shadow(0 0 6px #fff); }
#cast.show { animation: cast .7s forwards; }
@keyframes cast { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-30deg); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(0); } 70% { opacity: .9; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1.5); } }
#toast { position: fixed; left: 50%; bottom: 22%; transform: translateX(-50%); z-index: 25; background: rgba(10,14,38,.9); padding: 8px 18px; border-radius: 999px; font-size: 26px;
  box-shadow: 0 0 0 1px var(--line) inset; opacity: 0; transition: opacity .2s; pointer-events: none; display: flex; gap: 6px; color: var(--red); }
#toast.show { opacity: 1; }
#hurt { position: fixed; inset: 0; pointer-events: none; z-index: 9; }
#hurt.show { animation: hurt .35s; }
@keyframes hurt { 0% { box-shadow: inset 0 0 140px rgba(255,40,80,.7); } 100% { box-shadow: inset 0 0 140px rgba(255,40,80,0); } }
.glabel { position: fixed; z-index: 16; pointer-events: none; transform: translate(-50%, -140%); color: var(--c); animation: glabel .7s forwards; }
.glabel .ico { width: 34px; height: 34px; filter: drop-shadow(0 0 8px var(--c)); }
@keyframes glabel { to { opacity: 0; transform: translate(-50%, -260%) scale(1.4); } }

/* ---------- aligned result / pause panels ---------- */
#over .panel, #pause .panel { width: min(400px, 92vw); gap: 14px; }
#over .ostats { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
#over .ostats > div { justify-content: center; padding: 10px 6px; }
#over .row, #pause .row { width: 100%; display: flex; flex-wrap: nowrap; gap: 12px; }
#over .row > .btn, #pause .row > .btn { flex: 1 1 0; min-width: 0; width: auto; height: 64px; margin: 0; }
#over .row > .btn.big, #pause .row > .btn.big { flex: 2 1 0; height: 72px; border-radius: 22px; font-size: 34px; }
#over .row > .btn.sq, #pause .row > .btn.sq { height: 72px; border-radius: 22px; }
#over .row > .btn.reward { height: 60px; border-radius: 18px; }
#pause #pResume { width: 100%; height: 72px; border-radius: 22px; }
.ko-em, .win-em { width: 160px; height: 120px; margin: 0 auto; }
.ko-em img, .win-em img { position: absolute; left: 50%; top: 50%; width: 110px; height: 110px; margin: -55px 0 0 -55px; }
.ko-em img { transform: rotate(-14deg); }
.ko-em span { position: absolute; inset: 0; display: grid; place-items: center; transform: rotate(-8deg); }
@keyframes ko { from { transform: rotate(-8deg) scale(2.4); opacity: 0; } }
.win-em .crown { left: 50%; margin-left: -32px; }

#bPause.paused { background: linear-gradient(180deg, #34f0ff, #0aa6d6); color: #04203a; box-shadow: 0 0 18px rgba(45,226,255,.7); animation: breathe 1.6s ease-in-out infinite; }
body.is-paused canvas#game { filter: brightness(.6) saturate(.7); transition: filter .2s; }
#over #oMenu.wide { width: 100%; height: 72px; border-radius: 22px; font-size: 34px; margin-top: 4px; }
