* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1f2120;
  color: #fbf3e4;
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.hidden {
  display: none !important;
}

/* ---------- HUD ---------- */

.hud {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 10px;
  right: 68px;
  display: flex;
  gap: 8px;
  pointer-events: none;
}

.chip {
  min-width: 92px;
  padding: 6px 12px 7px;
  border-radius: 16px;
  background: rgb(31 33 32 / 0.78);
  border: 2px solid rgb(255 255 255 / 0.1);
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.chip .label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d9cfbd;
}

.chip .value {
  display: flex;
  align-items: baseline;
  gap: 3px;
  white-space: nowrap;
}

.chip strong {
  font-size: clamp(18px, 3.6vmin, 26px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.chip small {
  font-size: 12px;
  font-weight: 700;
  color: #d9cfbd;
}

.chip-coin strong {
  color: #facc15;
}

.chip.nitro {
  border-color: #27d6c1;
  box-shadow: 0 0 16px rgb(34 211 238 / 0.55);
}

.chip.nitro strong {
  color: #27d6c1;
}

@media (max-width: 480px) {
  .chip {
    flex: 1 1 0;
    min-width: 0;
    padding: 5px 9px 6px;
  }
}

.icon-btn {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: 10px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 0.14);
  background: rgb(31 33 32 / 0.78);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.pause-icon {
  width: 16px;
  height: 18px;
  border-left: 5px solid currentColor;
  border-right: 5px solid currentColor;
}

.icon-btn:focus-visible,
.btn:focus-visible {
  outline: 3px solid #c6f432;
  outline-offset: 3px;
}

/* ---------- Overlays ---------- */

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  background: rgb(31 33 32 / 0.55);
}

.card {
  width: 100%;
  max-width: 440px;
  margin: auto;
  padding: clamp(18px, 4.5vmin, 34px) clamp(18px, 4vmin, 30px);
  border-radius: 28px;
  background: rgb(42 44 42 / 0.94);
  border: 2px solid rgb(255 255 255 / 0.08);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 2vmin, 14px);
  text-align: center;
}

.title {
  margin: 0;
  font-size: clamp(36px, 10vmin, 64px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #facc15, #fb923c 45%, #fb7185);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title.small {
  font-size: clamp(30px, 8vmin, 50px);
}

.card p {
  margin: 0;
}

.goal {
  font-size: clamp(15px, 3.4vmin, 18px);
  color: #f1e8d6;
  max-width: 34ch;
}

.hint {
  font-size: 14px;
  color: #d9cfbd;
}

.hint kbd {
  display: inline-block;
  min-width: 24px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgb(255 255 255 / 0.25);
  border-bottom-width: 3px;
  background: rgb(255 255 255 / 0.06);
  color: #fbf3e4;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.sub {
  font-size: 13px;
  color: #d9cfbd;
  min-height: 1em;
}

.score-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.score-big > span {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d9cfbd;
}

.score-big strong {
  font-size: clamp(40px, 11vmin, 64px);
  font-weight: 900;
  color: #facc15;
  font-variant-numeric: tabular-nums;
}

.breakdown {
  font-size: 15px;
  color: #e0d6c3;
}

.best {
  font-size: 16px;
  color: #f1e8d6;
}

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #a3e635;
  color: #1a2e05;
  font-size: 13px;
  font-weight: 900;
}

.near-miss {
  font-size: 14px;
  font-weight: 800;
  color: #fb923c;
  background: rgb(251 146 60 / 0.15);
  border: 1px solid rgb(251 146 60 / 0.35);
  padding: 4px 14px;
  border-radius: 999px;
  margin: 2px 0 6px;
}

.btn {
  min-width: 170px;
  min-height: 54px;
  padding: 12px 30px;
  border: 0;
  border-radius: 999px;
  background: #ee5e24;
  color: #15130f;
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 0 #b8400f;
  transition: transform 0.08s ease;
}

.btn:hover {
  background: #d93d12;
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #b8400f;
}

@media (max-height: 430px) {
  .card {
    gap: 6px;
    padding: 14px 22px;
  }
  .title {
    font-size: 36px;
  }
  .title.small {
    font-size: 30px;
  }
  .score-big strong {
    font-size: 38px;
  }
  .btn {
    min-height: 48px;
  }
}

/* ---------- Jelly Jump accents ---------- */

.title {
  background: linear-gradient(90deg, #fb7185, #f472b6 45%, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
}

.chip-coin strong,
.chip-best strong {
  color: #facc15;
}

.score-big strong {
  color: #fb7185;
}
