:root {
  color-scheme: dark;
  --ink: #f8fbff;
  --muted: #aeb8c8;
  --panel: rgba(10, 15, 24, 0.78);
  --panel-strong: rgba(17, 24, 36, 0.92);
  --line: rgba(255, 255, 255, 0.14);
  --green: #37d67a;
  --mint: #7de2c3;
  --gold: #ffd166;
  --red: #ff5c7a;
  --blue: #58a6ff;
  --pitch: #113f2f;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 15%, rgba(55, 214, 122, 0.22), transparent 24rem),
    radial-gradient(circle at 80% 20%, rgba(255, 209, 102, 0.18), transparent 22rem),
    linear-gradient(145deg, #081018 0%, #111827 48%, #061f18 100%);
  color: var(--ink);
}

.widget-shell {
  width: min(430px, calc(100vw - 28px));
  padding: 14px;
}

.scoreboard {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(rgba(255,255,255,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(160deg, var(--panel-strong), var(--panel));
  background-size: 34px 34px, 34px 34px, auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.12);
}

.scoreboard::before {
  content: "";
  position: absolute;
  inset: 86px -60px auto;
  height: 220px;
  border: 2px solid rgba(255,255,255,0.11);
  border-radius: 50%;
  pointer-events: none;
}

.hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  min-height: 142px;
  padding: 24px 24px 18px;
  background:
    linear-gradient(135deg, rgba(55,214,122,0.2), transparent 45%),
    linear-gradient(90deg, rgba(88,166,255,0.12), transparent 65%);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 48px;
  line-height: 0.95;
  letter-spacing: 0;
}

.date-line {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.ball {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 42%, #ffffff 0 12px, #111827 13px 15px, transparent 16px),
    conic-gradient(from 20deg, #f8fbff 0 15%, #111827 15% 18%, #f8fbff 18% 37%, #111827 37% 41%, #f8fbff 41% 64%, #111827 64% 68%, #f8fbff 68% 100%);
  box-shadow: 0 10px 28px rgba(0,0,0,0.28), inset -10px -12px 20px rgba(0,0,0,0.18);
}

.ball span {
  width: 74%;
  height: 74%;
  border: 2px solid rgba(17,24,39,0.55);
  border-radius: 50%;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 14px 14px;
}

.metric {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
}

.metric strong {
  display: block;
  font-size: 19px;
}

.metric span {
  color: var(--muted);
  font-size: 11px;
}

.games {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.game {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.09), rgba(255,255,255,0.035)),
    linear-gradient(90deg, rgba(17,63,47,0.88), rgba(12,19,31,0.9));
}

.game::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--progress);
  background: linear-gradient(90deg, rgba(55,214,122,0.22), transparent);
  pointer-events: none;
}

.game-inner {
  position: relative;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 14px;
}

.time {
  width: 56px;
  padding: 7px 0;
  border-radius: 12px;
  background: rgba(0,0,0,0.24);
  text-align: center;
  font-size: 17px;
  font-weight: 800;
}

.match {
  min-width: 0;
}

.phase {
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 760;
}

.teams {
  font-size: 18px;
  font-weight: 820;
  line-height: 1.2;
}

.place {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.live-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  color: #ffd9e1;
  font-size: 12px;
  font-weight: 760;
}

.score {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 92, 122, 0.2);
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
}

.score span {
  color: rgba(248,251,255,0.72);
  font-size: 12px;
}

.live-line.pending {
  color: rgba(248,251,255,0.7);
}

.live-line.pending .score {
  background: rgba(255,255,255,0.1);
  color: rgba(248,251,255,0.76);
}

.status {
  justify-self: end;
  min-width: 74px;
  padding: 8px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: var(--ink);
  text-align: center;
  font-size: 12px;
  font-weight: 760;
}

.status.live {
  background: rgba(255, 92, 122, 0.2);
  color: #ffd9e1;
}

.status.next {
  background: rgba(55, 214, 122, 0.18);
  color: #d7ffe8;
}

.status.done {
  color: var(--muted);
}

.empty-state {
  margin: 0 14px 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  line-height: 1.45;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 16px;
  color: rgba(248,251,255,0.58);
  font-size: 11px;
}

.alarm-toggle {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: rgba(248,251,255,0.78);
  font: inherit;
  font-weight: 760;
  cursor: pointer;
}

.alarm-toggle[aria-pressed="true"] {
  border-color: rgba(255, 209, 102, 0.55);
  background: rgba(255, 209, 102, 0.18);
  color: var(--ink);
}

.goal-alert .scoreboard {
  animation: goalPulse 0.55s ease-in-out 3;
}

@keyframes goalPulse {
  0%, 100% {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.12);
  }

  50% {
    box-shadow: 0 24px 70px rgba(255, 209, 102, 0.42), inset 0 1px 0 rgba(255,255,255,0.22);
  }
}

@media (max-width: 390px) {
  .hero {
    padding: 20px 18px 16px;
  }

  h1 {
    font-size: 40px;
  }

  .ball {
    width: 62px;
    height: 62px;
  }

  .summary {
    grid-template-columns: 1fr;
  }

  .game-inner {
    grid-template-columns: 54px 1fr;
  }

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

  footer {
    flex-wrap: wrap;
  }
}
