@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --broadcast-bg: #0e1a2e;
  --broadcast-deep: #0a1424;
  --line-soft: rgba(255, 255, 255, 0.08);
  --text-main: rgba(255, 255, 255, 0.94);
  --text-muted: rgba(255, 255, 255, 0.55);
  --brand-yellow: #ffd300;
  --live-red: #ff5a52;
  --color-text-primary: #1c2a38;
  --color-text-secondary: #8a8f98;
  --color-text-alert: #d72641;
  --color-text-icon: #dbdade;
  --color-bg-primary: #fff;
  --color-bg-secondary: #f3f5f9;
  --color-bg-alert: #fdeaec;
  --color-theme-primary: #623ce6;
}

* {
  box-sizing: border-box;
}

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

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  padding: 0;
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  user-select: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

img {
  display: block;
}

strong {
  font-weight: 600;
}

.score-bug {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-left: 0 solid transparent;
  transition: border-color 200ms ease, opacity 200ms ease, transform 200ms ease;
}

.score-bug.match {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  overflow: visible;
  border-left: 0 solid transparent;
  border-radius: 0;
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  box-shadow: none;
}

.score-bug.match.is-brazil {
  border-left: 6px solid var(--brand-yellow);
}

.match-header {
  display: flex;
  align-items: center;
  min-height: clamp(42px, 5.5vh, 60px);
  padding: 12px clamp(16px, 2.2vw, 32px);
  border-bottom: 2px solid rgba(48, 48, 48, 0.08);
  gap: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  max-width: min(44vw, 210px);
  min-height: 24px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 200ms ease, transform 200ms ease, background-color 200ms ease, color 200ms ease;
}

.match-status.status-pill {
  position: static;
  display: inline-flex;
  align-items: center;
  max-width: 40vw;
  min-height: 30px;
  margin-right: auto;
  padding: 8px 12px;
  border-radius: 6px;
  background-color: rgba(48, 48, 48, 0.06);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  transform: none;
}

.status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  display: none;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background-color: currentColor;
  flex: 0 0 auto;
}

.score-bug.is-live .match-status {
  background-color: var(--color-bg-alert);
  color: var(--color-text-alert);
}

.score-bug.is-live .match-status .status-dot {
  display: block;
  animation: pulse 1.5s ease-in-out infinite;
}

.score-bug.is-upcoming .match-status {
  background-color: rgba(255, 211, 0, 0.18);
  color: #967900;
}

.score-bug.is-finished .match-status {
  background-color: rgba(28, 42, 56, 0.07);
  color: var(--color-text-secondary);
}

.match-tournament {
  display: flex;
  align-items: center;
  min-width: 0;
  margin-left: auto;
  color: var(--color-text-primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.match-tournament span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tournament-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 12px;
  border-radius: 50%;
  background: var(--color-theme-primary);
  color: rgba(255, 255, 255, 0.94);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  flex: 0 0 auto;
}

.match-content {
  position: relative;
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: clamp(82px, 14vh, 176px);
}

.column {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: clamp(14px, 2.4vw, 32px);
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  color: var(--color-text-primary);
  gap: 0;
  font-size: inherit;
  line-height: 1.2;
  text-align: center;
}

.team-home,
.team-away {
  justify-content: center;
  padding-right: 0;
  text-align: center;
}

.team-logo.crest-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(52px, 7.5vw, 100px);
  height: clamp(52px, 7.5vw, 100px);
  overflow: visible;
  border-radius: 50%;
  background-color: var(--color-bg-primary);
  box-shadow: 0 4px 4px 0 rgba(48, 48, 48, 0.15), 0 0 0 clamp(8px, 1.3vw, 15px) var(--color-bg-primary);
}

.team-logo .crest {
  width: 58%;
  height: 58%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

.team-logo .crest-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  color: #fff;
  font-size: clamp(12px, 1.2vw, 16px);
  font-weight: 700;
}

.team-name {
  max-width: 100%;
  margin: clamp(12px, 1.8vw, 24px) 0 0;
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: clamp(15px, 1.9vw, 22px);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: clamp(118px, 16vw, 210px);
}

.match-score.score {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin-top: 4px;
  color: var(--color-text-primary);
  font-weight: 600;
  line-height: 1;
}

.match-score-number.score-num {
  min-width: 1.2ch;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--color-text-primary);
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  transition: background-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.match-score-number--leading {
  color: var(--color-theme-primary);
}

.match-score-divider.score-separator {
  margin: 0 10px;
  color: var(--color-text-icon);
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}

.match-datetime {
  margin-bottom: 6px;
  color: var(--color-text-secondary);
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.match-time-lapsed {
  margin-top: 8px;
  color: #df9443;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.team-scorers {
  list-style: none;
  margin: clamp(6px, 1vw, 12px) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 0;
}

.team-scorers li {
  color: var(--color-text-secondary);
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.team-scorers li .scorer-og {
  color: var(--color-text-secondary);
  font-size: 0.85em;
  opacity: 0.7;
}

.score-num.flash {
  animation: scoreFlash 600ms ease-out;
}

.idle-panel {
  display: none;
  width: 100%;
  min-width: 0;
  padding: 0 clamp(18px, 6vw, 80px);
  text-align: center;
}

.idle-title {
  overflow: hidden;
  color: var(--color-text-primary);
  font-size: clamp(24px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.idle-subtitle {
  margin-top: 8px;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: clamp(13px, 1.6vw, 18px);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-bug.is-idle .match-content {
  display: flex;
  justify-content: center;
}

.score-bug.is-idle .column {
  display: none;
}

.score-bug.is-idle .idle-panel {
  display: block;
  opacity: 1;
  transform: none;
}

.score-bug.is-idle .match-status {
  display: none;
}

.match-events.bug-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 clamp(18px, 3vw, 42px);
  border-top: 2px solid rgba(48, 48, 48, 0.08);
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

.match-events.bug-footer.is-hidden {
  display: none;
}

.match-events span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand {
  position: absolute;
  right: clamp(14px, 2vw, 28px);
  bottom: clamp(10px, 1.6vw, 18px);
  max-height: 24px;
  color: rgba(28, 42, 56, 0.38);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.score-bug.is-idle .brand {
  color: rgba(28, 42, 56, 0.5);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }
}

@keyframes scoreFlash {
  0% {
    background-color: rgba(255, 211, 0, 0);
  }

  34% {
    background-color: rgba(255, 211, 0, 0.3);
  }

  100% {
    background-color: rgba(255, 211, 0, 0);
  }
}

@media (max-height: 360px) {
  body {
    align-items: center;
  }

  .score-bug.match {

  .match-header {
    min-height: 40px;
    padding: 8px 16px;
  }

  .match-status.status-pill {
    min-height: 26px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .match-content {
    min-height: 94px;
  }

  .column {
    padding: 10px 16px;
  }

  .team-logo.crest-wrap {
    width: 48px;
    height: 48px;
    box-shadow: 0 3px 3px 0 rgba(48, 48, 48, 0.12), 0 0 0 8px var(--color-bg-primary);
  }

  .team-name {
    margin-top: 10px;
    font-size: 14px;
  }

  .match-score-number.score-num {
    font-size: 40px;
  }

  .match-time-lapsed {
    margin-top: 4px;
    font-size: 12px;
  }

  .match-events.bug-footer {
    display: none;
  }

  .brand {
    bottom: 8px;
  }
}

@media (max-width: 720px) {
  .score-bug.match {

  .match-header {
    gap: 10px;
  }

  .match-status.status-pill {
    max-width: 48vw;
    font-size: 12px;
  }

  .tournament-mark {
    display: none;
  }

  .match-content {
    grid-template-columns: minmax(0, 1fr) minmax(90px, auto) minmax(0, 1fr);
  }

  .column {
    padding: 14px 10px;
  }

  .team-logo.crest-wrap {
    width: 54px;
    height: 54px;
  }

  .team-name {
    font-size: 14px;
  }

  .match-score-number.score-num {
    font-size: 38px;
  }

  .match-score-divider.score-separator {
    margin: 0 5px;
  }
}
