/* =====================
   Variables & Reset
   ===================== */
:root {
  --green: #2ecc71;
  --green-dark: #27ae60;
  --red: #e74c3c;
  --red-dark: #c0392b;
  --blue: #3498db;
  --blue-dark: #2980b9;
  --orange: #f39c12;
  --orange-dark: #e67e22;
  --gray: #95a5a6;
  --gray-light: #ecf0f1;
  --gray-dark: #7f8c8d;
  --bg: #f0f4f8;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
  --radius: 16px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 40px;
}

/* =====================
   Lucide Icon Sizing
   ===================== */
.icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
  stroke: currentColor;
}
.icon-lg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
  stroke: currentColor;
}

/* =====================
   Player Login Overlay
   ===================== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(145deg, #1a5276 0%, #27ae60 100%);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.login-panel {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 8px;
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.login-logo p {
  font-size: 0.85rem;
  color: var(--text-light);
}

.login-form h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.login-hint {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 14px;
}

.login-search-wrap input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text);
  background: #fafbfc;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 10px;
}

.login-search-wrap input:focus {
  border-color: var(--blue);
  background: #fff;
}

.login-player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.login-player-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: var(--bg);
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  width: 100%;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.login-player-btn:hover {
  background: #eafaf1;
  border-color: var(--green);
  color: var(--green-dark);
}

.login-player-btn:active {
  transform: scale(0.98);
}

.login-player-btn svg {
  flex-shrink: 0;
  opacity: 0.5;
}

.login-not-registered {
  font-size: 0.8rem;
  color: var(--text-light);
  text-align: center;
}

/* =====================
   Header
   ===================== */
header {
  background: linear-gradient(135deg, #1a5276, #2ecc71);
  color: white;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo-icon {
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.logo h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.subtitle {
  font-size: 0.75rem;
  opacity: 0.85;
  font-weight: 400;
  margin-top: 1px;
}

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

.header-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  color: white;
  text-decoration: none;
}

.header-btn:hover {
  background: rgba(255,255,255,0.35);
}

.header-player {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: background 0.15s;
  max-width: 160px;
  overflow: hidden;
}

.header-player span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-player:hover {
  background: rgba(255,255,255,0.35);
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #ff4757;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* =====================
   Main Content
   ===================== */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* =====================
   Info Bar (Clock + Weather)
   ===================== */
.info-bar {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.info-clock,
.info-weather {
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-icon {
  font-size: 1.5rem;
}

.clock-time {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.clock-date {
  display: block;
  font-size: 0.78rem;
  color: var(--text-light);
}

.weather-temp {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.weather-cond {
  display: block;
  font-size: 0.78rem;
  color: var(--text-light);
}

@media (max-width: 480px) {
  .info-bar { flex-direction: column; gap: 10px; }
}

/* =====================
   Mini Dashboard
   ===================== */
.dashboard {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.dash-cards {
  display: flex;
  gap: 12px;
  overflow-x: auto;
}

.dash-card {
  flex: 1;
  min-width: 120px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.dash-card-highlight {
  background: linear-gradient(135deg, #1a5276, #2471a3);
  color: white;
}

.dash-card-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  opacity: 0.8;
}

.dash-progress {
  height: 6px;
  background: #dfe6e9;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.dash-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.dash-card-stats {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.dash-stat {
  font-size: 0.72rem;
  font-weight: 500;
}

.dash-stat.booked { color: var(--orange); }
.dash-stat.available { color: var(--green-dark); }

.dash-big-num {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.dash-card-highlight .dash-card-title { opacity: 0.9; }
.dash-card-highlight .dash-stat { color: rgba(255,255,255,0.8); }

@media (max-width: 480px) {
  .dash-cards { flex-wrap: wrap; }
  .dash-card { min-width: calc(50% - 6px); }
}

/* =====================
   Date Navigation
   ===================== */
.date-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}

.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.btn-nav {
  background: var(--gray-light);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
  color: var(--text);
}

.btn-nav:hover {
  background: #dfe6e9;
  transform: scale(1.05);
}

.btn-nav:active { transform: scale(0.95); }

.date-display {
  text-align: center;
  flex: 1;
}

.date-label {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.date-sublabel {
  display: block;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 2px;
}

/* =====================
   Player Selector
   ===================== */
.name-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}

.name-box label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.player-select-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.player-input-wrap {
  flex: 1;
  position: relative;
}

.player-input-wrap input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  background: #fafbfc;
}

.player-input-wrap input:focus {
  border-color: var(--blue);
  background: #fff;
}

.player-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid var(--gray-light);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow);
}

.dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.1s;
}

.dropdown-item:hover,
.dropdown-item--focused {
  background: var(--gray-light);
}

.dropdown-empty {
  padding: 10px 16px;
  color: var(--text-light);
  font-size: 0.85rem;
}

.player-input-wrap input.input-error {
  border-color: var(--red);
}

.player-error-msg {
  font-size: 0.8rem;
  color: var(--red);
  margin-top: 4px;
}

.btn-add-player {
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  width: 46px;
  height: 46px;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.btn-add-player:hover {
  background: var(--green-dark);
  transform: scale(1.05);
}

.selected-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #eafaf1;
  border: 2px solid #a9dfbf;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.selected-player span {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--green-dark);
}

.btn-clear-player {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--gray);
  padding: 0 4px;
}

.btn-clear-player:hover {
  color: var(--red);
}

/* =====================
   Courts Grid
   ===================== */
.courts-section {
  min-height: 200px;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-light);
  gap: 16px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--gray-light);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =====================
   Skeleton Loading
   ===================== */
.skeleton-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .skeleton-grid { grid-template-columns: 1fr; }
}

.skeleton-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.skeleton-header {
  height: 56px;
  background: linear-gradient(90deg, #dde1e7 25%, #eef1f4 50%, #dde1e7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton-slot {
  height: 60px;
  margin: 8px 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #f0f2f5 25%, #f8f9fa 50%, #f0f2f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.courts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .courts-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================
   Court Card
   ===================== */
.court-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.court-header {
  background: linear-gradient(135deg, #1a5276, #2471a3);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.court-header .court-icon {
  font-size: 1.4rem;
}

.court-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.court-slots {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* =====================
   Slot
   ===================== */
.slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
  border: 2px solid transparent;
  gap: 8px;
  min-height: 60px;
}

.slot:active { transform: scale(0.98); }

.slot:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.slot-time {
  font-size: clamp(0.7rem, 2.5vw, 0.85rem);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.slot-info {
  flex: 1;
  text-align: right;
}

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

.slot-when {
  font-size: 0.7rem;
  opacity: 0.7;
}

.slot-score {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue-dark);
  background: rgba(52,152,219,0.1);
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 2px;
}

/* Available slot */
.slot.available {
  background: #eafaf1;
  border-color: #a9dfbf;
  color: var(--green-dark);
}

.slot.available:hover {
  background: #d5f5e3;
  box-shadow: 0 2px 8px rgba(46,204,113,0.2);
}

.slot.available .slot-time { color: var(--green-dark); }
.slot.available .slot-name { color: var(--green-dark); font-weight: 400; opacity: 0.7; }

/* Booked slot */
.slot.booked {
  background: #fef9e7;
  border-color: #f9ca24;
  color: #856404;
}

.slot.booked:hover {
  background: #fef3cd;
  box-shadow: 0 2px 8px rgba(249,202,36,0.25);
}

.slot.booked .slot-time { color: #6c4f00; }

/* Locked slot */
.slot.locked {
  background: #fdecea;
  border-color: #f5b7b1;
  color: var(--red-dark);
  cursor: not-allowed;
  opacity: 0.75;
}

.slot.locked .slot-badge {
  background: var(--red);
  color: white;
}

/* Past slot */
.slot.past {
  background: #f8f9fa;
  border-color: #e9ecef;
  color: var(--gray);
  cursor: not-allowed;
  opacity: 0.6;
}

.slot-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.slot.available .slot-badge {
  background: var(--green);
  color: white;
}

.slot.booked .slot-badge {
  background: #f9ca24;
  color: #6c4f00;
}

.slot.past .slot-badge {
  background: var(--gray);
  color: white;
}

/* =====================
   Legend
   ===================== */
.legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-light);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.available { background: var(--green); }
.legend-dot.booked { background: #f9ca24; }
.legend-dot.locked { background: var(--red); }
.legend-dot.past { background: var(--gray); }

/* =====================
   Modal
   ===================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 28px 24px;
  position: relative;
  animation: slideUp 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.leaderboard-modal {
  max-width: 500px;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: #2c3e50;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.modal-close:hover { background: #1a252f; }
.modal-close svg { stroke: white; }

.modal-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-content .modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.4;
}

.modal-content .modal-info {
  background: var(--gray-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.modal-content .modal-info strong { font-weight: 700; }

.modal-form {
  margin-bottom: 20px;
}

.modal-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 4px;
  margin-top: 12px;
}

.modal-form label:first-child {
  margin-top: 0;
}

.modal-form input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.modal-form input:focus {
  border-color: var(--blue);
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
  text-align: center;
}

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

.btn-primary {
  background: var(--green);
  color: white;
}

.btn-primary:hover {
  background: var(--green-dark);
  box-shadow: 0 4px 12px rgba(46,204,113,0.35);
}

.btn-danger {
  background: var(--red);
  color: white;
}

.btn-danger:hover {
  background: var(--red-dark);
  box-shadow: 0 4px 12px rgba(231,76,60,0.35);
}

.btn-secondary {
  background: var(--gray-light);
  color: var(--text);
}

.btn-secondary:hover { background: #dfe6e9; }

/* =====================
   Match Result in Modal
   ===================== */
.match-result {
  background: #eaf2f8;
  border: 2px solid #aed6f1;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  text-align: center;
}

.match-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.match-teams .vs {
  color: var(--text-light);
  font-weight: 400;
  font-size: 0.8rem;
}

.match-teams .winner {
  color: var(--green-dark);
}

.match-scores {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.match-scores span {
  background: white;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--blue-dark);
}

/* =====================
   Score Form
   ===================== */
.score-form {
  margin-bottom: 20px;
}

.team-section {
  margin-bottom: 12px;
}

.team-section label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.team-section-label-1 { color: var(--green-dark); }
.team-section-label-2 { color: var(--orange-dark); }

.score-select {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 4px;
  outline: none;
  background: white;
}

.score-select:focus {
  border-color: var(--blue);
}

.sets-section {
  margin-top: 14px;
}

.sets-section label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.set-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.set-row span {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 42px;
  color: var(--text);
}

.set-row input {
  width: 54px;
  padding: 6px 10px;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  text-align: center;
  outline: none;
}

.set-row input:focus {
  border-color: var(--blue);
}

/* =====================
   Leaderboard
   ===================== */
.lb-header, .lb-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  gap: 8px;
}

.lb-header {
  border-bottom: 2px solid var(--gray-light);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

.lb-row {
  border-bottom: 1px solid #f1f2f3;
  font-size: 0.9rem;
}

.lb-row:last-child { border-bottom: none; }

.lb-top {
  font-weight: 600;
}

.lb-rank { width: 32px; text-align: center; flex-shrink: 0; }
.lb-name { flex: 1; }
.lb-w { width: 36px; text-align: center; color: var(--green-dark); font-weight: 600; }
.lb-l { width: 36px; text-align: center; color: var(--red); font-weight: 600; }
.lb-pct { width: 48px; text-align: center; }

/* =====================
   Toast
   ===================== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #2c3e50;
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 300;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success { background: var(--green-dark); }
.toast.error { background: var(--red-dark); }

/* =====================
   Dark Mode
   ===================== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1f2e;
    --card-bg: #252b3b;
    --text: #e8edf5;
    --text-light: #8892a4;
    --gray-light: #2f3649;
    --gray-dark: #5a6478;
  }

  header {
    background: linear-gradient(135deg, #0e2d47, #1a8a50);
  }

  .modal { background: var(--card-bg); }

  .player-input-wrap input,
  .modal-form input,
  .score-select,
  .set-row input {
    background: #1e2535;
    color: var(--text);
    border-color: #3a4155;
  }

  .player-dropdown {
    background: #1e2535;
    border-color: #3a4155;
  }

  .skeleton-header {
    background: linear-gradient(90deg, #2f3649 25%, #3a4155 50%, #2f3649 75%);
    background-size: 200% 100%;
  }

  .skeleton-slot {
    background: linear-gradient(90deg, #252b3b 25%, #2f3649 50%, #252b3b 75%);
    background-size: 200% 100%;
  }

  .login-panel {
    background: var(--card-bg);
  }

  .login-search-wrap input {
    background: #1e2535;
    color: var(--text);
    border-color: #3a4155;
  }

  .login-player-btn {
    background: #1e2535;
    border-color: #3a4155;
    color: var(--text);
  }

  .login-player-btn:hover {
    background: #1e3a2e;
    border-color: var(--green);
  }
}
