/* Оформление игры: окна — ледяные плиты со снежной шапкой, HUD — льдинки и табло. */
body { background: radial-gradient(circle at 50% 30%, #3f9dff, #0c3f86 70%); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
#scr-menu { background: #58b8ff; }
#scr-game { background: #58b8ff; touch-action: none; }
#scv, #gcv { position: absolute; left: 0; top: 0; display: block; }
#gcv { touch-action: none; }

/* окна */
.overlay { background: rgba(6, 30, 70, .55); }
.panel.ice { width: 320px; padding: 22px 18px 18px; border-radius: 26px; color: #0b3d78; align-items: stretch; animation: pin .28s cubic-bezier(.3, 1.5, .5, 1);
  background: linear-gradient(170deg, #ffffff, #dff5ff 45%, #a8e2ff); border: 4px solid #0b3d78; box-shadow: inset 0 3px 0 #fff, inset 0 -6px 0 rgba(30, 120, 210, .3), 0 7px 0 #0b3d78, 0 18px 30px rgba(0, 20, 60, .5); }
.panel.wide { width: 340px; }
.panel-cap { position: absolute; left: -6px; right: -6px; top: -16px; height: 28px; pointer-events: none;
  background: radial-gradient(circle at 10% 70%, #fff 0 15px, transparent 16px), radial-gradient(circle at 30% 45%, #fff 0 18px, transparent 19px), radial-gradient(circle at 55% 60%, #fff 0 16px, transparent 17px), radial-gradient(circle at 78% 40%, #fff 0 19px, transparent 20px), radial-gradient(circle at 95% 70%, #fff 0 13px, transparent 14px);
  filter: drop-shadow(0 2px 0 #9cc4f2); }
@keyframes pin { from { transform: translateY(30px) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-title { text-align: center; font-size: 26px; font-weight: 900; color: #0b3d78; text-shadow: 0 2px 0 #fff; margin-bottom: 4px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border-radius: 16px; border: 3px solid #0b3d78; font: inherit; font-size: 18px; font-weight: 900; color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .5), inset 0 -4px 0 rgba(0, 0, 0, .18), 0 5px 0 #0b3d78; transition: transform .06s; padding: 0 12px; }
.btn:active { transform: translateY(4px); }
.btn * { pointer-events: none; }
.btn-go { background: linear-gradient(#fff27a, #ffd21a 48%, #ffb000 52%, #ffc61f); color: #0b3d78; text-shadow: 0 2px 0 rgba(255, 255, 255, .6); font-size: 21px; min-height: 58px; }
.btn-blue { background: linear-gradient(#8fdcff, #2f8df0); }
.btn-pink { background: linear-gradient(#ffb0d0, #ef3f72); }
.btn-sm { min-height: 42px; font-size: 15px; background: linear-gradient(#e6f4ff, #a9c9ef); color: #0b3d78; text-shadow: none; }
.res-row { display: flex; gap: 10px; }
.btn-half { flex: 1; }

/* результат */
.res-title { text-align: center; line-height: 0; min-height: 50px; }
.res-stars { display: flex; justify-content: center; gap: 6px; margin-top: -2px; }
.res-stars svg { width: 54px; height: 54px; }
.res-stars .off { filter: grayscale(1) brightness(1.4); opacity: .45; }
.res-stars .on { animation: starPop .45s cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes starPop { from { transform: scale(0) rotate(-40deg); } to { transform: none; } }
.res-reason { text-align: center; font-size: 15px; font-weight: 800; color: #d0154a; min-height: 0; }
.res-reason:empty { display: none; }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.res-grid div { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border-radius: 12px; background: rgba(255, 255, 255, .75); border: 2px solid #9cc4f2; }
.res-grid span { font-size: 11px; font-weight: 700; color: #4a6f9f; }
.res-grid b { font-size: 20px; font-weight: 900; color: #0b3d78; }
.res-grid .rec b { color: #ef3f72; }

/* уровни */
#lv-list { max-height: 360px; display: flex; flex-direction: column; gap: 10px; padding: 2px; }
.lv-world { border-radius: 16px; padding: 8px; border: 3px solid #0b3d78; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45); }
.lv-head { display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 900; font-size: 15px; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); margin: 0 4px 6px; }
.lv-head small { display: flex; align-items: center; gap: 2px; font-size: 13px; }
.lv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lv-tile { position: relative; height: 62px; border-radius: 14px; border: 3px solid #0b3d78; background: linear-gradient(#ffffff, #cfeeff); color: #0b3d78; font: inherit; font-size: 22px; font-weight: 900;
  display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset 0 -3px 0 rgba(30, 120, 210, .25), 0 3px 0 #0b3d78; padding: 0; }
.lv-tile * { pointer-events: none; }
.lv-tile .st { display: flex; gap: 1px; height: 14px; }
.lv-tile .st svg { width: 14px; height: 14px; }
.lv-tile .st .off { opacity: .25; filter: grayscale(1); }
.lv-tile.boss { background: linear-gradient(#fff27a, #ffb000); }
.lv-tile.cur { box-shadow: 0 0 0 3px #fff, 0 3px 0 #0b3d78, 0 0 14px #fff; }
.lv-tile.lock { background: linear-gradient(#c8d6ea, #8ea6c8); color: #4a5f80; }
.lv-tile.lock svg.lk { width: 24px; height: 24px; }

/* магазин */
.shop-coins { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 20px; color: #0b3d78; }
#shop-list { max-height: 330px; display: flex; flex-direction: column; gap: 8px; }
.up-row { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, .8); border: 2px solid #9cc4f2; }
.up-ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: linear-gradient(#e9fbff, #9fe0ff); border: 2px solid #0b3d78; flex-shrink: 0; }
.up-ic svg { width: 30px; height: 30px; }
.up-mid { flex: 1; min-width: 0; }
.up-name { font-size: 14px; font-weight: 900; color: #0b3d78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-pips { display: flex; gap: 3px; margin-top: 4px; }
.up-pips i { width: 16px; height: 8px; border-radius: 4px; background: #c8d6ea; border: 1px solid #6a85b0; }
.up-pips i.on { background: linear-gradient(#fff27a, #ffb000); border-color: #7a3a00; }
.up-q { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #0b3d78; background: #fff; color: #0b3d78; font: inherit; font-size: 18px; font-weight: 900; flex-shrink: 0; padding: 0; }
.up-buy { min-width: 80px; height: 42px; border-radius: 12px; border: 2px solid #0b3d78; background: linear-gradient(#7df067, #1f9e2c); color: #fff; font: inherit; font-size: 15px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; gap: 3px; box-shadow: 0 3px 0 #0b3d78; flex-shrink: 0; padding: 0 6px; text-shadow: 0 1px 0 rgba(0, 0, 0, .3); }
.up-buy svg { width: 18px; height: 18px; }
.up-buy.no { background: linear-gradient(#c8d6ea, #8ea6c8); }
.up-buy.max { background: linear-gradient(#fff27a, #ffb000); color: #7a3a00; text-shadow: none; }
.up-buy *, .up-q * { pointer-events: none; }

/* рейтинг */
.lb-me { text-align: center; font-size: 14px; font-weight: 700; color: #4a6f9f; }
#lb-list { max-height: 330px; }
.lb-row { border-radius: 12px; background: rgba(255, 255, 255, .8); border: 2px solid #9cc4f2; color: #0b3d78; font-weight: 800; }
.lb-medal { font-weight: 900; font-size: 15px; }
.lb-avatar { background: linear-gradient(#bfe9ff, #5ab2f0); color: #fff; font-weight: 900; }
.lb-score { color: #ef3f72; font-weight: 900; }
.lb-row.top-1 { background: linear-gradient(90deg, #fff6b0, #ffe066); border-color: #e0a100; }
.lb-row.top-2 { background: linear-gradient(90deg, #f4f8ff, #d6e2f2); border-color: #8ea6c8; }
.lb-row.top-3 { background: linear-gradient(90deg, #ffe2c6, #ffbf8a); border-color: #c9762a; }
.lb-row.me { box-shadow: 0 0 0 3px #2f8df0; }
.top-1 .lb-medal, .top-2 .lb-medal, .top-3 .lb-medal { width: 30px; height: 30px; line-height: 26px; border-radius: 50%; border: 2px solid #0b3d78; color: #0b3d78; }
.top-1 .lb-medal { background: radial-gradient(circle at 35% 30%, #fff8c0, #ffc21a); }
.top-2 .lb-medal { background: radial-gradient(circle at 35% 30%, #fff, #b8c6da); }
.top-3 .lb-medal { background: radial-gradient(circle at 35% 30%, #ffe2c0, #d9822e); }
.lb-empty { color: #4a6f9f; font-weight: 700; }

#toast { top: 64px; padding: 10px 16px; border-radius: 14px; background: #0b3d78; color: #fff; font-weight: 800; font-size: 15px; border: 2px solid #fff; }

/* HUD */
.hud { pointer-events: none; }
.hud > * { pointer-events: none; }
.hud-top { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; align-items: center; gap: 8px; }
.hud-lv { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 19px; font-weight: 900;
  background: radial-gradient(circle at 35% 30%, #8fdcff, #2f8df0 70%); border: 3px solid #0b3d78; box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 3px 0 #0b3d78; text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.hud-prog { flex: 1; position: relative; height: 34px; display: flex; align-items: center; }
.hud-track { position: relative; flex: 1; height: 14px; border-radius: 7px; background: rgba(11, 61, 120, .55); border: 2px solid #fff; margin-right: 4px; }
#hud-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 6px; background: linear-gradient(#fff, #9fe0ff); transform-origin: 0 50%; transform: scaleX(0); }
#hud-dot { position: absolute; top: 50%; left: 0; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #cfe3fb); border: 2px solid #0b3d78; }
.hud-sm { flex-shrink: 0; filter: drop-shadow(0 2px 0 rgba(0, 30, 80, .4)); }
.hud-coins { display: flex; align-items: center; gap: 3px; height: 34px; padding: 0 10px 0 6px; border-radius: 17px; background: rgba(255, 255, 255, .92); border: 2px solid #0b3d78; color: #0b3d78; font-size: 17px; font-weight: 900; }
.hud-pause { pointer-events: auto !important; width: 44px; height: 44px; border-radius: 14px; border: 3px solid #0b3d78; background: linear-gradient(#fff, #bfe6ff); color: #0b3d78;
  display: flex; align-items: center; justify-content: center; padding: 0; box-shadow: 0 3px 0 #0b3d78; }
.hud-pause * { pointer-events: none; }
.hud-lim { position: absolute; right: 10px; top: 62px; display: none; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 14px; background: #fff; color: #0b3d78; border: 2px solid #0b3d78; font-size: 13px; font-weight: 800; box-shadow: 0 3px 0 rgba(0, 30, 80, .35); }
.hud-lim b { font-size: 18px; }
.hud-lim.show { display: flex; }
.hud-lim.warn { background: #ffe14a; animation: limPulse .5s ease-in-out infinite alternate; }
@keyframes limPulse { to { transform: scale(1.08); } }
.hud-bons { position: absolute; left: 10px; top: 62px; display: flex; flex-direction: column; gap: 6px; }
.bon { position: relative; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; border: 3px solid #0b3d78; }
.bon::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: conic-gradient(#ffc21a calc(var(--p) * 1turn), transparent 0); -webkit-mask: radial-gradient(circle, transparent 19px, #000 20px); mask: radial-gradient(circle, transparent 19px, #000 20px); }
.bon svg { width: 28px; height: 28px; }
.hud-tip { position: absolute; left: 50%; top: 104px; transform: translateX(-50%); max-width: 300px; padding: 8px 14px; border-radius: 14px; background: rgba(11, 61, 120, .85); color: #fff; font-size: 15px; font-weight: 800;
  text-align: center; border: 2px solid #fff; opacity: 0; transition: opacity .3s; }
.hud-tip.show { opacity: 1; }
.hud-pops { position: absolute; left: 0; right: 0; top: 150px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pop { font-size: 28px; font-weight: 900; color: #fff; -webkit-text-stroke: 1px #0b3d78; text-shadow: 0 3px 0 #0b3d78, 0 0 10px rgba(0, 40, 120, .6); animation: popUp 1.1s ease-out forwards; white-space: nowrap; }
.pop.good { color: #6dff8a; } .pop.bad { color: #ff5a6e; text-shadow: 0 3px 0 #5a0018, 0 0 10px rgba(120, 0, 30, .5); } .pop.combo { color: #ffe14a; font-size: 22px; } .pop.smash { color: #ffe14a; font-size: 40px; }
@keyframes popUp { 0% { transform: scale(.4); opacity: 0; } 15% { transform: scale(1.15); opacity: 1; } 30% { transform: scale(1); } 80% { opacity: 1; } 100% { transform: translateY(-30px); opacity: 0; } }
.hud-big { position: absolute; left: 0; right: 0; top: 300px; text-align: center; line-height: 0; opacity: 0; }
.hud-big.show { animation: bigIn 1.6s ease-out forwards; }
@keyframes bigIn { 0% { transform: scale(2.4); opacity: 0; } 18% { transform: scale(1); opacity: 1; } 75% { opacity: 1; } 100% { transform: scale(.9) translateY(-20px); opacity: 0; } }
#massTag { position: absolute; z-index: 3; left: 0; top: 0; pointer-events: none; transform: translate(-50%, -100%); white-space: nowrap; will-change: transform; }
#massTag b { display: block; padding: 2px 12px; border-radius: 14px; font-size: 26px; font-weight: 900; color: #0b3d78; background: linear-gradient(#ffffff, #cfeeff); border: 3px solid #0b3d78; box-shadow: 0 3px 0 #0b3d78; }
#massTag { display: flex; flex-direction: column; align-items: center; gap: 6px; }
#massTag i { display: block; padding: 1px 8px; border-radius: 10px; font-style: normal; font-size: 13px; font-weight: 900; color: #fff; background: rgba(11, 61, 120, .78); }
#massTag.hit b { animation: tagHit .3s ease-out; }
@keyframes tagHit { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }

#nitro { position: absolute; z-index: 6; left: 0; top: 0; width: 160px; height: 160px; margin: -80px 0 0 -80px; pointer-events: none; opacity: 0; transform: scale(.4); transition: opacity .15s, transform .2s cubic-bezier(.3, 1.6, .5, 1); will-change: left, top; }
#nitro.show { opacity: 1; transform: scale(1); }
#nitro.full #nit-fill { animation: nitFull .25s ease-in-out infinite alternate; }
@keyframes nitFull { to { stroke-width: 16px; } }
#nitro svg { width: 160px; height: 160px; }
