:root {
  --bg: #0A0A0F;
  --card: #12121A;
  --accent1: #00F0FF;
  --accent2: #7B2FFF;
  --pink: #FF1A6C;
  --text: #FFFFFF;
  --text-muted: #888899;
  --border: rgba(0,240,255,0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

.splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.splash-logo {
  font-family: 'Courier New', monospace;
  font-size: 72px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(0,240,255,0.5), 0 0 40px rgba(123,47,255,0.3);
  animation: neonPulse 1.5s ease-in-out infinite;
  letter-spacing: -2px;
}

@keyframes neonPulse {
  0%, 100% { text-shadow: 0 0 20px rgba(0,240,255,0.5), 0 0 40px rgba(123,47,255,0.3); }
  50% { text-shadow: 0 0 40px rgba(0,240,255,0.8), 0 0 80px rgba(123,47,255,0.5); }
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Courier New', monospace;
  font-size: 28px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.logo-text {
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-play {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-play svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px var(--accent1));
}

.random-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  color: var(--accent1);
  border: 1px solid var(--accent1);
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.random-btn:hover {
  background: rgba(0,240,255,0.1);
  border-color: var(--accent2);
  color: var(--accent2);
  box-shadow: 0 0 15px rgba(0,240,255,0.3);
}

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

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 420px;
}

.search-wrapper svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 48px;
  background: #1A1A24;
  border: 1px solid rgba(0,240,255,0.2);
  border-radius: 9999px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--accent1);
  box-shadow: 0 0 0 4px rgba(0,240,255,0.1);
}

.sort-group {
  display: flex;
  gap: 8px;
}

.sort-btn {
  padding: 10px 18px;
  background: #1A1A24;
  border: 1px solid rgba(0,240,255,0.2);
  border-radius: 9999px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sort-btn.active {
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  color: #000;
  border-color: transparent;
  font-weight: 700;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 16px;
  background: #1A1A24;
  border: 1px solid rgba(0,240,255,0.2);
  border-radius: 9999px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.chip.active {
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  color: #000;
  border-color: transparent;
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  animation: fadeSlideUp 0.4s ease forwards;
  opacity: 0;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,240,255,0.5);
  box-shadow: 0 0 20px rgba(0,240,255,0.3);
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.preview {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0A0A0F;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.neon-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: iconPulse 2s ease-in-out infinite;
}

.neon-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 12px var(--accent1)) drop-shadow(0 0 24px var(--accent2));
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

.card-info {
  padding: 14px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}

.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  width: 70vw;
  max-width: 900px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid rgba(0,240,255,0.2);
  overflow: hidden;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.active .modal-content {
  transform: scale(1);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pink);
  font-size: 28px;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.3s ease;
  user-select: none;
}

.modal-close:hover {
  transform: rotate(90deg);
}

.player-container {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
  width: 100%;
}

.player-container video {
  width: 100%;
  height: 100%;
  display: block;
}

.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.player-container:hover .player-controls {
  opacity: 1;
  pointer-events: all;
}

.play-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.progress-container {
  flex: 1;
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.unavailable {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
}

.unavailable svg {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 0 12px var(--pink));
}

.unavailable p {
  font-size: 15px;
}

.footer {
  text-align: center;
  padding: 32px 24px;
  color: #333344;
  font-size: 11px;
}

#sentinel {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(0,240,255,0.2);
  border-top-color: var(--accent1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  opacity: 0.6;
}