.meta {
  display: flex;
  justify-content: center;
}

.meta-card {
  background: #f2ead8;
  border: 1px solid #c8bea8;
  border-radius: 14px 14px 0 0;
  padding: 8px 10px;
  min-width: 240px;
  text-align: center;
}

.meta-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meta-card span {
  line-height: 1.2;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-bar {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) 75px minmax(420px, 1.35fr);
  align-items: center;
  gap: 10px;
  width: 100%;
}

.match-minute {
  justify-self: start;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

#teamsLabel {
  min-width: 0;
  text-align: left;
}

.scoreboard {
  display: inline-grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.scoreboard-team {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  column-gap: 8px;
  min-width: 0;
}

.scoreboard-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scoreboard-score,
.scoreboard-divider {
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 700;
}

.scoreboard-divider {
  display: none;
}

.viewer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 100svh;
  padding: 14px 28px 0px;
  max-width: 1000px;
  margin: 0 auto;
}

.source-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.source-grid.hidden {
  display: none !important;
}

.timeline {
  display: grid;
  grid-template-columns: 42px 72px 42px 74px minmax(120px, 1fr) max-content;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.timeline input[type="range"] {
  width: 100%;
  min-width: 0;
  accent-color: var(--accent);
}

.timeline button,
.timeline select {
  min-height: 32px;
  padding: 0px 9px;
}

.timeline-counter {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
  white-space: nowrap;
}

.timeline-label {
  appearance: none;
  min-width: 66px;
  border: 1px solid #d7c2a1;
  border-radius: 999px;
  background: #f7f0e3;
  color: var(--accent-2);
  cursor: pointer;
  font: 800 14px/1 "Source Code Pro", monospace;
  padding: 7px 9px;
  text-align: center;
}

.timeline-label:not(:disabled):hover,
.timeline-label:not(:disabled):focus-visible {
  background: #f7f0e3;
  border-color: #d7c2a1;
  color: var(--ink);
  outline: none;
}

.timeline-label:disabled {
  cursor: default;
  opacity: 0.62;
}

.timeline-info-button {
  width: 32px;
  height: 32px;
  border: 1px solid #d7c2a1;
  border-radius: 999px;
  background: #f7f0e3;
  color: var(--accent-2);
  cursor: pointer;
  font: 800 14px/1 "Source Code Pro", monospace;
  padding: 0;
}

.timeline-info-button:not(:disabled):hover,
.timeline-info-button:not(:disabled):focus-visible {
  background: #f7f0e3;
  border-color: #d7c2a1;
  color: var(--ink);
  outline: none;
}

.timeline-info-button:disabled {
  cursor: default;
  opacity: 0.62;
}

.side-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-content: start;
  width: 100%;
}

.details-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.card-title {
  margin: 0 0 10px;
  font-size: 18px;
}

.event-card {
  background: #f7f0e3;
  border: 1px solid #d7c2a1;
  border-radius: 16px;
  padding: 16px;
}

.status {
  margin-top: 12px;
  min-height: 24px;
  color: var(--accent-2);
}

.status.error {
  color: var(--danger);
}

.progress {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(239, 228, 204, 0.85));
  display: none;
  gap: 12px;
}

.progress.visible {
  display: grid;
}

.progress-head {
  display: grid;
  gap: 6px;
}

.progress-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
}

.progress-detail {
  min-height: 22px;
  color: var(--text);
  line-height: 1.4;
}

.progress-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(24, 79, 67, 0.12);
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #d48b33 55%, var(--accent-2));
  transition: width 220ms ease;
}

.progress-steps {
  display: grid;
  gap: 8px;
}

.progress-step {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--muted);
}

.progress-step::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #b8ab89;
  background: #fffaf0;
  box-shadow: inset 0 0 0 4px transparent;
  transition: all 180ms ease;
}

.progress-step strong {
  display: block;
  margin-bottom: 2px;
  font-size: 14px;
  color: var(--text);
}

.progress-step small {
  display: block;
  color: inherit;
  line-height: 1.35;
}

.progress-step.active {
  color: var(--accent-2);
}

.progress-step.active::before {
  border-color: var(--accent-2);
  box-shadow: inset 0 0 0 5px var(--accent-2);
}

.progress-step.done {
  color: var(--accent-2);
}

.progress-step.done::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 5px #f8dfc3;
}

.progress-step.error {
  color: var(--danger);
}

.progress-step.error::before {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 5px var(--danger);
}

@media (max-width: 1120px) {
  .viewer {
    min-height: 100svh;
    padding: 14px 28px 0px;
  }

  .side-panel {
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .match-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
  }

  .timeline {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    order: 3;
  }

  .timeline button,
  .timeline select {
    min-width: 0;
  }

  .timeline input[type="range"] {
    grid-column: 1 / 4;
  }

  .timeline-counter {
    grid-column: 4 / 5;
  }

  .timeline-counter {
    justify-self: end;
  }

  #teamsLabel {
    text-align: left;
  }

  .scoreboard {
    gap: 4px;
  }

  .scoreboard-team {
    column-gap: 8px;
  }

  .viewer {
    padding: 14px 28px 0px;
  }

  .details-row {
    grid-template-columns: 1fr;
  }
}
