/* ============================================================================
   Prode Mundial 2026 — estilos. Mobile-first (la familia entra del celular).
   ========================================================================== */
:root {
  --green: #0b6e4f;
  --green-dark: #095c41;
  --bg: #f3f5f4;
  --card: #ffffff;
  --ink: #18211d;
  --muted: #6b7a72;
  --line: #e3e8e5;
  --gold: #e0b400;
  --red: #c0392b;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

.screen { min-height: 100dvh; }
.muted { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--red); font-size: 0.9rem; margin: 8px 0 0; }
[hidden] { display: none !important; }

/* ----- Login ----- */
#login {
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(160deg, var(--green), var(--green-dark));
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
.login-card { width: 100%; max-width: 380px; padding: 28px 24px; }
.brand {
  font-size: 1.6rem; margin: 0 0 6px; color: var(--green);
  display: flex; align-items: baseline; gap: 8px;
}
.brand span { color: var(--gold); font-weight: 800; }
#login-form { display: grid; gap: 14px; margin-top: 18px; }
label { display: grid; gap: 6px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
input[type="text"], input[type="password"] {
  font-size: 1.1rem; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 10px; width: 100%;
}
input:focus { outline: none; border-color: var(--green); }
#pin { letter-spacing: 0.4em; }
button {
  font: inherit; cursor: pointer; border: none; border-radius: 10px;
}
#login-btn {
  background: var(--green); color: #fff; font-weight: 700;
  padding: 13px; font-size: 1.05rem; margin-top: 4px;
}
#login-btn:active { background: var(--green-dark); }
#login-btn:disabled { opacity: 0.6; }

/* ----- Topbar / tabs ----- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  background: var(--green); color: #fff; padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  position: sticky; top: 0; z-index: 10;
}
.brand-sm { font-weight: 800; }
.spacer { flex: 1; }
.hello { font-size: 0.9rem; opacity: 0.95; }
.link { background: transparent; color: #fff; text-decoration: underline; padding: 4px; }

.tabs {
  display: flex; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 49px; z-index: 9;
}
.tab {
  flex: 1; background: transparent; padding: 14px; font-weight: 700;
  color: var(--muted); border-bottom: 3px solid transparent;
}
.tab.active { color: var(--green); border-bottom-color: var(--green); }

.tab-panel { padding: 14px; max-width: 640px; margin: 0 auto; }

/* ----- Partidos ----- */
.day-head {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 700; margin: 18px 4px 8px;
}
.match {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px;
}
.match-top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.72rem; color: var(--muted); margin-bottom: 10px;
}
.badge {
  background: #eef3f0; color: var(--green-dark);
  padding: 2px 8px; border-radius: 999px; font-weight: 700;
}
.locked-tag { color: var(--red); font-weight: 700; }
.match-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
}
.team { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.team.away { justify-content: flex-end; text-align: right; }
.team .flag { font-size: 1.2rem; }
.team .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-box { display: flex; align-items: center; gap: 6px; }
.score {
  width: 46px; height: 46px; text-align: center; font-size: 1.3rem; font-weight: 700;
  border: 1.5px solid var(--line); border-radius: 10px;
}
.score:focus { outline: none; border-color: var(--green); }
.score:disabled { background: #f6f8f7; color: var(--ink); opacity: 1; }
.vs { color: var(--muted); font-weight: 700; }
.match-foot {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  font-size: 0.8rem; min-height: 18px;
}
.real-score { color: var(--ink); font-weight: 700; }
.pts { margin-left: auto; font-weight: 800; }
.pts.exact { color: var(--green); }
.pts.result { color: var(--gold); }
.pts.miss { color: var(--muted); }
.saved { color: var(--green); font-weight: 700; }
.saving { color: var(--muted); }
.save-err { color: var(--red); }

/* ----- Posiciones ----- */
table.lb { width: 100%; border-collapse: collapse; background: var(--card);
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.lb th, .lb td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.lb th { font-size: 0.72rem; text-transform: uppercase; color: var(--muted); }
.lb td.num, .lb th.num { text-align: center; }
.lb tr.me { background: #eef9f4; font-weight: 700; }
.lb .pos { color: var(--muted); font-weight: 700; width: 28px; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty .big { font-size: 2.4rem; }

/* ----- Admin ----- */
.admin-hint { margin: 4px 4px 14px; }
.admin-card .adm-teams {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px;
}
.admin-card .adm-teams .nm {
  display: flex; align-items: center; min-height: 40px; font-weight: 600;
}
.adm-team {
  font: inherit; padding: 9px 8px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fff; width: 100%;
}
.adm-team:focus { outline: none; border-color: var(--green); }
.adm-result { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adm-save {
  background: var(--green); color: #fff; font-weight: 700; padding: 10px 16px;
}
.adm-save:active { background: var(--green-dark); }
.adm-clear { color: var(--red); }
.done-tag { color: var(--green); font-weight: 700; }
.adm-status { font-size: 0.8rem; }
