/* WM Tippspiel 2026 — "stadium night" theme */

:root {
  --bg: #0b1410;
  --bg-raise: #101b15;
  --bg-card: #13211a;
  --line: #1e3328;
  --green: #19a05c;
  --green-soft: rgba(25, 160, 92, 0.16);
  --text: #f2efe4;
  --muted: #9db3a6;
  --faint: #6c8276;
  --gold: #ffd166;
  --silver: #c8d2d8;
  --bronze: #d99b66;
  --red: #ff4d4d;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background-color: var(--bg);
  /* subtle vertical pitch stripes + a soft floodlight glow at the top */
  background-image:
    radial-gradient(ellipse 120% 50% at 50% -10%, rgba(25, 160, 92, 0.14), transparent 60%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.018) 0px,
      rgba(255, 255, 255, 0.018) 72px,
      rgba(0, 0, 0, 0) 72px,
      rgba(0, 0, 0, 0) 144px
    );
  background-attachment: fixed;
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

/* ── Header / tabs ─────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px 8px;
  max-width: 1100px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 22px;
  letter-spacing: 0.3px;
}
.brand strong {
  color: var(--green);
}
.brand-ball {
  filter: drop-shadow(0 0 6px rgba(25, 160, 92, 0.7));
}
.brand-sub {
  color: var(--faint);
  font-size: 12px;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 12px;
  max-width: 1100px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(11, 20, 16, 0.96), rgba(11, 20, 16, 0.88));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs a {
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tabs a.active {
  color: #fff;
  background: var(--green-soft);
  border-color: rgba(25, 160, 92, 0.5);
}
.tabs a:hover {
  color: var(--text);
}

.view {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 12px 40px;
}

.footer {
  text-align: center;
  color: var(--faint);
  font-size: 11.5px;
  padding: 18px 12px 28px;
}

/* ── Shared bits ───────────────────────────────────────────────────────── */

.table-scroll {
  overflow-x: auto;
  border-radius: 12px;
}

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--bg-raise);
  border-radius: 12px;
  overflow: hidden;
}
th,
td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  background: rgba(0, 0, 0, 0.25);
}
tr:last-child td {
  border-bottom: none;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  flex: 0 0 auto;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.kind-tag {
  font-size: 10.5px;
  color: var(--faint);
  margin-left: 6px;
}

.who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.who .name {
  font-weight: 600;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.chip.points {
  background: var(--green-soft);
  color: #5ee39b;
  border: 1px solid rgba(25, 160, 92, 0.45);
  font-family: var(--mono);
}
.chip.points.zero {
  background: rgba(255, 255, 255, 0.05);
  color: var(--faint);
  border-color: var(--line);
}
.chip.live {
  background: rgba(255, 77, 77, 0.14);
  color: #ff7a7a;
  border: 1px solid rgba(255, 77, 77, 0.5);
}
.chip.live .dot {
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}
.chip.time {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid var(--line);
  font-family: var(--mono);
}

.score {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  background: #0a0f0c;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
  color: #eaffe9;
  text-shadow: 0 0 8px rgba(94, 227, 155, 0.35);
  white-space: nowrap;
}
.pens {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
  margin-left: 6px;
}

.pill.placeholder {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
}

.presence {
  font-size: 11.5px;
  color: var(--faint);
  font-family: var(--mono);
  white-space: nowrap;
}

.empty {
  text-align: center;
  color: var(--muted);
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 42px 16px;
  font-size: 17px;
}

.error-box {
  background: rgba(255, 77, 77, 0.08);
  border: 1px solid rgba(255, 77, 77, 0.4);
  border-radius: 12px;
  padding: 16px;
  color: #ffb3b3;
}

.flag {
  font-size: 17px;
}

/* ── Rangliste ─────────────────────────────────────────────────────────── */

.lb-row.rank-1 {
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.16), rgba(255, 209, 102, 0.02));
}
.lb-row.rank-2 {
  background: linear-gradient(90deg, rgba(200, 210, 216, 0.13), rgba(200, 210, 216, 0.02));
}
.lb-row.rank-3 {
  background: linear-gradient(90deg, rgba(217, 155, 102, 0.14), rgba(217, 155, 102, 0.02));
}
.lb-row.rank-1 .rank-cell {
  color: var(--gold);
}
.lb-row.rank-2 .rank-cell {
  color: var(--silver);
}
.lb-row.rank-3 .rank-cell {
  color: var(--bronze);
}
.rank-cell {
  font-weight: 800;
  font-family: var(--mono);
}
.total-cell {
  font-weight: 800;
  font-size: 16px;
  font-family: var(--mono);
  color: #5ee39b;
}
.phase-cell {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.mv {
  font-size: 12px;
  font-weight: 800;
}
.mv-up {
  color: #5ee39b;
}
.mv-down {
  color: #ff7a7a;
}
.mv-flat {
  color: var(--faint);
}

.spark {
  width: 84px;
  height: 26px;
  display: block;
}
.spark polyline {
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.spark circle {
  fill: var(--green);
}

/* ── Spielplan ─────────────────────────────────────────────────────────── */

.day-header {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green);
  margin: 22px 4px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.day-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.match-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.match-row:hover {
  border-color: rgba(25, 160, 92, 0.5);
  background: var(--bg-card);
}
.match-row.is-live {
  border-color: rgba(255, 77, 77, 0.45);
}

.mcode {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  width: 38px;
  flex: 0 0 auto;
}
.fixture {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-weight: 600;
}
.fixture .vs {
  color: var(--faint);
  font-weight: 400;
}
.match-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* ── Match-Detail ──────────────────────────────────────────────────────── */

.match-card {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-raise));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 16px;
  text-align: center;
}
.match-card .meta {
  color: var(--faint);
  font-size: 12px;
  margin-bottom: 8px;
}
.match-card .teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 19px;
  font-weight: 700;
}
.match-card .big-score {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 800;
  color: #eaffe9;
  text-shadow: 0 0 14px rgba(94, 227, 155, 0.45);
}
.match-card .kickoff {
  font-family: var(--mono);
  font-size: 20px;
  color: var(--muted);
}
.match-card .venue {
  color: var(--faint);
  font-size: 12px;
  margin-top: 8px;
}

.locked-note {
  text-align: center;
  background: var(--green-soft);
  border: 1px solid rgba(25, 160, 92, 0.4);
  color: #b9e9cd;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
  font-weight: 600;
}

.tip-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tip-row,
.presence-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tip-row .who,
.presence-row .who {
  flex: 1 1 auto;
  min-width: 0;
}
.tip-score {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 15px;
  min-width: 44px;
  text-align: center;
}
.tip-score.failed {
  color: var(--faint);
}
.presence-state {
  font-size: 12.5px;
  font-weight: 600;
}
.presence-state.ok {
  color: #5ee39b;
}
.presence-state.none {
  color: var(--faint);
}
.presence-state.failed {
  color: #ff7a7a;
}

/* ── Weltmeister ───────────────────────────────────────────────────────── */

.champ-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.champ-card {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.champ-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.champ-card h3 .count {
  margin-left: auto;
  color: var(--faint);
  font-size: 12px;
  font-family: var(--mono);
}
.champ-people {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.champ-person {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.champ-person .name {
  flex: 1;
}

/* ── Teilnehmer ────────────────────────────────────────────────────────── */

.bio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 10px;
}
.bio-grid--single {
  grid-template-columns: 1fr;
}

.bio-card {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  min-width: 0;
}
.bio-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.bio-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.bio-title .name {
  font-weight: 700;
}
.bio-title .kind-tag {
  margin-left: 0;
}
.bio-rank {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.bio-tagline {
  font-weight: 800;
  font-size: 13.5px;
  margin-bottom: 4px;
  color: #d9f4e4;
}
.bio-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* bots get the spotlight: green glow frame + tinted background */
.bio-card--bot {
  background: linear-gradient(180deg, rgba(25, 160, 92, 0.14), var(--bg-raise));
  border-color: rgba(25, 160, 92, 0.55);
  box-shadow: 0 0 18px rgba(25, 160, 92, 0.16);
}
.bio-card--bot .bio-tagline {
  color: #5ee39b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bio-card--special {
  background: linear-gradient(135deg, rgba(189, 93, 58, 0.18), var(--bg-raise) 55%);
  border-color: rgba(217, 119, 87, 0.6);
}

/* ── Zusatzfragen ──────────────────────────────────────────────────────── */

.bq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bq-card h3 {
  flex-wrap: wrap;
}
.bq-question {
  flex: 1 1 auto;
  min-width: 0;
}
.bq-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bq-option {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}
.bq-option.correct {
  background: var(--green-soft);
  border-color: rgba(25, 160, 92, 0.55);
}
.bq-option-label {
  font-weight: 700;
  font-size: 13px;
}
.bq-option .count {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11.5px;
}
.bq-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}
.bq-person {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.bq-presence {
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 8px;
}
.bq-presence-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bq-presence-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.bq-presence-badge .tickmark {
  font-size: 10px;
  font-weight: 800;
}
.bq-presence-badge.ok .tickmark {
  color: #5ee39b;
}
.bq-presence-badge.none {
  opacity: 0.4;
}

/* ── Besucher-Ranking ──────────────────────────────────────────────────── */

.rules-box {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-raise));
  border: 1px solid rgba(25, 160, 92, 0.4);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.rules-box h2 {
  margin: 0 0 6px;
  font-size: 17px;
}
.rules-box p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.vg-podium {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vg-slot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 10px;
  user-select: none;
  -webkit-user-select: none;
}
.vg-slot--empty {
  border-style: dashed;
  opacity: 0.75;
}
.vg-slot-hint {
  color: var(--faint);
  font-size: 13px;
}
.vg-pos {
  font-size: 16px;
  width: 24px;
  text-align: center;
  flex: 0 0 auto;
}
.vg-slot .name {
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vg-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}
.vg-choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 7px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.vg-choice:hover:not(:disabled) {
  border-color: rgba(25, 160, 92, 0.6);
}
.vg-choice.is-disabled {
  opacity: 0.4;
  cursor: default;
}
.vg-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.vg-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 7px;
  width: 30px;
  height: 26px;
  font-size: 11px;
  cursor: pointer;
}
.vg-btn:hover {
  color: #fff;
  border-color: rgba(25, 160, 92, 0.5);
}
.vg-btn--remove:hover {
  border-color: rgba(229, 75, 77, 0.6);
}

.vg-submitbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.vg-submitbar input {
  flex: 1 1 200px;
  min-width: 0;
  background: #0a0f0c;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
}
.vg-submitbar input:focus {
  outline: none;
  border-color: rgba(25, 160, 92, 0.6);
}
.vg-submitbar button {
  background: var(--green);
  color: #04130a;
  font-weight: 800;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
}
.vg-submitbar button:hover {
  filter: brightness(1.1);
}
.vg-submitbar button:disabled {
  opacity: 0.5;
  cursor: default;
}
.vg-feedback {
  min-height: 20px;
  margin-top: 8px;
  font-weight: 600;
  font-size: 13.5px;
}
.vg-feedback.ok {
  color: #5ee39b;
}
.vg-feedback.err {
  color: #ff7a7a;
}

.vg-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.vg-row:hover {
  border-color: rgba(25, 160, 92, 0.5);
}
.vg-row--winner {
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.18), var(--bg-raise));
  border-color: rgba(255, 209, 102, 0.55);
}
.vg-row--pending {
  cursor: default;
}
.vg-row--pending:hover {
  border-color: var(--line);
}
.vg-rank {
  font-family: var(--mono);
  font-weight: 800;
  width: 30px;
  flex: 0 0 auto;
}
.vg-name {
  font-weight: 700;
  flex: 1 1 auto;
  min-width: 0;
}
.vg-picks {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.vg-mini {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 11px;
}
.vg-date {
  color: var(--faint);
  font-size: 11.5px;
  font-family: var(--mono);
}
.vg-detail {
  padding: 4px 0 8px;
}
.vg-breakdown td,
.vg-breakdown th {
  white-space: nowrap;
}

/* ── Mobile ────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }
  .brand-sub {
    display: none;
  }
  .view {
    padding: 10px 8px 32px;
  }
  th,
  td {
    padding: 7px 7px;
  }
  .mcode {
    display: none;
  }
  .match-row {
    flex-wrap: wrap;
  }
  .match-right {
    margin-left: auto;
  }
  .spark {
    width: 64px;
  }
  .vg-date {
    display: none;
  }
  .bq-badges {
    margin-left: 0;
    flex-basis: 100%;
  }
}

/* ── Lade-Indikator (nur bei kaltem Cache > 300ms sichtbar) ────────────── */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 0;
  color: var(--muted);
  font-size: 15px;
}
.loading-ball {
  display: inline-block;
  animation: loading-bounce 0.9s ease-in-out infinite;
}
@keyframes loading-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}
