/* ================================
RESET + BASE
================================ */
*{
  box-sizing:border-box;
  margin:0;
  padding:0;
  font-family:"Segoe UI",Arial,sans-serif;
}

body{
  background:
  radial-gradient(circle at 20% 0%, #162052 0%, transparent 40%),
  radial-gradient(circle at 80% 0%, #0f1a45 0%, transparent 40%),
  linear-gradient(180deg,#070b1d,#020617);
  color:#fff;
}

.hidden{display:none;}

input,button{
  border:none;
  outline:none;
}

button{cursor:pointer;}


/* ================================
APP CONTENEDOR GLOBAL
================================ */
#app{
  max-width:1200px;
  margin:auto;
  padding:0 18px;
}


/* ================================
HEADER
================================ */
.header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:20px 24px;

  background:linear-gradient(180deg,#0f172a,#020617);
  border-radius:0 0 18px 18px;

  box-shadow:
  0 20px 50px rgba(0,0,0,.9),
  inset 0 1px 0 rgba(255,255,255,.05);
}

.logout-btn{
  padding:10px 16px;
  border-radius:12px;
  background:linear-gradient(135deg,#ef4444,#7f1d1d);
  color:#fff;
  font-weight:600;
  transition:.25s;
}

.logout-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 25px rgba(239,68,68,.35);
}


/* ================================
MENU PRO
================================ */
.menu{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:12px;

  margin:18px auto;
  padding:18px;

  max-width:1100px;

  background:rgba(255,255,255,.03);
  backdrop-filter:blur(12px);
  border-radius:20px;

  box-shadow:
  inset 0 0 0 1px rgba(255,255,255,.05),
  0 20px 50px rgba(0,0,0,.7);
}

.menu button{
  padding:12px 22px;
  border-radius:14px;
  font-weight:600;
  letter-spacing:.4px;

  background:linear-gradient(145deg,#1e3a8a,#0f172a);
  color:#e2e8f0;

  transition:.25s;

  box-shadow:
  0 6px 18px rgba(0,0,0,.6),
  inset 0 1px 0 rgba(255,255,255,.08);
}

.menu button:hover{
  transform:translateY(-2px);
  background:linear-gradient(145deg,#2563eb,#1e40af);
  box-shadow:
  0 10px 28px rgba(37,99,235,.35);
}

.menu button:active{
  transform:scale(.96);
}


/* ================================
SECCIONES
================================ */
.container{padding:20px;}

.section{
  max-width:1100px;
  margin:auto;
  display:none;
}

.section.active{display:block;}

.section h3{
  margin-bottom:14px;
  font-weight:600;
  opacity:.9;
}


/* ================================
BOX
================================ */
.box{
  background:linear-gradient(180deg,#101c45,#0a1433);
  border:1px solid rgba(255,255,255,.05);
  padding:18px;
  border-radius:18px;

  box-shadow:
  0 20px 50px rgba(0,0,0,.8),
  inset 0 1px 0 rgba(255,255,255,.05);

  max-width:520px;
  margin:auto;
}

.box input{
  width:100%;
  margin-bottom:10px;
  padding:11px;
  border-radius:10px;
  background:rgba(255,255,255,.08);
  color:#fff;
  border:1px solid rgba(255,255,255,.05);
  font-size:14px;
}


/* ================================
GRID
================================ */
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(170px,200px));
  justify-content:center;
  gap:16px;
}

.cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,190px));
  justify-content:center;
  gap:16px;
}


/* ================================
PLAYER CARD
================================ */
.player-card{
  position:relative;
  width:100%;
  max-width:200px;
  margin:auto;

  background:linear-gradient(180deg,#101c45,#0a1433);
  border-radius:20px;
  padding:14px;
  text-align:center;

  box-shadow:
  0 20px 40px rgba(0,0,0,.7),
  inset 0 1px 0 rgba(255,255,255,.05);

  transition:.25s;
}

.player-card:hover{
  transform:translateY(-4px);
  box-shadow:0 30px 60px rgba(0,0,0,.9);
}

.player-photo{
  width:100%;
  height:110px;
  object-fit:cover;
  border-radius:12px;
  margin-bottom:10px;
}

.player-rating{
  position:absolute;
  top:10px;
  right:10px;
  background:linear-gradient(135deg,#fde047,#eab308);
  color:#111;
  width:38px;
  height:38px;
  border-radius:50%;
  font-weight:bold;
  display:flex;
  align-items:center;
  justify-content:center;
}

.player-name{
  font-weight:bold;
  font-size:14px;
}

/* 🔥 FIX — STATS EN 2 COLUMNAS SIN TOCAR JS */
.player-card .player-info,
.player-card .stats,
.player-card .info,
.player-card .player-stats{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px 10px;
  margin-top:6px;
  font-size:13px;
  opacity:.9;
  text-align:left;
}


/* ================================
TABLA
================================ */
#tabla{
  background:linear-gradient(180deg,#0e1a42,#0a1433);
  border-radius:18px;
  padding:18px;
  box-shadow:0 20px 40px rgba(0,0,0,.6);
  overflow-x:auto;
}

#tabla .tabla{
  min-width:900px;
}

#tabla .tabla-header,
#tabla .tabla-row{
  display:grid;
  grid-template-columns: 2.5fr repeat(9,1fr);
  gap:10px;
  align-items:center;
}

#tabla .tabla-header{
  background:rgba(255,255,255,.12);
  font-size:13px;
  padding:10px;
}

#tabla .tabla-row{
  padding:10px;
  border-top:1px solid rgba(255,255,255,.08);
}

#tabla input{
  width:100%;
  background:rgba(255,255,255,.12);
  border-radius:8px;
  padding:6px;
  color:#fff;
  text-align:center;
  font-size:13px;
}

#tabla .df{color:#7fd3ff;}
#tabla .pts{color:gold;font-weight:bold;}


/* ================================
🔥 PROGRAMACION MAS CLARA
================================ */
.partido-edit{
  background:
  linear-gradient(180deg,#1a2a66,#132055);

  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;

  padding:14px;
  margin-bottom:14px;

  display:grid;
  grid-template-columns:repeat(5,auto);
  gap:10px;
  align-items:center;

  box-shadow:
  0 10px 25px rgba(0,0,0,.5),
  inset 0 1px 0 rgba(255,255,255,.08);
}

.partido-edit input,
.partido-edit select{
  background:rgba(255,255,255,.18);
  color:white;
  border:1px solid rgba(255,255,255,.15);
  border-radius:8px;
  padding:6px 8px;
}

.partido-edit button{
  background:linear-gradient(135deg,#3b5bdb,#364fc7);
  border-radius:10px;
  padding:6px 12px;
  font-size:13px;
}

.partido-edit button:hover{
  filter:brightness(1.15);
}


/* ================================
FOOTER
================================ */
.footer{
  text-align:center;
  width:100%;
  margin-top:40px;
  opacity:.6;
}


/* ================================
RESPONSIVE
================================ */
@media(max-width:768px){

  #app{ padding:0 12px; }

  .menu button{
    font-size:13px;
    padding:10px 14px;
  }

  .grid{ grid-template-columns:repeat(2,1fr); }
  .cards{ grid-template-columns:repeat(2,1fr); }

  #tabla .tabla{ min-width:700px; }
}


/* ================================
BOTON GLOBAL
================================ */
button{
  background:linear-gradient(145deg,#1e3a8a,#0f172a);
  color:#e2e8f0;
  padding:10px 18px;
  border-radius:12px;
  font-weight:600;
  transition:.25s;

  box-shadow:
  0 6px 18px rgba(0,0,0,.6),
  inset 0 1px 0 rgba(255,255,255,.08);
}

button:hover{
  transform:translateY(-2px);
  background:linear-gradient(145deg,#2563eb,#1e40af);
  box-shadow:0 10px 28px rgba(37,99,235,.35);
}

.toggle-btn{
  margin-bottom:14px;
}

.tabla{
  background:linear-gradient(180deg,#0e1a42,#0a1433);
  border-radius:16px;
  padding:14px;
  box-shadow:0 20px 40px rgba(0,0,0,.6);
}

.tabla-header,
.tabla-row{
  display:grid;
  grid-template-columns:2fr 2fr 1fr auto;
  gap:10px;
  padding:10px;
  align-items:center;
}

.tabla-header{
  background:rgba(255,255,255,.12);
  border-radius:10px;
  font-size:13px;
}

.tabla-row{
  border-top:1px solid rgba(255,255,255,.08);
}

.delete-btn{
  background:#ef4444;
  padding:6px 10px;
  border-radius:8px;
}

/* ================================
LOGIN FIX (NO TOCA MENUS)
================================ */

.login-wrapper{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

/* Header login separado visualmente */
.login-header{
  padding:30px 20px 10px 20px;
}

/* Zona central */
.login-body{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:40px 20px;
}

/* Card login */
.login-card{
  width:100%;
  max-width:480px;

  background:linear-gradient(180deg,#101c45,#0a1433);
  border-radius:22px;
  padding:30px;

  box-shadow:
  0 30px 80px rgba(0,0,0,.9),
  inset 0 1px 0 rgba(255,255,255,.05);
}

/* Inputs login */
.login-card input{
  width:100%;
  margin-bottom:14px;
  padding:14px;
  border-radius:12px;
  background:rgba(255,255,255,.08);
  color:#fff;
  border:1px solid rgba(255,255,255,.05);
  font-size:15px;
}

/* Botón login */
.login-card button{
  width:100%;
  margin-top:6px;
  padding:14px;
  font-size:15px;
}

/* Footer login */
.login-footer{
  text-align:center;
  padding:25px;
  opacity:.6;
}

/* ================================
LOGIN CENTER PERFECT FIX
(NO TOCA MENUS NI APP)
================================ */

body{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.login-wrapper{
  flex:1;
  display:flex;
  flex-direction:column;
}

/* Centrado REAL matemático */
.login-body{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;

  /* 👇 Ajuste fino visual */
  padding-top:40px;
  padding-bottom:40px;
}

/* Evita que header empuje visualmente */
.login-header{
  flex-shrink:0;
}

/* Footer siempre abajo */
.login-footer{
  flex-shrink:0;
  margin-top:auto;
}

/* Micro ajuste visual para centrar óptico */
@media(min-height:700px){
  .login-body{
    transform:translateY(-20px);
  }
}

/* ================================
LOGIN HARD CENTER FIX
NO TOCA MENUS / APP
================================ */

/* Wrapper ocupa todo el viewport */
.login-wrapper{
  width:100%;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

/* Centro REAL horizontal + vertical */
.login-body{
  flex:1;
  width:100%;

  display:flex;
  justify-content:center;
  align-items:center;
}

/* Card SIEMPRE centrado */
.login-card{
  margin:auto;
}
