:root {
  --bg: #0b1020;
  --bg-2: #121a33;
  --card: #18223f;
  --card-2: #1f2c4f;
  --line: #2a3a63;
  --text: #e8ecf7;
  --muted: #8ea0c9;
  --accent: #00e08a;
  --accent-2: #ffd23f;
  --danger: #ff5c7a;
  --blue: #3f8cff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 70% -10%, #1b2750 0%, var(--bg) 55%) fixed;
  color: var(--text);
  min-height: 100vh;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ---------- Gate / overlay ---------- */
.gate, .overlay {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(900px 500px at 50% 0%, #1b2750, var(--bg));
  z-index: 50; padding: 20px;
}
.gate {
  background:
    linear-gradient(rgba(7,11,24,.62), rgba(7,11,24,.88)),
    url('/mats/2026WC_main%20page.webp') center/cover no-repeat fixed;
}
.overlay { background: rgba(6,10,22,.78); backdrop-filter: blur(6px); }

/* Hero-sáv a Tippelés fül tetején */
.wc-hero {
  position: relative; border-radius: 16px; overflow: hidden;
  background: url('/mats/2026WC_main%20page.webp') center 30%/cover no-repeat;
  min-height: 180px; margin-bottom: 22px; border: 1px solid var(--line);
  display: flex; align-items: flex-end; box-shadow: var(--shadow);
}
.wc-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(7,11,24,.92) 0%, rgba(7,11,24,.55) 48%, rgba(7,11,24,.05) 100%);
}
.wc-hero .wc-hero-text { position: relative; z-index: 1; padding: 20px 24px; max-width: 72%; }
.wc-hero h2 { margin: 0; font-size: 27px; font-weight: 800; letter-spacing: .3px; }
.wc-hero p { margin: 6px 0 0; color: #cfe0ff; font-size: 14px; line-height: 1.5; }
.gate-card, .overlay-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 38px 34px; text-align: center; max-width: 420px; width: 100%; box-shadow: var(--shadow);
}
.gate-logo { font-size: 46px; }
.gate-card h1 { font-size: 30px; line-height: 1.1; margin: 12px 0 14px; font-weight: 800; }
.gate-card h1 span { color: var(--accent); }
.overlay-card h2 { margin: 10px 0 8px; font-weight: 800; }
.overlay-card p { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.overlay-card input {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font-size: 16px; margin-bottom: 14px; text-align: center;
}
.overlay-card input:focus { outline: none; border-color: var(--accent); }
.hint { font-size: 13px; color: var(--danger); min-height: 16px; margin: 8px 0 0; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 22px; background: rgba(12,18,38,.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 19px; letter-spacing: .3px; }
.brand em { color: var(--accent); font-style: normal; }
.brand .ball { margin-right: 4px; }
.tabs { display: flex; gap: 6px; margin-left: 8px; flex-wrap: wrap; }
.tab {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: 9px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; transition: .15s;
}
.tab:hover { color: var(--text); background: var(--card); }
.tab.active { color: #06210f; background: var(--accent); }
.mode-toggle {
  margin-left: auto;
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; transition: .15s;
}
.mode-toggle.is-admin {
  background: linear-gradient(135deg, #4a3a00, #2a2200);
  border-color: var(--accent-2); color: var(--accent-2);
}
.mode-toggle:hover { filter: brightness(1.15); }
.mode-toggle:not(.hidden) + .user-chip { margin-left: 0; }
.user-chip {
  margin-left: auto; display: flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--line); padding: 7px 13px; border-radius: 999px;
  font-weight: 600; font-size: 14px;
}
.user-chip .avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--accent)); color: #06210f; font-weight: 800; font-size: 13px;
}
.user-chip .god { color: var(--accent-2); }

/* ---------- Layout ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 26px 20px 80px; }
.tab-panel { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h2.section-title { font-size: 22px; margin: 4px 0 6px; font-weight: 800; }
.section-sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

/* ---------- Cards / matches ---------- */
.group-block { margin-bottom: 26px; }
.group-head {
  display: flex; align-items: center; gap: 10px; margin: 18px 0 12px;
  font-weight: 700; font-size: 16px;
}
.group-badge {
  background: var(--accent-2); color: #2a1c00; font-weight: 800;
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px;
}
.matchday-label { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 14px 0 8px; }

.match {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px;
}
.match-when {
  grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-weight: 600;
  letter-spacing: .3px; margin-bottom: 2px;
}
.match.locked { opacity: .9; }
.match.finished { border-color: #2c4a3a; }
.team { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; }
.team.away { justify-content: flex-end; text-align: right; }
.team .flag { font-size: 22px; }
.score-box { display: flex; align-items: center; gap: 6px; }
.score-box input {
  width: 46px; height: 44px; text-align: center; font-size: 19px; font-weight: 700;
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
}
.score-box input:focus { outline: none; border-color: var(--accent); }
.score-box input:disabled { opacity: .55; }
.score-sep { color: var(--muted); font-weight: 700; }
.match-meta { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); }
.pill { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.open { background: rgba(0,224,138,.14); color: var(--accent); }
.pill.locked { background: rgba(255,210,63,.14); color: var(--accent-2); }
.pill.finished { background: rgba(63,140,255,.16); color: var(--blue); }
.pts { font-weight: 800; }
.pts.p3 { color: var(--accent); }
.pts.p1 { color: var(--accent-2); }
.pts.p0 { color: var(--danger); }
.real-score { font-weight: 800; color: var(--text); }

/* sticky submit bar */
.submit-bar {
  position: sticky; bottom: 0; margin-top: 18px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: rgba(18,26,51,.95); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 18px; box-shadow: var(--shadow);
}
.submit-bar .count { color: var(--muted); font-size: 14px; }
.submit-bar .count b { color: var(--text); }

.btn-primary {
  background: var(--accent); color: #06210f; border: none; padding: 12px 22px; border-radius: 11px;
  font-weight: 800; font-size: 15px; transition: .15s;
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--text); border: 1px solid var(--line);
  padding: 9px 15px; border-radius: 10px; font-weight: 600; font-size: 14px;
}
.btn-ghost:hover { background: var(--card-2); }
.btn-mini { padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.btn-danger { background: var(--danger); color: #2a0010; border: none; }

/* champion picker */
.champ-card {
  background: linear-gradient(135deg, #1d2a4f, #18223f); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 26px;
}
.champ-card h3 { margin: 0 0 4px; font-size: 18px; }
.champ-card p { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.champ-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.champ-row select {
  flex: 1; min-width: 200px; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font-size: 15px;
}
.champ-current { font-weight: 700; }

/* ---------- Dashboard ---------- */
.podium { display: flex; gap: 14px; justify-content: center; align-items: flex-end; margin: 10px 0 30px; flex-wrap: wrap; }
.podium .step {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  text-align: center; width: 170px;
}
.podium .step .medal { font-size: 30px; }
.podium .step .pn { font-weight: 800; font-size: 17px; margin: 6px 0 2px; }
.podium .step .pp { color: var(--accent); font-weight: 800; font-size: 22px; }
.podium .step.s1 { transform: translateY(-12px); border-color: var(--accent-2); }

table.board { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
table.board th, table.board td { padding: 13px 14px; text-align: left; font-size: 14px; }
table.board th { background: var(--bg-2); color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
table.board tr { border-top: 1px solid var(--line); }
table.board td.num, table.board th.num { text-align: center; }
table.board .total { font-weight: 800; color: var(--accent); font-size: 16px; }
table.board .rank { font-weight: 800; color: var(--muted); width: 40px; }
table.board tr.me { background: rgba(0,224,138,.07); }
.name-tag { display: flex; align-items: center; gap: 8px; }
.name-tag .god { color: var(--accent-2); }

/* ---------- Others / admin shared ---------- */
.tabbar-mini { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.chip-select { background: var(--card); border: 1px solid var(--line); color: var(--muted); padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.chip-select.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.admin-grid { display: grid; gap: 18px; }
.admin-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.admin-box h3 { margin: 0 0 14px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.field-row input, .field-row select {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 14px;
}
.field-row label { font-size: 13px; color: var(--muted); min-width: 110px; }
.muted { color: var(--muted); font-size: 13px; }
.email-row { padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.email-row .st { font-weight: 700; }
.st.sent { color: var(--accent); }
.st.error { color: var(--danger); }
.st.skipped { color: var(--accent-2); }
.email-row pre { white-space: pre-wrap; color: var(--muted); margin: 6px 0 0; font-size: 12px; max-height: 120px; overflow: auto; }
.copy-link { word-break: break-all; color: var(--blue); font-size: 12px; }

/* ---------- Tipp-napló ---------- */
.log-group {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 12px;
}
.log-group-head {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 11px 16px; background: var(--bg-2); font-size: 14px;
}
.log-row {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 9px 16px; border-top: 1px solid var(--line); font-size: 13px;
}
.log-row.edit { background: rgba(255,210,63,.05); }
.log-time { color: var(--muted); font-size: 12px; min-width: 138px; font-variant-numeric: tabular-nums; }
.log-who { font-weight: 700; min-width: 110px; }
.log-badge {
  padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.log-badge.submit { background: rgba(0,224,138,.14); color: var(--accent); }
.log-badge.admin { background: rgba(255,210,63,.16); color: var(--accent-2); }
.log-target { flex: 1; min-width: 200px; }
.log-what { font-size: 14px; }
.log-old { color: var(--muted); text-decoration: line-through; }
.log-arrow { color: var(--accent-2); font-weight: 800; }

/* toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  padding: 13px 20px; border-radius: 12px; box-shadow: var(--shadow); z-index: 60; font-weight: 600; font-size: 14px;
}
.toast.ok { border-color: var(--accent); }
.toast.err { border-color: var(--danger); }

@media (max-width: 560px) {
  .match { grid-template-columns: 1fr auto 1fr; padding: 12px; }
  .team { font-size: 13px; gap: 6px; }
  .team .flag { font-size: 18px; }
  .tabs { order: 3; width: 100%; }
  .user-chip { margin-left: auto; }
}
