@font-face { font-family: Inter; src: url(assets/inter.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(assets/space-grotesk.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1f2120;
  color: #fbf3e4;
  font-family: Inter, 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;
}

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

.hud {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 8px;
  right: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  font-size: clamp(13px, 1vmin + 9px, 18px);
  font-weight: 800;
}

.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgb(42 44 42 / 0.86);
  border: 1px solid #46443e;
  white-space: nowrap;
}

.pill.round {
  color: #d9cfbd;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #1f2120;
}

.p1 .swatch {
  background: #27d6c1;
}

.p2 .swatch {
  background: #ff6b8e;
}

.pips {
  display: flex;
  gap: 4px;
}

.pips i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #b3a995;
}

.p1 .pips i.on {
  background: #27d6c1;
  border-color: #27d6c1;
}

.p2 .pips i.on {
  background: #ff6b8e;
  border-color: #ff6b8e;
}

@media (max-width: 420px) {
  .hud {
    gap: 4px;
    left: 6px;
    right: 58px;
  }
  .pill {
    padding: 5px 8px;
    gap: 4px;
  }
  .pill.round {
    display: none;
  }
}

/* ---------- Pause button ---------- */

.icon-btn {
  position: fixed;
  top: max(6px, env(safe-area-inset-top));
  right: 8px;
  width: 46px;
  height: 46px;
  border: 1px solid #46443e;
  border-radius: 14px;
  background: rgb(42 44 42 / 0.86);
  color: #fbf3e4;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

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

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

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

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

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.8vmin, 12px);
  width: min(460px, 100%);
  margin: auto 0;
  padding: clamp(16px, 4vmin, 30px) clamp(16px, 4vmin, 28px);
  border-radius: 28px;
  background: rgb(42 44 42 / 0.95);
  border: 1px solid #46443e;
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.45);
}

.badge {
  position: relative;
  width: clamp(88px, 20vmin, 120px);
  height: clamp(48px, 11vmin, 66px);
  border-radius: 18px;
  background: repeating-linear-gradient(90deg, #d98b48 0 14px, #cc7d3e 14px 28px);
  box-shadow: 0 6px 0 #8f4f22;
  overflow: hidden;
}

.badge span {
  position: absolute;
  bottom: 14%;
  width: 30%;
  height: 56%;
  border-radius: 50%;
}

.badge .b1 {
  left: 8%;
  background: #27d6c1;
}

.badge .b2 {
  right: 8%;
  background: #ff6b8e;
}

.badge .ball {
  left: 44%;
  top: 10%;
  bottom: auto;
  width: 18%;
  height: 33%;
  background: #ff9550;
  border: 2px solid #1f2120;
}

.badge .hoop {
  position: absolute;
  top: 18%;
  right: 3%;
  bottom: auto;
  width: 30%;
  height: 7%;
  border-radius: 4px;
  background: #ff6b3d;
}

.hud .clock {
  min-width: 64px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  color: #ffc857;
}

.overlay h1,
.overlay h2 {
  margin: 0;
  font-size: clamp(30px, 8vmin, 52px);
  font-weight: 900;
  line-height: 1.05;
  color: #fbf3e4;
}

.overlay p {
  margin: 0;
  color: #d9cfbd;
  font-size: clamp(14px, 3.4vmin, 17px);
  line-height: 1.35;
}

.overlay .hint {
  font-size: clamp(13px, 3vmin, 15px);
}

.overlay .result {
  font-size: clamp(22px, 5vmin, 30px);
  color: #fbf3e4;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.overlay strong {
  color: #fbf3e4;
}

.overlay .best-line strong,
.overlay .stats strong {
  color: #27d6c1;
}

.controls {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  color: #d9cfbd;
  font-size: clamp(13px, 3vmin, 15px);
}

.tag {
  display: inline-block;
  padding: 1px 8px;
  margin-right: 4px;
  border-radius: 999px;
  color: #1f2120;
  font-weight: 800;
}

.tag.p1 {
  background: #27d6c1;
}

.tag.p2 {
  background: #ff6b8e;
}

.mode-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
  width: 100%;
}

.mode-buttons .btn {
  min-width: 0;
  flex: 1 1 180px;
  font-size: 18px;
}

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

.btn:hover {
  background: #8552f7;
}

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

.btn.btn-alt {
  background: #363836;
  box-shadow: 0 6px 0 #46443e;
  border: 1px solid #3a4250;
}

.btn.btn-alt:hover {
  background: #2a3140;
}

.btn.btn-alt:active {
  box-shadow: 0 3px 0 #46443e;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

@media (max-height: 460px) {
  .badge,
  .controls {
    display: none;
  }
  .card {
    gap: 6px;
    padding: 14px 18px;
  }
  .btn {
    min-height: 46px;
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}

/* Jelly Gym: cream native panels against a quiet teal playable court. */
body { background: #172e31; }
.overlay { background: rgb(9 30 33 / .7); padding: 12px; }
.card { width: min(490px,100%); background: #fff9ed; color: #173b3c; border: 1px solid #ead9bc; box-shadow: 0 18px 45px rgb(0 0 0 / .28); gap: 9px; padding: 20px; border-radius: 24px; }
.menu-art { display: block; width: 100%; height: clamp(75px,22vh,150px); border-radius: 15px; object-fit: cover; object-position: center 18%; }
.overlay h1,.overlay h2 { font-family: "Space Grotesk",sans-serif; font-weight: 700; color: #173b3c; font-size: clamp(29px,7vmin,42px); }
.overlay p,.controls { color: #4e625c; }
.overlay .eyebrow { color: #1b6b61; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.overlay strong,.overlay .result { color: #173b3c; }
.overlay .best-line strong,.overlay .stats strong { color: #1b6b61; }
.overlay .best-line { font-size: 12px; }
.mode-buttons { gap: 10px; }
.mode-buttons .btn { flex: 1 1 120px; font-size: 15px; padding: 12px 10px; }
.btn { font-family: Inter,sans-serif; font-weight: 700; min-height: 48px; background: #f47235; color: #152e2e; box-shadow: 0 4px 0 #bf4b20; }
.btn:hover { background: #ff9550; }
.btn.btn-alt { background: #d9eee5; color: #173b3c; box-shadow: 0 4px 0 #a8c8bc; }
.btn.btn-alt:hover { background: #a8c8bc; }
.btn:focus-visible,.icon-btn:focus-visible,summary:focus-visible { outline: 3px solid #3255d8; outline-offset: 3px; }
details { width: 100%; font-size: 12px; }
summary { cursor: pointer; padding: 6px; color: #1b6b61; font-weight: 700; }
.controls { display: grid; font-size: 12px; margin-top: 5px; }
.overlay .hint { font-size: 12px; line-height: 1.4; }
.pill,.icon-btn { background: rgb(15 43 46 / .95); border-color: #4a6967; }
.hud { font-weight: 700; }
@media (max-height: 360px) { .menu-art { height: 70px; } .card { width: min(650px,100%); padding: 12px 18px; gap: 5px; } .overlay .goal { font-size: 12px; } .overlay h1 { font-size: 28px; } .mode-buttons { margin: 0; } .btn { min-height: 44px; } }
