:root {
  color-scheme: dark;
  --bg: #071122;
  --bg-soft: #101d3b;
  --card: #0b1530;
  --text: #f7fbff;
  --muted: #c8d7ff;
  --green: #d2ff1f;
  --green-bright: #e4ff63;
  --pink: #ff4d8d;
  --cyan: #53e6ff;
  --violet: #5067ff;
  --panel: rgba(7, 16, 38, 0.82);
  --panel-strong: rgba(10, 22, 51, 0.92);
  --border: rgba(255,255,255,0.16);
  --shadow: 0 24px 80px rgba(0,0,0,0.42);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { overflow: hidden; }
button, a { font: inherit; }
button { color: inherit; }

.app-shell {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 15% 0%, rgba(83, 230, 255, 0.20), transparent 24rem),
    radial-gradient(circle at 100% 15%, rgba(255, 77, 141, 0.18), transparent 24rem),
    radial-gradient(circle at 50% 100%, rgba(80, 103, 255, 0.22), transparent 36rem),
    linear-gradient(180deg, #071122 0%, #0a1430 48%, #0c1836 100%);
}

.topbar {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 14px 10px;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(7, 17, 34, 0.92), rgba(7, 17, 34, 0.42));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  font-weight: 900;
  letter-spacing: -0.04em;
}
.brand img { width: 32px; height: 32px; border-radius: 10px; }
.brand span { font-size: 1.2rem; }
.actions { display: flex; gap: 8px; }
.actions button,
.filter-row button,
.copy,
.open {
  border: 1px solid var(--border);
  background: rgba(83, 230, 255, 0.10);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 12px;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(10px);
}
.actions button:hover,
.filter-row button:hover,
.copy:hover,
.open:hover { background: rgba(210, 255, 31, 0.16); }

.intro {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 88px 18px 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(10, 17, 34, 0.98), rgba(10, 17, 34, 0.86));
  transition: opacity .3s ease, transform .3s ease, visibility .3s ease;
}
.intro.hidden { opacity: 0; visibility: hidden; transform: translateY(-18px); pointer-events: none; }
.eyebrow { margin: 0; color: var(--green-bright); font-weight: 800; text-transform: uppercase; letter-spacing: .16em; font-size: .76rem; }
.intro h1 { max-width: 720px; margin: 0 auto; font-size: clamp(2.25rem, 8vw, 5.8rem); line-height: .9; letter-spacing: -0.075em; }
.intro p:not(.eyebrow) { max-width: 560px; margin: 0 auto; color: var(--muted); line-height: 1.5; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 760px; margin: 16px auto 0; }
.filter-row button.active { background: var(--green); color: #071122; border-color: transparent; font-weight: 850; }

.feed {
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }

.video-card {
  height: 100dvh;
  min-height: 560px;
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  padding: 68px 12px 18px;
}
.media-wrap {
  position: relative;
  width: min(100%, 480px);
  height: min(78dvh, 850px);
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 34px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background:
    radial-gradient(circle at 50% 18%, rgba(83, 230, 255, 0.12), transparent 18rem),
    linear-gradient(180deg, #132456 0%, #0e1a3d 45%, #0b1430 100%);
}
.poster,
.player,
.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.poster {
  border: 0;
  cursor: pointer;
  padding: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(83, 230, 255, 0.10), transparent 18rem),
    linear-gradient(180deg, #132456 0%, #0e1a3d 45%, #0b1430 100%);
}
.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.06) contrast(1.02);
}
.player iframe { border: 0; }
.gradient {
  pointer-events: none;
  position: absolute;
  inset: auto 0 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(7,17,34,0) 0%, rgba(13, 24, 54, 0.52) 38%, rgba(13, 24, 54, 0.92) 100%);
}
.play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(247,251,255,0.94);
  color: #071122;
  font-size: 1.7rem;
  box-shadow: 0 12px 36px rgba(0,0,0,.32);
}
.duration-pill {
  position: absolute;
  right: 14px;
  top: 14px;
  background: rgba(10, 22, 51, 0.74);
  border: 1px solid rgba(255,255,255,.18);
  padding: 8px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: .82rem;
  backdrop-filter: blur(10px);
}
.meta {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 28px), 454px);
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  pointer-events: none;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(18, 31, 68, 0.70), rgba(10, 21, 48, 0.90));
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.28);
}
.meta > * { pointer-events: auto; }
.meta, .meta h2, .meta .date, .meta .channel { color: #f7fbff; }
.channel { margin: 0 0 6px; color: var(--green-bright) !important; font-size: .88rem; font-weight: 850; text-shadow: 0 1px 10px rgba(0,0,0,.25); }
h2 { margin: 0; font-size: clamp(1.15rem, 5vw, 1.9rem); line-height: 1.04; letter-spacing: -0.045em; text-shadow: none; }
.date { color: rgba(247,251,255,.88) !important; margin: 8px 0 0; font-size: .9rem; }
.side-actions { display: grid; gap: 8px; }
.side-actions .open, .side-actions .copy { min-width: 68px; text-align: center; background: rgba(255,255,255,0.08); }

.status {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(92vw, 560px);
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(10, 22, 51, 0.84);
  border: 1px solid var(--border);
  color: var(--text);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  text-align: center;
}
.status.visible { opacity: 1; }

@media (min-width: 760px) {
  .video-card { padding-top: 76px; }
  .media-wrap { width: min(42vw, 520px); height: min(84dvh, 900px); }
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(83, 230, 255, 0.10);
  padding: 7px 9px 7px 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  font-size: .86rem;
}
.mode-switch input {
  appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  position: relative;
  margin: 0;
}
.mode-switch input::after {
  content: '';
  width: 18px;
  height: 18px;
  position: absolute;
  top: 2px;
  left: 3px;
  border-radius: 50%;
  background: #d6e2ff;
  transition: transform .18s ease, background .18s ease;
}
.mode-switch input:checked { background: linear-gradient(90deg, var(--pink), var(--green)); }
.mode-switch input:checked::after { transform: translateX(18px); background: #071122; }
.day-mode .app-shell { filter: saturate(.96); }
.night-mode .app-shell { filter: saturate(1.08); }

@media (max-width: 560px) {
  .actions { gap: 6px; }
  .mode-switch span { display: none; }
  .actions button, .filter-row button, .copy, .open { padding: 8px 10px; }
  .meta {
    width: min(calc(100% - 20px), 454px);
    padding: 11px 12px;
    bottom: max(14px, env(safe-area-inset-bottom));
  }
}
