/* ============================================================
   WM 2026 Tippspiel – Stylesheet
   Palette: Nachtblau #0A1628, Gold #D4AF37, Rasen #1A6B3C,
            Hellgrau #F0F2F5, Weiß #FFFFFF, Akzent #C0392B
   ============================================================ */

:root {
  --bg:          #0A1628;
  --bg-card:     #0F1E38;
  --bg-surface:  #162440;
  --gold:        #D4AF37;
  --gold-light:  #F0D060;
  --green:       #1A6B3C;
  --green-light: #27AE60;
  --red:         #C0392B;
  --text:        #E8EDF5;
  --text-muted:  #8899AA;
  --border:      #1E3050;
  --radius:      10px;
  --shadow:      0 4px 20px rgba(0,0,0,.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* ===== LOGIN ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(26,107,60,.25) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, rgba(212,175,55,.12) 0%, transparent 60%),
    var(--bg);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}

.login-emblem {
  text-align: center;
  margin-bottom: 2rem;
}

.trophy {
  font-size: 3rem;
  display: block;
  margin-bottom: .5rem;
}

.login-emblem h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.2;
}

.login-emblem h1 span {
  color: var(--gold);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: .15em;
  text-transform: uppercase;
}

/* ===== FORM FIELDS ===== */
.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .4rem;
}

input[type="text"],
input[type="password"],
input[type="number"] {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  padding: .65rem .9rem;
  width: 100%;
  transition: border-color .2s;
}

input:focus {
  outline: none;
  border-color: var(--gold);
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  padding: .75rem 1.75rem;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn-primary:hover  { background: var(--gold-light); }
.btn-primary:active { transform: scale(.98); }
.btn-full { width: 100%; }

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: .85rem;
  padding: .35rem .8rem;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.btn-logout:hover { color: var(--text); border-color: var(--text-muted); }

.btn-pw {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: .85rem;
  padding: .35rem .8rem;
  transition: color .2s, border-color .2s;
}
.btn-pw:hover,
.btn-pw.active { color: var(--gold); border-color: var(--gold); }

/* ===== ALERTS ===== */
.alert {
  border-radius: 8px;
  font-size: .9rem;
  margin-bottom: 1.25rem;
  padding: .75rem 1rem;
}
.alert-success { background: rgba(39,174,96,.15); border: 1px solid var(--green-light); color: var(--green-light); }
.alert-error   { background: rgba(192,57,43,.15);  border: 1px solid var(--red);         color: #E74C3C; }

/* ===== HEADER ===== */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: .8rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  flex: 1;
}

.site-nav a {
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  transition: color .2s;
}
.site-nav a:hover,
.site-nav a.active { color: var(--gold); }

.user-badge {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .9rem;
  white-space: nowrap;
}

.points-pill {
  background: var(--gold);
  color: var(--bg);
  border-radius: 99px;
  font-size: .8rem;
  font-weight: 700;
  padding: .2rem .7rem;
}

/* ===== GROUP TABS ===== */
.group-tabs-wrap {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.group-tabs {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.group-tab {
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .05em;
  padding: .75rem 1rem;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.group-tab:hover  { color: var(--text); }
.group-tab.active { color: var(--gold); border-color: var(--gold); }

/* ===== MAIN ===== */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--gold);
}

/* ===== MATCH DAY ===== */
.match-day { margin-bottom: 2.5rem; }
.match-day-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-left: 3px solid var(--gold);
  padding-left: .75rem;
  margin-bottom: 1rem;
}

/* ===== MATCH GRID ===== */
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

/* ===== MATCH CARD ===== */
.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: border-color .2s;
}
.match-card:hover  { border-color: #2A4070; }
.match-card.locked { opacity: .75; }

.match-meta {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .6rem;
  flex-wrap: wrap;
  gap: .25rem;
}

.match-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.team {
  flex: 1;
  font-size: .92rem;
  font-weight: 600;
}
.team-home { text-align: right; }
.team-away { text-align: left; }

.score-block {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
}

.tip-input {
  width: 48px !important;
  padding: .4rem .3rem !important;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 6px !important;
}

.colon {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-muted);
}

.official-result {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--green-light);
  letter-spacing: .05em;
  padding: .2rem .5rem;
}

.locked-result { color: var(--text-muted); }

.lock-icon { font-size: 1rem; }

.points-badge {
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 700;
  padding: .15rem .4rem;
}
.pts-5 { background: var(--gold);        color: var(--bg); }
.pts-3 { background: var(--green-light);  color: var(--bg); }
.pts-2 { background: var(--green);        color: #fff; }
.pts-0 { background: var(--bg-surface);   color: var(--text-muted); }

.my-tip {
  font-size: .75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}

/* ===== SAVE BAR ===== */
.save-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
}

.save-hint {
  font-size: .85rem;
  color: var(--text-muted);
}

/* ===== RANKING TABLE ===== */
.table-wrap { overflow-x: auto; }

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}

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

.ranking-table th {
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ranking-table tr:hover td { background: var(--bg-surface); }

.ranking-table tr.my-row td {
  background: rgba(212,175,55,.07);
  font-weight: 600;
}

.rank-cell { font-size: 1.2rem; width: 3rem; }
.points-cell { font-size: 1.15rem; font-weight: 700; color: var(--gold); }

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: .8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.sync-info {
  margin-top: .4rem;
  font-size: .72rem;
  opacity: .7;
}

/* ===== ADMIN ===== */
.admin-card { border-color: rgba(212,175,55,.25); }

/* ===== GRUPPENTABELLEN ===== */
.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.group-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 1.25rem;
}

.group-table-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--gold);
  margin-bottom: .75rem;
}

.standings-table th,
.standings-table td {
  padding: .45rem .6rem;
  font-size: .85rem;
  text-align: center;
}
.standings-table th:nth-child(2),
.standings-table td:nth-child(2) {
  text-align: left;
}

.rank-cell-small {
  font-weight: 700;
  color: var(--text-muted);
}

.qualified-row td { background: rgba(39,174,96,.08); }
.thirdplace-row td { background: rgba(212,175,55,.06); }

.table-legend {
  margin-top: 1.5rem;
  font-size: .8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  vertical-align: middle;
}
.legend-qualified  { background: rgba(39,174,96,.35); }
.legend-thirdplace { background: rgba(212,175,55,.3); }

/* ===== KO-RUNDE ===== */
.ko-number {
  font-weight: 700;
  color: var(--gold);
}

.ko-team {
  font-size: .85rem;
}

.ko-labels {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
  flex-wrap: wrap;
}

.ko-label-sep { color: var(--text-muted); }

.ko-team-inputs {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
}

.ko-team-input {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .8rem;
  padding: .4rem .5rem;
  flex: 1;
  min-width: 0;
}
.ko-team-input:focus {
  outline: none;
  border-color: var(--gold);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; gap: .75rem; }
  .site-nav { gap: 1rem; }
  .user-badge { margin-left: auto; }
  .match-grid { grid-template-columns: 1fr; }
  .team { font-size: .82rem; }
  .save-bar { flex-direction: column; align-items: flex-start; }
}

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

/* ===== ADMIN-NAVIGATIONSZEILE ===== */
.admin-nav-bar {
  background: rgba(212,175,55,.08);
  border-top: 1px solid rgba(212,175,55,.2);
}
.admin-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: .4rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.admin-nav-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .7;
}
.admin-nav-inner a {
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
  transition: color .2s;
}
.admin-nav-inner a:hover,
.admin-nav-inner a.active { color: var(--gold); }

/* ===== USER-NAME in Badge ===== */
.user-name { font-size: .9rem; }

/* ===== ADMIN Ergebnisse / Tipps – kompakte Liste ===== */
.user-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.user-tab {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 600;
  padding: .5rem 1rem;
  text-decoration: none;
  transition: all .2s;
}
.user-tab:hover  { color: var(--text); border-color: #2A4070; }
.user-tab.active { background: var(--gold); color: var(--bg); border-color: var(--gold); }
