:root {
  --bg-0: #f7f1e8;
  --bg-1: #efe6d8;
  --bg-2: #e8dcc8;
  --panel: rgba(90, 62, 34, 0.05);
  --panel-strong: rgba(90, 62, 34, 0.09);
  --panel-border: rgba(90, 62, 34, 0.16);
  --text: #3a2c1c;
  --text-dim: #7d6a52;
  --text-faint: #a69074;

  /* Warm caramel-to-coffee gradient — the accent pairing used everywhere
     (buttons, active states, highlights). Kept under the same --lime/--teal
     variable names as the original dark theme so every rule that already
     references them just picks up the new palette automatically. */
  --lime: #b07a45;
  --lime-soft: rgba(176, 122, 69, 0.16);
  --teal: #7a4a26;
  --teal-soft: rgba(122, 74, 38, 0.14);

  /* Text color for content sitting on top of an accent-gradient surface
     (buttons, active toggle states) — needs to be light now that the
     accent itself is a medium-dark brown, the opposite of the old
     near-black-on-neon-lime combination. */
  --on-accent: #fdf8f0;

  --win: #4c8c5c;
  --win-soft: rgba(76, 140, 92, 0.16);
  --loss: #b8493f;
  --loss-soft: rgba(184, 73, 63, 0.16);
  --draw: #8a7d68;
  --draw-soft: rgba(138, 125, 104, 0.16);
  --pending: #c98a3a;
  --pending-soft: rgba(201, 138, 58, 0.16);

  --radius: 16px;
  --radius-sm: 10px;
  --font-display: "Rajdhani", "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg-0);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: radial-gradient(1200px 600px at 15% -10%, rgba(122, 74, 38, 0.08), transparent 60%),
    radial-gradient(1000px 500px at 90% 0%, rgba(176, 122, 69, 0.1), transparent 55%), var(--bg-0);
  position: relative;
}

/* Faint padel-court line motif behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: linear-gradient(rgba(58, 42, 26, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 42, 26, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(900px 500px at 50% 0%, black, transparent 75%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: rgba(247, 241, 232, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--panel-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--lime), var(--teal));
  font-size: 20px;
  box-shadow: 0 0 20px rgba(176, 122, 69, 0.3);
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}

.brand-text .tagline {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sync-status {
  color: var(--text-dim);
  font-size: 13px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  background: linear-gradient(120deg, var(--lime), var(--teal));
  color: var(--on-accent);
  box-shadow: 0 0 0 rgba(176, 122, 69, 0);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(176, 122, 69, 0.3);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.btn-ghost {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(58, 42, 26, 0.3);
}

.nav-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 12px;
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-icon-btn:hover {
  color: var(--text);
  background: var(--panel);
}

.nav-icon-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 57px;
  height: 57px;
  border-radius: 17px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  font-size: 26px;
}

.nav-icon-btn:hover .nav-icon-btn-icon {
  border-color: rgba(58, 42, 26, 0.3);
}

.nav-icon-btn-label {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

main {
  position: relative;
  z-index: 1;
  padding: 28px 28px 60px;
  max-width: 1240px;
  margin: 0 auto;
}

/* Stats -------------------------------------------------------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stats-grid[hidden] {
  display: none;
}

.usage-bar {
  margin-top: 10px;
  height: 6px;
  border-radius: 3px;
  background: var(--panel-strong);
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--lime), var(--teal));
  transition: width 0.3s ease;
}

.stat-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-align: center;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--lime), var(--teal));
  opacity: 0.8;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(176, 122, 69, 0.4);
}

.stat-icon {
  font-size: 15px;
  margin-bottom: 4px;
  opacity: 0.85;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.stat-label {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card--rate .stat-value {
  background: linear-gradient(120deg, var(--lime), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-card--filter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.segmented-btn {
  border: 1px solid var(--panel-border);
  background: var(--panel-strong);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-body);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.segmented-btn:hover {
  color: var(--text);
  border-color: rgba(58, 42, 26, 0.3);
}

.segmented-btn.active {
  background: linear-gradient(120deg, var(--lime), var(--teal));
  color: var(--on-accent);
  border-color: transparent;
}

.ring-wrap {
  position: relative;
  width: 74px;
  height: 74px;
  margin: 0 auto;
}

.ring-wrap svg {
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(58, 42, 26, 0.12);
  stroke-width: 8;
}

.ring-fill {
  fill: none;
  stroke: url(#ringGradient);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

/* Breakdown panels ----------------------------------------------------- */

.breakdowns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
}

.panel h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel h2::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--lime), var(--teal));
  display: inline-block;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.rank-row-link {
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  padding: 6px 8px;
  margin: 0 -8px;
  transition: background 0.12s ease;
}

.rank-row-link:hover {
  background: var(--lime-soft);
}

.rank-row-link:hover .rank-name {
  color: var(--lime);
}

/* Video analysis ------------------------------------------------------- */

.video-analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
}

.video-embed-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--panel-border);
}

.video-embed-wrap iframe,
.video-embed-wrap #youtubePlayer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-analysis-lists {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.video-analysis-lists-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.player-tiles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: none;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: inherit;
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.player-row:hover {
  background: var(--panel);
}

.player-row.active {
  border-color: var(--lime);
}

.player-row--empty {
  opacity: 0.5;
  cursor: default;
}

.player-row-photo {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
}

.player-row-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-row-main {
  flex: 1;
  min-width: 0;
}

.player-row-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.player-row-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.player-kpi strong {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text);
  margin-right: 4px;
}

.player-kpi--win strong {
  color: var(--win);
}

.player-kpi--loss strong {
  color: var(--loss);
}

.player-kpi--pending strong {
  color: var(--pending);
}

.player-row-insight {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.timeline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  color: inherit;
  cursor: pointer;
  font-size: 13px;
}

.timeline-timestamp {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--teal);
  font-size: 12px;
}

.timeline-desc {
  flex: 1;
  min-width: 0;
}

.timeline-shot {
  flex: 0 0 auto;
}

@media (max-width: 860px) {
  .video-analysis-layout,
  .video-analysis-lists {
    grid-template-columns: 1fr;
  }
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: #06120c;
  flex-shrink: 0;
}

.avatar-photo {
  object-fit: cover;
  background: none;
}

.rank-main {
  min-width: 0;
}

.rank-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.rank-bar {
  margin-top: 5px;
  height: 4px;
  border-radius: 2px;
  background: rgba(58, 42, 26, 0.1);
  overflow: hidden;
}

.rank-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--teal), var(--lime));
}

.rank-meta {
  color: var(--text-dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Games section ---------------------------------------------------------- */

.games-section {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.filters input,
.filters select {
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filters input:focus,
.filters select:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(176, 122, 69, 0.18);
}

#searchInput {
  flex: 1;
  min-width: 200px;
}

.table-scroll {
  overflow-x: auto;
}

.games-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.games-table th {
  text-align: left;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  border-bottom: 2px solid rgba(176, 122, 69, 0.3);
  white-space: nowrap;
}

.games-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--panel-border);
  white-space: nowrap;
}

.games-table tbody tr {
  transition: background 0.12s ease;
}

.games-table tbody tr:nth-child(even) {
  background: rgba(58, 42, 26, 0.02);
}

.games-table tbody tr:hover {
  background: var(--lime-soft);
}

.set-chips {
  display: inline-flex;
  gap: 4px;
}

.set-chip {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text-dim);
}

.set-chip.set-won {
  background: var(--win-soft);
  color: var(--win);
}

.set-chip.set-lost {
  background: var(--loss-soft);
  color: var(--loss);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-win {
  background: var(--win-soft);
  color: var(--win);
}

.badge-loss {
  background: var(--loss-soft);
  color: var(--loss);
}

.badge-draw {
  background: var(--draw-soft);
  color: var(--draw);
}

.badge-pending {
  background: var(--pending-soft);
  color: var(--pending);
}

.badge-info {
  background: var(--teal-soft);
  color: var(--teal);
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 28px;
  font-size: 14px;
}

/* Admin: full-database view --------------------------------------------- */

.summary-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.summary-chip {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  text-align: center;
}

.summary-chip .chip-value {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.summary-chip .chip-label {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.summary-chip.chip-played .chip-value {
  color: var(--teal);
}

.summary-chip.chip-win .chip-value {
  color: var(--win);
}

.summary-chip.chip-loss .chip-value {
  color: var(--loss);
}

.summary-chip.chip-pending .chip-value {
  color: var(--pending);
}

.summary-chip.chip-draw .chip-value {
  color: var(--draw);
}

.games-section h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel-note {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 16px;
  max-width: 800px;
  line-height: 1.5;
}

.row-count {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.admin-table {
  font-size: 12.5px;
}

.admin-table th,
.admin-table td {
  padding: 7px 10px;
}

.admin-table th[data-sort]:hover {
  color: var(--lime);
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  color: var(--text-faint);
}

/* Find a Game --------------------------------------------------------- */

.filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.filter-label input {
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-family: var(--font-body);
}

.match-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.match-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.match-card:hover {
  transform: translateY(-2px);
  border-color: rgba(176, 122, 69, 0.4);
}

/* 1 open spot = closest to a ready game, so it gets the strongest pull */
.match-card--hot {
  background: linear-gradient(160deg, rgba(176, 122, 69, 0.1), var(--panel) 55%);
  border-color: rgba(176, 122, 69, 0.55);
  box-shadow: 0 0 0 1px rgba(176, 122, 69, 0.14), 0 8px 28px rgba(176, 122, 69, 0.14);
}

.match-card--hot:hover {
  border-color: var(--lime);
  box-shadow: 0 0 0 1px rgba(176, 122, 69, 0.25), 0 10px 32px rgba(176, 122, 69, 0.22);
}

.match-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.match-date {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}

.match-venue {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.match-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.match-players {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Scoreboard: one row per team, one column per set */
.score-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}

.score-row + .score-row {
  border-top: 1px solid var(--panel-border);
}

.score-team-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-cells {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.score-cell {
  min-width: 26px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dim);
}

.score-cell.score-win {
  color: var(--lime);
}

.player-chip {
  font-size: 12px;
  background: var(--panel-strong);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--text);
}

.player-chip em {
  font-style: normal;
  color: var(--teal);
  font-weight: 600;
}

.match-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.match-card-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-body);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
}

.match-card-icon-btn:hover {
  transform: translateY(-1px);
}

.match-card-whatsapp {
  background: #25d366;
  border-color: transparent;
}

.match-card-whatsapp img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.match-card-whatsapp:hover {
  filter: brightness(1.08);
}

.match-card-details {
  background: var(--panel-strong);
}

.match-card-details:hover {
  border-color: rgba(176, 122, 69, 0.4);
  color: var(--lime);
}

/* Match details modal ---------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(35, 24, 14, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 85vh;
  overflow-y: auto;
  background: #fffaf2;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: 0 24px 60px rgba(58, 42, 26, 0.25);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: var(--panel-strong);
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
  border-color: rgba(58, 42, 26, 0.35);
}

.modal-date {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.modal-time {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

.modal-venue-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
  flex-wrap: wrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 18px 0;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.modal-panel h3 {
  margin: 20px 0 10px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.modal-description {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
  white-space: pre-line;
}

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

.slot-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  min-height: 52px;
}

.slot-card.slot-empty {
  border-style: dashed;
  color: var(--text-faint);
  font-size: 13px;
  justify-content: center;
}

.slot-info {
  min-width: 0;
  flex: 1;
}

.slot-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 1px;
}

.modal-level-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-dim);
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
}

.modal-level-note strong {
  color: var(--text);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn {
  flex: 1;
  text-align: center;
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  main {
    padding: 20px 16px 48px;
  }
}

/* Auth page ------------------------------------------------------------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 36px 30px;
  text-align: center;
}

.auth-card .brand-mark {
  margin: 0 auto 18px;
}

.auth-card h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-card .tagline {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 26px;
}

.auth-card .g-signin-wrap {
  display: flex;
  justify-content: center;
}

.auth-role-toggle {
  display: flex;
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 22px;
  gap: 4px;
}

.auth-role-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.auth-role-tab.active {
  background: linear-gradient(120deg, var(--lime), var(--teal));
  color: var(--on-accent);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form input {
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(176, 122, 69, 0.18);
}

/* Coach picker ------------------------------------------------------------ */

.coach-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.coach-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: left;
  color: inherit;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.coach-card:hover {
  transform: translateY(-2px);
  border-color: rgba(176, 122, 69, 0.4);
}

.coach-card.selected {
  border-color: var(--lime);
  background: var(--lime-soft);
}

.coach-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}

.coach-card-bio {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Video list -------------------------------------------------------------- */

.video-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
  background: var(--panel);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.video-list-row:hover {
  background: var(--panel-strong);
  border-color: rgba(58, 42, 26, 0.3);
}

/* Guide ("how it works") section ------------------------------------------ */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.guide-steps {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px 18px;
}

.guide-steps[hidden] {
  display: none;
}

.guide-step {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-step-number {
  position: absolute;
  top: -13px;
  left: 18px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--lime), var(--teal));
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(176, 122, 69, 0.35);
}

.guide-step-icon {
  font-size: 26px;
}

.guide-step h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.guide-step p {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  flex: 1;
}

/* Miniature, non-interactive replicas of the real submit form / coach
   picker / stats chips — real product visuals convert better here than
   generic decorative icons, so each step shows what it actually looks
   like rather than an abstract illustration. */
.guide-mock {
  margin-top: 4px;
  background: var(--bg-0);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.guide-mock-input {
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-mock-btn {
  align-self: flex-end;
  background: linear-gradient(120deg, var(--lime), var(--teal));
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
}

.guide-mock-coaches {
  flex-direction: row;
  flex-wrap: wrap;
}

.guide-mock-coach {
  flex: 1;
  min-width: 90px;
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.guide-mock-coach strong {
  font-size: 12px;
}

.guide-mock-coach span {
  font-size: 10px;
  color: var(--text-dim);
}

.guide-mock-payment {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.guide-mock-payment span {
  font-size: 12px;
  color: var(--text-dim);
}

.guide-mock-payment strong {
  font-family: var(--font-display);
  font-size: 14px;
}

.guide-mock-stats {
  margin: 4px 0 0 !important;
  pointer-events: none;
}

.guide-trust-strip {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  padding: 16px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  border-top: 1px solid var(--panel-border);
  margin-top: 6px;
}

.guide-cta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-header .btn {
    width: 100%;
    text-align: center;
  }
}

.video-list-row + .video-list-row {
  margin-top: 10px;
}

/* Our coaches section ------------------------------------------------------ */

.coach-roster {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
}

.coach-roster[hidden] {
  display: none;
}

.coach-roster-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  cursor: pointer;
  color: inherit;
  font-family: var(--font-body);
}

.coach-roster-card:hover {
  transform: translateY(-2px);
  border-color: rgba(176, 122, 69, 0.4);
}

.coach-photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--panel-strong);
  margin-bottom: 8px;
}

.coach-photo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(120deg, var(--lime), var(--teal));
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
}

.coach-roster-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}

.coach-roster-title {
  font-size: 12px;
  color: var(--lime);
  font-weight: 600;
}

.coach-roster-years {
  font-size: 11px;
  color: var(--text-dim);
}

/* Product comparison cards --------------------------------------------- */

.product-cards {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.product-cards[hidden] {
  display: none;
}

.product-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-card-featured {
  border-color: var(--lime);
  background: var(--lime-soft);
  box-shadow: 0 8px 24px rgba(176, 122, 69, 0.18);
}

.product-card-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: linear-gradient(120deg, var(--lime), var(--teal));
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(176, 122, 69, 0.35);
}

.product-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
}

.product-card-tagline {
  margin: -6px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

.product-card-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-card-features li {
  position: relative;
  padding-left: 22px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.product-card-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--lime);
  font-weight: 700;
}

.product-card-cta {
  width: 100%;
  text-align: center;
  margin-top: 4px;
}

/* Coach dashboard --------------------------------------------------------- */

.coach-queue {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}

.coach-queue-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 18px;
}

.coach-queue-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.coach-queue-player {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}

.coach-review-input {
  width: 100%;
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.coach-review-input:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(176, 122, 69, 0.18);
}

/* Super admin -------------------------------------------------------------- */

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}

.admin-form-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.admin-form-label input,
.admin-form-label textarea,
.admin-form-label select,
.admin-form-select {
  background: var(--panel-strong);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 400;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-form-label input:focus,
.admin-form-label textarea:focus,
.admin-form-label select:focus,
.admin-form-select:focus {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(176, 122, 69, 0.18);
}

.admin-form-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-faint);
}

.admin-coach-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.admin-coach-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
}

.admin-coach-row-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}

.modal-overlay--nested {
  z-index: 200;
}

.product-choice-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.product-choice-row .btn {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.product-choice-price {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.85;
  text-transform: none;
}

.coach-confirm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
}

.coach-confirm-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  flex: 1;
  min-width: 160px;
}

.coach-confirm-selected .coach-photo,
.coach-confirm-selected .coach-photo-fallback {
  width: 32px;
  height: 32px;
  font-size: 13px;
  margin-bottom: 0;
}

.coach-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.coach-picker-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.coach-picker-actions {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
}

.coach-picker-actions .btn {
  flex: 1;
  padding: 7px 8px;
  font-size: 11px;
}

.self-hint-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
