/* ==========================================================================
   Ballin' — styles
   The game world is drawn on the <canvas>. This file styles the page around
   it and the HTML overlays (HUD, menus, buttons).
   ========================================================================== */

:root {
  --bg: #070b18;
  --accent: #ff6b1a;
  --accent-light: #ffb347;
  --blue: #7aa2ff;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.6);
  --font: -apple-system, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  /* Condensed italic for the logo, mode names and big numbers */
  --display: "Barlow Condensed", var(--font);

  /* Space for the iPhone notch / home bar */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

/* Lock the page: no scrolling, bouncing, text selection or tap flashes */
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 50% 30%, #141c38, var(--bg) 70%);
  color: var(--text);
  font-family: var(--font);
}

/* Portrait game area. Fills the phone; on a wide screen it's a centered column. */
#game {
  position: relative;
  width: min(100vw, 62vh);
  height: 100vh;
  width: min(100vw, 62dvh);
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.6);
}

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

.hidden {
  display: none !important;
}

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

#hud {
  position: absolute;
  top: calc(var(--safe-top) + 14px);
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.hud-score {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.hud-label,
#best-small {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--muted);
}

#score {
  font-size: 44px;
  font-weight: 900;
  margin: 2px 0 4px;
  font-variant-numeric: tabular-nums;
}

.hud-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#timer {
  min-width: 68px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 26px;
  font-weight: 900;
  text-align: center;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#timer.low {
  color: #ff5a5a;
  border-color: rgba(255, 90, 90, 0.5);
  animation: pulse 1s ease-in-out infinite;
}

#streak {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(122, 162, 255, 0.18);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

#streak.fire {
  background: linear-gradient(90deg, #ff3d1a, #ffb347);
  color: #fff;
  box-shadow: 0 0 18px rgba(255, 110, 30, 0.7);
  animation: pulse 0.6s ease-in-out infinite;
}

/* --- Mute button ---------------------------------------------------------- */

#mute-btn {
  position: absolute;
  top: calc(var(--safe-top) + 14px);
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 20;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#mute-btn .slash,
#mute-btn.muted .waves {
  display: none;
}

#mute-btn.muted .slash {
  display: inline;
}

#mute-btn.muted {
  color: var(--muted);
}

/* Music mute button, sits just to the left of the sound mute button */
#music-btn {
  position: absolute;
  top: calc(var(--safe-top) + 14px);
  right: 66px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 20;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#music-btn .slash {
  display: none;
}

#music-btn.muted .slash {
  display: inline;
}

#music-btn.muted {
  color: var(--muted);
}

/* LEAVE / END button, just under the mute button */
#leave-btn {
  position: absolute;
  top: calc(var(--safe-top) + 66px);
  right: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  cursor: pointer;
  z-index: 20;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Change-difficulty button, just under LEAVE */
#difficulty-btn {
  position: absolute;
  top: calc(var(--safe-top) + 108px);
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 20;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Hot Hand's trophy button, just under the change-difficulty button */
#missions-btn {
  position: absolute;
  top: calc(var(--safe-top) + 150px);
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  font-size: 16px;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 20;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Small notification dot for a corner button, e.g. #missions-btn */
.corner-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  padding: 1px 4px;
  border-radius: 999px;
  background: #ff3b5c;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.4;
  box-shadow: 0 0 8px rgba(255, 59, 92, 0.7);
  animation: pulse 1.2s ease-in-out infinite;
}

.missions-close-btn {
  margin-top: 16px;
}

/* --- Hint ----------------------------------------------------------- */

#hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-bottom) + 3%);
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}

.hint-arrow {
  display: block;
  font-size: 26px;
  color: var(--accent-light);
  animation: nudge 1.1s ease-in-out infinite;
}

/* --- Power-up trays (in game) --------------------------------------------- */

.tray {
  position: absolute;
  top: 46%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
}

.tray-left {
  left: 10px;
}

.tray-right {
  right: 10px;
}

.tray-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.1s ease, opacity 0.2s ease;
}

.tray-btn:active {
  transform: scale(0.92);
}

.tray-btn.empty {
  opacity: 0.35;
}

.tray-btn.selected {
  border-color: var(--accent-light);
  box-shadow: 0 0 16px rgba(255, 179, 71, 0.8);
  background: rgba(255, 179, 71, 0.25);
}

.tray-btn.active {
  border-color: #7ee8ff;
  box-shadow: 0 0 16px rgba(126, 232, 255, 0.6);
  animation: pulse 1.4s ease-in-out infinite;
}

.tray-count,
.tray-shots,
.tray-soon {
  position: absolute;
  right: -5px;
  bottom: -5px;
  min-width: 20px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.3;
}

.tray-shots {
  background: #7ee8ff;
}

.tray-soon {
  font-size: 8px;
  padding: 3px 4px;
  background: #3aa0ff;
  color: #fff;
}

/* --- Item icons (drawn with CSS) ------------------------------------------ */

.icon {
  display: inline-block;
  flex: none;
}

.icon-ball {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: inset -3px -4px 6px rgba(0, 0, 0, 0.35);
}

.icon-ball.gold {
  background: radial-gradient(circle at 35% 30%, #fff4b0, #ffc928 55%, #9a6a00);
}

.icon-ball.silver {
  background: radial-gradient(circle at 35% 30%, #ffffff, #c9d2de 55%, #5d6878);
}

.icon-ball.bronze {
  background: radial-gradient(circle at 35% 30%, #ffd2a8, #c97a3d 55%, #6b3814);
}

/* A little drink can: dark body with a colored stripe and a silver top */
.icon-can {
  position: relative;
  width: 18px;
  height: 30px;
  border-radius: 4px;
  background: linear-gradient(90deg, #111, #2c2c2c 45%, #111);
  border-top: 3px solid #b8c0cc;
  overflow: hidden;
}

.icon-can::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 7px;
  height: 13px;
  border-radius: 2px;
  background: var(--can);
  box-shadow: 0 0 8px var(--can);
}

.icon-can.white { --can: #f2f4f8; }
.icon-can.green { --can: #5ee05a; }
.icon-can.orange { --can: #ff9a1f; }
.icon-can.blue { --can: #3aa0ff; }

/* --- Menus ---------------------------------------------------------------- */

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  padding: calc(var(--safe-top) + 28px) 18px calc(var(--safe-bottom) + 28px);
  /* Deep navy with warm and cool glows in the corners */
  background:
    radial-gradient(120% 55% at 0% 0%, rgba(255, 107, 26, 0.28), transparent 60%),
    radial-gradient(110% 55% at 100% 100%, rgba(120, 80, 255, 0.3), transparent 60%),
    linear-gradient(180deg, rgba(10, 12, 28, 0.93), rgba(5, 7, 18, 0.97));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
  animation: fade-in 0.3s ease both;
}

/* Menus can scroll on short screens (the rest of the page never does) */
.scroll {
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.panel {
  width: 100%;
  max-width: 380px;
  margin: auto 0;
  text-align: center;
}

.title {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: clamp(76px, 26vw, 104px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 0.9;
  background: linear-gradient(180deg, #fff3d6 0%, #ffb347 35%, var(--accent) 65%, #e0350b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 rgba(120, 30, 0, 0.55)) drop-shadow(0 10px 30px rgba(255, 107, 26, 0.55));
}

/* --- Home screen hero ------------------------------------------------------ */

.hero {
  position: relative;
  margin-bottom: 18px;
}

/* A basketball drawn in CSS, bouncing above the logo */
.hero-ball {
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 47%, #2a1204 48%, #2a1204 52%, transparent 53%) no-repeat,
    linear-gradient(90deg, transparent 47%, #2a1204 47%, #2a1204 53%, transparent 53%),
    linear-gradient(0deg, transparent 47%, #2a1204 47%, #2a1204 53%, transparent 53%),
    radial-gradient(circle at 32% 28%, #ffc07a, #f2711c 55%, #9e3a08);
  background-size: 150% 150%, 100% 100%, 100% 100%, 100% 100%;
  background-position: -110% 50%, 0 0, 0 0, 0 0;
  box-shadow: 0 10px 24px rgba(255, 107, 26, 0.45), inset -6px -8px 14px rgba(0, 0, 0, 0.35);
  animation: hero-bounce 1.4s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes hero-bounce {
  0%, 100% { transform: translateY(0) scale(1.04, 0.96); }
  50% { transform: translateY(-14px) scale(1, 1); }
}

.home .tagline {
  margin: 8px 0 14px;
  color: rgba(255, 255, 255, 0.75);
}

.home .how {
  margin-top: 18px;
}

.tagline {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.lifetime-total {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 179, 71, 0.35);
  background: linear-gradient(180deg, rgba(255, 179, 71, 0.18), rgba(255, 107, 26, 0.1));
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(255, 107, 26, 0.18);
}

.lifetime-total b {
  font-family: var(--display);
  font-style: italic;
  font-size: 19px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* Tiny CSS basketball (replaces the 🏀 emoji) */
.mini-ball {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 45%, #2a1204 45%, #2a1204 55%, transparent 55%),
    linear-gradient(0deg, transparent 45%, #2a1204 45%, #2a1204 55%, transparent 55%),
    radial-gradient(circle at 32% 28%, #ffc07a, #f2711c 55%, #9e3a08);
}

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* A mode card: vivid gradient, glossy top edge, big faded icon as artwork */
.mode-card {
  --glow: rgba(61, 108, 255, 0.45);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  background: linear-gradient(155deg, #5b8cff 0%, #3155e6 55%, #1c2fa3 100%);
  color: #fff;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 30px -8px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

/* Glossy shine across the top of the card */
.mode-card::before {
  content: '';
  position: absolute;
  inset: 0 0 55% 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.mode-card:active {
  transform: scale(0.96);
}

.mode-card.hot {
  --glow: rgba(255, 107, 26, 0.55);
  background: linear-gradient(155deg, #ffc15e 0%, #ff6b1a 50%, #d4300a 100%);
}

.mode-card.freethrow {
  --glow: rgba(30, 210, 150, 0.45);
  background: linear-gradient(155deg, #4ff0b8 0%, #14b886 50%, #0a7a5a 100%);
}

.mode-card.friends {
  --glow: rgba(150, 90, 255, 0.5);
  background: linear-gradient(135deg, #c77dff 0%, #8a3ffc 50%, #4f1fb8 100%);
}

/* Blitz: full-width hero card */
.mode-card.blitz {
  grid-column: 1 / 3;
  min-height: 132px;
  padding: 16px 16px 14px;
}

/* Friends: wide strip with the badge inline on the right */
.mode-card.friends {
  grid-column: 1 / 3;
  min-height: 0;
  padding: 14px 16px;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.mode-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Big faded number/mark in the corner, like a jersey number */
.mode-mark {
  position: absolute;
  right: -6px;
  bottom: -30px;
  font-family: var(--display);
  font-size: 120px;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  color: rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.blitz .mode-mark {
  right: -4px;
  bottom: -40px;
  font-size: 170px;
  color: rgba(255, 255, 255, 0.13);
}

.mode-eyebrow {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.75);
}

.mode-name {
  font-family: var(--display);
  font-size: clamp(22px, 7.2vw, 28px);
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.friends .mode-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.blitz .mode-name {
  font-size: 38px;
}

.mode-desc {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0.92;
  flex: 1;
}

.mode-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mode-stats > span {
  white-space: nowrap;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* "2 YOUR TURN" badge on the Blitz with Friends card */
.mode-badge {
  flex: none;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 999px;
  background: #ff3b5c;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 14px rgba(255, 59, 92, 0.5);
  animation: pulse 1.2s ease-in-out infinite;
}

.section-title {
  margin: 26px 0 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
}

/* Mission cards */
.missions {
  display: grid;
  gap: 8px;
  text-align: left;
}

.mission {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.mission-top {
  transition: opacity 0.3s ease;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
}

.mission-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 8px;
  margin: 8px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3d6cff, #7ee8ff);
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mission.gained .bar-fill {
  background: linear-gradient(90deg, #ffb347, #ff6b1a);
}

/* A finished mission turns into a green "package" with a big collect button */
.mission {
  position: relative;
  overflow: hidden;
}

.collect-btn {
  display: none;
}

.mission.done {
  background: repeating-linear-gradient(90deg, transparent 0 46%, rgba(255, 255, 255, 0.18) 46% 54%, transparent 54% 100%),
    linear-gradient(160deg, #2fd37a, #16a35a);
  border-color: rgba(126, 232, 168, 0.8);
  box-shadow: 0 8px 24px rgba(47, 211, 122, 0.35);
}

.mission.done .mission-top,
.mission.done .bar {
  opacity: 0.25;
}

.mission.done .collect-btn {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #0c7a3e;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  animation: collect-pulse 1.2s ease-in-out infinite;
}

@keyframes collect-pulse {
  50% { transform: translate(-50%, -50%) scale(1.07); }
}

/* Locker (your power-ups, shown on the start screen) */
.locker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.locker-tile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

.locker-tile .icon {
  grid-row: span 2;
}

.locker-name {
  font-size: 12px;
  font-weight: 800;
}

.locker-desc {
  grid-column: 2 / 4;
  font-size: 10px;
  line-height: 1.3;
  color: var(--muted);
}

.locker-count {
  grid-column: 3;
  grid-row: 1;
  font-size: 12px;
  font-weight: 900;
  color: var(--accent-light);
}

.locker-tile.empty {
  opacity: 0.45;
}

.how {
  margin: 22px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

/* Game over */
.eyebrow {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: var(--accent-light);
}

.final-score {
  font-size: 100px;
  font-weight: 900;
  line-height: 1;
  margin: 6px 0 8px;
  font-variant-numeric: tabular-nums;
}

.new-best {
  display: block;
  width: fit-content;
  margin: 0 auto 12px;
  padding: 6px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff3d1a, #ffb347);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.14em;
  animation: pulse 0.9s ease-in-out infinite;
}

.best-pill {
  display: inline-block;
  margin-bottom: 18px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.best-pill strong {
  color: var(--text);
  margin-left: 6px;
  font-size: 16px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stats div {
  padding: 10px 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats span {
  font-size: 18px;
  font-weight: 900;
}

.stats small {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  margin-top: 24px;
}

.big-btn,
.ghost-btn {
  display: block;
  width: 100%;
  padding: 18px 10px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.big-btn {
  background: linear-gradient(180deg, var(--accent-light), var(--accent));
  box-shadow: 0 10px 30px rgba(255, 107, 26, 0.45), inset 0 -4px 0 rgba(0, 0, 0, 0.15);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.big-btn:active,
.ghost-btn:active {
  transform: scale(0.97);
}

/* --- Difficulty picker, hubs, friends -------------------------------------- */

.difficulty-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.difficulty-picker button {
  padding: 10px 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.difficulty-picker button.selected {
  background: #fff;
  color: #111a33;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* Blitz's 30s/60s toggle on the mode screen, same look as the difficulty picker */
.duration-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin: 0 0 10px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.duration-picker button {
  position: relative;
  padding: 10px 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.duration-picker button.selected {
  background: #fff;
  color: #111a33;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* Small pill flagging the new 30 sec option */
.new-badge {
  position: absolute;
  top: -9px;
  right: -2px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #ff3b5c;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  box-shadow: 0 3px 8px rgba(255, 59, 92, 0.5);
}

/* Customize button in the home screen's top-left corner (same spot as the back arrows) */
.customize-btn {
  position: absolute;
  top: calc(var(--safe-top) + 14px);
  left: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.customize-btn:active {
  transform: scale(0.96);
}

/* Coin balance shown inside the Customize button */
.customize-coins {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-left: 8px;
  margin-left: 2px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffd23f;
  font-variant-numeric: tabular-nums;
}

/* Small dot in a court's lane paint color (set from ui.js) */
.court-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, #fff);
}

.back-btn {
  position: absolute;
  top: calc(var(--safe-top) + 14px);
  left: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  padding-bottom: 4px;
  cursor: pointer;
}

.mode-title {
  margin: 34px 0 0;
  font-size: 44px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.02em;
  line-height: 1;
}

.hot-text {
  background: linear-gradient(180deg, #ffd08a, var(--accent) 60%, #d9420b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.friends-text {
  font-size: 34px;
  background: linear-gradient(180deg, #e2c4ff, #b36bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hub-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.hub-stats div {
  padding: 12px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hub-stats span {
  font-size: 26px;
  font-weight: 900;
}

.hub-stats small {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.lifetime-small {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.name-fields {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  text-align: left;
}

.name-fields label {
  display: grid;
  gap: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Text boxes must be selectable/typeable even though the page locks selection */
.name-fields input,
.add-friend input {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: var(--font);
  font-size: 17px; /* 16px+ stops iPhone from zooming in on focus */
  font-weight: 700;
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}

.name-fields input:focus {
  outline: 2px solid #b36bff;
}

#online-panel .name-fields input:focus,
.add-friend input:focus {
  outline: 2px solid #26c6f2;
}

.handoff-pass {
  margin: 30px 0 4px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.handoff-name {
  margin-bottom: 26px;
  font-size: 48px;
  font-weight: 900;
  line-height: 1.05;
  word-break: break-word;
  color: #e2c4ff;
  animation: pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.scoreboard {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

.score-row .who {
  flex: 1;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-row b {
  font-size: 22px;
  font-weight: 900;
}

.rounds {
  display: flex;
  gap: 6px;
}

.rounds i {
  min-width: 30px;
  padding: 3px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  color: var(--muted);
}

.winner {
  margin: 8px 0 22px;
  font-size: 42px;
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(180deg, #fff4b0, #ffc928);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: pop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

/* --- Online screen ------------------------------------------------------------ */

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: #7fdcff;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.form-error {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 90, 90, 0.15);
  color: #ff9a9a;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.add-friend {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
}

.add-friend input {
  min-width: 0;
}

.add-friend .big-btn {
  width: auto;
  padding: 0 18px;
  font-size: 15px;
  background: linear-gradient(180deg, #7fdcff, #1c9fd6);
  box-shadow: 0 8px 22px rgba(38, 198, 242, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}

.online-list {
  display: grid;
  gap: 8px;
}

.online-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

/* Colored stripe on the left of each challenge */
.online-row.yourTurn { box-shadow: inset 4px 0 0 #ffb347; background: rgba(255, 179, 71, 0.12); }
.online-row.won { box-shadow: inset 4px 0 0 #4be08a; }
.online-row.lost { box-shadow: inset 4px 0 0 #ff5a5a; }
.online-row.tie,
.online-row.waiting,
.online-row.declined { box-shadow: inset 4px 0 0 rgba(255, 255, 255, 0.25); }

.online-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.online-who b {
  font-size: 16px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-who small {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.row-btn {
  flex: none;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: rgba(38, 198, 242, 0.2);
  color: #9fe6ff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.row-btn.go {
  background: linear-gradient(180deg, var(--accent-light), var(--accent));
  color: #fff;
}

.row-x {
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.list-empty {
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

/* --- Tabs (Customize screen) ------------------------------------------------ */

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 18px 0 12px;
  padding: 5px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tabs button {
  position: relative;
  padding: 12px 6px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.tabs.three {
  grid-template-columns: repeat(3, 1fr);
}

.tabs.four {
  grid-template-columns: repeat(4, 1fr);
}

.tabs.four button {
  padding: 12px 2px;
  font-size: 12px;
}

.tabs button.selected {
  background: linear-gradient(135deg, #c77dff, #8a3ffc);
  color: #fff;
  box-shadow: 0 6px 18px rgba(140, 80, 255, 0.45);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0 10px;
}

.section-head .section-title {
  margin: 0;
}

.pill-btn {
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #7fdcff, #1c9fd6);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(38, 198, 242, 0.35);
}

/* Friend rows: the left part opens their page */
.online-row.friend {
  padding: 6px 10px 6px 6px;
}

.friend-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
}

.friend-open:active {
  background: rgba(255, 255, 255, 0.08);
}

.chevron {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

/* Round letter avatar */
.avatar {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin: 30px auto 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c77dff, #26c6f2);
  color: #fff;
  font-size: 38px;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(140, 80, 255, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

.avatar.small {
  flex: none;
  width: 38px;
  height: 38px;
  margin: 0;
  font-size: 17px;
  box-shadow: none;
}

/* --- Friend page ------------------------------------------------------------ */

.friend-name {
  margin: 0;
  font-size: 34px;
  font-weight: 900;
  font-style: italic;
  word-break: break-word;
}

#friend-screen .tagline {
  margin: 4px 0 18px;
}

.stats.record .win span {
  color: #4be08a;
}

.stats.record .loss span {
  color: #ff6b6b;
}

.stats.three {
  grid-template-columns: repeat(3, 1fr);
}

/* You vs them numbers */
.h2h {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.h2h-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  align-items: center;
  padding: 6px 0;
}

.h2h-row span {
  font-size: 22px;
  font-weight: 900;
}

.h2h-row small,
.h2h-labels b {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.h2h-labels {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.h2h-labels b {
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-row.history {
  gap: 12px;
}

.result-tag {
  flex: none;
  min-width: 64px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: center;
}

.history.won .result-tag { background: rgba(75, 224, 138, 0.2); color: #6ff0a4; }
.history.lost .result-tag { background: rgba(255, 90, 90, 0.2); color: #ff8a8a; }
.history.yourTurn .result-tag { background: rgba(255, 179, 71, 0.2); color: #ffc46b; }

/* Online challenge result under the final score */
.gameover-note {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 800;
  color: #9fe6ff;
}

/* --- Coins and the Shop ------------------------------------------------------ */

/* Lifetime baskets pill on the home screen */
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* Leaderboard button next to the lifetime baskets pill */
.leaderboard-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid rgba(199, 125, 255, 0.35);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(199, 125, 255, 0.18), rgba(138, 63, 252, 0.1));
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(138, 63, 252, 0.18);
  cursor: pointer;
}

.leaderboard-btn:active {
  transform: scale(0.97);
}

/* Leaderboard screen rows: rank, avatar, name, that tab's number */
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.leaderboard-row.you {
  box-shadow: inset 4px 0 0 #26c6f2;
  background: rgba(38, 198, 242, 0.12);
}

.leaderboard-rank {
  flex: none;
  width: 22px;
  text-align: center;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 15px;
  color: var(--muted);
}

.leaderboard-row:nth-child(1) .leaderboard-rank { color: #ffd23f; }
.leaderboard-row:nth-child(2) .leaderboard-rank { color: #cfd8e3; }
.leaderboard-row:nth-child(3) .leaderboard-rank { color: #d98c4a; }

.leaderboard-value {
  flex: none;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 18px;
}

/* Tiny CSS coin (like .mini-ball) */
.mini-coin {
  flex: none;
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6b8, #ffc928 55%, #a86b00);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  vertical-align: -2px;
}

.coins-small {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ffd23f;
}

.coins-small .mini-coin {
  width: 11px;
  height: 11px;
}

.shop-text {
  background: linear-gradient(180deg, #fff6b8, #ffc928 60%, #c98a00);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.coin-balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(255, 210, 63, 0.14);
  border: 1px solid rgba(255, 210, 63, 0.4);
  font-size: 14px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.8);
}

.coin-balance b {
  font-family: var(--display);
  font-style: italic;
  font-size: 26px;
  color: #fff;
}

.coin-balance .mini-coin {
  width: 20px;
  height: 20px;
}

#shop-note {
  margin-top: 12px;
}

.shop-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.shop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.shop-card:active {
  transform: scale(0.97);
}

.shop-card.in-use {
  border-color: #5ee05a;
  background: rgba(94, 224, 90, 0.12);
}

.shop-card.locked .shop-ball {
  opacity: 0.55;
}

.shop-card.locked .shop-price {
  color: var(--muted);
}

/* A preview ball: same seam trick as .hero-ball, colors come from wallet.js */
.shop-ball {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 46%, var(--seam) 46%, var(--seam) 54%, transparent 54%),
    linear-gradient(0deg, transparent 46%, var(--seam) 46%, var(--seam) 54%, transparent 54%),
    radial-gradient(circle at 32% 28%, var(--light), var(--mid) 55%, var(--edge));
  box-shadow: inset -6px -8px 14px rgba(0, 0, 0, 0.35);
}

.shop-ball.glow {
  box-shadow: 0 0 18px var(--mid), inset -6px -8px 14px rgba(0, 0, 0, 0.35);
}

.shop-ball.rainbow {
  animation: rainbow 4s linear infinite;
}

/* A textured novelty ball: drawn on canvas (see drawShopBalls() in main.js),
   sized bigger than the ball itself (62px) so its glow has room to show. */
.shop-ball-canvas {
  width: 80px;
  height: 80px;
  margin: -9px;
}

.shop-card.locked .shop-ball-canvas {
  opacity: 0.55;
}

@keyframes rainbow {
  to { filter: hue-rotate(360deg); }
}

.shop-name {
  font-size: 15px;
  font-weight: 900;
}

.shop-price {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #ffd23f;
}

.shop-card.owned .shop-price {
  color: var(--muted);
}

.shop-card.in-use .shop-price {
  color: #5ee05a;
}

/* Power-ups tab: same shop-card shell, bigger icons and a "how many you own" line */
.powerup-card .icon-ball {
  width: 54px;
  height: 54px;
}

.powerup-card .icon-can {
  width: 32px;
  height: 54px;
  border-top-width: 5px;
}

.powerup-card .icon-can::after {
  top: 12px;
  height: 24px;
}

.powerup-desc {
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  text-align: center;
}

.powerup-owned {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

/* --- Reward popup ----------------------------------------------------------- */

.popup {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 6, 14, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in 0.25s ease both;
  cursor: pointer;
}

.popup-card {
  width: 100%;
  max-width: 340px;
  padding: 26px 20px;
  border-radius: 26px;
  background: radial-gradient(circle at 50% 0%, rgba(255, 210, 63, 0.25), transparent 60%), #111a33;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

/* Challenge popup: one button per difficulty */
.challenge-picks {
  display: grid;
  gap: 10px;
  margin: 18px 0 14px;
}

.challenge-picks .ghost-btn.selected {
  border-color: var(--accent-light);
}

/* Pause popup: your run so far, then RESUME or FORFEIT */
.pause-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 4px;
}

.pause-stat {
  padding: 14px 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}

.pause-stat span {
  display: block;
  font-size: 30px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.pause-stat small {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.pause-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.forfeit-btn {
  display: block;
  width: 100%;
  padding: 18px 10px;
  border: 1px solid rgba(255, 90, 90, 0.4);
  border-radius: 18px;
  background: rgba(255, 90, 90, 0.18);
  color: #ff8a8a;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.forfeit-btn:active {
  transform: scale(0.97);
}

#my-stats {
  margin-bottom: 18px;
}

.reward-items {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.reward-item {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  animation: pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.reward-item .icon-ball {
  width: 54px;
  height: 54px;
}

.reward-item .icon-can {
  width: 32px;
  height: 54px;
  border-top-width: 5px;
}

.reward-item .icon-can::after {
  top: 12px;
  height: 24px;
}

.reward-item span {
  font-size: 18px;
  font-weight: 900;
}

.reward-item small {
  font-size: 12px;
  color: var(--muted);
}

.tap-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* --- Animations ----------------------------------------------------------- */

@keyframes pulse {
  50% { transform: scale(1.07); }
}

@keyframes nudge {
  50% { transform: translateY(-8px); }
}

@keyframes pop {
  0% { transform: scale(0.3); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; }
}

/* --------------------------------------------------------------------------
   Courts screen (pictures drawn by main.js drawCourtPictures)
   -------------------------------------------------------------------------- */

.court-preview {
  position: relative;
}

.court-preview canvas {
  display: block;
  width: 100%;
  height: 230px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.6);
}

.court-preview-label {
  position: absolute;
  left: 14px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  pointer-events: none;
}

.court-equipped {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.court-preview-name {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

#customize-screen .section-title {
  margin-top: 22px;
  text-align: left;
}

.court-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.court-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 5px 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.court-tile:active {
  transform: scale(0.96);
}

.court-tile.selected {
  /* 1px thicker border: pull the padding in so the tile doesn't grow */
  padding: 4px 4px 7px;
  border: 2px solid #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 18px var(--dot);
}

.court-tile canvas {
  display: block;
  width: 100%;
  height: 132px;
  border-radius: 12px;
}

.court-tile-name {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 3px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  text-transform: uppercase;
  min-width: 0;
}

.court-tile-name-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
}

.court-tile-price {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 3px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.court-tile.selected .court-tile-price {
  color: #4be08a;
}

.court-tile-price .mini-coin {
  width: 11px;
  height: 11px;
}

/* Can't afford it yet */
.court-tile.locked .court-tile-price {
  color: rgba(255, 255, 255, 0.35);
}

.court-tile.locked canvas {
  filter: saturate(0.4) brightness(0.7);
}

#look-list {
  margin-top: 14px;
}

.court-tile-name .court-dot {
  width: 6px;
  height: 6px;
}

/* --------------------------------------------------------------------------
   Pass and play: a teal button (not the orange PLAY buttons) under the friends list
   -------------------------------------------------------------------------- */

.big-btn.passplay-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  background: linear-gradient(180deg, #3fe0c5, #0f9e8a);
  box-shadow: 0 10px 30px rgba(20, 190, 160, 0.4), inset 0 -4px 0 rgba(0, 0, 0, 0.15);
}

.passplay-btn small {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.passplay-text {
  font-size: 38px;
  background: linear-gradient(180deg, #b6fff1, #3fe0c5 60%, #0f9e8a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#passplay-screen .difficulty-picker {
  margin-top: 18px;
}
