/* ------------------------------------------------------------------
   styles.css — portrait-first. On desktop the stage is clamped to a
   phone-shaped panel so the layout is identical to the Android build.
   ------------------------------------------------------------------ */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #05070f;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}

#stage {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: calc(100vh * 0.5625);
  margin: 0 auto;
  overflow: hidden;
  background: #0b0e1c;
  box-shadow: 0 0 60px rgba(0, 0, 0, .8);
}

#game { display: block; width: 100%; height: 100%; }

.layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.hide { display: none !important; }

/* ------------------------------------------------------------- HUD */
/* Lives left, score pill centre, coins right. The sky now carries the
   altitude, so the HUD is only what changes shot to shot. */
.hud-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 0;
}
.pill {
  justify-self: center;
  text-align: center;
  padding: 7px 18px 6px;
  border-radius: 20px;
  background: rgba(4, 18, 12, .5);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
#score {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .8px;
  color: #ffd75e;
}
.combo {
  opacity: .5;
  transition: color .2s, transform .2s, opacity .2s;
}
.combo.hot { color: #ffe45e; transform: scale(1.15); opacity: 1; }
.hcoins {
  justify-self: end;
  font-size: 13px;
  font-weight: 800;
  color: #ffd75e;
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
  padding: 5px 10px;
  border-radius: 14px;
  background: rgba(4, 18, 12, .45);
}
/* Fever x2: the score goes gold and throbs */
/* ---- consumables ---- */
.bi { width: 34px; height: 34px; display: block; margin: 0 auto 2px; }
/* The headstart tab docks to the right edge, outside the aiming zone, so a
   tap can never become a shot. #hud is pointer-events:none so the overlay
   never blocks aiming; anything tappable inside it must opt back in — the
   original bottom-centre button forgot to, and every tap fell through to
   the canvas. */
.edge {
  position: absolute; right: 0; top: 40%;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.hsbtn {
  pointer-events: auto;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; padding: 0 0 0 4px; border: 0; cursor: pointer;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, #ffd45a, #f0a020);
  box-shadow: -4px 0 0 #b5610a, 0 6px 18px rgba(0, 0, 0, .35);
  color: #2a1603; font: 800 10px/1 inherit; letter-spacing: .02em;
  animation: hsIn .4s cubic-bezier(.2, .9, .3, 1.2), hspulse 1.2s ease-in-out .4s infinite;
}
.hsbtn .bi { width: 38px; height: 38px; margin: 0; }
.hsbtn .ring { position: absolute; inset: 3px; pointer-events: none; }
.hsbtn .ring circle { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 160; transform: rotate(-90deg); transform-origin: 50% 50%; }
.hsbtn.armed { box-shadow: -4px 0 0 #b5610a, 0 0 22px rgba(255, 220, 120, .95); }
.hsbtn:active .bi { transform: scale(.92); }
.hsbtn:active { transform: translateX(4px); box-shadow: 0 0 0 #b5610a, 0 4px 12px rgba(0, 0, 0, .35); }
.dbbtn { background: linear-gradient(180deg, #ffe066, #f5bf1f); box-shadow: -4px 0 0 #a87400, 0 6px 18px rgba(0, 0, 0, .35); }
.dbbtn:active { box-shadow: 0 0 0 #a87400, 0 4px 12px rgba(0, 0, 0, .35); }
@keyframes hsIn { from { transform: translateX(110%); } }
@keyframes hspulse {
  from { box-shadow: -4px 0 0 #b5610a, 0 6px 18px rgba(0, 0, 0, .35), 0 0 14px rgba(255, 200, 90, .4); }
  to   { box-shadow: -4px 0 0 #b5610a, 0 6px 18px rgba(0, 0, 0, .35), 0 0 30px rgba(255, 200, 90, .85); }
}
.boosts { display: flex; gap: 8px; justify-content: center; margin: 10px 0 2px; flex-wrap: wrap; }
.boost {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 7px 14px; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, .06);
  border: 2px solid rgba(255, 255, 255, .14);
  color: #cfd6f5; font: inherit; line-height: 1.15;
  transition: transform .12s, border-color .12s, background .12s;
}
.boost { min-width: 92px; }
.boost b { font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.boost span { font-size: 11px; color: #ffd75e; }
.boost.on { background: rgba(255, 168, 60, .18); border-color: #ffa83c; color: #fff; transform: translateY(-1px); }
.boost.poor { opacity: .45; }
.cost-line { font-size: 11px; letter-spacing: .6px; color: #ffe8a8; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); margin-top: -6px; }
.btn.cont { background: linear-gradient(180deg, #37d39a, #1b9e73); box-shadow: 0 6px 0 #14775a, 0 10px 22px rgba(30, 200, 150, .35); }

#score.fever { color: #ffb347; text-shadow: 0 0 18px rgba(255,179,71,.8), 0 2px 0 rgba(0,0,0,.35); animation: fever .5s ease-in-out infinite alternate; }
@keyframes fever { from { transform: scale(1); } to { transform: scale(1.12); } }

.powers {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  padding: 0 14px;
}
.chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(8, 11, 24, .72);
  border: 1.5px solid var(--c);
  box-shadow: 0 0 14px -4px var(--c);
  font-size: 11px;
  letter-spacing: .6px;
}
.chip b { color: var(--c); font-weight: 800; }
.chip span { opacity: .65; font-variant-numeric: tabular-nums; }

.jump {
  pointer-events: auto;
  position: absolute;
  right: 20px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 78px);
  width: 82px; height: 82px;
  border-radius: 50%;
  border: 3px solid #ffd84a;
  background: rgba(20, 16, 4, .72);
  color: #ffd84a;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 1px;
  box-shadow: 0 0 26px -6px #ffd84a;
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.07); } }

/* ---------------------------------------------------------- panels */
.panel {
  pointer-events: auto;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px 26px;
  background: radial-gradient(120% 80% at 50% 0%, rgba(40, 46, 92, .72), rgba(5, 7, 16, .92));
  backdrop-filter: blur(3px);
}
.menu {
  background: linear-gradient(180deg, rgba(5, 7, 16, .10) 0%, rgba(5, 7, 16, .38) 45%, rgba(5, 7, 16, .78) 100%);
  backdrop-filter: none;
}
.topbar {
  position: absolute;
  left: 18px; right: 18px;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .coins {
  padding: 6px 12px;
  border-radius: 16px;
  background: rgba(4, 18, 12, .45);
}
.row.nav { width: 100%; max-width: 300px; }
.row.nav .btn { flex: 1; padding: 13px 6px; }
.brand { text-align: center; margin-bottom: 6px; }
.brand h1 {
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: .95;
  text-shadow: 0 5px 0 rgba(0, 0, 0, .35);
}
.brand h1 span { display: block; color: #ff7043; }
.tagline {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .55;
}
h2 { font-size: 30px; font-weight: 900; letter-spacing: 1px; }
h2.best { color: #ffe45e; }

.btn {
  pointer-events: auto;
  border: 0;
  border-radius: 14px;
  padding: 15px 34px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #12050a;
  background: linear-gradient(180deg, #ff9a5a, #f4622c);
  box-shadow: 0 5px 0 #a93d15, 0 12px 26px -10px #ff7043;
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #a93d15; }
.btn.big { width: 100%; max-width: 280px; font-size: 20px; padding: 18px; }
.btn.ghost {
  background: rgba(255, 255, 255, .09);
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22);
  padding: 13px 22px;
  font-size: 13px;
}
.btn.ghost:active { transform: translateY(2px); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22); }
.btn.disabled { opacity: .4; }

.row { display: flex; gap: 10px; }
.best {
  font-size: 12px;
  letter-spacing: 1.6px;
  opacity: .85;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
}
.hint { font-size: 11px; letter-spacing: 1px; opacity: .7; text-align: center; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }

.stats {
  display: flex;
  gap: 26px;
  margin: 8px 0 4px;
  text-align: center;
}
.stats label {
  display: block;
  font-size: 9px;
  letter-spacing: 1.6px;
  opacity: .5;
  margin-bottom: 5px;
}
.stats b { font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.gold { color: #ffd75e; }

.foot {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.coins { font-size: 14px; font-weight: 800; color: #ffd75e; letter-spacing: 1px; }
.icon {
  pointer-events: auto;
  border: 0;
  background: rgba(4, 18, 12, .45);
  color: rgba(255, 255, 255, .9);
  border-radius: 50%;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon.off { opacity: .4; }

/* ------------------------------------------------------------ shop */
.shop { justify-content: flex-start; gap: 16px; padding-top: calc(env(safe-area-inset-top, 0px) + 28px); }
.shop-head { display: flex; align-items: center; gap: 14px; }
.tabs { display: flex; gap: 8px; }
.tabs button {
  border: 0;
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .6);
  font-family: inherit;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1.2px;
  padding: 9px 16px;
  border-radius: 20px;
}
.tabs button.on { background: #ff7043; color: #190803; }

.grid {
  flex: 1;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  overflow-y: auto;
  align-content: start;
  padding: 2px;
}
.item {
  border: 0;
  background: rgba(255, 255, 255, .06);
  border-radius: 14px;
  padding: 12px 6px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  color: #fff;
  box-shadow: inset 0 0 0 1.5px transparent;
}
.item.equipped { box-shadow: inset 0 0 0 2px #ffd75e; background: rgba(255, 215, 94, .12); }
.sw { width: 38px; height: 38px; border-radius: 50%; display: block; }
.sw.hoopsw { display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .3); }
.sw.hoopsw u { display: block; width: 30px; height: 6px; border-radius: 4px; }
.nm { font-size: 11px; font-weight: 700; }
.pr { font-size: 9.5px; font-weight: 800; letter-spacing: .8px; color: #ffd75e; }
.pr.owned { color: #8ef0c4; }
.pr.poor { color: #ff7a7a; opacity: .8; }

/* ----------------------------------------------------------- lives */
.hud-left { justify-self: start; display: flex; align-items: center; gap: 6px; }
.hicon {
  pointer-events: auto;
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: rgba(4, 18, 12, .45); color: rgba(255, 255, 255, .9);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.hcoins i { font-style: normal; color: #2a1603; background: #ffd75e; border-radius: 9px; padding: 1px 6px; margin-right: 5px; font-size: 11px; }
.lives {
  display: flex;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(4, 18, 12, .45);
}
.lives i { display: block; width: 10px; height: 10px; border-radius: 50%; background: #ff5d7a; box-shadow: 0 0 6px rgba(255, 93, 122, .7); transition: transform .15s, background .15s; }
.lives i.lost { background: rgba(255, 255, 255, .25); box-shadow: none; }
.lives.flash i { animation: heartbeat .5s ease-out; }
@keyframes heartbeat { 30% { transform: scale(1.5); } }

.sw.bgsw { border-radius: 10px; width: 46px; height: 38px; }
.tabs button { padding: 9px 12px; }

/* ----------------------------------------------------------- mixer */
.mixer { display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
.mixer { gap: 14px; }
.mixer label { display: flex; align-items: center; gap: 12px; font-size: 18px; }
.mixer label em { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 1.4px; opacity: .55; width: 56px; }
.mixer input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 130px;
  height: 28px;
  background: transparent;
  cursor: pointer;
}
.mixer input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .18);
}
.mixer input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  margin-top: -8px;
  border-radius: 50%;
  background: #ff7043;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.mixer input[type="range"]::-moz-range-track {
  height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .18);
}
.mixer input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: #ff7043; border: 3px solid #fff;
}

/* -------------------------------------------------------- tutorial */
.tut {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 78px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 88%;
  padding: 10px 16px 10px 10px;
  border-radius: 30px;
  background: rgba(8, 11, 24, .82);
  border: 1.5px solid rgba(255, 255, 255, .25);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .8);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .3px;
  animation: tutIn .35s ease-out;
}
.tut b {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #ff7043;
  color: #190803;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
@keyframes tutIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ------------------------------------------------------- best score */
.meters {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 16px 0;
}
.meters:empty, .meters.hide { display: none; }
.meter {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 9px; border-radius: 16px;
  background: rgba(4, 18, 12, .55);
  transition: box-shadow .15s;
}
.meter.armed { box-shadow: 0 0 0 2px #ffb020; }
#dbMeter { margin-left: auto; }   /* stays right even when it is the only meter */
.meter .bi { width: 16px; height: 16px; margin: 0; }
.meter i { display: block; width: 13px; height: 19px; border-radius: 4px; background: rgba(255, 255, 255, .18); transition: background .12s; }
.meter i.l1 { background: #ffe066; }
.meter i.l2 { background: #ffb020; }
.meter i.l3 { background: #ff5a3c; }
.meter i.dim { opacity: .35; }
.meter b { font-size: 11px; font-weight: 800; color: #fff; margin: 0 2px; font-variant-numeric: tabular-nums; }
.best-line {
  align-self: center;
  text-align: center;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 14px;
  background: rgba(4, 18, 12, .45);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  opacity: .6;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .45);
  font-variant-numeric: tabular-nums;
  transition: color .25s, opacity .25s;
}
.best-line.beaten { color: #ffe45e; opacity: 1; animation: bestPop .5s ease-out; }
@keyframes bestPop { 30% { transform: scale(1.25); } }

.pause { background: rgba(5, 7, 16, .55); backdrop-filter: blur(2px); }
.btn.toggle b { color: #8ef0c4; margin-left: 6px; }
.btn.toggle.off b { color: #ff7a7a; }
.boost { position: relative; }
.boost .stock {
  position: absolute; top: -8px; right: -6px;
  min-width: 24px; padding: 3px 7px; border-radius: 12px;
  background: #ffd75e; color: #2a1603; font-size: 11px; font-weight: 800;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.build { font-size: 10px; color: rgba(160,170,205,.45); letter-spacing: .08em; margin-top: 4px; }
/* the settings sliders are wider now that they have a screen of their own */
.mixer input[type="range"] { width: 170px; }
