* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #060815; color: #FFF4E6;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
}
#app { position: fixed; inset: 0; overflow: hidden; }
#game { display: block; width: 100%; height: 100%; touch-action: none; }

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

/* ---------- HUD ---------- */
.hud {
  position: absolute; left: 0; right: 0;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; pointer-events: none;
  transition: opacity .2s ease;
  z-index: 5;
}
.score-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 15px 8px 12px;
  border-radius: 999px;
  background: rgba(8, 12, 30, .58);
  border: 1px solid rgba(255, 138, 61, .42);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .3);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 19px; font-weight: 800; letter-spacing: .5px;
  line-height: 1;
}
.score-pill .mp-icon { width: 19px; height: 19px; color: #FFB56B; }
.lives { display: flex; align-items: center; gap: 5px; }
.lives .mp-icon {
  width: 23px; height: 23px; color: #FF6B52;
  filter: drop-shadow(0 2px 5px rgba(255, 80, 50, .55));
  transition: opacity .2s ease, transform .2s ease;
}
.lives .mp-icon.off { opacity: .22; transform: scale(.82); filter: none; }

/* ---------- Screens ---------- */
.screen {
  position: absolute; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center;
  transition: opacity .28s ease;
}
.start-screen {
  background:
    radial-gradient(ellipse at 50% 82%, rgba(255, 138, 61, .16), transparent 42%),
    linear-gradient(180deg, rgba(4, 7, 20, .62) 0%, rgba(4, 7, 20, 0) 32%, rgba(4, 7, 20, 0) 70%, rgba(4, 7, 20, .35) 100%);
}
.brand {
  margin-top: calc(env(safe-area-inset-top, 0px) + 8vh);
  text-align: center; padding: 0 20px;
}
.brand-kicker {
  font-size: 11px; font-weight: 700;
  letter-spacing: .42em; text-indent: .42em;
  color: #FFAE72; opacity: .9;
  margin-bottom: 12px;
}
.brand-title {
  margin: 0;
  font-size: clamp(42px, 13.2vw, 62px);
  line-height: 1; font-weight: 900; letter-spacing: .01em;
  color: #FFF6E9;
  text-shadow:
    0 3px 0 #C24E12,
    0 6px 0 rgba(95, 28, 4, .55),
    0 12px 34px rgba(255, 122, 40, .5);
  white-space: nowrap;
}
.brand-title .num {
  display: inline-block;
  margin-left: 6px;
  color: #FF8A3D;
  -webkit-text-stroke: 1.5px #4A1B05;
  text-shadow: 0 3px 0 #8F3208, 0 8px 26px rgba(255, 122, 40, .6);
}
.brand-sub {
  margin: 16px 0 0;
  font-size: 14px; letter-spacing: .14em;
  color: rgba(255, 233, 214, .78);
}
.start-actions {
  position: absolute; left: 0; right: 0; top: 59%;
  display: flex; flex-direction: column; align-items: center;
  transform: translateY(-14%);
}
.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 900; color: #3A1604;
  -webkit-user-select: none; user-select: none;
}
.btn-primary {
  min-width: 214px; min-height: 58px;
  padding: 0 30px;
  font-size: 20px; letter-spacing: .06em;
  border-radius: 19px;
  background: linear-gradient(180deg, #FFB165 0%, #FF8A3D 48%, #F26A17 100%);
  border: 2px solid rgba(255, 236, 210, .55);
  box-shadow:
    0 12px 28px rgba(255, 106, 23, .38),
    0 3px 0 #A83E08,
    inset 0 2px 0 rgba(255, 255, 255, .55);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 5px 14px rgba(255, 106, 23, .32), 0 0 0 #A83E08, inset 0 2px 0 rgba(255, 255, 255, .45);
}
.btn-primary .mp-icon { width: 26px; height: 26px; color: #3A1604; }
.tip {
  position: absolute; left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 12px; letter-spacing: .06em;
  color: rgba(255, 244, 230, .55);
}
.tip .mp-icon { width: 16px; height: 16px; color: #FFAE72; opacity: .85; }

/* ---------- Game over ---------- */
.over-screen {
  justify-content: center;
  background: radial-gradient(ellipse at 50% 50%, rgba(25, 14, 45, .35), rgba(3, 6, 18, .78));
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
}
.panel {
  width: min(320px, 84vw);
  padding: 26px 24px 24px;
  text-align: center;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(29, 34, 62, .96), rgba(12, 16, 34, .97));
  border: 1px solid rgba(255, 138, 61, .38);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.panel-kicker {
  font-size: 13px; font-weight: 800; letter-spacing: .34em; text-indent: .34em;
  color: #FF8A3D;
}
.final-score {
  margin-top: 12px;
  font-size: 58px; line-height: 1; font-weight: 900;
  color: #FFE9D2;
  text-shadow: 0 3px 0 #A83E08, 0 10px 30px rgba(255, 122, 40, .45);
}
.final-label {
  margin-top: 7px;
  font-size: 12px; letter-spacing: .2em; color: rgba(255, 244, 230, .48);
}
.panel .btn { width: 100%; min-width: 0; margin-top: 22px; }

@media (max-height: 640px) {
  .brand { margin-top: calc(env(safe-area-inset-top, 0px) + 4vh); }
  .brand-title { font-size: clamp(36px, 11vw, 50px); }
  .start-actions { top: 56%; }
  .tip { display: none; }
}
