/* ===========================================================================
   Foci VB 2026 — „Stadion éjszaka" téma
   Sötét, neonzöld + elektromos cyan akcentus, reflektor-gradiens, pálya-motívum.
   Display betű: Oswald (self-hosted, variable 200–700, latin + latin-ext).
   =========================================================================== */

@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url('/fonts/oswald-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url('/fonts/oswald-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; }

:root {
  --bg: #0b1220;
  --card: #16203a;
  --card-2: #1c2845;
  --tile: #0c1426;
  --text: #eef2f8;
  --muted: #8a97ad;
  --border: rgba(255, 255, 255, 0.09);
  --accent: #2fe07a;
  --accent-2: #28c8ff;
  --gold: #f4c542;
  --silver: #c5cfdd;
  --bronze: #cd7f32;
  --warn: #ffb02e;
  --error: #ff5a52;
  --display: 'Oswald', system-ui, sans-serif;
  --topbar-h: 88px;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 520px at 50% -220px, rgba(47, 224, 122, 0.13), transparent 70%),
    radial-gradient(900px 460px at 50% -160px, rgba(40, 200, 255, 0.10), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

/* Halvány pálya-motívum az egész háttéren (rögzített). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('/img/pitch.svg') no-repeat center 70px;
  background-size: min(680px, 120%) auto;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

#topbar, #app, #savebar, #toast { position: relative; z-index: 1; }

.hidden { display: none !important; }

/* ---- Fejléc ---- */
#topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 8px 12px;
  background: rgba(9, 15, 27, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

#topbar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

#topbar .brand .brand-crest { width: 26px; height: 26px; }
#topbar .brand .brand-text { color: var(--text); }
#topbar .brand .brand-text b { color: var(--accent); font-weight: 700; }

#topbar nav {
  order: 3;
  flex-basis: 100%;
  display: flex;
  gap: 4px;
}

#topbar nav a {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  color: var(--muted);
  text-decoration: none;
  padding: 9px 6px;
  border-radius: 9px;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.15s, background 0.15s;
}

#topbar nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

#topbar nav a.active {
  color: var(--accent);
  background: rgba(47, 224, 122, 0.10);
  box-shadow: inset 0 -3px 0 var(--accent), 0 0 14px rgba(47, 224, 122, 0.25);
}

#btn-profile {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 9px;
  transition: color 0.15s, border-color 0.15s;
}

#btn-profile:hover { color: var(--text); }
#btn-profile.active { color: var(--accent); border-color: var(--accent); }

#btn-logout {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

#btn-logout:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }

#app { max-width: 640px; margin: 0 auto; padding: 16px 12px 90px; }

h1 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.7rem;
  margin: 6px 0 16px;
}

h2 {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 1.1rem;
  margin: 22px 0 10px;
  color: var(--text);
}

/* ---- Login hero ---- */
.login-box {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 30px 22px 24px;
  margin-top: 9vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(47, 224, 122, 0.06);
  position: relative;
  overflow: hidden;
}

.login-box::before {
  content: "";
  position: absolute;
  top: -120px; left: 50%;
  width: 360px; height: 240px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(47, 224, 122, 0.25), transparent);
  pointer-events: none;
}

.login-crest { width: 92px; height: 92px; margin: 0 auto 2px; filter: drop-shadow(0 6px 18px rgba(47, 224, 122, 0.3)); }

.login-box h1 { margin: 0; font-size: 1.6rem; }
.login-box .login-sub { color: var(--muted); margin: -6px 0 6px; font-size: 0.9rem; }

.login-box input {
  font-size: 1.1rem;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  width: 100%;
  background: var(--tile);
  color: var(--text);
  text-align: center;
}

.login-box input::placeholder { color: var(--muted); }
.login-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 224, 122, 0.2); }

button.primary {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: linear-gradient(120deg, var(--accent), #1fbf63);
  color: #062012;
  border: 0;
  border-radius: 11px;
  padding: 13px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(47, 224, 122, 0.28);
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
}

button.primary:hover { box-shadow: 0 10px 28px rgba(47, 224, 122, 0.4); }
button.primary:active { transform: translateY(1px) scale(0.995); }
button.primary:disabled { opacity: 0.55; box-shadow: none; }

.error-msg { color: var(--error); min-height: 1.2em; margin: 0; }

/* ---- Következő meccs visszaszámláló ---- */
#next-match {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(100deg, rgba(47, 224, 122, 0.14), rgba(40, 200, 255, 0.10));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 14px;
  margin-bottom: 12px;
}

#next-match .nm-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(47, 224, 122, 0.6);
  animation: pulse 1.8s infinite;
  flex: none;
}

#next-match .nm-main { min-width: 0; }
#next-match .nm-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
#next-match .nm-teams { font-family: var(--display); font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#next-match .nm-time {
  margin-left: auto;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--accent);
  white-space: nowrap;
  text-align: right;
  line-height: 1.05;
}
#next-match .nm-time small { display: block; font-size: 0.6rem; color: var(--muted); letter-spacing: 1px; }

/* ---- Szűrő chipek ---- */
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 10px;
  position: sticky;
  top: var(--topbar-h);
  background: linear-gradient(180deg, var(--bg) 70%, transparent);
  z-index: 5;
}

.chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.chip:hover { color: var(--text); }
.chip.active {
  background: rgba(47, 224, 122, 0.14);
  color: var(--accent);
  border-color: var(--accent);
}

/* ---- Nap-fejléc ---- */
.day-header {
  margin: 20px 0 10px;
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text);
  font-size: 0.95rem;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

/* ---- Meccskártya ---- */
.match {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 13px;
  margin-bottom: 9px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  animation: cardIn 0.32s ease both;
}

.match.locked { opacity: 0.92; background: linear-gradient(180deg, #131c30, #0f1726); }

.match .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 8px;
}

.match .row {
  display: grid;
  grid-template-columns: 1fr auto auto auto 1fr;
  align-items: center;
  gap: 6px;
}

.match .team {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.2px;
}

.match .team.away { justify-content: flex-end; }
.match .team .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.flag {
  width: 24px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
  flex: none;
  background: #0c1426;
}

.flag.small { width: 21px; height: 15px; }

/* Eredményjelző-tábla csempék */
.match input.goal {
  width: 48px;
  height: 46px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.4rem;
  text-align: center;
  color: var(--text);
  background: var(--tile);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.match input.goal::-webkit-outer-spin-button,
.match input.goal::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.match input.goal { -moz-appearance: textfield; appearance: textfield; }

.match input.goal:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 224, 122, 0.22), inset 0 0 12px rgba(47, 224, 122, 0.14);
}

.match input.goal:disabled {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  opacity: 1;
  border-color: rgba(47, 224, 122, 0.25);
  background: #0a1422;
  text-shadow: 0 0 10px rgba(47, 224, 122, 0.4);
}

.match .sep { color: var(--muted); font-family: var(--display); font-size: 1.2rem; }

.match .result-line {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.points-badge {
  font-family: var(--display);
  font-weight: 700;
  color: var(--accent);
  background: rgba(47, 224, 122, 0.12);
  border: 1px solid rgba(47, 224, 122, 0.3);
  border-radius: 999px;
  padding: 2px 10px;
}

.lock-ico { animation: lockPulse 2.4s ease-in-out infinite; display: inline-block; }

.status { width: 18px; text-align: center; font-size: 0.95rem; }
.status.saved { color: var(--accent); animation: pop 0.3s ease; }
.status.saving { color: var(--warn); }
.status.error { color: var(--error); }

/* ---- Mentés sáv ---- */
#savebar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  background: rgba(9, 15, 27, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

#savebar button { max-width: 612px; width: 100%; }

/* ---- Űrlapok (hosszútáv, profil, admin) ---- */
.lt-form {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

.lt-form label { font-weight: 600; font-size: 0.95rem; display: block; margin-bottom: 5px; }
.lt-form .pts { color: var(--accent); font-weight: 400; }

.lt-form select, .lt-form input {
  width: 100%;
  font-size: 1rem;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--tile);
  color: var(--text);
}

.lt-form select:focus, .lt-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 224, 122, 0.18); }
.lt-form option { background: var(--card); color: var(--text); }

.gap-below { margin-bottom: 14px; }
.lt-val { display: flex; align-items: center; gap: 8px; }

.countdown {
  text-align: center;
  font-family: var(--display);
  color: var(--warn);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin: 10px 0;
}

.info-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  color: var(--muted);
}

.info-box strong { color: var(--text); }

/* ---- Táblázat (ranglista, belépések) ---- */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.table th, .table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .score { font-family: var(--display); font-weight: 600; color: var(--accent); }
.table .me-row td { box-shadow: inset 3px 0 0 var(--accent); background: rgba(47, 224, 122, 0.06); }

.table .lb-1 td { background: linear-gradient(90deg, rgba(244, 197, 66, 0.16), transparent 60%); }
.table .lb-2 td { background: linear-gradient(90deg, rgba(197, 207, 221, 0.13), transparent 60%); }
.table .lb-3 td { background: linear-gradient(90deg, rgba(205, 127, 50, 0.14), transparent 60%); }
.table .me-row.lb-1 td, .table .me-row.lb-2 td, .table .me-row.lb-3 td { box-shadow: inset 3px 0 0 var(--accent); }
.medal { font-size: 1.1rem; }

.badge {
  background: rgba(47, 224, 122, 0.16);
  color: var(--accent);
  border: 1px solid rgba(47, 224, 122, 0.35);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 0.72rem;
}

.hint { color: var(--muted); font-size: 0.85rem; }

.table-scroll { overflow-x: auto; }
.table .ip { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.table .fail-row td { background: rgba(255, 90, 82, 0.08); }
.fail-mark { color: var(--error); font-size: 0.8rem; }

/* ---- Játékos-kártyák (admin) ---- */
.player-list { display: flex; flex-direction: column; gap: 8px; }

.player-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 11px 13px;
}

.player-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.player-name { font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.player-actions { display: flex; gap: 6px; }

.player-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.84rem;
  color: var(--muted);
}

/* ---- Admin szegmens-kapcsoló ---- */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--tile);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
}

.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  padding: 10px 4px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.tab:hover { color: var(--text); }
.tab.active { background: rgba(47, 224, 122, 0.14); color: var(--accent); }

.admin-row-actions { display: flex; gap: 8px; margin-top: 8px; justify-content: flex-end; }

.chip.danger { color: var(--error); border-color: rgba(255, 90, 82, 0.4); }
.chip.danger:hover { background: rgba(255, 90, 82, 0.1); }

.admin-actions { margin: 18px 0; display: flex; justify-content: center; }

.pairing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }

.pairing-grid select, .pairing-grid input {
  font-size: 1rem;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--tile);
  color: var(--text);
  width: 100%;
  min-width: 0;
}

.pairing-grid button { justify-self: end; }
.checkbox-row label { font-weight: 400; display: flex; align-items: center; gap: 8px; }

/* ---- Toast ---- */
#toast {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 18px;
  font-size: 0.95rem;
  z-index: 20;
  max-width: 90vw;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.25s ease;
}

#toast.error { border-color: rgba(255, 90, 82, 0.5); color: #ffd9d6; }

/* ---- Animációk ---- */
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.5); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 224, 122, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(47, 224, 122, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 224, 122, 0); }
}
@keyframes lockPulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
