/* =============================================
   AMERICANOS PÁDEL - Estilos globales
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600&display=swap');

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

:root {
  --green: #00C87A;
  --green-dk: #009959;
  --green-bg: rgba(0,200,122,0.08);
  --green-border: rgba(0,200,122,0.25);
  --court: #111A15;
  --court-2: #172010;
  --surface: rgba(255,255,255,0.04);
  --surface-2: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.09);
  --border-2: rgba(255,255,255,0.15);
  --text: #EDF7F2;
  --text-2: #7FA893;
  --text-3: #4D7060;
  --gold: #FFD53E;
  --silver: #C8D6E0;
  --bronze: #D4956A;
  --carton: #8B6F47;
  --danger: #FF6B6B;
  --danger-bg: rgba(255,107,107,0.1);
  --r: 10px;
  --r-lg: 14px;
}

html { font-size: 16px; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--court);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* Court texture background */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(0,200,122,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,200,122,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none; z-index: 0;
}

#app, .container {
  position: relative; z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

/* ---- HEADER ---- */
.site-header {
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.logo { display: flex; align-items: flex-end; gap: 10px; }
.logo-main {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 46px; letter-spacing: 3px;
  color: var(--green); line-height: 1;
}
.logo-sub {
  font-size: 10px; font-weight: 600;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--text-2); margin-bottom: 6px;
}
.header-actions { display: flex; gap: 8px; align-items: center; }

/* ---- NAV ---- */
.nav-tabs {
  display: flex; gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 4px;
  margin-bottom: 28px;
  overflow-x: auto;
}
.nav-tab {
  flex: 1; min-width: 80px;
  padding: 9px 10px;
  border: none; background: transparent;
  color: var(--text-2);
  font-family: 'Outfit', sans-serif;
  font-size: 13px; font-weight: 500;
  border-radius: 8px; cursor: pointer;
  transition: all 0.18s; white-space: nowrap; text-align: center;
}
.nav-tab.active { background: var(--green); color: var(--court); font-weight: 600; }
.nav-tab:hover:not(.active) { color: var(--text); background: var(--surface-2); }
.nav-tab.disabled { opacity: 0.35; pointer-events: none; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: none; border-radius: var(--r);
  font-family: 'Outfit', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; white-space: nowrap; text-decoration: none;
}
.btn-green { background: var(--green); color: var(--court); }
.btn-green:hover { background: var(--green-dk); }
.btn-outline { background: transparent; border: 1px solid var(--border-2); color: var(--text-2); }
.btn-outline:hover { border-color: var(--green); color: var(--green); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(255,107,107,0.2); }
.btn-danger:hover { background: rgba(255,107,107,0.2); }
.btn-gold { background: rgba(255,213,62,0.15); color: var(--gold); border: 1px solid rgba(255,213,62,0.3); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.4; pointer-events: none; }

/* ---- CARDS ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
}
.card-title {
  font-size: 10px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 14px;
}

/* ---- INPUTS ---- */
.input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  color: var(--text);
  font-family: 'Outfit', sans-serif; font-size: 14px;
  outline: none; transition: border-color 0.15s;
}
.input:focus { border-color: var(--green); }
.input::placeholder { color: var(--text-3); }
.input-row { display: flex; gap: 8px; margin-bottom: 10px; }
.select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 9px 12px;
  color: var(--text);
  font-family: 'Outfit', sans-serif; font-size: 14px;
  outline: none; cursor: pointer; transition: border-color 0.15s;
}
.select:focus { border-color: var(--green); }

/* ---- SECTION TITLE ---- */
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px; letter-spacing: 2px;
  color: var(--green); margin-bottom: 16px;
}
.section-sub {
  font-size: 13px; color: var(--text-2);
  margin-top: -10px; margin-bottom: 16px;
}

/* ---- DIVIDER ---- */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ---- STATUS BAR ---- */
.status-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--green-bg); border: 1px solid var(--green-border);
  border-radius: 10px; padding: 10px 14px;
  font-size: 13px; color: var(--green);
  margin-bottom: 20px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.35} }

/* ---- COPA BADGES ---- */
.copa-oro   { color: var(--gold);   border-color: rgba(255,213,62,0.4); background: rgba(255,213,62,0.08); }
.copa-plata { color: var(--silver); border-color: rgba(200,214,224,0.4); background: rgba(200,214,224,0.06); }
.copa-bronce{ color: var(--bronze); border-color: rgba(212,149,106,0.4); background: rgba(212,149,106,0.08); }
.copa-carton{ color: var(--carton); border-color: rgba(139,111,71,0.3);  background: rgba(139,111,71,0.06); }

.copa-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px; border: 1px solid;
  font-size: 12px; font-weight: 600;
}

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 10px 20px; border-radius: 10px;
  font-weight: 600; font-size: 14px;
  transition: transform 0.3s ease; z-index: 9999;
  white-space: nowrap; pointer-events: none;
}
.toast.success { background: var(--green); color: var(--court); }
.toast.error { background: var(--danger); color: white; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  background: #1A2E1F;
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: 24px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 1.5px;
  color: var(--green); margin-bottom: 18px;
}
.modal-actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }

/* ---- EMPTY STATE ---- */
.empty {
  text-align: center; padding: 48px 24px;
  color: var(--text-2);
}
.empty-icon { font-size: 36px; margin-bottom: 12px; opacity: .4; }
.empty-text { font-size: 15px; }
.empty-sub { font-size: 13px; margin-top: 6px; opacity: .6; }

/* ---- PARTIDO CARD ---- */
.partido-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  margin-bottom: 10px; transition: border-color 0.15s;
}
.partido-card.jugado { border-color: var(--green-border); }
.partido-teams {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.partido-team { flex: 1; font-size: 14px; font-weight: 500; }
.partido-team.right { text-align: right; }
.partido-vs {
  font-family: 'Bebas Neue', sans-serif; font-size: 16px;
  color: var(--text-3); padding: 0 6px; flex-shrink: 0;
}
.score-row { display: flex; align-items: center; gap: 8px; }
.score-inp {
  width: 54px; text-align: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 4px;
  color: var(--text); font-family: 'Bebas Neue', sans-serif; font-size: 24px;
  outline: none; transition: border-color 0.15s;
}
.score-inp:focus { border-color: var(--green); }
.score-dash { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: var(--text-3); }
.score-display {
  font-family: 'Bebas Neue', sans-serif; font-size: 30px;
  flex: 1; text-align: center; letter-spacing: 3px;
}
.score-display .win { color: var(--green); }
.pista-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  padding: 2px 8px; border-radius: 20px;
  background: var(--green-bg); color: var(--green);
  border: 1px solid var(--green-border);
}

/* ---- RANKING TABLE ---- */
.rank-table { width: 100%; border-collapse: collapse; }
.rank-table th {
  font-size: 10px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-3);
  padding: 8px 12px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.rank-table th.center, .rank-table td.center { text-align: center; }
.rank-table td { padding: 10px 12px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,.03); }
.rank-table tr:hover td { background: rgba(255,255,255,.02); }
.rank-pos {
  font-family: 'Bebas Neue', sans-serif; font-size: 22px;
  color: var(--text-3); width: 36px; display: block;
}
.rank-pos.p1 { color: var(--gold); }
.rank-pos.p2 { color: var(--silver); }
.rank-pos.p3 { color: var(--bronze); }
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.pill-green { background: var(--green-bg); color: var(--green); }
.pill-gold  { background: rgba(255,213,62,.12); color: var(--gold); }
.pill-red   { background: rgba(255,107,107,.1); color: #ff9999; }
.pill-gray  { background: var(--surface-2); color: var(--text-2); }

/* ---- GRUPO LABEL ---- */
.grupo-label {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--green-bg); border: 1px solid var(--green-border);
  border-radius: 6px; font-weight: 700; font-size: 13px; color: var(--green);
}

/* ---- ROUND HEADER ---- */
.round-header {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0 12px;
}
.round-label {
  font-family: 'Bebas Neue', sans-serif; font-size: 18px;
  letter-spacing: 1px; color: var(--text-2);
  white-space: nowrap;
}
.round-line { flex: 1; height: 1px; background: var(--border); }

/* ---- CONFIG ROW ---- */
.cfg-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 12px;
}
.cfg-label { font-size: 14px; color: var(--text-2); }

/* ---- PROGRESS DOTS ---- */
.progress-dots { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; }
.prog-dot {
  width: 30px; height: 30px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  border: 1px solid var(--border); color: var(--text-3);
  transition: all 0.2s;
}
.prog-dot.done { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.prog-dot.current { background: var(--green); color: var(--court); border-color: var(--green); }

/* ---- GRID ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width:580px){ .grid-2 { grid-template-columns: 1fr; } }

/* ---- SPINNER ---- */
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--border-2);
  border-top-color: var(--green);
  animation: spin 0.7s linear infinite;
  margin: 32px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- LOADING ---- */
.loading { text-align: center; padding: 40px; color: var(--text-2); }

/* ---- ADMIN INDICATOR ---- */
.admin-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 4px 10px; border-radius: 20px;
  background: rgba(255,213,62,0.12); color: var(--gold);
  border: 1px solid rgba(255,213,62,0.3);
}
