:root {
  --bg: #0a0a0c;
  --surface: #15151a;
  --surface-hover: #1d1d24;
  --border: #2a2a30;
  --text: #fafafa;
  --text-dim: #a0a0a8;
  --text-faint: #6a6a72;
  --accent: #00E5FF;
  --accent-warm: #FF6B5C;
  --shadow: 0 20px 60px -20px rgba(0, 229, 255, 0.15);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0, 229, 255, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 30%, rgba(255, 107, 92, 0.05), transparent 50%),
    var(--bg);
}

/* HERO */
.hero {
  padding: 96px 24px 48px;
  text-align: center;
}

.hero-inner {
  max-width: 880px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 32px;
  background: rgba(255, 255, 255, 0.02);
}

.hero h1 {
  font-size: clamp(40px, 7vw, 80px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.accent {
  background: linear-gradient(120deg, var(--accent) 0%, #7DFFFF 60%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.subtitle {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto 40px;
  line-height: 1.55;
}

.filters {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filters-niche .chip {
  font-size: 12.5px;
  padding: 7px 14px;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
}

.filters-niche .chip.is-active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.sort-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 12.5px;
}

.sort-label {
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10px;
}

.sort-select {
  background: transparent;
  color: var(--text);
  border: 0;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  padding-right: 6px;
}

.sort-select option {
  background: var(--surface);
  color: var(--text);
}

.chip {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  color: var(--text);
  border-color: rgba(0, 229, 255, 0.4);
}

.chip.is-active {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}

/* GRID */
.grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding: 24px 24px 80px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .grid { padding: 32px 48px 96px; gap: 28px; }
}

/* CARD */
.card {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  isolation: isolate;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: var(--shadow);
}

.card-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.card:hover .card-thumb {
  transform: scale(1.05);
  filter: brightness(0.85);
}

/* When card uses placeholder, hide the bottom view-stat (already shown big in placeholder) */
.card.is-placeholder .view-stat { display: none; }
.card.is-placeholder .card-bottom { padding-bottom: 16px; }
.card.is-placeholder .card-shade {
  background: linear-gradient(180deg, transparent 70%, rgba(0, 0, 0, 0.7) 100%);
}

.card-thumb.placeholder {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 30% 20%, rgba(0, 229, 255, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 90%, rgba(255, 107, 92, 0.45) 0%, transparent 55%),
    linear-gradient(155deg, #0a1a2e 0%, #1a1a35 50%, #2a1a2a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 22px;
  gap: 12px;
  overflow: hidden;
}

/* Decorative noise/grain overlay for premium feel */
.card-thumb.placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 4px 4px;
  opacity: 0.6;
  pointer-events: none;
}

/* Big abstract decorative shape behind */
.card-thumb.placeholder::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -25%;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.18) 0%, transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

.card-thumb.placeholder .ph-glyph {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 2;
  margin-bottom: 4px;
}

.card-thumb.placeholder .ph-glyph svg {
  width: 26px;
  height: 26px;
  opacity: 0.95;
}

.card-thumb.placeholder .ph-views {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(36px, 8vw, 56px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text);
  text-shadow: 0 4px 24px rgba(0, 229, 255, 0.35);
  position: relative;
  z-index: 2;
}

.card-thumb.placeholder .ph-views-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-top: -4px;
  position: relative;
  z-index: 2;
}

.card-thumb.placeholder .ph-label {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.005em;
  line-height: 1.25;
  max-width: 88%;
  position: relative;
  z-index: 2;
  margin-top: 4px;
}

.card-thumb.placeholder .ph-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  position: relative;
  z-index: 2;
  margin-top: 6px;
}

.card-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 25%, transparent 55%, rgba(0, 0, 0, 0.9) 100%);
  z-index: 1;
}

.card-top {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 2;
  gap: 8px;
}

.niche-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.platform-icon svg {
  width: 16px;
  height: 16px;
}

.card-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 18px 18px 20px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Native TikTok/IG-style view counter: ▶ + big number */
.view-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
}

.view-stat .play-ico {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.view-stat .count {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.view-stat.tba .count {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  letter-spacing: 0;
}

.author {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  letter-spacing: -0.005em;
}

/* PLAY ICON OVERLAY (visible on hover) */
.card::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230a0a0c'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") no-repeat center / 28px;
  transform: translate(-50%, -50%) scale(0.7);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3;
  pointer-events: none;
}

.card:hover::after {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* FOOTER */
.foot {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  background: rgba(0, 0, 0, 0.3);
}

.foot-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-dim);
}

.foot a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.foot a:hover {
  color: var(--accent);
}

.dot {
  color: var(--text-faint);
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal.is-open {
  display: flex;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: inherit;
  z-index: 101;
}

.modal-close:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.modal-frame {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 9 / 16;
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.modal-frame .link-only {
  padding: 32px;
  text-align: center;
}

.modal-frame .link-only a {
  display: inline-block;
  margin-top: 16px;
  padding: 14px 28px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

/* LOADING / EMPTY / ERROR STATES */
.loading, .empty-state, .error-state {
  grid-column: 1 / -1;
  padding: 80px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 15px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* RESPONSIVE */
@media (max-width: 480px) {
  .hero { padding: 56px 16px 24px; }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    padding: 16px 16px 60px;
  }
  .views { font-size: 24px; }
  .niche-tag { font-size: 10px; padding: 5px 10px; }
  .card-bottom { padding: 14px 14px 16px; }
}
