/* ── pitch.css ───────────────────────────────────────────────────────────── */

body[data-tab="pitch"] {
  background: #0A0A0A;
}

/* Sine wave texture across the full background */
body[data-tab="pitch"]::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 56'%3E%3Cpath d='M0 28 C25 12 75 12 100 28 S175 44 200 28' stroke='%2339FF14' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-size: 200px 56px;
  background-repeat: repeat;
  opacity: 0.09;
}

/* ── Splash screen ───────────────────────────────────────────────────────── */
#pitch-splash {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 28px calc(40px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  max-width: 480px;
  margin: 0 auto;
  gap: 20px;
}

#pitch-splash.hidden { display: none; }

#pitch-splash-logo {
  height: 48px;
  width: auto;
  margin-bottom: 8px;
}

#pitch-splash-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(57, 255, 20, 0.65);
  text-align: center;
  margin: 0;
}

#pitch-splash-warning {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: #39FF14;
  text-align: center;
  margin: 0;
  text-shadow: 0 0 14px rgba(57, 255, 20, 0.4);
}

#pitch-play-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 15px 48px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: #39FF14;
  color: #0A0A0A;
  letter-spacing: 0.04em;
  margin-top: 4px;
  transition: background 0.12s, transform 0.08s;
}

#pitch-play-btn:hover { background: #5fff35; }
#pitch-play-btn:active { transform: scale(0.97); }

/* ── Game wrap ───────────────────────────────────────────────────────────── */
#pitch-wrap.hidden { display: none; }

#pitch-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 32px;
  box-sizing: border-box;
}

/* ── Game screen ─────────────────────────────────────────────────────────── */
#pitch-game {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 380px;
}

/* ── Round label ─────────────────────────────────────────────────────────── */
#pitch-round-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(57, 255, 20, 0.5);
}

/* ── Dial ────────────────────────────────────────────────────────────────── */
#pitch-dial-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#pitch-dial {
  display: block;
  width: min(300px, calc(100vw - 60px));
  height: min(300px, calc(100vw - 60px));
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#pitch-dial:active {
  cursor: grabbing;
}

#pitch-dial.dial--disabled {
  opacity: 0.45;
  transition: opacity 0.2s;
}

/* ── Hz readout ──────────────────────────────────────────────────────────── */
#pitch-hz-display {
  font-family: 'DM Sans', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #39FF14;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(57, 255, 20, 0.5);
  min-width: 9ch;
  text-align: center;
}

/* ── Listen overlay (during target tone) ────────────────────────────────── */
#pitch-listen-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.55);
  pointer-events: none;
}

#pitch-listen-overlay.hidden { display: none; }

#pitch-listen-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(57, 255, 20, 0.7);
}

/* ── Per-round result line ───────────────────────────────────────────────── */
#pitch-round-result {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(57, 255, 20, 0.65);
  text-align: center;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

#pitch-round-result.hidden { display: none; }

/* ── Session-end screen ──────────────────────────────────────────────────── */
#pitch-end {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px calc(40px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

#pitch-end.hidden { display: none; }

#pitch-end-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 380px;
}

#pitch-end-total-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(57, 255, 20, 0.45);
}

#pitch-end-total {
  font-family: 'DM Sans', sans-serif;
  font-size: 3.4rem;
  font-weight: 700;
  color: #39FF14;
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 0 32px rgba(57, 255, 20, 0.4);
}

#pitch-end-pb {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #39FF14;
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.3);
  border-radius: 20px;
  padding: 5px 14px;
}

#pitch-end-pb.hidden { display: none; }

#pitch-end-rounds {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0;
}

.pitch-end-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #141414;
  border: 1px solid #222;
  border-radius: 10px;
  padding: 12px 16px;
}

.pitch-end-round-num {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(57, 255, 20, 0.45);
  min-width: 52px;
  flex-shrink: 0;
}

.pitch-end-row-detail {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
  flex: 1;
  line-height: 1.4;
}

.pitch-end-row-detail strong {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.pitch-end-row-score {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #39FF14;
  flex-shrink: 0;
  text-align: right;
}

.pitch-end-row-score small {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(57, 255, 20, 0.5);
}

#pitch-end-btns {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 4px;
}

#pitch-share-btn {
  background: #1A1A1A;
  color: #39FF14;
  border: 1.5px solid rgba(57, 255, 20, 0.35);
}

#pitch-share-btn:hover {
  background: #222;
  border-color: rgba(57, 255, 20, 0.6);
}

#pitch-again-btn {
  background: #39FF14;
  color: #0A0A0A;
}

#pitch-again-btn:hover {
  background: #5fff35;
}

/* ── Controls ────────────────────────────────────────────────────────────── */
#pitch-controls {
  display: flex;
  gap: 12px;
  width: 100%;
}

.pitch-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: opacity 0.12s, transform 0.08s, background 0.12s;
  flex: 1;
  letter-spacing: 0.02em;
}

.pitch-btn:active {
  transform: scale(0.97);
  opacity: 0.85;
}

#pitch-replay-btn {
  background: #1A1A1A;
  color: #39FF14;
  border: 1.5px solid rgba(57, 255, 20, 0.35);
}

#pitch-replay-btn:hover {
  background: #222;
  border-color: rgba(57, 255, 20, 0.6);
}

#pitch-submit-btn {
  background: #39FF14;
  color: #0A0A0A;
}

#pitch-submit-btn:hover {
  background: #5fff35;
}

#pitch-submit-btn:disabled {
  background: #1a3a0a;
  color: rgba(57, 255, 20, 0.35);
  cursor: default;
  transform: none;
  opacity: 1;
}
