:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #617083;
  --line: #d7dee8;
  --panel: #ffffff;
  --page: #eef3f8;
  --accent: #166f67;
  --accent-strong: #0d554e;
  --ok: #1f7a45;
  --warn: #b25e10;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: var(--page);
  color: var(--ink);
}

a {
  color: var(--accent-strong);
}

.home-shell {
  width: min(1040px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 16px 0 36px;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.brand-title {
  display: inline-flex;
  align-items: center;
  margin: 0;
  line-height: 1;
}

.brand-title img {
  display: block;
  width: auto;
  height: 96px;
  max-width: 72vw;
  object-fit: contain;
}

.home-header h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
}

.home-header p,
.section-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

.home-header nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.primary-link:hover {
  background: var(--accent-strong);
}

.game-section {
  width: min(760px, 100%);
  margin-top: 26px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.section-title h2 {
  margin: 0;
  font-size: 19px;
}

.section-title p {
  font-size: 13px;
}

.count {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #edf1f5;
  color: var(--muted);
  font-weight: 750;
}

.game-list {
  display: grid;
}

.game-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 150px 110px;
  gap: 14px;
  align-items: center;
  min-height: 76px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.game-item:last-child {
  border-bottom: 0;
}

.game-item:hover {
  background: #f7fafc;
}

.schedule-item {
  grid-template-columns: 58px 56px minmax(0, 1fr);
  gap: 10px;
  min-height: 38px;
  padding: 6px 14px;
  border-left: 0;
  background: #fff;
  color: #111820;
}

.schedule-item:hover {
  background: #f7fafc;
}

.today-section {
  margin-top: 18px;
}

.today-section .section-title {
  padding: 11px 14px;
}

.today-section .section-title h2 {
  font-size: 17px;
}

.today-section .section-title p {
  margin-top: 3px;
  font-size: 12px;
}

.game-item .game-type {
  display: inline-grid;
  place-items: center;
  justify-self: start;
  min-width: 50px;
  height: 24px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--game-color-light, var(--game-color, #7bb9df)), var(--game-color, #449fdc));
  color: #fff;
  font-size: 14px;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

.saved-game-item .game-type {
  min-width: 58px;
}

.schedule-item .game-name strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

.track-flag {
  flex: 0 0 auto;
  width: 22px;
  height: 16px;
  border: 1px solid rgba(23, 33, 43, 0.18);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(23, 33, 43, 0.08);
}

.fi {
  display: inline-block;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.fi-se { background-image: url("/vendor/flag-icons/flags/4x3/se.svg"); }
.fi-dk { background-image: url("/vendor/flag-icons/flags/4x3/dk.svg"); }
.fi-fi { background-image: url("/vendor/flag-icons/flags/4x3/fi.svg"); }
.fi-no { background-image: url("/vendor/flag-icons/flags/4x3/no.svg"); }
.fi-fr { background-image: url("/vendor/flag-icons/flags/4x3/fr.svg"); }
.fi-de { background-image: url("/vendor/flag-icons/flags/4x3/de.svg"); }
.fi-us { background-image: url("/vendor/flag-icons/flags/4x3/us.svg"); }
.fi-ca { background-image: url("/vendor/flag-icons/flags/4x3/ca.svg"); }
.fi-gb { background-image: url("/vendor/flag-icons/flags/4x3/gb.svg"); }
.fi-za { background-image: url("/vendor/flag-icons/flags/4x3/za.svg"); }

.schedule-item .game-time {
  justify-self: start;
  margin-top: 0;
  color: #111820;
  font-size: 13px;
  font-weight: 700;
}

.schedule-v4,
.schedule-v5 {
  --game-color: rgb(68, 159, 220);
  --game-color-light: rgb(116, 185, 230);
}

.schedule-v64 {
  --game-color: rgb(234, 98, 6);
  --game-color-light: rgb(250, 132, 47);
}

.schedule-v65 {
  --game-color: rgb(192, 10, 38);
  --game-color-light: rgb(219, 48, 74);
}

.schedule-v85 {
  --game-color: rgb(0, 79, 159);
  --game-color-light: rgb(42, 115, 190);
}

.schedule-v86 {
  --game-color: rgb(128, 44, 126);
  --game-color-light: rgb(164, 74, 162);
}

.schedule-gs75 {
  --game-color: rgb(21, 97, 78);
  --game-color-light: rgb(45, 130, 108);
}

.game-type {
  font-size: 17px;
  font-weight: 800;
}

.game-name {
  min-width: 0;
}

.game-name strong,
.game-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-name span,
.game-time {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.schedule-item .track-flag {
  display: inline-block;
  margin-top: 0;
  color: inherit;
  font-size: inherit;
  overflow: hidden;
  white-space: normal;
}

.status {
  justify-self: end;
  border-radius: 999px;
  padding: 6px 9px;
  background: #edf1f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status.live {
  background: #edf8f5;
  color: var(--ok);
}

.status.ready {
  background: #fff4e8;
  color: var(--warn);
}

.empty-state {
  margin: 0;
  padding: 24px 18px;
  color: var(--muted);
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.benne-link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-1px);
}

.coffee-link {
  display: inline-flex;
  align-items: center;
}

.coffee-link img {
  display: block;
  width: 108px;
  height: 24px;
}

@media (max-width: 720px) {
  .home-header,
  .home-header nav,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .game-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .schedule-item {
    grid-template-columns: 58px 52px minmax(0, 1fr);
  }

  .game-time,
  .status {
    justify-self: start;
    grid-column: 2;
  }

  .schedule-item .game-time {
    justify-self: start;
    grid-column: 1;
  }
}
