:root {
  --navy: #07081a;
  --panel: #11142b;
  --panel-raised: #1b2040;
  --field: #0b0e23;
  --border: #303658;
  --control-border: #6673a3;
  --gold: #d4a62a;
  --gold-light: #f1d485;
  --blue: #b5c6ff;
  --muted: #c4c9dd;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-family: Barlow, system-ui, sans-serif;
  color: #fff;
  background: var(--navy);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 82% 0, #202453 0, transparent 38rem);
}
a { color: var(--blue); text-underline-offset: .18em; }
a:hover { color: #fff; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; }

.wrap { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
header { background: #090b20; border-bottom: 1px solid var(--border); }
header .wrap {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  font: 800 1.5rem/1 var(--display);
  white-space: nowrap;
}
.brand-logo {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.site-tabs { display: flex; gap: 3px 10px; margin-left: auto; flex-wrap: wrap; }
.site-tabs a {
  padding: 9px 10px;
  color: #fff;
  border-radius: 5px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .065em;
  font: 800 1rem/1.2 var(--display);
}
.site-tabs a:hover { background: var(--panel-raised); }
.site-tabs a[aria-current="page"] {
  color: var(--gold-light);
  background: #27243a;
  box-shadow: inset 0 -2px var(--gold);
}
main { padding: clamp(18px, 4vw, 40px) 0; }
footer {
  padding: 18px 0 25px;
  border-top: 1px solid var(--border);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 4vw, 42px);
  isolation: isolate;
  overflow: hidden;
  padding: clamp(24px, 5vw, 60px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: radial-gradient(ellipse at 86% 42%, #262f71, transparent 65%), #10122d;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0 18%, #4659a4 18% 70%, #151937 70%);
}
.home-hero {
  min-height: clamp(210px, 29vw, 330px);
  background:
    linear-gradient(103deg, #090b20 13%, #101438e8 45%, #10143855 100%),
    url("klub-optakt.jpg") center 52% / cover no-repeat,
    #131837;
}
.hero-copy { min-width: 0; }
.hero h1 {
  margin: .12em 0 .2em;
  color: #fff;
  font: 800 clamp(2.7rem, 7vw, 5.3rem)/.88 var(--display);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.home-hero h1 { max-width: 9em; font-size: clamp(2.7rem, 8vw, 6.3rem); }
.hero p:last-child { max-width: 42ch; margin-bottom: 0; color: #f0f2ff; font-size: 1.1rem; }
.hero-logo {
  display: block;
  width: clamp(60px, 15vw, 155px);
  height: auto;
  filter: brightness(0) invert(1) drop-shadow(0 2px 10px #07081a);
}
.pitch {
  position: absolute;
  width: 360px;
  height: 235px;
  border: 2px solid #b4ceff28;
  right: -60px;
  top: 35px;
  transform: rotate(-19deg);
  z-index: -1;
}
.pitch::before { content: ""; position: absolute; inset: 0 50% 0 auto; border-left: 2px solid #b4ceff28; }
.pitch::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80px;
  height: 80px;
  border: 2px solid #b4ceff28;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.kicker {
  color: var(--gold-light);
  font: 800 .95rem/1.2 var(--display);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 0;
}
.result.bye-notice, #competition.winter-competition, .kicker.contest-kicker { color: #fff; }

.grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; margin-top: 22px; }
.panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  padding: clamp(16px, 3vw, 24px);
  min-width: 0;
}
.panel :is(h1, h2) {
  margin: 4px 0 12px;
  font: 800 clamp(1.65rem, 3vw, 2.25rem)/1 var(--display);
  text-transform: uppercase;
}
.sub, .help, footer { color: var(--muted); font-size: .95rem; line-height: 1.5; }
.tip-layout { align-items: start; }
#kamptip { border-top: 3px solid var(--gold); }
.tip-layout .schedule { margin-top: 0; }
.schedule ul { list-style: none; padding: 0; margin: 12px 0; }
.schedule details { margin-top: 18px; }
.schedule summary { cursor: pointer; }
.schedule h3 { margin: 16px 0 0; }
.schedule a { white-space: nowrap; }
.fixture {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--border);
}
.fixture small { display: block; color: var(--muted); margin-top: 3px; }
.fixture button { flex-shrink: 0; }
.team-matchup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-align: center;
}
.team-matchup .club {
  display: grid;
  justify-items: center;
  align-self: start;
  gap: 8px;
  font-size: clamp(1rem, 3vw, 1.35rem);
  overflow-wrap: anywhere;
}
.team-matchup img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  padding: 6px;
  border-radius: 8px;
  background: var(--panel-raised);
}
.match-divider { color: var(--muted); font-size: 1rem; }
.archive-matchup, .archive-matchup .club { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.archive-matchup img { width: 22px; height: 22px; object-fit: contain; }

.score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; margin: 22px 0; }
.score label { text-align: center; font-weight: 700; font-size: .9rem; }
.score > span { padding-bottom: 14px; color: var(--muted); }
input, select {
  display: block;
  width: 100%;
  padding: 11px;
  margin-top: 7px;
  border: 1px solid var(--control-border);
  border-radius: 7px;
  background: var(--field);
  color: #fff;
}
input::placeholder { color: #adb4d1; opacity: 1; }
.score input { text-align: center; font: 800 1.75rem/1 var(--display); }
.name { display: block; font-weight: 700; }
.primary, .secondary {
  border: 1px solid var(--control-border);
  border-radius: 7px;
  padding: 9px 12px;
  font: 800 1rem/1.2 var(--display);
  letter-spacing: .045em;
  text-transform: uppercase;
}
.primary, .fixture button[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
}
.primary { width: 100%; margin-top: 15px; padding: 12px; }
.primary:hover:not(:disabled), .fixture button[aria-pressed="true"]:hover { background: var(--gold-light); }
.secondary:not([aria-pressed="true"]) { background: transparent; color: #fff; }
.secondary:not([aria-pressed="true"]):hover { background: var(--panel-raised); }
.status { min-height: 1.5em; color: var(--gold-light); margin: 12px 0 0; }
.result { color: var(--gold-light); font-weight: 700; }
#aliasStatus:empty { display: none; }
.auth-panel { max-width: 440px; margin: clamp(24px, 8vh, 90px) auto; }
.auth-secondary { width: 100%; margin-top: 10px; }
.auth-logout { flex: none; }
.auth-checkbox:not([hidden]) { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; }
.auth-checkbox input { width: auto; margin: 3px 0 0; accent-color: var(--gold); }

.player-tips { margin: 0 0 16px; padding: 13px; border: 1px solid var(--border); border-radius: 8px; }
.player-tips legend, .player-tips label { font-size: .9rem; font-weight: 700; }
.player-tips label { display: block; }
.player-tips label + label { margin-top: 12px; }
.player-picker { border: 1px solid var(--control-border); border-radius: 7px; background: var(--field); }
.player-picker + .player-picker { margin-top: 9px; }
.player-picker summary { cursor: pointer; padding: 10px 11px; font-weight: 700; }
.player-picker summary span { float: right; color: var(--muted); }
.player-options { max-height: 226px; overflow: auto; padding: 0 8px 8px; }
.player-tips .player-options label { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 4px 6px; margin: 0; }
.player-options input[type="checkbox"] { width: 17px; height: 17px; margin: 0; flex: none; accent-color: var(--gold); }
.player-options label > span { min-width: 0; overflow-wrap: anywhere; }
.player-position { margin-left: auto; text-align: right; color: var(--muted); font-weight: 400; }

.match-preview h3 { margin: 1rem 0 .4rem; font: 800 1.15rem/1.2 var(--display); text-transform: uppercase; }
.preview-results { list-style: none; padding: 0; margin: 0; }
.preview-result { border-bottom: 1px solid var(--border); }
.preview-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem; padding: .55rem 0; color: inherit; text-decoration: none; }
.preview-link > span:first-child { overflow-wrap: anywhere; }
.preview-link:hover, .preview-link:focus-visible { text-decoration: underline; }
.preview-link-arrow { display: none; }
.preview-result small { display: block; color: var(--muted); margin-top: .18rem; }
.preview-score { color: var(--gold-light); background: var(--panel-raised); border-radius: 5px; padding: .2rem .45rem; font-weight: 700; text-align: center; max-width: 7rem; }
.preview-score--win { color: #86efac; background: #123626; }
.preview-score--loss { color: #fca5a5; background: #421e2b; }
.preview-score--draw { color: #d1d5db; background: #303448; }

.ranking-panel, .season { margin-top: 22px; }
.ranking, .stats-table { width: 100%; border-collapse: collapse; }
.ranking { margin: 17px 0 13px; text-align: left; }
.ranking th, .ranking td, .stats-table th, .stats-table td { padding: 11px 9px; border-bottom: 1px solid var(--border); }
.ranking th, .stats-table thead th { color: var(--muted); font: 800 .95rem/1.2 var(--display); text-transform: uppercase; letter-spacing: .055em; }
.ranking td { overflow-wrap: anywhere; }
.ranking th:last-child, .ranking td:last-child { text-align: right; }
.ranking tr.mine { color: var(--gold-light); background: var(--panel-raised); }
.rules { display: flex; gap: 8px 16px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.rules b { color: #fff; }
.season label { display: block; font-weight: 700; margin-top: 12px; }
.season form { max-width: 450px; }
.prize-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(245px, 100%), 1fr)); gap: 14px; list-style: none; padding: 0; margin: 20px 0; }
.prize-tier { border-top: 2px solid var(--gold); }
.panel.prize-tier h2 { color: var(--gold-light); margin-top: 0; }
.prize-tier ul { margin: 0; padding-left: 1.2em; }
.prize-tier li + li { margin-top: 8px; }

.stats-panel { margin-top: 16px; }
.stats-scroll { overflow-x: auto; }
.stats-table th, .stats-table td { text-align: right; white-space: nowrap; }
.stats-table th:nth-child(2), .stats-table .stats-position { text-align: left; }
.stats-table tbody th { font-weight: 600; }
.stats-table tbody tr:last-child > * { border-bottom: 0; }
.history-player { padding: 0; border: 0; background: transparent; color: var(--blue); font-weight: inherit; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.history-dialog { width: min(920px, calc(100% - 28px)); max-height: calc(100% - 32px); color: inherit; }
.history-dialog::backdrop { background: #030414cc; }
.history-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.history-heading h2 { margin-bottom: 0; }
.history-table :is(th, td):nth-child(-n + 2) { text-align: left; }
.history-table .history-total { background: var(--panel-raised); font-weight: 700; }
.history-player-title { display: flex; align-items: center; gap: .75rem; }
#historyPortrait:empty, .stats-portrait[hidden] { display: none; }
.stats-portrait { display: block; width: 56px; height: 56px; object-fit: cover; object-position: center 30%; border-radius: 50%; }

#mine-tips { margin-block-start: 1rem; }
#mine-tips section + section { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.my-tips-list { display: grid; gap: .75rem; padding: 0; list-style: none; }
.my-tips-list:empty { display: none; }
.my-tips-list li { padding-block: .5rem; overflow-wrap: anywhere; }

@media (min-width: 691px) and (max-width: 1049px) {
  .tip-layout { grid-template-areas: "schedule tip" "preview tip"; }
  .tip-layout .schedule { grid-area: schedule; }
  .tip-layout #kamptip { grid-area: tip; }
  .match-preview { grid-area: preview; }
}
@media (min-width: 1050px) {
  .tip-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); }
}
@media (max-width: 690px) {
  .wrap { width: calc(100% - 32px); }
  header .wrap { flex-wrap: wrap; padding-block: 12px 8px; gap: 8px; }
  .site-tabs { width: 100%; margin: 0; gap: 2px 4px; }
  .site-tabs a { padding: 8px; }
  .grid { grid-template-columns: 1fr; }
  .pitch { right: -185px; }
}
@media (max-width: 430px) {
  .hero { padding: 22px 16px; }
  .hero h1, .home-hero h1 { font-size: clamp(2.2rem, 9vw, 3rem); }
  .hero p:last-child { font-size: 1rem; }
}
