:root {
  --ink: #1b3148;
  --navy: #284868;
  --muted: #5a6f82;
  --line: #c8d4de;
  --blue: #0078c0;
  --red: #e83038;
  --accent: #0078c0;
  --fin: #e83038;
  --bg: #f5f9fc;
  --gold: #e83038;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(700px 280px at 100% 0%, rgba(0, 120, 192, 0.1), transparent 65%),
    linear-gradient(180deg, #f5f9fc 0%, #fff 40%);
  color: var(--ink);
  padding: .85rem 1rem 1.25rem;
}
.wrap { max-width: 780px; margin: 0 auto; }
.brand {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: .75rem; padding-bottom: .55rem;
  border-bottom: 1px solid var(--line);
}
.brand-left { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.brand img { height: 44px; width: auto; display: block; flex-shrink: 0; }
.brand .event { display: block; font-size: .95rem; font-weight: 800; line-height: 1.2; }
.brand .event span { display: block; margin-top: .15rem; font-size: .82rem; font-weight: 500; color: var(--muted); }
.brand .sport {
  margin: 0; text-align: right; font-family: Outfit, "Source Sans 3", sans-serif;
  font-size: 1.32rem; font-weight: 800; line-height: 1.15; flex-shrink: 0; color: var(--red);
}
@media (max-width: 560px) {
  .brand { flex-wrap: wrap; }
  .brand .sport { width: 100%; text-align: left; margin-top: .15rem; }
}
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .85rem .8rem; margin-bottom: .65rem;
}
.card h2 {
  margin: 0 0 .4rem; font-size: .78rem; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.ko .card h2 { color: var(--fin); }
.blurb { margin: 0 0 .5rem; color: var(--muted); font-size: .84rem; line-height: 1.35; font-weight: 600; }
.teams { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .55rem; }
.team {
  border: 1px dashed var(--line); border-radius: 6px; padding: .28rem .55rem;
  font-weight: 600; background: #fafcfd; font-size: .9rem;
}
.round-label {
  margin: .55rem 0 .2rem; font-size: .72rem; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; color: var(--blue);
}
.round-label:first-of-type { margin-top: 0; }
.m {
  display: flex; justify-content: space-between; gap: .75rem;
  border-top: 1px solid var(--line); padding: .32rem 0;
  font-size: .92rem; font-weight: 600;
}
.m:first-of-type, .round-label + .m { border-top: 0; }
.m span:last-child { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.legend { margin: .5rem 0 0; font-size: .8rem; color: var(--muted); }
.legend b { color: var(--ink); }
.arrow { text-align: center; color: var(--muted); font-weight: 700; margin: .15rem 0 .4rem; font-size: .8rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { border-bottom: 1px solid var(--line); padding: .28rem .3rem; text-align: left; }
th.num, td.num { text-align: right; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
tr.r1 td, tr.adv-1 td { background: #fff5f5; font-weight: 800; }
tr.r2 td, tr.adv-2 td { background: #f4f7fa; font-weight: 700; }
tr.r3 td, tr.adv-3 td { font-weight: 600; }
tr.adv-4 td { color: var(--muted); }
.place { font-weight: 800; color: var(--gold); width: 2.5rem; }
.tag {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: .1rem .35rem; border-radius: 4px; margin-left: .35rem;
}
.tag.fin { background: #fff5f5; color: var(--fin); }
.tag.third { background: #eef6fa; color: var(--blue); }
.ko { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-bottom: .65rem; }
@media (max-width: 640px) { .ko { grid-template-columns: 1fr; } }
.pair { font-size: 1.02rem; font-weight: 800; margin: .1rem 0 .2rem; }
.hint { color: var(--muted); font-size: .82rem; margin: 0; }
.score-line { margin: .35rem 0 0; font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.foot {
  margin-top: .15rem; padding: .55rem .75rem; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .82rem;
}
.foot strong { color: var(--ink); }
.powered {
  margin-top: .9rem; padding-top: .65rem; border-top: 1px solid var(--line);
  text-align: center; font-size: .78rem; color: var(--muted);
}
.powered a { color: var(--blue); font-weight: 800; text-decoration: none; }
.back { display: inline-block; margin-bottom: .65rem; font-size: 1.7rem; font-weight: 700; color: var(--blue); text-decoration: none; opacity: .5; }
.back:hover { text-decoration: underline; }

/* Telefon / QR */
@media (max-width: 640px) {
  body {
    padding:
      max(.65rem, env(safe-area-inset-top, 0px))
      max(.75rem, env(safe-area-inset-right, 0px))
      calc(1rem + env(safe-area-inset-bottom, 0px))
      max(.75rem, env(safe-area-inset-left, 0px));
  }
  .back {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    font-size: 1.35rem;
    opacity: .65;
    margin-bottom: .45rem;
    padding: .1rem .15rem;
    -webkit-tap-highlight-color: transparent;
  }
  .brand {
    margin-bottom: .6rem;
    padding-bottom: .45rem;
    gap: .55rem;
  }
  .brand img { height: 38px; }
  .brand .event { font-size: .9rem; }
  .brand .event span { font-size: .78rem; }
  .brand .sport { font-size: 1.15rem; }
  .card {
    padding: .6rem .7rem .7rem;
    margin-bottom: .55rem;
    border-radius: 8px;
  }
  .card h2 { font-size: .74rem; margin-bottom: .35rem; }
  .blurb { font-size: .82rem; }
  .m {
    padding: .42rem 0;
    font-size: .95rem;
    gap: .5rem;
  }
  table { font-size: .95rem; }
  th, td { padding: .4rem .28rem; }
  .pair { font-size: .98rem; }
  .score-line { font-size: .98rem; }
  .foot { font-size: .8rem; padding: .5rem .65rem; }
  .powered { font-size: .76rem; }
}
