@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800;900&family=Oswald:wght@500;700&display=swap');

:root {
  --bg-dark: #0a0a0c;
  --bg-panel: #141418;
  --bg-card: #1b1b20;
  --bg-input: #0f0f12;
  --red-primary: #e30613;
  --red-dark: #9e040d;
  --red-glow: rgba(227, 6, 19, 0.35);
  --yellow-rangers: #ffde00;
  --text-main: #f4f4f6;
  --text-muted: #9ca3af;
  --border-subtle: #2a2a32;
  --success: #10b981;
  --warning: #f59e0b;
}

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

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  background-image:
    linear-gradient(135deg, rgba(10, 10, 12, 0.92) 0%, rgba(18, 18, 22, 0.88) 65%, rgba(158, 4, 13, 0.25) 100%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 2px, transparent 2px, transparent 8px);
  background-attachment: fixed;
}

/* Franja diagonal estilo afiche oficial */
.diagonal-stripe {
  position: fixed;
  top: 0;
  right: 0;
  width: 28vw;
  height: 100vh;
  background: linear-gradient(110deg, transparent 35%, rgba(227, 6, 19, 0.14) 35.5%, rgba(227, 6, 19, 0.22) 60%, rgba(0, 0, 0, 0.85) 60.5%);
  pointer-events: none;
  z-index: 0;
}

.app-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.top-header {
  background: rgba(12, 12, 15, 0.95);
  border-bottom: 2px solid var(--red-primary);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.copa-logo-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f4f4f6;
  box-shadow: 0 2px 10px rgba(0,0,0,0.45);
  padding: 4px 10px 4px 6px;
  border-radius: 6px;
  border-left: 4px solid var(--red-primary);
}

.copa-logo-box img {
  height: 52px;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
}

.rangers-logo {
  height: 56px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(255, 222, 0, 0.25));
}

.event-title-block h1 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.55rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1.1;
}

.event-title-block h1 span {
  color: var(--red-primary);
}

.event-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.event-subtitle strong {
  color: var(--yellow-rangers);
}

.user-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.role-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
}

.role-badge.admin {
  border-color: var(--yellow-rangers);
  color: var(--yellow-rangers);
}

.role-badge.team {
  border-color: var(--red-primary);
  color: #fff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.btn-primary {
  background: var(--red-primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--red-glow);
}

.btn-primary:hover {
  background: #ff1220;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  background: #24242b;
}

.btn-gold {
  background: var(--yellow-rangers);
  color: #0a0a0c;
}

.btn-gold:hover {
  background: #ffe84d;
}

.btn-danger {
  background: rgba(227, 6, 19, 0.15);
  color: #ff5c66;
  border: 1px solid rgba(227, 6, 19, 0.4);
}

.btn-danger:hover {
  background: var(--red-primary);
  color: #fff;
}

.btn-sm {
  padding: 0.38rem 0.75rem;
  font-size: 0.75rem;
}

/* Login Screen */
.login-container {
  flex: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  max-width: 1180px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
  gap: 2.5rem;
  align-items: center;
}

.hero-showcase {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.65);
}

.hero-showcase::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red-primary), var(--yellow-rangers), var(--red-primary));
}

.hero-top-logos {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.hero-copa-corner {
  background: #f4f4f6;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  padding: 6px 12px;
  border-radius: 8px;
  border-bottom: 3px solid var(--red-primary);
}

.hero-copa-corner img {
  height: 76px;
  display: block;
}

.hero-rangers-corner img {
  height: 82px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.8));
}

.hero-headline {
  font-family: 'Oswald', sans-serif;
  font-size: 2.6rem;
  line-height: 1.02;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hero-headline span {
  color: var(--red-primary);
  display: block;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.teams-grid-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.team-slot-box {
  background: linear-gradient(180deg, #1d1d22 0%, #101013 100%);
  border: 1px solid #2b2b33;
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.team-slot-box.host {
  border-color: var(--red-primary);
  box-shadow: inset 0 0 18px rgba(227, 6, 19, 0.25);
}

.slot-num {
  color: var(--text-muted);
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
}

.team-slot-box.host .slot-num {
  color: var(--yellow-rangers);
}

.hero-footer-meta {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
  text-align: center;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  font-size: 1rem;
}

.hero-footer-meta .loc {
  color: var(--red-primary);
  font-size: 0.88rem;
  margin-top: 2px;
}

/* Login Card */
.login-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2.25rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.65);
}

.login-card h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.75rem;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.login-card p.sub {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.4px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.72rem 0.95rem;
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.92rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.15);
}

.alert-box {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: none;
}

.alert-box.error {
  display: block;
  background: rgba(227, 6, 19, 0.15);
  border: 1px solid var(--red-primary);
  color: #ff7b83;
}

.alert-box.success {
  display: block;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--success);
  color: #6ee7b7;
}

.credentials-helper {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.credentials-helper summary {
  cursor: pointer;
  color: var(--yellow-rangers);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.cred-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-top: 0.5rem;
  background: var(--bg-input);
  padding: 0.75rem;
  border-radius: 6px;
}

/* Main Dashboard Content */
.main-content {
  max-width: 1260px;
  width: 100%;
  margin: 1.75rem auto;
  padding: 0 1.5rem 3rem;
  flex: 1;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-header h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-header h2 span {
  color: var(--red-primary);
}

.action-bar {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Stats Cards (Admin) */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--red-primary);
  border-radius: 8px;
  padding: 1.15rem 1.25rem;
}

.stat-card.gold {
  border-left-color: var(--yellow-rangers);
}

.stat-card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.stat-card .value {
  font-family: 'Oswald', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

/* Roster Form Panels */
.roster-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.panel-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.25rem;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.counter-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.counter-pill.ok {
  border-color: var(--success);
  color: var(--success);
}

.counter-pill.warn {
  border-color: var(--warning);
  color: var(--warning);
}

/* Player & Staff Rows */
.roster-table-wrapper {
  overflow-x: auto;
}

.roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.roster-table th {
  text-align: left;
  padding: 0.75rem 0.65rem;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-subtle);
}

.roster-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.roster-table tr.gk-row {
  background: rgba(255, 222, 0, 0.04);
}

.role-tag {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.role-tag.gk {
  background: rgba(255, 222, 0, 0.18);
  color: var(--yellow-rangers);
  border: 1px solid rgba(255, 222, 0, 0.4);
}

.role-tag.player {
  background: rgba(227, 6, 19, 0.18);
  color: #ff6b74;
  border: 1px solid rgba(227, 6, 19, 0.4);
}

.role-tag.coach {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.role-tag.pf {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.table-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.48rem 0.65rem;
  border-radius: 5px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
}

.table-input:focus {
  outline: none;
  border-color: var(--red-primary);
}

.table-input.num-input {
  width: 72px;
  text-align: center;
  font-weight: 700;
}

/* Admin Teams Overview Grid */
.admin-teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 1.15rem;
  margin-bottom: 2rem;
}

.team-admin-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s;
}

.team-admin-card:hover {
  border-color: var(--red-primary);
  transform: translateY(-2px);
}

.team-admin-card .card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.team-admin-card h4 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;
  text-transform: uppercase;
}

.team-admin-card .team-code {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.team-metrics {
  display: flex;
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
  font-size: 0.8rem;
}

.metric-chip {
  background: var(--bg-card);
  padding: 0.35rem 0.6rem;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}

/* Footer */
.app-footer {
  background: #08080a;
  border-top: 1px solid var(--border-subtle);
  padding: 1.1rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.app-footer strong {
  color: var(--text-main);
}

@media (max-width: 900px) {
  .login-container {
    grid-template-columns: 1fr;
  }
  .diagonal-stripe {
    display: none;
  }
}

/* Document Photo Upload & Modal Preview */
.doc-upload-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 165px;
}

.file-btn-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  color: var(--text-main);
  padding: 0.4rem 0.65rem;
  border-radius: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.file-btn-label:hover {
  border-color: var(--yellow-rangers);
  color: var(--yellow-rangers);
}

.file-btn-label.has-file {
  border-style: solid;
  border-color: var(--success);
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
}

.doc-thumb-btn {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid var(--yellow-rangers);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: #000;
  flex-shrink: 0;
}

.doc-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.doc-remove-btn {
  background: transparent;
  border: none;
  color: #ff6b74;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0 4px;
}

.doc-remove-btn:hover {
  color: #fff;
}

/* Modal Lightbox para ver foto Carnet / DNI */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--bg-panel);
  border: 1px solid var(--red-primary);
  border-radius: 10px;
  max-width: 680px;
  width: 100%;
  padding: 1.25rem;
  box-shadow: 0 24px 60px rgba(0,0,0,0.85);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h4 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;
  text-transform: uppercase;
}

.modal-body {
  text-align: center;
  background: #08080a;
  border-radius: 8px;
  padding: 0.75rem;
  max-height: 70vh;
  overflow: auto;
}

.modal-body img {
  max-width: 100%;
  max-height: 62vh;
  border-radius: 6px;
}

/* Grilla de 8 Equipos con Escudos Extraídos en Pantalla Inicial */
.team-slot-box {
  background: linear-gradient(180deg, #1d1d22 0%, #101013 100%);
  border: 1px solid #2b2b33;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.45rem;
  min-height: 96px;
  position: relative;
  transition: transform 0.2s, border-color 0.2s;
}

.team-slot-box.confirmed {
  border-color: #3f3f4a;
}

.team-slot-box.host {
  border-color: var(--red-primary);
  background: linear-gradient(180deg, rgba(227, 6, 19, 0.22) 0%, #110809 100%);
  box-shadow: inset 0 0 20px rgba(227, 6, 19, 0.28);
}

.team-slot-box .slot-num {
  position: absolute;
  top: 6px;
  left: 9px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.team-slot-box.host .slot-num {
  color: var(--yellow-rangers);
}

.team-slot-logo {
  height: 44px;
  width: auto;
  max-width: 58px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.85));
}

.team-slot-mystery {
  font-family: 'Oswald', sans-serif;
  font-size: 1.7rem;
  color: #4b5563;
  line-height: 44px;
}

.team-slot-name {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1.2;
  color: #f4f4f6;
}

.team-slot-box.pending .team-slot-name {
  color: var(--text-muted);
  font-weight: 600;
}

.team-header-crest {
  height: 36px;
  width: auto;
  vertical-align: middle;
  margin-right: 8px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}

.admin-card-crest {
  height: 32px;
  width: auto;
  object-fit: contain;
  margin-right: 8px;
  vertical-align: middle;
}

/* Estado de carga en botón Guardar + Modal de Confirmación de Guardado */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  display: inline-block;
  animation: copaSpin 0.75s linear infinite;
  flex-shrink: 0;
}

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

.btn.is-saving {
  opacity: 0.85;
  cursor: wait;
  pointer-events: none;
  background: #b80510;
}

.save-success-box {
  max-width: 460px;
  text-align: center;
  padding: 2rem 1.75rem;
  border: 1.5px solid var(--success);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(16, 185, 129, 0.22);
}

.save-check-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.16);
  border: 2.5px solid var(--success);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.15rem;
  animation: popInCheck 0.32s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popInCheck {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.save-success-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.55rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.save-success-msg {
  color: #d1d5db;
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.save-success-summary {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.4rem;
}

.save-success-summary strong {
  color: var(--yellow-rangers);
}

/* Transiciones suaves de vista y Overlay de Acción en Progreso */
@keyframes viewFadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-animate-in {
  animation: viewFadeSlideIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.action-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 11, 0.84);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.action-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.action-overlay-card {
  background: linear-gradient(180deg, #18181e 0%, #101014 100%);
  border: 1.5px solid var(--red-primary);
  border-radius: 14px;
  padding: 2rem 2.5rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 32px rgba(227, 6, 19, 0.25);
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.action-overlay.active .action-overlay-card {
  transform: scale(1);
}

.overlay-spinner-ring {
  width: 54px;
  height: 54px;
  border: 4px solid rgba(255, 222, 0, 0.2);
  border-top-color: var(--red-primary);
  border-right-color: var(--yellow-rangers);
  border-radius: 50%;
  margin: 0 auto 1.15rem;
  animation: copaSpin 0.8s linear infinite;
}

.action-overlay-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.action-overlay-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Botón / Banner de Descarga de Bases Reglamentarias */
.rules-banner {
  margin-top: 1.15rem;
  background: linear-gradient(90deg, rgba(227, 6, 19, 0.14) 0%, rgba(255, 222, 0, 0.08) 100%);
  border: 1px solid rgba(255, 222, 0, 0.35);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.rules-banner-info {
  text-align: left;
}

.rules-banner-info strong {
  display: block;
  font-size: 0.82rem;
  color: var(--yellow-rangers);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.rules-banner-info span {
  font-size: 0.75rem;
  color: #d1d5db;
}

.btn-rules {
  background: rgba(255, 222, 0, 0.14);
  color: var(--yellow-rangers);
  border: 1px solid var(--yellow-rangers);
  text-decoration: none;
}

.btn-rules:hover {
  background: var(--yellow-rangers);
  color: #0a0a0c;
  transform: translateY(-1px);
}

/* === NUEVO DISEÑO PANTALLA INICIAL CENTRADA (4x2 + MODAL DE INGRESO + ADMIN APARTE) === */
.login-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 1180px;
  width: 100%;
  margin: 1.75rem auto 2.5rem;
  padding: 0 1.5rem;
  gap: 1.35rem;
}

.hero-showcase.centered-wide {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 2.15rem 2.35rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72);
}

.hero-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.hero-title-center {
  text-align: center;
  flex: 1;
  min-width: 260px;
}

.hero-title-center .hero-headline {
  font-size: 2.75rem;
  margin-bottom: 0.35rem;
}

.hero-title-center .hero-headline span {
  display: inline;
  margin-left: 0.4rem;
}

.hero-instruction-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(227, 6, 19, 0.14);
  border: 1px solid rgba(227, 6, 19, 0.45);
  color: #f4f4f6;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 0.4rem;
}

.hero-instruction-pill strong {
  color: var(--yellow-rangers);
}

/* Grilla 4 arriba x 4 abajo */
.teams-grid-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0 1.65rem;
}

@media (max-width: 960px) {
  .teams-grid-preview {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .teams-grid-preview {
    grid-template-columns: 1fr;
  }
}

/* Tarjeta interactiva de equipo: el foco rojo se mueve dinámicamente con el puntero */
.team-slot-box {
  background: linear-gradient(180deg, #1b1b21 0%, #101014 100%);
  border: 1.5px solid #2b2b34;
  border-radius: 10px;
  padding: 1.15rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.6rem;
  min-height: 142px;
  position: relative;
  cursor: pointer;
  user-select: none;
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.22s ease,
    background 0.24s ease,
    box-shadow 0.24s ease;
}

.team-slot-box:hover,
.team-slot-box:focus-visible,
.team-slot-box.is-focused {
  outline: none;
  transform: translateY(-6px) scale(1.025);
  border-color: var(--red-primary);
  background: linear-gradient(180deg, rgba(227, 6, 19, 0.30) 0%, #14080a 100%);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.65),
    0 0 22px rgba(227, 6, 19, 0.45),
    inset 0 0 24px rgba(227, 6, 19, 0.32);
}

.team-slot-box:active {
  transform: translateY(-2px) scale(0.99);
}

.team-slot-box .slot-num {
  position: absolute;
  top: 8px;
  left: 11px;
  font-family: 'Oswald', sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.team-slot-box:hover .slot-num,
.team-slot-box:focus-visible .slot-num,
.team-slot-box.is-focused .slot-num {
  color: var(--yellow-rangers);
}

.team-slot-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.team-slot-box:hover .team-slot-badge,
.team-slot-box:focus-visible .team-slot-badge,
.team-slot-box.is-focused .team-slot-badge {
  background: var(--red-primary);
  color: #ffffff;
}

.team-slot-logo {
  height: 62px;
  width: auto;
  max-width: 78px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.85));
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.team-slot-box:hover .team-slot-logo,
.team-slot-box:focus-visible .team-slot-logo,
.team-slot-box.is-focused .team-slot-logo {
  transform: scale(1.08);
}

.team-slot-mystery {
  font-family: 'Oswald', sans-serif;
  font-size: 2.15rem;
  color: #4b5563;
  line-height: 62px;
  transition: color 0.2s ease, transform 0.24s ease;
}

.team-slot-box:hover .team-slot-mystery,
.team-slot-box:focus-visible .team-slot-mystery,
.team-slot-box.is-focused .team-slot-mystery {
  color: var(--yellow-rangers);
  transform: scale(1.1);
}

.team-slot-name {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.35px;
  line-height: 1.25;
  color: #f4f4f6;
}

.team-slot-box.pending .team-slot-name {
  color: var(--text-muted);
  font-weight: 600;
}

.team-slot-hint {
  font-size: 0.68rem;
  color: var(--yellow-rangers);
  font-weight: 700;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.team-slot-box:hover .team-slot-hint,
.team-slot-box:focus-visible .team-slot-hint,
.team-slot-box.is-focused .team-slot-hint {
  opacity: 1;
  transform: translateY(0);
}

/* Apartado inferior separado para Ingreso Administrador */
.admin-access-bar {
  width: 100%;
  background: rgba(20, 20, 24, 0.94);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--yellow-rangers);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.admin-access-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.admin-shield-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 222, 0, 0.14);
  border: 1px solid rgba(255, 222, 0, 0.4);
  color: var(--yellow-rangers);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-access-info h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.admin-access-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Modal de Autenticación (Equipo o Administrador) */
.auth-modal-box {
  max-width: 440px;
  padding: 2rem 1.85rem;
  border: 1.5px solid var(--red-primary);
  box-shadow: 0 26px 65px rgba(0, 0, 0, 0.92), 0 0 32px rgba(227, 6, 19, 0.25);
}

.auth-modal-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.auth-team-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.35rem;
}

.auth-team-crest {
  height: 76px;
  width: auto;
  max-width: 96px;
  object-fit: contain;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8));
}

.auth-team-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.55rem;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1.15;
}

.auth-user-pill {
  display: inline-block;
  margin-top: 0.45rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.auth-user-pill strong {
  color: var(--yellow-rangers);
}
