.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
}

.sidebar,
.main {
  min-width: 0;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.panel-title {
  font-weight: 700;
  margin-bottom: 12px;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-list-item {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.match-list-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.match-list-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.match-list-title {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.match-list-meta {
  font-size: 13px;
  color: var(--muted);
}

.recent-events {
  min-height: 120px;
}

.event-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.event-item:last-child {
  border-bottom: none;
}

.event-time {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.selected-empty {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.selected-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.selected-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.selected-title {
  font-size: 34px;
  font-weight: 800;
}

.selected-subtitle {
  color: var(--muted);
  margin-top: 6px;
}

.score-block {
  text-align: right;
}

.score-big {
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
}

.clock-big {
  margin-top: 8px;
  color: var(--accent);
  font-size: 26px;
  font-weight: 800;
}

.delay-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.delay-box {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  min-width: 180px;
}

.delay-label {
  color: var(--muted);
  font-size: 12px;
  display: block;
  margin-bottom: 6px;
}

.delay-value {
  font-size: 26px;
  font-weight: 800;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  display: block;
  margin-bottom: 6px;
}

.metric-value {
  font-size: 26px;
  font-weight: 800;
}

.flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.raw-meta {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.delay-good {
  color: var(--good);
}

.delay-warn {
  color: var(--warn);
}

.delay-bad {
  color: var(--danger);
}

.sniper-alert:empty {
  display: none;
}

#sniper-alert-host {
  margin-bottom: 16px;
}

#sniper-alert-host:empty {
  display: none;
}

.sniper-alert {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.10);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
  animation: pulse 1.2s ease-in-out 3;
}

.sniper-alert-title {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 6px;
}

.goal-flash {
  animation: flashDanger 1.3s ease-in-out 3;
}

.goal-flash-good {
  animation: flashGood 1.3s ease-in-out 3;
}

.timeline-panel {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-top: 18px;
}

.timeline-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 10px;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.timeline-line {
  font-size: 14px;
}

.timeline-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.live-banner {
  height: 6px;
  width: 100%;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.95), rgba(248, 113, 113, 0.95));
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.35);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.live-banner-inner {
  position: absolute;
  top: 8px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #ffdede;
  letter-spacing: 0.08em;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
}

.footer {
  margin-top: 40px;
  padding: 18px 20px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.footer-inner {
  max-width: 1680px;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  opacity: 0.7;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.92; }
  50% { transform: scale(1.01); opacity: 1; }
  100% { transform: scale(1); opacity: 0.95; }
}

@keyframes flashDanger {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35), 0 0 28px rgba(239, 68, 68, 0.20); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes flashGood {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
  50% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35), 0 0 28px rgba(34, 197, 94, 0.20); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

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

  .selected-head {
    flex-direction: column;
  }

  .score-block {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

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

  .selected-title {
    font-size: 26px;
  }

  .score-big {
    font-size: 52px;
  }

  .clock-big {
    font-size: 22px;
  }
}

  .footer-inner {
    text-align: center;
  }

