:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --elevated: #1f2937;
  --text: #ffffff;
  --muted: #9ca3af;
  --primary: #6366f1;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  background-color: var(--surface);
  padding: 40px 0;
  text-align: center;
  border-bottom: 1px solid var(--elevated);
}

.site-header h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.site-header p {
  margin: 12px 0 0;
  color: var(--muted);
}

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 24px 0;
}

.filter-btn {
  padding: 8px 18px;
  border: 1px solid var(--elevated);
  border-radius: 20px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding-bottom: 48px;
}

.video-card {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--elevated);
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.video-thumb {
  aspect-ratio: 16 / 9;
  background: var(--elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 48px;
}

.video-info {
  padding: 16px;
}

.video-title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.score-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  color: white;
  font-size: 12px;
}

.loading,
.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border-radius: 20px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  z-index: 101;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 32px;
  cursor: pointer;
}

.modal-close:hover {
  color: white;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--elevated);
  font-size: 14px;
}

.detail-row a {
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
}

.detail-row a:hover {
  text-decoration: underline;
}

.site-footer {
  background: var(--surface);
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--elevated);
}

@media (max-width: 640px) {
  .site-header h1 { font-size: 1.8rem; }
  .video-grid { grid-template-columns: 1fr; }
}
