/* ═══════════════════════════════════════
   Polla Mundial 2026 — Boccherini
   Paleta: #007cba · #00558b · #13304d
═══════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Bebas+Neue&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:          #0a1e2d;
  --surface:     #13304d;
  --surface2:    #1a3d5c;
  --surface3:    #1f4a6e;
  --border:      rgba(0,124,186,0.2);
  --border-hi:   rgba(0,124,186,0.5);

  /* Paleta corporativa Boccherini */
  --blue:        #007cba;
  --blue-light:  #00558b;
  --blue-bright: #33b5e8;
  --blue-dim:    rgba(0,124,186,0.15);
  --blue-glow:   rgba(0,124,186,0.08);

  --green:   #00c853;
  --orange:  #ff6d00;
  --red:     #f44336;
  --gray:    #8eacc8;
  --text:    #e8f0fe;
  --text-dim:#5c7a9f;

  /* Alias semánticos */
  --accent:      var(--blue-bright);
  --accent-dim:  var(--blue-dim);
  --tbl-head:    #0a1e2d;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  min-height: 100vh;
  background-image: url('../assets/portada.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(10,30,45,0.92) 0%,
    rgba(19,48,77,0.90) 50%,
    rgba(0,85,139,0.88) 100%
  );
  z-index: 0;
  pointer-events: none;
}
.navbar, .main-content, footer {
  position: relative;
  z-index: 1;
}

/* ── Navbar ─────────────────────────────── */
.navbar {
  background: rgba(10,30,45,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-brand img {
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1);
}
.nav-brand-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  color: var(--blue-bright);
  letter-spacing: .06em;
  line-height: 1.1;
}
.nav-brand-sub {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: .08em;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  display: block;
}
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  color: var(--gray);
  text-decoration: none;
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
}
.nav-link:hover { background: var(--surface2); color: var(--text); }
.nav-link.active { background: var(--surface2); color: var(--text); }
.nav-admin {
  background: var(--blue-dim);
  color: var(--blue-bright) !important;
  border: 1px solid var(--border);
}
.nav-admin:hover { background: rgba(0,124,186,0.25) !important; }
.nav-user { display: flex; align-items: center; gap: 6px; padding: 0 8px; font-size: 12px; color: var(--text-dim); }
.user-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Layout ────────────────────────────── */
.main-content { max-width: 1100px; margin: 0 auto; padding: 28px 20px; }
.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-dim);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.site-footer img { height: 18px; width: auto; vertical-align: middle; margin-right: 6px; filter: brightness(0) invert(.4); }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.page-title span { color: var(--blue-bright); }
.container-sm { max-width: 480px; margin: 0 auto; }
.row { display: grid; gap: 16px; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: repeat(3,1fr); }

/* ── Cards ─────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.card-title {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.stat-big {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 42px;
  color: var(--blue-bright);
  line-height: 1;
}
.stat-label { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* ── Forms ─────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: .05em;
  font-weight: 600;
}
.form-control {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,124,186,0.15);
}
.form-control::placeholder { color: var(--text-dim); }
.form-control.error { border-color: var(--red); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ── Buttons ───────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0,124,186,0.3);
}
.btn-primary:hover { background: var(--blue-light); box-shadow: 0 4px 16px rgba(0,124,186,0.4); }
.btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--border-hi); background: var(--surface3); }
.btn-danger {
  background: rgba(244,67,54,0.12);
  border: 1px solid rgba(244,67,54,0.3);
  color: #ef9a9a;
}
.btn-danger:hover { background: rgba(244,67,54,0.22); }
.btn-success {
  background: rgba(0,200,83,0.12);
  border: 1px solid rgba(0,200,83,0.3);
  color: #69f0ae;
}
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Login ─────────────────────────────── */
.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: rgba(19,48,77,0.90);
  border: 1px solid rgba(0,124,186,0.45);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(0,124,186,0.1);
  backdrop-filter: blur(12px);
}
.login-logo { margin-bottom: 6px; }
.login-logo img { height: 40px; width: auto; filter: brightness(0) invert(1); }
.login-logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  color: var(--blue-bright);
  letter-spacing: .06em;
}
.login-divider {
  width: 40px;
  height: 2px;
  background: var(--blue);
  margin: 10px auto 8px;
  border-radius: 2px;
}
.login-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 28px; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-error  { background: rgba(244,67,54,0.1);  border: 1px solid rgba(244,67,54,0.3);  color: #ef9a9a; }
.alert-success{ background: rgba(0,200,83,0.1);   border: 1px solid rgba(0,200,83,0.3);   color: #69f0ae; }
.alert-info   { background: rgba(0,124,186,0.1);  border: 1px solid rgba(0,124,186,0.3);  color: #90caf9; }

/* ── Tables ─────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.table-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.table-header h3 { font-size: 14px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--tbl-head);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
  padding: 10px 16px;
  text-align: left;
}
thead th.c { text-align: center; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(0,124,186,0.04); }
tbody td { padding: 12px 16px; }
tbody td.c { text-align: center; }

/* Ranking positions */
.rank-num { font-family: 'Bebas Neue', sans-serif; font-size: 22px; color: var(--text-dim); }
.rank-1 .rank-num { color: #ffd54f; }
.rank-2 .rank-num { color: #b0bec5; }
.rank-3 .rank-num { color: #ff8a65; }
.player-cell { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.total-pts { font-family: 'Bebas Neue', sans-serif; font-size: 26px; color: var(--blue-bright); }
.me-row { background: rgba(0,124,186,0.08) !important; }
.me-row td { color: var(--blue-bright) !important; }

/* ── Badges ─────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
}
.b10 { background: rgba(0,200,83,0.15);    color: #69f0ae; }
.b7  { background: rgba(0,124,186,0.2);    color: #90caf9; }
.b5  { background: rgba(255,109,0,0.15);   color: #ffab40; }
.b3  { background: rgba(142,172,200,0.12); color: #8eacc8; }
.b0  { background: rgba(244,67,54,0.1);    color: #ef9a9a; }
.b-  { background: transparent; color: var(--text-dim); }

.phase-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--blue-dim);
  color: var(--blue-bright);
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.status-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.status-pending  { background: rgba(142,172,200,0.12); color: #8eacc8; }
.status-locked   { background: rgba(255,109,0,0.15);   color: #ffab40; }
.status-finished { background: rgba(0,200,83,0.15);    color: #69f0ae; }

/* ── Match cards ──────────────────────── */
.matches-list { display: flex; flex-direction: column; gap: 10px; }
.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .15s;
}
.match-card:hover { border-color: var(--border-hi); }
.match-card.locked   { border-color: rgba(255,109,0,0.2); }
.match-card.finished { border-color: rgba(0,200,83,0.15); }
.match-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.match-meta { font-size: 11px; color: var(--text-dim); margin-bottom: 2px; }
.match-teams { font-weight: 600; font-size: 14px; }
.match-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.result-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--blue-bright);
  background: var(--blue-dim);
  padding: 3px 12px;
  border-radius: 5px;
  border: 1px solid var(--border);
}
.match-body { padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.pred-input-wrap { display: flex; align-items: center; gap: 8px; flex: 1; }
.score-input {
  width: 52px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 8px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  font-family: 'Bebas Neue', sans-serif;
  transition: border-color .15s;
}
.score-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(0,124,186,0.2); }
.score-input:disabled { opacity: .5; cursor: not-allowed; }
.score-sep { font-size: 18px; color: var(--text-dim); font-weight: 700; }
.pred-pts { margin-left: auto; }
.lock-msg { font-size: 11px; color: var(--orange); margin-left: auto; }

/* ── Phase header ─────────────────────── */
.phase-header {
  padding: 10px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  margin-bottom: 8px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.phase-header h3 { font-size: 14px; font-weight: 700; color: var(--blue-bright); }
.phase-dates { font-size: 11px; color: var(--text-dim); }

/* ── Ranking ──────────────────────────── */
.tie-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  background: rgba(255,109,0,0.15);
  color: #ffab40;
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Admin ────────────────────────────── */
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Responsive ───────────────────────── */
@media (max-width: 700px) {
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .nav-links { gap: 2px; }
  .user-name { display: none; }
  .main-content { padding: 16px 12px; }
  .form-row { grid-template-columns: 1fr; }
  thead th.hide-mob, tbody td.hide-mob { display: none; }
}

/* ── Scrollbar ────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }
