:root {
  --orange: #FF8A3D;
  --orange-2: #FFB264;
  --orange-deep: #E45F13;
  --amber: #FFC46B;
  --ink: #080A0E;
  --panel: rgba(15, 18, 24, .82);
  --panel-solid: #11151B;
  --line: rgba(255, 255, 255, .10);
  --text: #F7F3EC;
  --muted: #9CA3AE;
  --danger: #FF4F4F;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}
body { position: fixed; inset: 0; }
button { font-family: inherit; border: 0; background: none; color: inherit; padding: 0; cursor: pointer; }
#app { position: absolute; inset: 0; overflow: hidden; background: #080A0E; touch-action: none; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.vignette {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 42%, transparent 42%, rgba(0, 0, 0, .34) 78%, rgba(0, 0, 0, .62) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .42) 0%, transparent 14%, transparent 78%, rgba(0, 0, 0, .35) 100%);
}
.damage-flash {
  position: absolute; inset: 0; z-index: 8; pointer-events: none; opacity: 0;
  background: radial-gradient(100% 80% at 50% 55%, rgba(255, 32, 32, 0) 38%, rgba(255, 26, 26, .55) 100%);
  transition: opacity .18s ease-out;
}
.damage-flash.hit { opacity: 1; transition-duration: .04s; }

.is-hidden { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }
.hidden { display: none !important; }

/* ---------------- shared bits ---------------- */
.avatar {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(145deg, #FFB264, #E45F13);
  color: #1B0D04;
  font-size: 18px; font-weight: 900;
  border: 2px solid rgba(255, 255, 255, .22);
  box-shadow: 0 0 0 3px rgba(255, 138, 61, .16), 0 4px 12px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(20, 24, 31, .68);
  border: 1px solid var(--line);
  color: #D8DCE3;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .12s ease, background .2s;
}
.icon-btn .mp-icon { font-size: 19px; width: 19px; height: 19px; }
.icon-btn:active { transform: scale(.92); background: rgba(255, 138, 61, .18); color: var(--orange-2); }

.profile-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 14px 5px 5px;
  border-radius: 999px;
  background: rgba(14, 17, 23, .66);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 68vw;
}
.profile-chip .avatar { width: 36px; height: 36px; font-size: 15px; }
.profile-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.profile-text strong { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-text small { margin-top: 2px; font-size: 9.5px; letter-spacing: .08em; color: var(--orange-2); opacity: .85; }

/* ---------------- HUD ---------------- */
.hud {
  position: absolute; inset: 0; z-index: 12; pointer-events: none;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 12px) 16px calc(var(--safe-b) + 16px);
  transition: opacity .25s ease, visibility .25s;
}
.hud button { pointer-events: auto; }
.hud-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.player-mini {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: rgba(10, 13, 18, .58);
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: 58vw;
}
.player-mini .avatar { width: 34px; height: 34px; font-size: 14px; }
.player-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.player-meta strong { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-meta small { font-size: 9px; letter-spacing: .1em; color: var(--orange-2); opacity: .8; margin-top: 3px; }
.hud-top-right { display: flex; align-items: center; gap: 8px; }
.wave-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 11px;
  border-radius: 999px;
  background: rgba(10, 13, 18, .62);
  border: 1px solid rgba(255, 138, 61, .28);
  font-size: 11.5px; color: #E9E3D9;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.wave-chip .mp-icon { width: 15px; height: 15px; color: var(--orange-2); }
.wave-chip b { color: var(--orange-2); font-size: 15px; margin: 0 1px; }
#btnSoundHud { width: 34px; height: 34px; border-radius: 50%; }

.hud-sub { margin-top: 12px; display: flex; align-items: flex-end; gap: 8px; }
.score-chip {
  display: flex; flex-direction: column;
  padding: 7px 13px 6px;
  border-radius: 13px;
  background: rgba(10, 13, 18, .58);
  border: 1px solid rgba(255, 255, 255, .07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  line-height: 1;
}
.score-chip small { font-size: 9px; letter-spacing: .14em; color: var(--muted); }
.score-chip b { font-size: 22px; font-weight: 900; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.score-chip.pop b { animation: scorePop .24s ease-out; }
@keyframes scorePop { 0% { transform: scale(1.25); color: var(--orange-2); } 100% { transform: scale(1); color: var(--text); } }
.best-chip {
  padding: 5px 9px; border-radius: 9px;
  background: rgba(10, 13, 18, .42);
  border: 1px solid rgba(255, 255, 255, .06);
  font-size: 9.5px; color: var(--muted);
}
.best-chip b { color: #D9DEE6; font-variant-numeric: tabular-nums; }

.combo-chip {
  position: absolute; right: 20px; top: 34%;
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 12px; border-radius: 14px;
  pointer-events: none;
  background: linear-gradient(150deg, rgba(255, 138, 61, .94), rgba(224, 87, 13, .94));
  box-shadow: 0 8px 22px rgba(255, 100, 20, .3);
  transform: rotate(-5deg);
  animation: comboIn .2s cubic-bezier(.2, 1.5, .5, 1);
  transition: opacity .2s, visibility .2s;
}
.combo-chip b { font-size: 22px; font-weight: 900; line-height: 1; color: #2A1002; }
.combo-chip small { margin-top: 2px; font-size: 9px; font-weight: 700; letter-spacing: .16em; color: rgba(42, 16, 2, .72); }
@keyframes comboIn { from { transform: scale(.6) rotate(-12deg); opacity: 0; } to { transform: scale(1) rotate(-5deg); opacity: 1; } }

.wave-banner {
  position: absolute; left: 0; right: 0; top: 38%;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .8);
  transition: opacity .3s, visibility .3s;
}
.wave-banner small { font-size: 10px; letter-spacing: .48em; color: var(--orange-2); margin-bottom: 2px; }
.wave-banner strong {
  font-size: 74px; line-height: .9; font-weight: 900; letter-spacing: -.04em;
  color: #FFF3E6;
  text-shadow: 0 0 24px rgba(255, 138, 61, .55), 0 6px 26px rgba(0, 0, 0, .8);
}
.wave-banner span { margin-top: 7px; font-size: 12px; letter-spacing: .3em; color: rgba(255, 237, 219, .78); }
.wave-banner.show { animation: bannerIn .55s cubic-bezier(.16, 1, .3, 1); }
@keyframes bannerIn {
  0% { transform: scale(1.35); opacity: 0; filter: blur(6px); }
  55% { opacity: 1; filter: blur(0); }
  100% { transform: scale(1); }
}

.bottom-hud { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hp-panel {
  flex: 1 1 auto; max-width: 220px;
  padding: 10px 13px 10px;
  border-radius: 16px;
  background: rgba(10, 13, 18, .64);
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.hp-head { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); letter-spacing: .05em; }
.hp-head .mp-icon { width: 14px; height: 14px; color: #FF6A5B; }
.hp-head b { margin-left: auto; font-size: 16px; color: #EFF3F0; font-variant-numeric: tabular-nums; }
.hp-track {
  margin-top: 7px; height: 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .45);
}
.hp-track span {
  display: block; height: 100%; width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4FDD84, #A6F26E);
  box-shadow: 0 0 10px rgba(124, 242, 154, .55);
  transition: width .18s ease-out, background .25s;
}
.hp-track span.low { background: linear-gradient(90deg, #FF4D4D, #FF8A3D); box-shadow: 0 0 12px rgba(255, 77, 77, .6); animation: lowPulse 1s infinite; }
@keyframes lowPulse { 0%, 100% { opacity: 1; } 50% { opacity: .62; } }
.revive-pill {
  display: flex; align-items: center; gap: 5px;
  margin-top: 8px; font-size: 9px; color: rgba(255, 196, 107, .8);
  letter-spacing: .02em;
}
.revive-pill .mp-icon { width: 13px; height: 13px; color: var(--orange-2); }

.item-stack {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; flex: 0 0 auto;
}
.bomb-btn {
  position: relative;
  width: 62px; height: 62px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(255, 138, 61, .24), rgba(18, 22, 28, .92) 62%);
  border: 1px solid rgba(255, 138, 61, .42);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .1);
  pointer-events: auto;
  transition: transform .1s, opacity .2s, border-color .2s;
}
.bomb-btn .mp-icon {
  width: 23px; height: 23px;
  color: var(--orange-2);
  filter: drop-shadow(0 0 7px rgba(255, 138, 61, .4));
}
.bomb-btn b {
  position: absolute; top: -6px; right: -6px;
  min-width: 22px; height: 22px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: linear-gradient(180deg, #FFB264, #F06410);
  border: 1px solid rgba(255, 226, 194, .5);
  box-shadow: 0 3px 10px rgba(255, 100, 20, .35);
  font-size: 12px; font-weight: 900; color: #2A1102;
  font-variant-numeric: tabular-nums;
}
.bomb-btn small { margin-top: 1px; font-size: 8px; letter-spacing: .16em; color: #A9AEB8; }
.bomb-btn:active { transform: scale(.92); }
.bomb-btn.empty { opacity: .55; border-color: rgba(255, 255, 255, .12); }
.bomb-btn.cooling { filter: saturate(.55) brightness(.82); }
.bomb-ad {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  height: 24px; padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 138, 61, .13);
  border: 1px solid rgba(255, 138, 61, .32);
  font-size: 8.5px; font-weight: 700; letter-spacing: .02em;
  color: #FFC98D;
  pointer-events: auto;
  white-space: nowrap;
  transition: opacity .2s, transform .1s, background .2s;
}
.bomb-ad::after { content: ""; position: absolute; inset: -6px -8px -8px; }
.bomb-ad .mp-icon { width: 12px; height: 12px; color: var(--orange-2); }
.bomb-ad:active { transform: scale(.94); background: rgba(255, 138, 61, .24); }
.bomb-ad.is-full { opacity: .4; }
.bomb-ad.urgent {
  background: rgba(255, 138, 61, .28);
  border-color: rgba(255, 138, 61, .65);
  color: #FFE4C8;
  animation: bombUrgent 1.15s ease-in-out infinite;
}
@keyframes bombUrgent {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 138, 61, 0); }
  50% { box-shadow: 0 0 0 5px rgba(255, 138, 61, .16); }
}

.reload-btn {
  position: relative;
  width: 84px; height: 84px; flex: 0 0 auto;
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(10, 13, 18, .72);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
  pointer-events: auto;
  transition: transform .1s;
  overflow: hidden;
}
.reload-btn:active { transform: scale(.94); }
.reload-btn .mp-icon { width: 15px; height: 15px; color: var(--orange-2); opacity: .9; margin-bottom: 1px; transition: transform .3s; }
.reload-btn b { font-size: 25px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; color: #FFF4E7; }
.reload-btn small { margin-top: 2px; font-size: 8.5px; letter-spacing: .18em; color: var(--muted); }
.reload-btn.empty { border-color: rgba(255, 77, 77, .55); }
.reload-btn.empty b { color: #FF7A6B; }
.reload-btn.empty .mp-icon { color: #FF7A6B; }
.reload-btn.reloading .mp-icon { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.reload-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--orange) var(--p, 0%), rgba(255, 255, 255, .06) 0);
  opacity: 0; transition: opacity .2s;
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%);
  mask: radial-gradient(circle, transparent 62%, #000 63%);
}
.reload-btn.reloading .reload-ring { opacity: 1; }

/* ---------------- crosshair ---------------- */
.crosshair {
  position: absolute; left: 50%; top: 50%; z-index: 10;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  pointer-events: none;
  transition: opacity .12s, transform .08s;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .9));
}
.crosshair i { position: absolute; background: var(--orange-2); border-radius: 2px; }
.crosshair .ch-dot { left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; border-radius: 50%; background: #FFF4E6; }
.crosshair .ch-t { left: 50%; top: 3px; width: 2px; height: 9px; margin-left: -1px; }
.crosshair .ch-b { left: 50%; bottom: 3px; width: 2px; height: 9px; margin-left: -1px; }
.crosshair .ch-l { top: 50%; left: 3px; height: 2px; width: 9px; margin-top: -1px; }
.crosshair .ch-r { top: 50%; right: 3px; height: 2px; width: 9px; margin-top: -1px; }
.crosshair.locked i { background: #FF5B45; }
.crosshair.locked .ch-dot { background: #FFF; }
.crosshair.fire { transform: scale(1.24); }
.hit-marker {
  position: absolute; z-index: 11; width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  pointer-events: none; opacity: 0;
}
.hit-marker::before, .hit-marker::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 2px; height: 30px; margin: -15px 0 0 -1px;
  background: #FFF; border-radius: 2px;
  box-shadow: 0 0 6px rgba(255, 138, 61, .9);
}
.hit-marker::before { transform: rotate(45deg); }
.hit-marker::after { transform: rotate(-45deg); }
.hit-marker.show { animation: hitPop .22s ease-out; }
.hit-marker.head::before, .hit-marker.head::after { background: var(--orange-2); }
@keyframes hitPop {
  0% { opacity: 1; transform: scale(.65); }
  100% { opacity: 0; transform: scale(1.15); }
}

/* ---------------- menu ---------------- */
.screen {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column;
  opacity: 1; visibility: visible;
  transition: opacity .32s ease, visibility .32s;
}
.menu {
  justify-content: space-between;
  padding: calc(var(--safe-t) + 14px) 18px calc(var(--safe-b) + 14px);
  background:
    linear-gradient(180deg, rgba(4, 6, 10, .82) 0%, rgba(4, 6, 10, .28) 18%, rgba(4, 6, 10, 0) 38%),
    linear-gradient(0deg, rgba(4, 6, 10, .97) 0%, rgba(4, 6, 10, .86) 24%, rgba(4, 6, 10, .3) 52%, rgba(4, 6, 10, 0) 70%);
}
.menu-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.menu-main { margin-top: auto; padding-bottom: 8px; }
.kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; letter-spacing: .16em; font-weight: 600;
  color: #FFD7AC;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 138, 61, .32);
  background: rgba(255, 138, 61, .10);
}
.kicker .mp-icon { width: 14px; height: 14px; color: var(--orange-2); }
.logo {
  margin: 12px 0 0;
  font-size: clamp(56px, 17vw, 78px);
  line-height: .88;
  font-weight: 900;
  letter-spacing: -.075em;
  display: flex; align-items: baseline;
  text-shadow: 0 10px 40px rgba(0, 0, 0, .7);
}
.logo span {
  color: #FBF5EB;
  background: linear-gradient(180deg, #FFFFFF 8%, #E8DED1 58%, #B6A99A 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .35));
}
.logo em {
  position: relative;
  font-style: normal;
  margin-left: 2px;
  background: linear-gradient(180deg, #FFD39E 0%, #FFA55A 42%, #F06A12 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgba(255, 116, 26, .38));
}
.logo em::after {
  content: ""; position: absolute; left: 2%; right: 2%; bottom: -5px; height: 6px;
  background: linear-gradient(90deg, rgba(255, 138, 61, 0), rgba(255, 138, 61, .85), rgba(255, 138, 61, 0));
  filter: blur(1px); border-radius: 50%;
}
.tagline { margin: 14px 0 0; font-size: 13px; line-height: 1.65; color: #B9B2A8; letter-spacing: .01em; }

.menu-stats {
  display: flex; align-items: stretch;
  margin-top: 18px;
  border-radius: 16px;
  background: rgba(13, 16, 22, .62);
  border: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}
.menu-stats div { flex: 1; padding: 11px 8px 10px; display: flex; flex-direction: column; align-items: center; position: relative; }
.menu-stats div + div::before {
  content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .12), transparent);
}
.menu-stats b { font-size: 22px; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: #FFF4E8; }
.menu-stats span { margin-top: 3px; font-size: 9.5px; letter-spacing: .12em; color: var(--muted); }

.cta {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 62px;
  margin-top: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #FFA95E 0%, #FF8A3D 38%, #F06410 100%);
  border: 1px solid rgba(255, 215, 174, .55);
  box-shadow: 0 14px 34px rgba(255, 94, 12, .34), inset 0 1px 0 rgba(255, 255, 255, .35);
  color: #2B1203;
  overflow: hidden;
  transition: transform .12s ease, filter .2s, box-shadow .2s;
}
.cta::after {
  content: ""; position: absolute; inset: 2px; border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, .18);
  pointer-events: none;
}
.cta .mp-icon { width: 25px; height: 25px; color: #351604; }
.cta b { font-size: 20px; font-weight: 900; letter-spacing: .08em; }
.cta em {
  font-style: normal; font-size: 9px; font-weight: 800; letter-spacing: .16em;
  padding: 3px 7px; border-radius: 6px;
  background: rgba(44, 17, 3, .16); color: rgba(44, 17, 3, .72);
}
.cta:active { transform: scale(.975); filter: brightness(.96); }
.cta-shine {
  position: absolute; top: -60%; left: -35%; width: 26%; height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: rotate(18deg);
  animation: shineSweep 3.6s ease-in-out infinite;
}
@keyframes shineSweep {
  0%, 58% { left: -40%; opacity: 0; }
  62% { opacity: .85; }
  82%, 100% { left: 120%; opacity: 0; }
}
.menu-hints { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; }
.menu-hints span { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: #8E929B; }
.menu-hints .mp-icon { width: 13px; height: 13px; color: var(--orange-2); opacity: .8; }
.menu-foot {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding-top: 10px; font-size: 9px; letter-spacing: .18em; color: rgba(255, 255, 255, .28);
}
.live-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 6px var(--orange); }

/* ---------------- defeat ---------------- */
.over {
  z-index: 30;
  justify-content: center; align-items: center;
  padding: calc(var(--safe-t) + 18px) 18px calc(var(--safe-b) + 18px);
  background:
    radial-gradient(90% 60% at 50% 30%, rgba(255, 77, 45, .12), transparent 60%),
    linear-gradient(180deg, rgba(5, 7, 10, .9), rgba(5, 7, 10, .97));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.over-panel {
  position: relative;
  width: 100%; max-width: 370px;
  margin: auto;
  padding: 26px 20px 18px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(26, 22, 21, .94), rgba(12, 14, 19, .97));
  border: 1px solid rgba(255, 138, 61, .2);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .07);
  text-align: center;
  animation: overIn .42s cubic-bezier(.16, 1, .3, 1);
}
@keyframes overIn { 0% { transform: translateY(18px) scale(.96); opacity: 0; } 100% { transform: none; opacity: 1; } }
.over-panel::before {
  content: ""; position: absolute; left: 18%; right: 18%; top: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  box-shadow: 0 0 18px rgba(255, 138, 61, .6);
}
.over-icon {
  width: 58px; height: 58px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(255, 138, 61, .28), rgba(255, 77, 45, .08));
  border: 1px solid rgba(255, 138, 61, .35);
  box-shadow: 0 0 30px rgba(255, 90, 30, .16);
}
.over-icon .mp-icon { width: 30px; height: 30px; color: #FF8C5A; }
.over-kicker { margin: 0; font-size: 9px; letter-spacing: .42em; color: rgba(255, 138, 61, .72); font-weight: 700; }
.over h2 { margin: 6px 0 0; font-size: 30px; font-weight: 900; letter-spacing: -.04em; color: #FFF2E4; }
.over-desc { margin: 7px 0 0; font-size: 12px; color: #9DA1A9; }
.result-grid {
  display: flex; margin: 20px 0 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .06);
  overflow: hidden;
}
.result-grid div { flex: 1; padding: 12px 4px 11px; display: flex; flex-direction: column; align-items: center; position: relative; }
.result-grid div + div::before {
  content: ""; position: absolute; left: 0; top: 24%; bottom: 24%; width: 1px;
  background: rgba(255, 255, 255, .08);
}
.result-grid b { font-size: 23px; line-height: 1; font-weight: 900; color: #FFE1C4; font-variant-numeric: tabular-nums; }
.result-grid span { margin-top: 5px; font-size: 9.5px; letter-spacing: .14em; color: #888D96; }
.new-best {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 12px; padding: 4px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 700; color: #2C1A05;
  background: linear-gradient(180deg, #FFD08A, #FFA34F);
  box-shadow: 0 4px 14px rgba(255, 138, 61, .28);
  transition: opacity .2s, visibility .2s;
}
.new-best .mp-icon { width: 13px; height: 13px; }
.revive-cta { height: 58px; margin-top: 18px; }
.revive-cta b { font-size: 18px; }
.revive-note { margin: 9px 0 0; font-size: 10px; line-height: 1.5; color: #8D929C; }
.btn-ghost {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 46px; margin-top: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .045);
  font-size: 13px; font-weight: 700; color: #D8DCE3;
  transition: transform .12s, background .2s;
}
.btn-ghost .mp-icon { width: 17px; height: 17px; color: var(--orange-2); }
.btn-ghost:active { transform: scale(.98); background: rgba(255, 255, 255, .08); }
.btn-text {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 10px auto 0; padding: 6px 10px;
  font-size: 11px; color: #7D828C;
}
.btn-text .mp-icon { width: 14px; height: 14px; }
.btn-text:active { color: #C9CDD4; }

/* ---------------- rewarded ad ---------------- */
.ad {
  z-index: 45;
  align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(3, 5, 8, .94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ad-card {
  width: 100%; max-width: 350px;
  border-radius: 22px; overflow: hidden;
  background: #0D1117;
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
}
.ad-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; font-size: 10px; color: #7E8590; letter-spacing: .06em; }
.ad-tag { padding: 2px 6px; border-radius: 4px; font-size: 9px; font-weight: 800; color: #2A1403; background: var(--orange-2); letter-spacing: .1em; }
.ad-stage {
  position: relative; height: 176px; overflow: hidden;
  background: linear-gradient(180deg, #1B2430 0%, #3A2B26 64%, #14100F 100%);
}
.ad-sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(46% 40% at 72% 26%, rgba(255, 193, 128, .38), transparent 70%),
    radial-gradient(30% 30% at 22% 18%, rgba(255, 138, 61, .16), transparent 70%);
}
.ad-city {
  position: absolute; left: 0; right: 0; bottom: 0; height: 58%;
  background: linear-gradient(180deg, #171D25, #0A0D12 70%);
  clip-path: polygon(0 100%, 0 62%, 7% 62%, 7% 40%, 14% 40%, 14% 66%, 21% 66%, 21% 22%, 27% 22%, 27% 54%, 33% 54%, 33% 34%, 39% 34%, 39% 70%, 46% 70%, 46% 48%, 53% 48%, 53% 16%, 59% 16%, 59% 58%, 67% 58%, 67% 38%, 74% 38%, 74% 64%, 82% 64%, 82% 27%, 88% 27%, 88% 55%, 95% 55%, 95% 44%, 100% 44%, 100% 100%);
  opacity: .94;
}
.ad-city::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 6px, rgba(255, 168, 94, .2) 6px 8px, transparent 8px 16px),
    repeating-linear-gradient(0deg, transparent 0 10px, rgba(255, 168, 94, .16) 10px 12px, transparent 12px 24px);
  opacity: .32;
  mix-blend-mode: screen;
}
.ad-scan {
  position: absolute; left: 0; right: 0; top: -20%; height: 24%;
  background: linear-gradient(180deg, transparent, rgba(255, 138, 61, .1));
  animation: scanMove 2.6s linear infinite;
}
@keyframes scanMove { to { transform: translateY(500%); } }
.ad-mascot {
  position: absolute; left: 18px; bottom: 14px;
  width: 36px; height: 36px; color: var(--orange-2);
  filter: drop-shadow(0 0 16px rgba(255, 138, 61, .55));
}
.ad-stage-text {
  position: absolute; left: 62px; bottom: 16px;
  font-size: 11px; line-height: 1.4; letter-spacing: .12em; color: rgba(255, 226, 200, .72);
}
.ad-stage-text b { font-size: 16px; letter-spacing: .04em; color: #FFF1DF; }
.ad-info { padding: 15px 16px 18px; text-align: center; }
.ad-title { margin: 0; font-size: 14px; font-weight: 800; color: #F1E9DE; }
.ad-sub { margin: 4px 0 0; font-size: 10px; color: #868D98; }
.ad-progress { margin-top: 13px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.ad-progress span { display: block; height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, var(--orange-2), var(--orange)); transition: width .12s linear; }
.ad-count { margin-top: 10px; font-size: 24px; font-weight: 900; color: var(--orange-2); line-height: 1; font-variant-numeric: tabular-nums; }
.ad-cancel {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  margin-top: 14px; padding: 6px 12px; border-radius: 999px;
  font-size: 10px; color: #78808B;
  border: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .025);
  transition: color .2s, background .2s;
}
.ad-cancel .mp-icon { width: 12px; height: 12px; }
.ad-cancel:active { color: #C9CDD4; background: rgba(255, 255, 255, .07); }

/* ---------------- toast ---------------- */
.toast {
  position: absolute; z-index: 60;
  left: 50%; bottom: calc(var(--safe-b) + 132px);
  transform: translate(-50%, 10px);
  max-width: 82vw;
  pointer-events: none;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(20, 24, 31, .94);
  border: 1px solid rgba(255, 138, 61, .26);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  font-size: 11.5px; color: #F2E9DC; text-align: center;
  transition: opacity .22s, transform .22s, visibility .22s;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---------------- small phones ---------------- */
@media (max-height: 700px) {
  .bomb-btn { width: 54px; height: 54px; border-radius: 16px; }
  .bomb-btn .mp-icon { width: 20px; height: 20px; }
  .bomb-btn small { font-size: 7.5px; }
  .bomb-ad { height: 21px; font-size: 7.5px; padding: 0 6px; }
  .hp-panel { padding: 8px 10px; }
  .menu { padding-top: calc(var(--safe-t) + 10px); padding-bottom: calc(var(--safe-b) + 10px); }
  .logo { font-size: clamp(48px, 15vw, 64px); }
  .tagline { margin-top: 10px; font-size: 12px; }
  .menu-stats { margin-top: 12px; }
  .menu-stats div { padding: 8px 6px; }
  .menu-stats b { font-size: 19px; }
  .cta { height: 56px; margin-top: 12px; }
  .menu-hints { margin-top: 8px; }
  .menu-foot { padding-top: 6px; }
  .over-panel { padding: 20px 16px 14px; }
  .over h2 { font-size: 26px; }
  .result-grid { margin-top: 14px; }
  .revive-cta { height: 54px; margin-top: 13px; }
}
@media (max-width: 360px) {
  .bottom-hud { gap: 8px; }
  .bomb-btn { width: 56px; height: 56px; }
  .hp-panel { max-width: none; padding: 9px 10px; }
  .reload-btn { width: 76px; height: 76px; }
}
@media (min-width: 560px) {
  .menu-main, .menu-top, .menu-foot { width: 100%; max-width: 460px; margin-left: auto; margin-right: auto; }
  .menu-main { margin-top: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .cta-shine, .ad-scan, .hp-track span.low { animation: none; }
}
