:root {
  color-scheme: dark;
  --widget-size: min(100vw, 174px);
  --ink: #f7fbff;
  --muted: rgba(247, 251, 255, 0.64);
  --line: rgba(255, 255, 255, 0.13);
  --panel: rgba(12, 20, 26, 0.8);
}

* {
  box-sizing: border-box;
}

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

body {
  align-items: center;
  background: linear-gradient(145deg, #24392f 0%, #101820 48%, #17212d 100%);
  color: var(--ink);
  display: grid;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  justify-items: center;
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
}

.widget {
  aspect-ratio: 1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(152deg, rgba(22, 69, 49, 0.94), rgba(14, 22, 31, 0.98) 58%, rgba(31, 37, 47, 0.98));
  background-size: 30px 30px, 30px 30px, auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.4);
  display: grid;
  gap: 4px;
  grid-template-rows: auto 1fr auto;
  height: var(--widget-size);
  overflow: hidden;
  padding: 10px;
  position: relative;
  width: var(--widget-size);
}

.widget::before {
  background: linear-gradient(90deg, #d40b1f, #ffffff, #171f38);
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.widget__header {
  align-items: start;
  display: flex;
  justify-content: space-between;
  min-width: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  margin: 0 0 3px;
  text-transform: uppercase;
}

h1 {
  font-size: 15px;
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
}

.matches {
  align-content: start;
  display: grid;
  gap: 3px;
  min-height: 0;
}

.match {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) 25px;
  min-height: 33px;
  padding: 3px 6px 3px 5px;
}

.match--today {
  background: rgba(18, 34, 28, 0.92);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.match--empty {
  opacity: 0.72;
}

.match__body {
  min-width: 0;
}

.match__teams {
  align-items: center;
  display: flex;
  font-size: 9px;
  font-weight: 800;
  gap: 3px;
  letter-spacing: 0;
  line-height: 1.1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.match__teams .team {
  align-items: center;
  display: inline-flex;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match__teams .team--own {
  color: #ffffff;
  text-shadow: 0 0 8px color-mix(in srgb, var(--accent) 55%, transparent);
}

.match__teams .team-sep {
  color: var(--muted);
  flex: 0 0 auto;
  font-weight: 700;
}

.team-side {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 3px;
  color: #ffffff;
  flex: 0 0 auto;
  font-size: 6px;
  font-weight: 900;
  line-height: 1;
  padding: 1px 2px;
}

.team-icon,
.league-icon {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.team-icon {
  height: 10px;
  width: 10px;
}

.league-icon {
  height: 8px;
  width: 8px;
}

.match__meta {
  color: var(--muted);
  font-size: 7px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.1;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match--today .match__meta {
  color: color-mix(in srgb, var(--accent) 70%, #ffffff);
  font-weight: 750;
}

.match__competition {
  align-items: center;
  color: rgba(247, 251, 255, 0.78);
  display: flex;
  font-size: 6.5px;
  font-weight: 750;
  gap: 3px;
  letter-spacing: 0;
  line-height: 1.05;
  margin-top: 0;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  margin-top: 1px;
}

.match__competition span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.countdown {
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.match--today .countdown {
  color: color-mix(in srgb, var(--accent) 75%, #ffffff);
}

.countdown small {
  color: var(--muted);
  display: block;
  font-size: 7px;
  font-weight: 800;
  margin-top: 2px;
}

.widget__footer {
  align-items: center;
  color: rgba(247, 251, 255, 0.52);
  display: flex;
  font-size: 7px;
  font-weight: 750;
  justify-content: space-between;
  line-height: 1;
  margin-top: 3px;
  min-width: 0;
}

@media (max-width: 160px) {
  .widget {
    gap: 5px;
    padding: 8px;
  }

  h1 {
    font-size: 13px;
  }

  .match {
    gap: 5px;
    grid-template-columns: minmax(0, 1fr) 23px;
    min-height: 34px;
    padding-right: 5px;
  }

  .match__teams {
    font-size: 9px;
  }

  .match__meta {
    font-size: 7px;
  }
}
