*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark: #1a3a2a;
  --green-mid: #2d6a4f;
  --green-light: #52b788;
  --green-accent: #74c69d;
  --white: #ffffff;
  --gray-light: #f4f7f5;
  --gray-mid: #d0ddd6;
  --gray-text: #6b7c74;
  --danger: #e05252;
  --warning: #e8a020;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.18);
  --transition: 0.2s ease;
  --nav-h: 64px;
  --ad-h: 120px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-light);
  color: var(--green-dark);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  overflow-x: hidden;
}

/* ── SCREENS ── */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + 16px);
}
.screen.active { display: flex; }

/* ── HEADER ── */
.app-header {
  background: var(--green-dark);
  color: var(--white);
  padding: calc(20px + env(safe-area-inset-top)) 16px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.app-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-header p {
  font-size: 0.82rem;
  opacity: 0.75;
  margin-top: 2px;
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--green-dark);
  display: flex;
  z-index: 401;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.2);
}
.bottom-nav.hidden { display: none; }

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: rgba(255,255,255,0.5);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  transition: color var(--transition);
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.nav-tab.active { color: var(--green-accent); }
.nav-tab svg { width: 22px; height: 22px; }
.nav-tab-install { color: var(--green-accent); }
.nav-tab-install:active { background: rgba(116,198,157,0.15); }

/* ── CONTENT WRAPPER ── */
.content {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── CARDS ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--green-mid);
  margin-bottom: 12px;
}

/* ── STEPPER (canchas) ── */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 2px solid var(--green-mid);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: fit-content;
}
.stepper button {
  width: 48px;
  height: 48px;
  border: none;
  background: var(--green-mid);
  color: var(--white);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.stepper button:active { background: var(--green-dark); }
.stepper-value {
  width: 56px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--green-dark);
}

/* ── TIME BUTTONS ── */
.time-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.time-btn {
  border: 2px solid var(--gray-mid);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 10px 4px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  min-height: 44px;
}
.time-btn.active {
  border-color: var(--green-light);
  background: var(--green-light);
  color: var(--white);
}

/* ── TEAMS ── */
.team-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.team-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-light);
  border-radius: var(--radius-sm);
  padding: 6px 8px 6px 12px;
}
.team-item input { outline: none; }
.btn-remove {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-add {
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--green-light);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--green-mid);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: all var(--transition);
}
.btn-add:active { background: var(--gray-light); }

/* ── MODE RADIO ── */
.radio-group {
  display: flex;
  gap: 0;
  border: 2px solid var(--gray-mid);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.radio-option {
  flex: 1;
  position: relative;
}
.radio-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-text);
  transition: all var(--transition);
  min-height: 44px;
  text-align: center;
}
.radio-option input:checked + label {
  background: var(--green-mid);
  color: var(--white);
}

/* pill variant */
.radio-pills { gap: 6px; border: none; overflow: visible; }
.radio-pills .radio-option label {
  border: 2px solid var(--gray-mid);
  border-radius: var(--radius-sm);
  background: var(--white);
  width: 100%;
  box-sizing: border-box;
}
.radio-pills .radio-option input:checked + label {
  background: var(--green-mid);
  color: var(--white);
  border-color: var(--green-mid);
}

/* ── SUMMARY CARD ── */
.summary-card {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.summary-main {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.summary-sub {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 8px;
}
.summary-time {
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 20px;
  display: inline-block;
}
.summary-time.ok { background: rgba(116,198,157,0.25); color: var(--green-accent); }
.summary-time.warn { background: rgba(232,160,32,0.25); color: var(--warning); }

/* ── PRIMARY BUTTON ── */
.btn-primary {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--green-light);
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 52px;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}
.btn-primary:disabled {
  background: var(--gray-mid);
  color: var(--gray-text);
  box-shadow: none;
  cursor: not-allowed;
}
.btn-primary:not(:disabled):active { transform: scale(0.98); }

/* ── PROGRESS BAR ── */
.progress-wrap {
  background: var(--gray-mid);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 4px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green-light), var(--green-accent));
  border-radius: 99px;
  transition: width 0.4s ease;
}
.progress-label {
  font-size: 0.78rem;
  color: var(--gray-text);
  font-weight: 600;
}

/* ── ROUNDS ── */
.round-block {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.round-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  background: var(--green-dark);
  color: var(--white);
}
.round-header h3 { font-size: 0.9rem; font-weight: 700; }
.round-header span { font-size: 0.78rem; opacity: 0.75; }
.round-chevron {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.round-block.collapsed .round-chevron { transform: rotate(-90deg); }

.round-matches {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 2000px;
  transition: max-height 0.3s ease;
}
.round-block.collapsed .round-matches { max-height: 0; }

.match-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 10px;
  cursor: pointer;
  border-top: 1px solid var(--gray-light);
  transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.match-item:active { background: var(--gray-light); }
.match-item.team-hover { background: rgba(82,183,136,.1); border-top-color: var(--green-mid); }
.match-info { flex: 1; min-width: 0; }
.match-court {
  font-size: 0.7rem;
  color: var(--gray-text);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.match-teams {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--green-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.match-score {
  font-size: 0.85rem;
  color: var(--green-mid);
  font-weight: 700;
  white-space: nowrap;
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-pending { background: #eee; color: var(--gray-text); }
.badge-playing { background: #fff3cd; color: #856404; }
.badge-finished { background: #d4edda; color: #155724; }

/* ── FAB ── */
.fab {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  right: 16px;
  z-index: 150;
  background: var(--green-light);
  color: var(--white);
  border: none;
  border-radius: 28px;
  padding: 14px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform var(--transition);
}
.fab:active { transform: scale(0.95); }
.fab.hidden { display: none; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 450;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  padding: 20px 16px 32px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
#modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--gray-mid);
  border-radius: 2px;
  margin: 0 auto 16px;
  flex-shrink: 0;
}
.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 4px;
  flex-shrink: 0;
}
.modal-subtitle {
  font-size: 0.82rem;
  color: var(--gray-text);
  margin-bottom: 20px;
  flex-shrink: 0;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.score-team { flex: 1; font-size: 0.88rem; font-weight: 600; color: var(--green-dark); text-align: center; }
.score-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 2px solid var(--green-mid);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.score-stepper button {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--green-mid);
  color: var(--white);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
}
.score-stepper button:active { background: var(--green-dark); }
.score-val {
  width: 48px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-dark);
}
.score-display {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 20px;
  letter-spacing: 4px;
}

.win-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.win-btn {
  flex: 1;
  padding: 16px 8px;
  border-radius: var(--radius);
  border: 2px solid var(--gray-mid);
  background: var(--white);
  color: var(--green-dark);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 72px;
  text-align: center;
  transition: all var(--transition);
  line-height: 1.3;
}
.win-btn.selected {
  border-color: var(--green-light);
  background: var(--green-light);
  color: var(--white);
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 16px;
}
.btn-confirm {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--green-light);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}
.btn-confirm:disabled { background: var(--gray-mid); color: var(--gray-text); cursor: not-allowed; }
.btn-cancel {
  padding: 14px 20px;
  border: 2px solid var(--gray-mid);
  border-radius: var(--radius);
  background: transparent;
  color: var(--gray-text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
}

/* ── POSITIONS TABLE ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
thead tr { background: var(--green-dark); color: var(--white); }
thead th {
  padding: 10px 8px;
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}
thead th:nth-child(2) { text-align: left; }
tbody tr { border-bottom: 1px solid var(--gray-light); }
tbody tr:nth-child(even) { background: var(--gray-light); }
tbody td {
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  color: var(--green-dark);
}
tbody td:nth-child(2) { text-align: left; font-weight: 700; }
.pos-medal { display: inline-flex; align-items: center; gap: 6px; }
.medal { font-size: 1rem; }

/* ── CHAMPION OVERLAY ── */
.champion-overlay {
  position: fixed;
  top: 0; left: 0; right: 0;
  bottom: var(--nav-h);
  background: rgba(26,58,42,0.95);
  z-index: 400;
  display: none;
  overflow: hidden;
  pointer-events: none;
}
.champion-overlay.show { display: block; }
.champion-inner {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 5vh 16px 16px;
  pointer-events: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  animation: confetti-fall linear infinite;
  border-radius: 2px;
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

.champion-title {
  color: var(--green-accent);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}
.champion-trophy { font-size: 4rem; margin-bottom: 8px; position: relative; z-index: 1; }
.champion-name {
  color: var(--white);
  font-size: 1.8rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.podium {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}
.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.podium-name {
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  max-width: 80px;
  word-break: break-word;
}
.podium-block {
  width: 80px;
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.podium-1 .podium-block { height: 90px; background: #ffd700; color: #5a4000; }
.podium-2 .podium-block { height: 65px; background: #c0c0c0; color: #3a3a3a; }
.podium-3 .podium-block { height: 45px; background: #cd7f32; color: #3a1a00; }

.champion-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  position: relative;
  z-index: 1;
}
.btn-share-wa {
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: #25d366;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}
.btn-share {
  padding: 14px;
  border: 2px solid var(--green-accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--green-accent);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}
.btn-new {
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--green-light);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}
.setup-action-row { display: flex; gap: 8px; }
.setup-action-row > button { flex: 1; }
.btn-ghost {
  padding: 14px;
  background: transparent;
  color: var(--gray-text);
  border: 1px solid var(--gray-mid);
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: background .15s;
}
.btn-ghost:hover { background: rgba(255,255,255,.05); }
.btn-regenerate {
  width: 100%;
  padding: 14px;
  background: rgba(224,82,82,.1);
  color: var(--danger);
  border: 1px solid rgba(224,82,82,.25);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  transition: background .15s;
}
.btn-regenerate:hover { background: rgba(224,82,82,.18); }
.btn-regenerate:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.btn-new-setup {
  width: 100%;
  padding: 15px;
  background: var(--green-mid);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  min-height: 52px;
}
.btn-new-setup:hover { background: var(--green-dark); }
.btn-new-setup:active { transform: scale(0.98); }

/* ── TOURNAMENT TYPE SELECTOR ── */
.tournament-type-sel { margin-bottom: 4px; }
.type-sel-label { font-size: .78rem; font-weight: 600; color: var(--gray-text); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.type-sel-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-sel-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 14px 10px; border-radius: var(--radius);
  border: 2px solid var(--gray-light); background: var(--white);
  cursor: pointer; transition: border-color .15s, background .15s; text-align: center;
}
.type-sel-btn strong { font-size: .88rem; color: var(--green-dark); display: block; }
.type-sel-btn small { font-size: .72rem; color: var(--gray-text); line-height: 1.3; display: block; }
.type-sel-icon { font-size: 1.4rem; }
.type-sel-btn.active {
  border-color: var(--green-mid); background: rgba(82,183,136,.08);
}
.type-sel-btn.active strong { color: var(--green-mid); }
.type-sel-btn:active { transform: scale(0.97); }

/* ── SECTION VISIBILITY ── */
.section-americano { display: none; }

/* ── AMERICANO PLAYER LIST ── */
.player-item {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.player-name-input {
  flex: 1; padding: 9px 12px; border: 1.5px solid var(--gray-light);
  border-radius: var(--radius-sm); font-size: .9rem; color: var(--green-dark);
  font-family: inherit; background: var(--white);
}
.player-name-input:focus { outline: none; border-color: var(--green-mid); }
.player-num { font-size: .75rem; font-weight: 700; color: var(--gray-text); min-width: 20px; text-align: center; }

/* ── AMERICANO SUMMARY ── */
.americano-summary { font-size:.85rem; color:var(--gray-dark); line-height:1.5; }
.americano-summary strong { color: var(--green-dark); }

/* ── HEADER ROW (título + botón guardar) ── */
.header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.header-brand { min-width: 0; }

/* ── BOTÓN GUARDAR SESIÓN ── */
.btn-save-session {
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 1.3rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}
.btn-save-session:active { background: rgba(255,255,255,0.28); }

.header-center {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.header-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.btn-cloud-share, .btn-cloud-sync {
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}
.btn-cloud-share:active, .btn-cloud-sync:active {
  background: rgba(255,255,255,0.28);
}
.btn-cloud-share:disabled, .btn-cloud-sync:disabled {
  opacity: 0.5;
}

/* ── SESIONES GUARDADAS ── */
.session-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-mid);
}
.session-item:last-child { border-bottom: none; }
.session-item.session-active { background: #f0faf4; border-radius: var(--radius-sm); padding: 10px 8px; }
.session-info { flex: 1; min-width: 0; }
.session-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-meta {
  font-size: 0.72rem;
  color: var(--gray-text);
  margin-top: 2px;
}
.session-finished-badge {
  display: inline-block;
  background: var(--green-dark);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 4px;
  letter-spacing: .03em;
  opacity: .75;
}
.session-btns { display: flex; gap: 6px; flex-shrink: 0; }
.btn-sess-load {
  background: var(--green-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 34px;
}
.btn-sess-del {
  background: #fff0f0;
  color: #c0392b;
  border: 1.5px solid #f5c6c6;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 34px;
  white-space: nowrap;
}
.btn-sess-del:active { background: #ffd5d5; }

/* ── BOTÓN EMPATE ── */
.win-draw-btn {
  background: #fff8e6;
  border-color: #e8a020 !important;
  color: #7a5500;
}
.win-draw-btn.selected {
  background: #e8a020 !important;
  border-color: #e8a020 !important;
  color: var(--white) !important;
}

/* ── INPUT NOMBRE SESIÓN ── */
.save-name-wrap { padding: 8px 0 16px; }
.session-name-input {
  width: 100%;
  padding: 14px 12px;
  border: 2px solid var(--gray-mid);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  color: var(--green-dark);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition);
}
.session-name-input:focus { border-color: var(--green-light); }

/* ── NOMBRE DEL TORNEO (primer campo) ── */
.card-highlight {
  border: 2px solid var(--green-light);
  background: linear-gradient(135deg, #f0faf4 0%, #fff 100%);
}
.session-name-field {
  width: 100%;
  padding: 13px 12px;
  border: 2px solid var(--gray-mid);
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-dark);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition);
  margin-top: 4px;
}
.session-name-field:focus { border-color: var(--green-light); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--green-dark);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── ZONA HINT ── */
.zona-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--green-mid);
  font-style: italic;
  padding: 6px 10px;
  background: rgba(82,183,136,0.1);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--green-light);
}

/* ── TIMER TOGGLE BUTTON (in fixture header) ── */
.btn-timer-toggle {
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}
.btn-timer-toggle:active { background: rgba(255,255,255,0.28); }
.btn-timer-toggle.active {
  background: rgba(116,198,157,0.35);
  border-color: var(--green-accent);
}

/* ── TIMER WIDGET ── */
.timer-widget {
  position: fixed;
  z-index: 420;
  background: var(--green-dark);
  color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 240px;
  min-width: 180px;
  user-select: none;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.timer-widget.dragging { box-shadow: 0 16px 48px rgba(0,0,0,0.4); }
.timer-widget.minimized .timer-body { display: none; }

.timer-drag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: grab;
  background: rgba(0,0,0,0.2);
  gap: 8px;
}
.timer-drag:active { cursor: grabbing; }
.timer-wlabel {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.timer-header-btns { display: flex; gap: 4px; }
.timer-hbtn {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}
.timer-hbtn:active { background: rgba(255,255,255,0.25); }

.timer-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timer-display {
  text-align: center;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.timer-display.warn { color: var(--warning); }
.timer-display.done { color: #ff6b6b; }

.timer-prog-wrap {
  background: rgba(255,255,255,0.12);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}
.timer-prog-bar {
  height: 100%;
  background: var(--green-accent);
  border-radius: 99px;
  transition: width 0.5s linear;
  width: 100%;
}
.timer-prog-bar.warn { background: var(--warning); }

.timer-status {
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.7;
  font-weight: 600;
}

.timer-controls {
  display: flex;
  gap: 8px;
}
.timer-btn {
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.88rem;
  min-height: 42px;
}
.timer-btn-main {
  flex: 1;
  background: var(--green-light);
  color: var(--white);
}
.timer-btn-main:active { background: var(--green-mid); }
.timer-btn-main.paused { background: var(--warning); }
.timer-btn-reset {
  width: 42px;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  font-size: 1.2rem;
}
.timer-btn-reset:active { background: rgba(255,255,255,0.25); }
.timer-btn-test {
  width: 42px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
}
.timer-btn-test:active { background: rgba(255,255,255,0.2); }

.timer-match-info {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  text-align: center;
  line-height: 1.3;
  min-height: 16px;
}

.timer-bt-btn {
  width: 100%;
  padding: 8px;
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.timer-bt-btn:active { background: rgba(255,255,255,0.1); }
.timer-bt-btn.connected { border-color: var(--green-accent); color: var(--green-accent); }

.timer-bt-name {
  font-size: 0.7rem;
  color: var(--green-accent);
  text-align: center;
  min-height: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── BRACKET VIEW (Por zona) ── */
.bracket-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.bracket-view {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 4px 0 8px;
  min-width: max-content;
}

.bracket-round-col {
  display: flex;
  flex-direction: column;
  width: 148px;
  flex-shrink: 0;
}

.bracket-round-header {
  background: var(--green-dark);
  color: var(--white);
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 6px 4px;
  border-radius: 6px 6px 0 0;
  margin: 0 4px;
}

.bracket-matches-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 8px 4px;
  gap: 8px;
}

.bracket-match-card {
  border: 1.5px solid var(--gray-mid);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}
.bracket-match-card:not(.bracket-tbd):active {
  border-color: var(--green-light);
  box-shadow: 0 2px 8px rgba(82,183,136,0.3);
}
.bracket-match-card.bracket-tbd {
  cursor: default;
  opacity: 0.65;
}
.bracket-match-card.bracket-finished {
  border-color: var(--green-light);
}

.bracket-team-slot {
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green-dark);
  border-bottom: 1px solid var(--gray-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  line-height: 1.2;
}
.bracket-team-slot:last-child { border-bottom: none; }
.bracket-team-slot.bracket-winner {
  background: var(--green-light);
  color: var(--white);
}
.bracket-team-slot.bracket-loser {
  color: var(--gray-text);
  text-decoration: line-through;
  text-decoration-color: var(--gray-mid);
}
.bracket-team-slot.bracket-tbd-slot {
  color: var(--gray-text);
  font-style: italic;
  background: var(--gray-light);
  font-weight: 400;
}

/* Connector between bracket columns */
.bracket-connector-col {
  width: 20px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding-top: 30px; /* offset for header */
}

.bracket-conn-pair {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.bracket-conn-top {
  flex: 1;
  border-right: 2px solid var(--gray-mid);
  border-bottom: 2px solid var(--gray-mid);
  border-bottom-right-radius: 4px;
}
.bracket-conn-bottom {
  flex: 1;
  border-right: 2px solid var(--gray-mid);
  border-top: 2px solid var(--gray-mid);
  border-top-right-radius: 4px;
}

/* ── CHAMPION REST (positions 4+) ── */
.champion-rest {
  width: 100%;
  max-width: 320px;
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  -webkit-overflow-scrolling: touch;
}
.champion-rest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
}
.champion-rest-item:last-child { border-bottom: none; }
.champion-rest-pos {
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  min-width: 28px;
  font-size: 0.78rem;
}
.champion-rest-name { font-weight: 600; flex: 1; }

/* ── CHAMPION RATING ── */
.champion-rating {
  width: 100%; max-width: 340px;
  margin: 18px auto 0;
  padding: 16px;
  background: rgba(255,255,255,.28);
  border-radius: 14px;
  text-align: center;
}
.rating-label {
  font-size: .85rem;
  color: rgba(255,255,255,.75);
  margin: 0 0 12px;
}
.rating-stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}
.rating-star {
  background: none;
  border: none;
  font-size: 2rem;
  color: rgba(255,255,255,.25);
  cursor: pointer;
  padding: 0 2px;
  transition: color .15s, transform .1s;
  line-height: 1;
}
.rating-star.hover,
.rating-star.selected { color: #f59e0b; }
.rating-star:active { transform: scale(1.2); }
.rating-thanks {
  font-size: .82rem;
  color: rgba(255,255,255,.7);
  margin: 6px 0 10px;
}
.btn-google-review {
  display: inline-block;
  background: #fff;
  color: #1a3a2a;
  font-weight: 700;
  font-size: .85rem;
  padding: 9px 18px;
  border-radius: 20px;
  text-decoration: none;
  transition: opacity .2s;
}
.btn-google-review:hover { opacity: .85; }
.btn-share-app {
  background: var(--green-mid);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: .88rem;
  padding: 10px 22px;
  border-radius: 20px;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-share-app:hover { opacity: .85; }

/* ── AUDIO DEVICE PICKER ── */
.audio-device-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}
.audio-device-btn {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gray-mid);
  border-radius: 10px;
  background: var(--gray-light);
  color: var(--green-dark);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  line-height: 1.3;
}
.audio-device-btn:hover { border-color: var(--green-light); background: #e8f4ee; }
.audio-device-btn.selected { border-color: var(--green-mid); background: #d0eddd; font-weight: 700; }
.audio-device-section {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-text);
  padding: 6px 2px 2px;
  margin-top: 4px;
}
.audio-device-scan-btn {
  border-style: dashed;
  border-color: var(--green-light);
  background: #f0faf4;
  color: var(--green-mid);
  font-size: 0.84rem;
}
.audio-device-scan-btn:hover { background: #e0f5e8; }
.audio-device-bt-item { border-color: #b0cfe0; background: #f0f8ff; }
.audio-device-clear {
  border-color: #f0c0c0;
  background: #fff5f5;
  color: #a03030;
  font-size: 0.8rem;
  margin-top: 4px;
}
.audio-device-tip {
  font-size: 0.74rem;
  color: var(--gray-text);
  text-align: center;
  margin-top: 10px;
  line-height: 1.4;
  padding: 0 4px;
}

/* ── HEADER ACTION BUTTONS (sorteo, edit-teams) ── */
.btn-header-action {
  background: rgba(255,255,255,0.15);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 1.2rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}
.btn-header-action:active { background: rgba(255,255,255,0.28); }

/* ── TEAM ITEM WITH PLAYERS ── */
.team-item {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 8px 8px 8px 12px;
}
.team-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.team-name-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--green-dark);
  font-weight: 600;
  min-height: 34px;
  outline: none;
}
.team-name-input::placeholder { color: var(--gray-text); }
.team-players {
  display: flex;
  gap: 6px;
  padding-left: 0;
}
.player-input {
  flex: 1;
  border: 1px solid var(--gray-mid);
  border-radius: 6px;
  background: var(--white);
  font-size: 0.78rem;
  color: var(--green-dark);
  font-weight: 500;
  padding: 5px 8px;
  outline: none;
  min-height: 30px;
  transition: border-color var(--transition);
}
.player-input:focus { border-color: var(--green-light); }
.player-input::placeholder { color: var(--gray-mid); }

/* ── ZONA — GROUP SECTION ── */
.group-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 0;
}
.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--green-mid);
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
}
.group-progress {
  font-size: 0.75rem;
  opacity: 0.8;
}
.group-standings {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.group-table {
  width: 100%;
  font-size: 0.78rem;
  border-collapse: collapse;
  min-width: 260px;
}
.group-table thead tr { background: var(--green-dark); color: var(--white); }
.group-table thead th {
  padding: 7px 6px;
  text-align: center;
  font-weight: 700;
  font-size: 0.7rem;
}
.group-table thead th:nth-child(2) { text-align: left; }
.group-table tbody tr { border-bottom: 1px solid var(--gray-light); }
.group-table tbody td { padding: 7px 6px; text-align: center; font-weight: 600; color: var(--green-dark); }
.group-table tbody td:nth-child(2) { text-align: left; font-weight: 700; font-size: 0.8rem; }
.group-table tbody tr.qualifies { background: rgba(82,183,136,0.08); }

.knockout-section .group-header { background: var(--green-dark); }
.knockout-header { background: var(--green-dark) !important; }

/* ── POSITIONS TABLE — GROUP ROW HEADER ── */
.group-row-header td {
  background: var(--green-mid);
  color: var(--white);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 6px 10px;
  text-align: left;
}

/* ── EDIT TEAMS MODAL ── */
.edit-teams-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}
.edit-team-row {
  background: var(--gray-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.edit-team-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-text);
  margin-bottom: 6px;
}
.edit-team-input {
  width: 100%;
  border: 1.5px solid var(--gray-mid);
  border-radius: 6px;
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green-dark);
  padding: 8px 10px;
  outline: none;
  margin-bottom: 6px;
  transition: border-color var(--transition);
}
.edit-team-input:focus { border-color: var(--green-light); }
.edit-team-players {
  display: flex;
  gap: 6px;
}
.edit-player-input {
  flex: 1;
  border: 1.5px solid var(--gray-mid);
  border-radius: 6px;
  background: var(--white);
  font-size: 0.8rem;
  color: var(--green-dark);
  padding: 7px 10px;
  outline: none;
  transition: border-color var(--transition);
}
.edit-player-input:focus { border-color: var(--green-light); }
.edit-player-input::placeholder { color: var(--gray-mid); font-size: 0.75rem; }

/* ── SORTEO OVERLAY ── */
.sorteo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 450;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sorteo-modal {
  position: relative;
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 420px;
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-height: 92vh;
  overflow: hidden;
}

.sorteo-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
  border-radius: var(--radius) var(--radius) 0 0;
}
.sorteo-header {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1rem;
  color: var(--green-dark);
}
.sorteo-close-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: var(--gray-text);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  min-height: 36px;
}
.sorteo-close-btn:active { background: var(--gray-light); }
.sorteo-canvas {
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  max-width: 300px;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  display: block;
}
.sorteo-result {
  text-align: center;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.sorteo-winner-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sorteo-winner-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--green-dark);
}
.sorteo-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}
.sorteo-again-btn {
  background: var(--green-mid);
}

/* ── SORTEO MODE TOGGLE ── */
.sorteo-mode-toggle {
  display: flex;
  border: 2px solid var(--gray-mid);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: 100%;
}
.sorteo-mode-btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  background: var(--white);
  color: var(--gray-text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 40px;
}
.sorteo-mode-btn.active {
  background: var(--green-mid);
  color: var(--white);
}

/* ── SETS ENTRY GRID ── */
.sets-grid { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 0; }
.sets-header, .sets-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) repeat(3, 74px);
  gap: 4px;
  align-items: center;
}
.sets-col-lbl {
  text-align: center;
  font-size: .68rem;
  color: var(--gray-text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.sets-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--green-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 4px;
}
.set-col {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.set-dec, .set-inc {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 1px solid var(--green-mid);
  background: var(--green-mid);
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.set-dec:active, .set-inc:active { background: var(--green-dark); border-color: var(--green-dark); }
.set-val {
  width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--green-dark);
}
.sets-result {
  text-align: center;
  font-size: .78rem;
  color: var(--gray-text);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--card-border);
}
.sets-score { font-weight: 700; color: var(--green-dark); }
.sets-won { color: var(--gray-text); }
.match-score-sets { font-size: .72rem !important; line-height: 1.5; }

/* ── BELL ── */
.bell-wrap { position: relative; display: flex; align-items: center; }
.bell-btn {
  background: none; border: none; cursor: pointer; padding: 6px;
  color: var(--header-text, #fff); position: relative; display: flex; align-items: center;
  border-radius: 8px; transition: background .15s;
}
.bell-btn:hover { background: rgba(255,255,255,.12); }
.bell-badge {
  position: absolute; top: 1px; right: 1px;
  min-width: 16px; height: 16px; background: #ef4444;
  border-radius: 8px; border: 1.5px solid var(--green-dark, #1a3a2a);
  font-size: 10px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; line-height: 1;
}

/* ── UPDATE PROGRESS OVERLAY ── */
#update-progress-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.72);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
}
.update-progress-box {
  background: #fff; border-radius: 18px; padding: 36px 44px;
  min-width: 280px; max-width: 340px; width: 90%; text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,.3);
}
.update-progress-label {
  font-size: 1rem; font-weight: 700; color: var(--green-dark); margin-bottom: 20px;
  transition: color .3s;
}
.update-progress-bar-wrap {
  background: #e8f0e8; border-radius: 8px; height: 10px; overflow: hidden; margin-bottom: 10px;
}
.update-progress-bar {
  height: 100%; background: var(--green-mid); border-radius: 8px;
  width: 0%; transition: width .12s ease;
}
.update-progress-pct {
  font-size: .88rem; color: var(--gray-text); font-weight: 600;
}
.bell-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.18);
  min-width: 260px; max-width: 320px; z-index: 500; overflow: hidden;
}
.bell-dropdown-title {
  padding: 12px 16px 8px; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #6b7c74);
  border-bottom: 1px solid #f0f0f0;
}
.bell-notif {
  padding: 12px 16px; border-bottom: 1px solid #f5f5f5;
  display: flex; flex-direction: column; gap: 6px;
}
.bell-notif-text { font-size: .85rem; color: #1a1a1a; }
.bell-notif-btn {
  align-self: flex-start; background: var(--green-dark, #1a3a2a); color: #fff;
  border: none; border-radius: 6px; padding: 5px 12px; font-size: .78rem;
  font-weight: 700; cursor: pointer;
}
.bell-empty { padding: 16px; font-size: .82rem; color: var(--muted, #6b7c74); margin: 0; text-align: center; }

/* ── UPDATE BANNER ── */
.update-banner {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green-dark);
  color: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  z-index: 600;
  white-space: nowrap;
}
.update-banner-btn {
  background: #fff;
  color: var(--green-dark);
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
}
.update-banner-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  cursor: pointer;
  font-size: .85rem;
  padding: 2px;
}
.update-banner-close:hover { color: #fff; }

/* ── AD CAROUSEL ── */
.ad-carousel {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  height: var(--ad-h);
  background: #e8e8e8;
  overflow: hidden;
}
.ad-carousel.hidden { display: none; }
.ad-carousel-inner {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease;
  will-change: transform;
}
.ad-slide {
  flex: 0 0 100%;
  height: 100%;
}
.ad-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e0e0e0;
  color: #aaa;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  height: 100%;
}

/* ── NOTIFICATION PROMPT (viewer) ── */
.notif-prompt {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a3a2a;
  color: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  z-index: 2000;
  max-width: 92vw;
  animation: slideUp .3s ease;
}
.notif-prompt-text { font-size: .84rem; flex: 1; }
.notif-prompt-btn {
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.notif-prompt-yes { background: #52b788; color: #fff; }
.notif-prompt-no  { background: rgba(255,255,255,.15); color: #fff; }

/* ── PAYWALL ── */
.paywall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
}
.paywall-modal {
  background: #fff;
  border-radius: 20px;
  padding: 32px 24px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,.3);
}
.paywall-icon { font-size: 2.8rem; margin-bottom: 10px; }
.paywall-title { font-size: 1.3rem; font-weight: 800; color: var(--green-dark); margin-bottom: 8px; }
.paywall-desc { color: var(--gray-text); font-size: .88rem; margin-bottom: 18px; line-height: 1.5; }
.paywall-features {
  list-style: none;
  text-align: left;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.paywall-features li { font-size: .88rem; color: var(--green-dark); }
.btn-paywall-mp {
  width: 100%;
  padding: 13px 16px;
  background: var(--green-dark);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
  transition: background var(--transition);
}
.btn-paywall-mp:hover { background: var(--green-mid); }
.mp-logo { height: 18px; filter: brightness(0) invert(1); }
.btn-paywall-close {
  background: none;
  border: none;
  color: var(--gray-text);
  font-size: .85rem;
  cursor: pointer;
  padding: 6px 12px;
}
.btn-paywall-close:hover { color: var(--green-dark); }

/* Paywall — plan único */
.paywall-price-block { margin: 0 0 18px; }
.paywall-price-premium {
  font-size: 2rem;
  font-weight: 800;
  color: var(--green-mid);
  line-height: 1;
}
.paywall-price-premium span {
  font-size: .8rem;
  font-weight: 500;
  color: var(--gray-text);
}
.paywall-free-note {
  font-size: .75rem;
  color: var(--gray-text);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--bg-light);
  border-radius: 8px;
}

/* Botón bloqueado por plan */
.btn--plan-locked {
  opacity: 0.45;
  position: relative;
}
.btn--plan-locked::after {
  content: '🔒';
  font-size: .65em;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── VIEWER MODE ── */
.viewer-banner { display: none; }
.viewer-footer {
  margin: 24px 0 16px;
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.viewer-cta-btn {
  display: inline-block;
  background: var(--green-dark);
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  text-align: center;
  letter-spacing: .02em;
  transition: background .15s;
}
.viewer-cta-btn:hover { background: var(--green-mid); color: #fff; }
.viewer-copyright {
  font-size: .7rem;
  color: var(--gray-text);
  text-align: center;
  margin: 0;
}
.sorteo-notif-time {
  color: var(--gray-text);
  font-size: .75rem;
  margin-left: 6px;
}
/* ── PAYMENT MODAL ─────────────────────────────────────── */
.pay-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  padding: 16px;
}
.pay-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,.3);
  position: relative;
}
.pay-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--gray-text);
  z-index: 1;
  padding: 6px 8px;
  line-height: 1;
  border-radius: 50%;
}
.pay-close:hover { background: #f0f4f0; }
.pay-modal-header { padding: 28px 24px 12px; text-align: center; }
.pay-modal-icon { font-size: 2.2rem; margin-bottom: 6px; }
.pay-modal-title { font-size: 1.05rem; font-weight: 800; color: var(--green-dark); }
.pay-modal-price { font-size: 1.7rem; font-weight: 800; color: var(--green); margin: 4px 0 0; }
.pay-modal-price span { font-size: .8rem; font-weight: 400; color: var(--gray-text); }
.pay-brick-wrap { padding: 0 16px 8px; min-height: 300px; }
.pay-status { padding: 12px 24px 20px; text-align: center; font-size: .92rem; font-weight: 500; }
.pay-status--processing { color: var(--gray-text); }
.pay-status--error { color: #c0392b; }
.pay-status--pending { color: #e65100; }

.viewer-org-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}
.viewer-org-photo {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.35);
  flex-shrink: 0;
}
.viewer-org-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.viewer-org-name {
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── AUTH SCREEN ── */
#screen-auth {
  min-height: 100dvh;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 48px;
  background: linear-gradient(150deg, rgba(26,58,42,0.88) 0%, rgba(45,106,79,0.80) 100%), url('./imagenes/paddle-tennis-white-line.jpg') center/cover no-repeat;
}
#screen-auth.active { display: flex; }

.auth-container {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.auth-logo { text-align: center; }
.auth-logo-icon { font-size: 3rem; line-height: 1; margin-bottom: 8px; }
.auth-logo-img { width: 260px; height: 260px; object-fit: contain; display: block; margin: 0 auto 2px; }
.auth-title { font-size: 1.35rem; font-weight: 800; color: #fff; letter-spacing: -.3px; text-align: center; margin-bottom: 8px; line-height: 1.25; }
.auth-features { width: 100%; display: flex; flex-direction: column; gap: 9px; }
.auth-feat { display: flex; align-items: flex-start; gap: 11px; background: rgba(15,40,25,.70); border: 1px solid rgba(82,183,136,.45); border-radius: 13px; padding: 12px 15px; box-shadow: 0 3px 14px rgba(0,0,0,.3); }
.auth-feat-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.auth-feat div { color: rgba(255,255,255,.82); font-size: .8rem; line-height: 1.38; }
.auth-feat strong { color: #74c69d; font-weight: 700; display: block; font-size: .83rem; margin-bottom: 1px; }
.auth-subtitle { color: rgba(255,255,255,.65); font-size: .9rem; margin-top: 4px; }
.auth-free-badge {
  display: inline-block;
  margin-top: 10px;
  background: rgba(82,183,136,.25);
  border: 1px solid rgba(82,183,136,.5);
  color: #74c69d;
  font-size: .78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: .02em;
}

.auth-card {
  width: 100%;
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-light);
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: .9rem;
  color: var(--gray-text);
  cursor: pointer;
  font-weight: 500;
  transition: color var(--transition), border-color var(--transition);
}
.auth-tab.active {
  color: var(--green-mid);
  border-bottom-color: var(--green-mid);
  font-weight: 700;
}

.auth-hidden { display: none !important; }

.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--gray-text);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.auth-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--card-border);
  border-radius: 10px;
  font-size: .95rem;
  color: var(--green-dark);
  background: var(--gray-light);
  transition: border-color var(--transition);
}
.auth-field input:focus {
  outline: none;
  border-color: var(--green-mid);
  background: #fff;
}
.auth-error {
  color: #e53e3e;
  font-size: .78rem;
  min-height: 18px;
  margin-bottom: 6px;
}
#form-login .btn-primary,
#form-register .btn-primary { width: 100%; margin-top: 4px; }

/* Password eye toggle */
.auth-pass-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-pass-wrap input {
  width: 100%;
  padding-right: 42px;
}
.auth-pass-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--gray-text);
  display: flex;
  align-items: center;
}
.auth-pass-toggle:hover { color: var(--green-mid); }
.eye-icon { width: 18px; height: 18px; display: block; }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
  color: #ccc;
  font-size: .8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
}

/* Google button */
.btn-google {
  width: 100%;
  padding: 11px 14px;
  background: #fff;
  color: #3c4043;
  border: 1.5px solid #dadce0;
  border-radius: 10px;
  font-size: .92rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background var(--transition), box-shadow var(--transition);
}
.btn-google:hover { background: #f8f9fa; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.google-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* Club photo upload */
.auth-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}
.auth-photo-circle {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--gray-light);
  border: 2px dashed var(--card-border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition);
}
.auth-photo-circle:hover { border-color: var(--green-mid); }
.auth-photo-placeholder { font-size: 1.8rem; line-height: 1; }
.auth-photo-btn {
  font-size: .78rem;
  color: var(--green-mid);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* Guest button */
.auth-guest-btn {
  color: rgba(255,255,255,.8);
  background: none;
  border: none;
  font-size: .92rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 0;
}
.auth-guest-btn:hover { color: #fff; }
.auth-guest-note {
  color: rgba(255,255,255,.45);
  font-size: .72rem;
  text-align: center;
}
.auth-legal-links {
  font-size: .7rem;
  color: rgba(255,255,255,.35);
  text-align: center;
  margin-top: 4px;
}
.auth-legal-links a {
  color: rgba(255,255,255,.5);
  text-decoration: underline;
}
.auth-legal-links a:hover { color: rgba(255,255,255,.8); }

/* User badge in setup header */
.auth-user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
  position: relative;
}
.auth-user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--green-mid);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.auth-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.auth-user-club {
  display: none;
}
.auth-logout-btn {
  background: none;
  border: none;
  font-size: .85rem;
  color: var(--gray-text);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.auth-logout-btn:hover { color: var(--green-dark); background: var(--gray-light); }

.btn-nav-upgrade {
  display: none;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  letter-spacing: .02em;
  box-shadow: 0 2px 10px rgba(245,158,11,.45);
  white-space: nowrap;
  transition: opacity .15s, transform .15s, box-shadow .15s;
  flex-shrink: 0;
}
.btn-nav-upgrade:hover {
  opacity: .92;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245,158,11,.55);
}

.user-plan-badge {
  font-size: .6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.user-plan-badge--free    { background: rgba(251,191,36,.18); color: #fbbf24; }
.user-plan-badge--basic   { background: rgba(96,165,250,.18); color: #93c5fd; }
.user-plan-badge--premium { background: rgba(52,211,153,.18); color: #6ee7b7; }

.auth-remember-row { display:flex; align-items:center; justify-content:space-between; margin: -4px 0 8px; }
.auth-remember-label { display:flex; align-items:center; gap:6px; font-size:.82rem; color:var(--gray-text); cursor:pointer; user-select:none; }
.auth-remember-label input[type=checkbox] { width:15px; height:15px; accent-color:var(--green-mid); cursor:pointer; }
.auth-forgot { text-align: right; }
.auth-forgot button {
  background: none;
  border: none;
  color: var(--green-mid);
  font-size: .8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px 2px 2px;
  border-radius: 6px;
}
.user-menu-btn:hover { background: rgba(116,198,157,.22); }
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: 10px;
  padding: 5px;
  min-width: 150px;
  box-shadow: var(--shadow);
  z-index: 200;
  display: none;
}
.user-dropdown.open { display: block; }
.user-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--green-dark);
}
.user-dropdown-item:hover { background: var(--gray-light); }
.user-dropdown-item--danger { color: var(--danger); }
.user-dropdown-item--disabled { opacity: .45; cursor: default; }
.user-dropdown-item--disabled:hover { background: none; }
.user-dropdown-sep { height: 1px; background: var(--gray-mid); margin: 4px 0; }

.header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
.header-brand > div:last-child { min-width: 0; overflow: hidden; }
.header-app-logo { height: 46px; width: auto; object-fit: contain; display: block; flex-shrink: 0; }
.header-club-logo {
  width: 38px; height: 38px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  display: none;
  background: var(--gray-light);
}
.header-club-logo img { width: 100%; height: 100%; object-fit: cover; }

/* ── CRUCE DE ZONAS ── */
.cruce-section { margin-top: 16px; }
.cruce-match-label {
  font-size: .68rem;
  font-weight: 700;
  color: var(--green-mid);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 0 0 4px;
}
.zona-sub-title {
  font-size: .78rem;
  font-weight: 600;
  color: var(--green-dark);
  margin: 10px 0 4px;
  opacity: .8;
}
.zona-cruce-opts .radio-group {
  flex-direction: column;
  border: none;
  background: none;
  gap: 6px;
  overflow: visible;
}
.zona-cruce-opts .radio-option {
  border: 1.5px solid var(--gray-mid);
  border-radius: var(--radius-sm);
}
.zona-cruce-opts .radio-option label {
  justify-content: flex-start;
  padding: 10px 12px;
  font-size: 0.82rem;
  text-align: left;
  min-height: 40px;
}
.zona-cruce-opts .radio-option input:checked + label {
  background: rgba(45,106,79,0.09);
  color: var(--green-dark);
  box-shadow: inset 3px 0 0 var(--green-mid);
}

.pair-hint {
  font-size: .72rem;
  font-weight: 400;
  color: var(--gray-text);
  margin-left: 4px;
}

.viewer-org-label {
  font-size: .78rem;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 480px)
   ══════════════════════════════════════════ */
@media (max-width: 480px) {

  /* ── Header: 2 filas en mobile ── */
  .app-header {
    padding: calc(10px + env(safe-area-inset-top)) 12px 8px;
  }
  .app-header h1 {
    font-size: 1.05rem;
  }
  .app-header p {
    font-size: 0.72rem;
  }
  /* Fila 1: título a la izquierda, campana+plan+avatar a la derecha */
  .header-row {
    display: flex;
    flex-wrap: wrap;
    row-gap: 6px;
    column-gap: 4px;
  }
  .header-brand {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
  }
  .header-right {
    order: 2;
    flex: 0 0 auto;
  }
  /* Fila 2: botones de acción centrados */
  .header-center {
    order: 3;
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
  }
  .btn-save-session,
  .btn-cloud-share,
  .btn-cloud-sync,
  .btn-header-action,
  .btn-timer-toggle {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  /* Club name hidden on mobile — plan badge + avatar + chevron son suficientes */
  .auth-user-club {
    display: none;
  }
  .btn-nav-upgrade {
    font-size: .65rem;
    padding: 5px 10px;
  }
  .user-plan-badge {
    font-size: .55rem;
    padding: 2px 5px;
  }
  /* Chevron más visible en el botón de menú */
  .user-menu-btn svg {
    opacity: 0.85;
  }

  /* ── Content & Cards ── */
  .content {
    padding: 10px;
    gap: 10px;
  }
  .card {
    padding: 12px;
  }

  /* ── Stepper (canchas) ── */
  .stepper {
    width: 100%;
  }
  .stepper-value {
    flex: 1;
    width: auto;
  }

  /* ── Grilla de tiempos: 3 col → 2 col ── */
  .time-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .time-btn {
    font-size: 0.75rem;
    padding: 8px 4px;
    min-height: 40px;
  }

  /* ── Inputs de jugadores: lado a lado → columna ── */
  .team-players {
    flex-direction: column;
    gap: 5px;
  }
  .player-input {
    width: 100%;
    min-height: 38px;
    font-size: 0.82rem;
    padding: 8px 10px;
  }
  .team-name-input {
    font-size: 0.88rem;
    min-height: 38px;
  }

  /* Prevent iOS auto-zoom on input focus */
  input, textarea, select {
    font-size: 16px !important;
  }

  /* ── Botón generar ── */
  .btn-primary {
    font-size: 0.92rem;
    padding: 14px;
    min-height: 48px;
  }

  /* ── Bottom nav (muy angosto) ── */
  .nav-tab {
    font-size: 0.62rem;
    gap: 2px;
  }
  .nav-tab svg {
    width: 20px;
    height: 20px;
  }

  /* ── Paywall modal ── */
  .paywall-modal {
    padding: 20px 16px;
    margin: 12px;
  }
  .paywall-price-premium {
    font-size: 1.7rem;
  }

  /* ── Modales genéricos ── */
  .modal-box,
  .modal-inner {
    margin: 12px;
    padding: 20px 14px;
  }
}

/* ══════════════════════════════════════════
   RESPONSIVE — iPhone SE y más angostos (≤ 375px)
   ══════════════════════════════════════════ */
@media (max-width: 375px) {
  .app-header h1 {
    font-size: 0.95rem;
  }
  .time-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}

/* ══════════════════════════════════════════
   RESPONSIVE — TABLET (≥ 768px)
   ══════════════════════════════════════════ */
@media (min-width: 768px) {
  .content {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    padding: 20px 24px;
    gap: 18px;
  }
  .card {
    padding: 20px;
  }
  /* Wider auth container */
  .auth-container {
    max-width: 460px;
  }
  /* Nav tabs: más espacio */
  .nav-tab {
    font-size: 0.75rem;
    gap: 4px;
  }
  .nav-tab svg {
    width: 24px;
    height: 24px;
  }
  /* Time grid: más columnas */
  .time-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1200px) {
  .content {
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding: 16px;
    gap: 16px;
  }
  .card { padding: 16px; }
}

/* ── INSTALL MODAL (bottom sheet) ── */
#install-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 700;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.install-sheet {
  position: relative;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 28px 24px 44px;
  width: 100%;
  max-width: 520px;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.25,.8,.25,1);
}
.install-sheet--open { transform: translateY(0); }
.install-sheet-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; font-size: 1.1rem;
  cursor: pointer; color: var(--gray-text);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.install-sheet-close:hover { background: var(--gray-light); }
.install-modal-icon { font-size: 2.2rem; text-align: center; margin-bottom: 8px; }
.install-modal-title {
  font-size: 1.1rem; font-weight: 800; color: var(--green-dark);
  text-align: center; margin-bottom: 8px;
}
.install-modal-sub {
  font-size: .88rem; color: var(--gray-text);
  text-align: center; margin-bottom: 20px; line-height: 1.5;
}
.install-steps { display: flex; flex-direction: column; gap: 10px; }
.install-step {
  display: flex; align-items: center; gap: 14px;
  background: #f5fdf8; border-radius: 12px; padding: 12px 16px;
  border: 1px solid #d8eed8;
}
.install-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--green-dark); color: #fff;
  font-weight: 800; font-size: .82rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.install-step-text { font-size: .88rem; color: var(--green-dark); line-height: 1.4; }
.install-step-text svg { vertical-align: middle; margin: 0 2px; }
