:root {
  --bg: #0f1720;
  --surface: #182230;
  --surface-2: #1f2b3c;
  --text: #e6edf3;
  --muted: #8aa1b8;
  --accent: #5eead4;
  --border: #2a3a52;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.site-header {
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.games {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.status {
  text-align: center;
  color: var(--muted);
  grid-column: 1 / -1;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  outline: none;
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-wrap .play-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.game-card-meta {
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.game-date {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}

.game-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.game-clips {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p { margin: 0.15rem 0; }
.site-footer .hint { font-size: 0.8rem; opacity: 0.8; }

dialog#player {
  width: min(95vw, 1100px);
  max-height: 95vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

dialog#player::backdrop {
  background: rgba(0, 0, 0, 0.75);
}

dialog#player video {
  width: 100%;
  max-height: 55vh;
  display: block;
  border-radius: 8px;
  background: black;
}

dialog#player h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  padding-right: 2rem;
}

dialog#player .close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

dialog#player .close:hover { color: var(--text); }

.now-playing {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.5rem 0.25rem 0.25rem;
}

.clip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: 30vh;
  border-top: 1px solid var(--border);
  scrollbar-gutter: stable;
}

.clip-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}

.clip-row.active {
  background: var(--surface-2);
}

.clip-row.active .clip-index {
  color: var(--accent);
  font-weight: 600;
}

.clip-jump {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: transparent;
  border: 0;
  padding: 0.6rem 0.75rem;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.clip-jump:hover { background: rgba(255, 255, 255, 0.03); }

.clip-index {
  width: 1.75rem;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.clip-name {
  flex: 1;
  font-size: 0.9rem;
}

.clip-size {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.clip-download {
  padding: 0 1rem;
  display: grid;
  place-items: center;
  color: var(--accent);
  text-decoration: none;
  font-size: 1.1rem;
  border-left: 1px solid var(--border);
}

.clip-download:hover { background: rgba(94, 234, 212, 0.1); }
