:root {
  --bg: #ececec;
  --surface: #f7f7f7;
  --surface-strong: #ffffff;
  --surface-soft: #efefef;
  --line: #dddddd;
  --text: #2f2f2f;
  --text-muted: #8d8d8d;
  --text-soft: #b1b1b1;
  --accent: #111111;
  --accent-soft: #d8d8d8;
  --success: #18a957;
  --danger: #d67042;
  --shadow: 0 10px 28px rgba(33, 33, 33, 0.06);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 999px;
  --font-sans: "Avenir Next", "SF Pro Display", "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #050807;
  --surface: #0b1110;
  --surface-strong: #101716;
  --surface-soft: #18201f;
  --line: #26302d;
  --text: #f4f7f5;
  --text-muted: #96a29d;
  --text-soft: #73807a;
  --accent: #f2f3f2;
  --accent-soft: #202927;
  --success: #58c883;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html,
body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(236, 236, 236, 0.96)),
    var(--bg);
  color: var(--text);
  overflow-x: clip;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at top, rgba(39, 63, 56, 0.28), transparent 34%),
    linear-gradient(180deg, #0a100f 0%, #050807 55%, #020303 100%);
}

.app-shell {
  width: 100%;
  max-width: min(860px, 100vw);
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(8px + env(safe-area-inset-top)) 8px calc(28px + env(safe-area-inset-bottom));
  overflow-x: clip;
}

.topbar,
.date-strip,
.delay-bar,
.competition-section {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 4px 8px;
  min-width: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-lockup > div {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
}

.brand-kicker {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(1.6rem, 7vw, 3rem);
  line-height: 0.98;
}

.theme-toggle {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.date-strip {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px 0 14px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.date-strip::-webkit-scrollbar {
  display: none;
}

.date-pill {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: color 180ms ease, transform 180ms ease;
}

.date-pill:active,
.theme-toggle:active,
.refresh-button:active,
.match-sheet__close:active,
.match-sheet__tab:active,
.match-sheet__switcher-button:active {
  transform: scale(0.98);
}

.date-pill--active {
  color: #000;
  position: relative;
}

.date-pill--active::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -6px;
  height: 5px;
  border-radius: var(--radius-sm);
  background: #000;
}

.content {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.delay-bar {
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow);
  width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.delay-bar__head,
.delay-bar__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.delay-bar__head {
  flex-direction: column;
}

.delay-bar__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.delay-bar__value {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
}

.refresh-button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  background: #111;
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.refresh-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.delay-slider-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  margin: 12px 0 8px;
}

#delaySlider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  background: transparent;
}

#delaySlider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}

#delaySlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 0;
  border-radius: 50%;
  background: var(--text);
}

#delaySlider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}

#delaySlider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: var(--text);
}

:root[data-theme="dark"] .refresh-button,
:root[data-theme="dark"] .date-pill--active {
  background: var(--surface-strong);
  color: var(--text);
  border-color: var(--line);
}

.delay-bar__meta,
.delay-bar__help {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.delay-bar__meta {
  gap: 8px;
  flex-wrap: wrap;
}

.delay-bar__help {
  margin: 8px 0 0;
  line-height: 1.45;
}

.warmup-banner {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: color-mix(in srgb, #fff5de 88%, var(--surface));
  color: #8a6017;
  border: 1px solid #efd59a;
  width: 100%;
  min-width: 0;
}

.warmup-banner--hidden {
  display: none;
}

.matches {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
  transition: opacity 220ms ease, transform 280ms ease;
}

.matches--loading {
  opacity: 0.96;
}

.matches--loaded {
  animation: content-fade-in 320ms ease;
}

.competition-section {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  width: 100%;
  min-width: 0;
  animation: section-rise 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--section-delay, 0ms);
}

.competition-section__header {
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: #f4f4f4;
  background: var(--surface);
  padding: 16px 16px;
  color: var(--text);
  cursor: pointer;
  transition: background-color 180ms ease, transform 180ms ease;
}

.competition-section__header--static {
  cursor: default;
}

.competition-section__title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.competition-section__flag {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 1rem;
  overflow: hidden;
}

.competition-section__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.competition-section__title {
  font-size: 0.98rem;
  font-weight: 800;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competition-section__chevron {
  color: #a3aab1;
  font-size: 1.1rem;
  transition: transform 180ms ease;
}

.competition-section--collapsed .competition-section__chevron {
  transform: rotate(180deg);
}

.competition-section--collapsed .competition-section__matches {
  display: none;
}

.competition-section__matches {
  background: var(--surface-strong);
  width: 100%;
  min-width: 0;
}

.match-row {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  display: grid;
  width: 100%;
  max-width: 100%;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  grid-template-areas:
    "status home hscore"
    "status away ascore"
    "time time time";
  align-items: center;
  row-gap: 8px;
  column-gap: 6px;
  padding: 14px 12px;
  min-height: 78px;
  overflow: hidden;
  transition: background-color 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.match-row + .match-row {
  border-top: 1px solid #efefef;
}

.match-row:hover,
.match-row:focus-visible {
  background: color-mix(in srgb, var(--surface) 72%, var(--surface-strong));
}

.match-row:active {
  transform: scale(0.992);
}

.match-row__status {
  grid-area: status;
  width: 38px;
  border-radius: var(--radius-sm);
  padding: 7px 0;
  background: #eeeeee;
  color: #9f9f9f;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 800;
}

.match-row__team {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  min-width: 0;
}

.match-row__badge {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 auto;
}

.match-row__team-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-row__team--home {
  grid-area: home;
}

.match-row__team--away {
  grid-area: away;
  text-align: left;
}

.match-row__score,
.match-row__separator {
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
}

.match-row__score--home {
  grid-area: hscore;
}

.match-row__separator {
  display: none;
}

.match-row__score--away {
  grid-area: ascore;
}

.match-row__score--kickoff {
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
}

.match-row--upcoming .match-row__score--away,
.match-row--upcoming .match-row__separator {
  display: none;
}

.match-row__time {
  grid-area: time;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: left;
  padding-left: 44px;
}

.match-row__status--live {
  background: color-mix(in srgb, #e9f8ee 75%, var(--surface-strong));
  color: var(--success);
}

.match-row__status--ended {
  background: var(--surface-soft);
  color: #a4a4a4;
}

.empty-state {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--surface-strong);
  color: var(--text-muted);
  text-align: center;
  box-shadow: var(--shadow);
  animation: section-rise 280ms ease both;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 12, 11, 0.42);
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 240ms ease, visibility 0s linear 240ms;
}

.sheet-backdrop--hidden {
  visibility: hidden;
}

.sheet-backdrop--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.match-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: min(82vh, 760px);
  max-height: calc(100vh - 10px);
  border-radius: 28px 28px 0 0;
  background: var(--surface-strong);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.22);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  padding: 10px 0 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(30px) scale(0.985);
  transition:
    transform 340ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 220ms ease,
    visibility 0s linear 340ms;
}

.match-sheet--hidden {
  visibility: hidden;
}

.match-sheet--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.match-sheet__handle {
  width: 46px;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  margin: 0 auto 10px;
}

.match-sheet__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px 8px;
}

.match-sheet__close {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.match-sheet__status {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 0 14px 10px;
}

.match-sheet__tabs {
  display: none;
}

.match-sheet__tab {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 46px;
  padding: 12px 10px;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: normal;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.match-sheet__tab--active {
  background: var(--accent);
  color: var(--surface-strong);
  border-color: var(--accent);
}

.match-sheet__body {
  overflow-y: auto;
  padding: 12px 14px calc(18px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
  min-height: 0;
}

.match-sheet__scoreboard,
.match-sheet__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.match-sheet__scoreboard {
  padding: 16px 14px;
  display: grid;
  gap: 14px;
}

.match-sheet__scoreboard--skeleton {
  min-height: 156px;
}

.match-sheet__team {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  min-width: 0;
}

.match-sheet__team--away {
  justify-content: flex-end;
}

.match-sheet__team span {
  min-width: 0;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.match-sheet__team--away span {
  text-align: right;
}

.match-sheet__badge {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex: 0 0 auto;
}

.match-sheet__scoreline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.8rem;
  font-weight: 800;
}

.match-sheet__card {
  padding: 14px;
}

.match-sheet__card h3,
.lineup-group h4 {
  margin: 0 0 10px;
}

.match-sheet__card p,
.lineup-group p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.match-sheet__card--meta {
  display: grid;
  gap: 12px;
}

.match-sheet__meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.match-sheet__meta-grid strong {
  display: block;
  font-size: 0.95rem;
}

.match-sheet__meta-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.match-sheet__note {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.match-sheet__panel {
  display: grid;
  gap: 10px;
  min-height: 52vh;
  align-content: start;
}

.match-sheet__switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.match-sheet__switcher-button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  min-height: 52px;
  padding: 12px 10px;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.match-sheet__switcher-button--active {
  background: var(--accent);
  color: var(--surface-strong);
  border-color: var(--accent);
}

.match-sheet__body--animate .match-sheet__panel {
  animation: panel-fade-in 240ms ease;
}

.incident-list,
.stat-list,
.lineup-grid {
  display: grid;
  gap: 10px;
}

.incident-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
}

.incident-row + .incident-row {
  border-top: 1px solid var(--line);
}

.incident-row__lane {
  min-width: 0;
  display: flex;
}

.incident-row__lane--home {
  justify-content: flex-start;
}

.incident-row__lane--away {
  justify-content: flex-end;
}

.incident-row__minute {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 0.85rem;
  font-weight: 800;
}

.incident-row__content strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.94rem;
}

.incident-row__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.incident-row__icon {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
}

.incident-row__card-stack {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 1.3rem;
  height: 1rem;
  flex: 0 0 auto;
}

.incident-row__card {
  position: absolute;
  font-size: 0.98rem;
  line-height: 1;
}

.incident-row__card--yellow {
  left: 0;
  z-index: 1;
}

.incident-row__card--red {
  left: 0.42rem;
  z-index: 2;
}

.incident-row__content p {
  font-size: 0.86rem;
}

.incident-row__summary-icon {
  display: inline-block;
  vertical-align: -0.08em;
  margin: 0 0.16rem;
}

.incident-row__content {
  width: min(100%, 220px);
}

.incident-row--away .incident-row__content {
  text-align: right;
}

.incident-row__content--neutral {
  width: 100%;
  text-align: center;
}

.incident-row--home .incident-row__minute {
  color: var(--success);
}

.incident-row--away .incident-row__minute {
  color: var(--danger);
}

.stat-bar {
  display: grid;
  gap: 10px;
  padding: 12px 0;
}

.stat-bar + .stat-bar {
  border-top: 1px solid var(--line);
}

.stat-bar__values {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: center;
}

.stat-bar__label {
  text-align: center;
  font-size: 0.96rem;
  color: var(--text-muted);
}

.stat-bar__value {
  font-size: 1rem;
  font-weight: 800;
}

.stat-bar__value--away {
  text-align: right;
}

.stat-bar__track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 78%, var(--line));
  overflow: hidden;
}

.stat-bar__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}

.stat-bar__fill--home {
  left: 0;
  width: var(--stat-home-width, 50%);
  background: var(--stat-home-color, #d10000);
}

.stat-bar__fill--away {
  right: 0;
  width: var(--stat-away-width, 50%);
  background: var(--stat-away-color, #6f7685);
}

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

.lineup-group + .lineup-group {
  margin-top: 14px;
}

.lineup-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}

.lineup-row + .lineup-row {
  border-top: 1px solid var(--line);
}

.lineup-row__number {
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 800;
}

.lineup-row__name {
  font-size: 0.92rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lineup-row__name-text {
  min-width: 0;
}

.lineup-row__markers {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.lineup-row__marker {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.86rem;
  line-height: 1;
}

.lineup-row__marker--stack {
  min-width: 1.3rem;
}

.lineup-row__marker--sub {
  color: var(--text-muted);
}

.lineup-row__meta {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.h2h-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.h2h-box {
  border-radius: 18px;
  background: var(--surface-soft);
  padding: 14px 10px;
  text-align: center;
}

.h2h-box strong {
  display: block;
  margin: 6px 0 4px;
  font-size: 1.35rem;
}

.h2h-box__label,
.h2h-box small {
  color: var(--text-muted);
  font-size: 0.82rem;
}

body.sheet-open {
  overflow: hidden;
}

.skeleton-block {
  position: relative;
  display: block;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-soft) 86%, var(--surface));
  border-radius: 999px;
  color: transparent;
}

.skeleton-block::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 45%,
    transparent 100%
  );
  animation: shimmer 1.25s infinite;
}

:root[data-theme="dark"] .skeleton-block::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 45%,
    transparent 100%
  );
}

.skeleton-block--circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.skeleton-block--text {
  height: 14px;
}

.skeleton-block--wide {
  width: 68%;
}

.skeleton-block--score {
  width: 92px;
  height: 34px;
  margin: 0 auto;
}

.skeleton-block--label {
  width: 44px;
  height: 10px;
  margin-bottom: 8px;
}

.skeleton-block--number {
  width: 28px;
  height: 14px;
}

.competition-section--skeleton {
  animation: none;
}

.competition-section--skeleton .competition-section__title {
  width: 190px;
  height: 16px;
}

.match-row--skeleton {
  cursor: default;
}

.match-row--skeleton .match-row__status {
  height: 32px;
}

.match-row--skeleton .match-row__team--home,
.match-row--skeleton .match-row__team--away {
  height: 14px;
  width: 78%;
}

.match-row--skeleton .match-row__score--home,
.match-row--skeleton .match-row__score--away {
  width: 24px;
  height: 16px;
  justify-self: end;
}

.match-row--skeleton .match-row__time {
  width: 132px;
  height: 12px;
}

.stat-row--skeleton {
  padding: 2px 0;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes section-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes content-fade-in {
  from {
    opacity: 0.45;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panel-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding: 0 0 20px;
  }

  .topbar {
    padding: 12px 12px 6px;
    gap: 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  h1 {
    font-size: clamp(1.45rem, 5.8vw, 1.7rem);
  }

  .theme-toggle {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .date-strip {
    padding: 6px 12px 14px;
    gap: 8px;
  }

  .content {
    gap: 10px;
    padding: 0 10px;
  }

  .date-pill {
    padding: 9px 12px;
    font-size: 0.92rem;
  }

  .date-pill--active::after {
    left: 10px;
    right: 10px;
  }

  .delay-bar {
    padding: 12px;
    border-radius: 18px;
  }

  .delay-bar__value {
    font-size: 1.2rem;
  }

  .delay-bar__controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .delay-bar__head,
  .delay-bar__meta,
  .delay-slider-wrap,
  .matches,
  .competition-section,
  .competition-section__matches,
  .warmup-banner,
  .empty-state {
    width: 100%;
    max-width: 100%;
  }

  .refresh-button {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .delay-slider-wrap {
    margin: 12px 0 10px;
  }

  .delay-bar__meta,
  .delay-bar__help {
    font-size: 0.8rem;
  }

  .competition-section__header {
    padding: 14px 14px;
  }

  .competition-section__title-wrap {
    gap: 10px;
  }

  .competition-section__flag {
    width: 26px;
    height: 26px;
    font-size: 0.9rem;
  }

  .competition-section__title {
    font-size: 0.92rem;
  }

  .match-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    column-gap: 7px;
    row-gap: 7px;
    padding: 12px 10px;
    min-height: 82px;
    width: 100%;
    max-width: 100%;
  }

  .match-row__status {
    width: 34px;
    font-size: 0.78rem;
  }

  .match-row__team {
    font-size: 0.92rem;
    align-items: flex-start;
    gap: 7px;
  }

  .match-row__badge {
    width: 20px;
    height: 20px;
  }

  .match-row__team-label {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    line-height: 1.16;
  }

  .match-row__score {
    font-size: 1rem;
  }

  .match-row__score--kickoff {
    font-size: 0.88rem;
  }

  .match-row__time {
    font-size: 0.74rem;
    padding-left: 38px;
  }

  .warmup-banner,
  .empty-state {
    padding: 12px 14px;
    border-radius: 16px;
  }

  .match-sheet {
    height: min(86vh, 760px);
    max-height: calc(100vh - 6px);
  }

  .match-sheet__header,
  .match-sheet__status,
  .match-sheet__body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .match-sheet__switcher {
    gap: 8px;
  }

  .match-sheet__switcher-button {
    min-height: 48px;
    padding: 10px 8px;
    font-size: 0.84rem;
  }

  .match-sheet__scoreline {
    font-size: 1.6rem;
  }

  .match-sheet__team {
    font-size: 0.95rem;
    gap: 8px;
  }

  .match-sheet__badge {
    width: 24px;
    height: 24px;
    margin-top: 1px;
  }

  .match-sheet__team span {
    max-width: 100%;
  }

  .match-sheet__meta-grid {
    grid-template-columns: 1fr;
  }

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

  .match-sheet__panel {
    min-height: 56vh;
  }

}

@media (min-width: 721px) {
  .app-shell {
    padding: 18px 14px 42px;
  }

  .topbar {
    align-items: center;
    padding: 22px 8px 12px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    font-size: 1.25rem;
  }

  .theme-toggle {
    padding: 9px 14px;
    font-size: 0.88rem;
  }

  #delaySlider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    margin-top: -8px;
  }

  #delaySlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }

  .date-pill {
    padding: 12px 18px;
    font-size: 1.2rem;
  }

  .delay-bar {
    padding: 18px;
  }

  .delay-bar__head {
    flex-direction: row;
    align-items: center;
  }

  .delay-bar__controls {
    width: auto;
  }

  .delay-bar__value {
    font-size: 1.8rem;
  }

  .delay-bar__meta,
  .delay-bar__help {
    font-size: 0.92rem;
  }

  .competition-section__header {
    padding: 18px 20px;
  }

  .competition-section__title {
    font-size: 1.05rem;
  }

  .match-row {
    grid-template-columns: 52px minmax(0, 1fr) auto 18px auto minmax(0, 1fr) 110px;
    grid-template-areas: "status home hscore sep ascore away time";
    row-gap: 0;
    column-gap: 10px;
    padding: 18px 20px;
    min-height: 88px;
  }

  .match-row__team {
    font-size: 1.08rem;
  }

  .match-row__score,
  .match-row__separator {
    font-size: 1.55rem;
  }

  .match-row--upcoming .match-row__score--home {
    grid-column: 3 / 6;
    justify-self: center;
  }

  .match-row--upcoming .match-row__score--kickoff {
    font-size: 1rem;
  }

  .match-row__team--away {
    justify-content: flex-start;
  }

  .match-row__separator {
    display: block;
  }

  .match-row__time {
    font-size: 0.9rem;
    text-align: right;
    padding-left: 0;
  }

  .lineup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-sheet {
    left: 50%;
    right: auto;
    width: min(860px, 100vw);
    transform: translateX(-50%);
  }
}
