:root {
  color-scheme: dark;
  --background: #0b0810;
  --surface: #15111d;
  --surface-raised: #1b1526;
  --border: #322743;
  --text: #f8f4ff;
  --muted: #b7abc6;
  --accent: #cf73ff;
  --accent-strong: #9a4de0;
  --cyan: #65d9ff;
  --success: #77efba;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 78% -10%, rgba(151, 66, 218, 0.24), transparent 35rem),
    radial-gradient(circle at 8% 28%, rgba(68, 172, 217, 0.1), transparent 28rem),
    var(--background);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.28;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 38px;
}

.topbar,
.hero,
.feed-heading,
.pagination,
.card-actions,
.clip-meta {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  min-height: 42px;
}

.back-link {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--text);
}

.live-mark {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-mark i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 16px rgba(119, 239, 186, 0.75);
}

.hero {
  justify-content: space-between;
  gap: 40px;
  min-height: 290px;
  padding: 44px 54px;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    linear-gradient(120deg, rgba(24, 17, 33, 0.98), rgba(17, 13, 25, 0.92)),
    var(--surface);
  box-shadow: var(--shadow);
  isolation: isolate;
  position: relative;
}

.hero::after {
  position: absolute;
  right: -90px;
  bottom: -160px;
  z-index: -1;
  width: 470px;
  height: 470px;
  content: "V";
  color: rgba(199, 109, 255, 0.055);
  font-family: Georgia, serif;
  font-size: 390px;
  font-weight: 800;
  line-height: 1;
  transform: rotate(-8deg);
}

.eyebrow {
  margin: 0 0 11px;
  color: var(--cyan);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.19em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 6.2rem);
  letter-spacing: -0.065em;
  line-height: 0.9;
}

h1 span {
  color: var(--accent);
  text-shadow: 0 0 34px rgba(207, 115, 255, 0.2);
}

.lede {
  max-width: 670px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.65;
}

.hero-stat {
  display: grid;
  flex: 0 0 auto;
  min-width: 160px;
  padding: 24px;
  border: 1px solid rgba(207, 115, 255, 0.34);
  border-radius: 22px;
  background: rgba(11, 8, 16, 0.52);
  text-align: center;
  backdrop-filter: blur(12px);
}

.stat-number {
  color: var(--text);
  font-size: 2.6rem;
  font-weight: 850;
  letter-spacing: -0.05em;
}

.stat-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feed {
  padding: 58px 0 22px;
}

.feed-heading {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.feed-heading h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.035em;
}

.feed-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.clip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.clip-card,
.skeleton-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.clip-card {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.clip-card:hover {
  border-color: #56416f;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
  transform: translateY(-3px);
}

.thumbnail {
  position: relative;
  display: grid;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  place-items: center;
  background: linear-gradient(145deg, #2b1839, #111b2b);
}

.thumbnail::after,
.thumbnail-fallback::before {
  position: absolute;
  content: "";
}

.thumbnail::after {
  inset: auto 0 0;
  height: 55%;
  background: linear-gradient(transparent, rgba(8, 5, 12, 0.72));
}

.thumbnail-fallback::before {
  width: 82px;
  height: 82px;
  border: 1px solid rgba(207, 115, 255, 0.3);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(207, 115, 255, 0.24), transparent 68%);
  box-shadow: 0 0 45px rgba(207, 115, 255, 0.15);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumbnail-fallback img {
  display: none;
}

.provider-pill {
  position: absolute;
  right: 12px;
  bottom: 11px;
  z-index: 1;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #130b19;
  background: var(--accent);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.card-body {
  padding: 18px;
}

.clip-title {
  display: -webkit-box;
  min-height: 2.8em;
  margin-bottom: 12px;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.clip-meta {
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.77rem;
}

.streamer-name {
  max-width: 42%;
  overflow: hidden;
  color: #e8dff3;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-divider {
  color: #655675;
}

.clip-meta time {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-actions {
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  margin-top: 17px;
  border-top: 1px solid #292035;
}

.clip-button,
.page-button,
.secondary-button {
  border: 1px solid transparent;
  border-radius: 11px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.clip-button {
  padding: 9px 12px;
  color: #160b1e;
  background: var(--accent);
}

.clip-button:hover,
.clip-button:focus-visible {
  background: #dc94ff;
  transform: translateY(-1px);
}

.clip-button.disabled {
  color: #877d91;
  background: #27212e;
}

.detected-mark {
  color: var(--success);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: right;
  text-transform: uppercase;
}

.skeleton-card {
  height: 340px;
  background: linear-gradient(105deg, var(--surface) 30%, var(--surface-raised) 45%, var(--surface) 60%);
  background-size: 220% 100%;
  animation: shimmer 1.25s linear infinite;
}

@keyframes shimmer {
  to { background-position-x: -220%; }
}

.empty-state {
  padding: 76px 24px;
  border: 1px dashed var(--border);
  border-radius: 20px;
  color: var(--muted);
  background: rgba(21, 17, 29, 0.58);
  text-align: center;
}

.empty-state[hidden],
.pagination[hidden],
.skeleton-grid[hidden] {
  display: none;
}

.empty-state h3 {
  margin: 18px 0 8px;
  color: var(--text);
  font-size: 1.25rem;
}

.empty-state p {
  margin-bottom: 0;
}

.empty-symbol {
  display: inline-grid;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(207, 115, 255, 0.38);
  border-radius: 50%;
  color: var(--accent);
  background: rgba(207, 115, 255, 0.08);
  font-family: Georgia, serif;
  font-size: 1.5rem;
  font-weight: 800;
  place-items: center;
}

.error-state .empty-symbol {
  color: #ffb4bc;
  border-color: rgba(255, 113, 128, 0.4);
  background: rgba(255, 113, 128, 0.08);
}

.secondary-button {
  padding: 10px 15px;
  margin-top: 20px;
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-raised);
  cursor: pointer;
}

.pagination {
  justify-content: center;
  gap: 18px;
  padding-top: 30px;
}

.page-button {
  min-width: 112px;
  padding: 11px 14px;
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
  cursor: pointer;
}

.page-button:hover:not(:disabled),
.page-button:focus-visible:not(:disabled),
.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: var(--accent-strong);
  background: var(--surface-raised);
}

.page-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.page-label {
  min-width: 112px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

footer {
  padding: 40px 0 10px;
  color: #81758e;
  font-size: 0.75rem;
  line-height: 1.6;
  text-align: center;
}

:focus-visible {
  outline: 3px solid rgba(101, 217, 255, 0.65);
  outline-offset: 3px;
}

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

  .hero {
    min-height: 250px;
    padding: 40px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 1180px);
    padding-top: 14px;
  }

  .live-mark {
    font-size: 0.64rem;
  }

  .hero {
    display: block;
    min-height: 0;
    padding: 34px 24px;
    border-radius: 20px;
  }

  .hero-stat {
    display: inline-grid;
    min-width: 140px;
    padding: 16px 20px;
    margin-top: 30px;
  }

  .stat-number {
    font-size: 2rem;
  }

  .feed {
    padding-top: 42px;
  }

  .feed-heading {
    display: block;
  }

  .feed-status {
    margin-top: 10px;
  }

  .clip-grid {
    grid-template-columns: 1fr;
  }

  .pagination {
    gap: 7px;
  }

  .page-button {
    min-width: 0;
  }

  .page-label {
    min-width: 90px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
