:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #617083;
  --line: #d7dee8;
  --line-soft: #e7edf3;
  --panel: #ffffff;
  --page: #eef3f8;
  --page-top: #f7fafc;
  --accent: #166f67;
  --accent-strong: #0d554e;
  --accent-soft: #e8f5f1;
  --ok: #1f7a45;
  --warn: #b25e10;
  --shadow: 0 14px 34px rgba(24, 42, 58, 0.08);
  --shadow-soft: 0 8px 22px rgba(24, 42, 58, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background:
    linear-gradient(180deg, var(--page-top) 0, var(--page) 280px),
    var(--page);
  color: var(--ink);
}

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

a:focus-visible {
  outline: 3px solid rgba(22, 111, 103, 0.22);
  outline-offset: 3px;
}

.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;
  min-height: 114px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.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;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.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;
  box-shadow: var(--shadow-soft);
  transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.primary-link:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

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

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.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-soft);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.16s ease, transform 0.16s ease;
}

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

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

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

.schedule-main-link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

.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);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 2px 6px rgba(24, 42, 58, 0.12);
}

.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;
}

.saved-track {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.game-name .saved-track {
  display: flex;
}

.game-name .saved-track .track-flag {
  display: inline-block;
  overflow: hidden;
  white-space: normal;
}

.saved-track .track-flag {
  width: 20px;
  height: 15px;
}

.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-it { background-image: url("/vendor/flag-icons/flags/4x3/it.svg"); }
.fi-nl { background-image: url("/vendor/flag-icons/flags/4x3/nl.svg"); }
.fi-hk { background-image: url("/vendor/flag-icons/flags/4x3/hk.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;
}

.game-turnover {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.builder-link {
  display: inline-grid;
  place-items: center;
  justify-self: end;
  min-width: 94px;
  min-height: 28px;
  border: 1px solid #b8c6d5;
  border-radius: 6px;
  padding: 0 9px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.builder-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.builder-link-plus {
  display: none;
  font-size: 18px;
  line-height: 1;
}

.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;
}

.game-name .saved-track {
  display: flex;
}

.game-name .saved-track .track-flag {
  display: inline-block;
  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: var(--accent-soft);
  color: var(--ok);
}

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

.empty-state {
  margin: 0;
  padding: 24px 18px;
  color: var(--muted);
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.info-section {
  margin-top: 24px;
}

.info-content {
  padding: 15px 18px 17px;
}

.info-content p {
  margin: 0;
  color: #2d3a48;
  font-size: 14px;
  line-height: 1.55;
}

.info-content p + p {
  margin-top: 10px;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  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;
  }

  .home-header {
    min-height: 0;
  }

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

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

  .game-turnover {
    display: none;
  }

  .builder-link {
    min-width: 32px;
    min-height: 28px;
    padding: 0;
  }

  .builder-link-text {
    display: none;
  }

  .builder-link-plus {
    display: block;
  }

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

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