/* Watch page: the player fills the screen, the video list sits below it */
.watch-page {
  --brand: #3ee0c0; --brand-ink: #04211b; --ink: #f4f4f5; --ink-2: #b4b4bd; --glass: rgba(20, 20, 24, .55);
  --card: #1c1c21; --ease: cubic-bezier(.2, .8, .2, 1);
  background: #0b0b0e; color: var(--ink);
  font-family: "Hind Siliguri", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
  overflow-x: hidden;
}
.watch-page .empty { color: var(--ink-2); }
.watch-page ::selection { background: var(--brand); color: var(--brand-ink); }

.stage { position: relative; height: 100vh; height: 100svh; background: #000; overflow: hidden; isolation: isolate; }
.video, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.shield { position: absolute; inset: 0; cursor: pointer; display: none; }
.stage.ready .shield { display: block; }
.stage.idle, .stage.idle .shield { cursor: none; }

.spinner { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border: 4px solid rgba(255, 255, 255, .15); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; pointer-events: none; }
.stage.started .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* glass surfaces */
.more, .sound-prompt, .upnext, .pill.ghost { background: var(--glass); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); border: 1px solid rgba(255, 255, 255, .12); }

/* controls */
.controls { position: absolute; left: 0; right: 0; bottom: 0; display: none; padding: 64px 20px max(12px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, .55) 40%, rgba(0, 0, 0, .85)); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.stage.ready .controls { display: block; }
.stage.idle .controls { opacity: 0; transform: translateY(12px); pointer-events: none; }
.stage.idle .more { opacity: 0; pointer-events: none; }
.bar { display: flex; align-items: center; gap: 2px; }
.ctl { flex: none; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; background: none; color: #fff; cursor: pointer; transition: background .2s, transform .15s; }
.ctl:hover, .ctl:focus-visible { background: rgba(255, 255, 255, .14); }
.ctl:active { transform: scale(.9); }
.ctl svg { width: 26px; height: 26px; fill: currentColor; }
#btn-play svg { width: 30px; height: 30px; }
.i-pause, .i-muted, .i-exit { display: none; }
.stage.playing .i-play, .stage.muted .i-sound, .stage.full .i-full { display: none; }
.stage.playing .i-pause, .stage.muted .i-muted, .stage.full .i-exit { display: block; }
.time { flex: none; margin: 0 10px; color: #e4e4e7; font-size: .9rem; font-variant-numeric: tabular-nums; }
.vid-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 1.02rem; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }

.progress { --fill: 0%; display: block; width: 100%; height: 20px; margin: 0 0 4px; padding: 0; background: none; border: 0; appearance: none; -webkit-appearance: none; cursor: pointer; }
.progress::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--brand) var(--fill), rgba(255, 255, 255, .28) var(--fill)); transition: height .15s; }
.progress::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .28); }
.progress::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--brand); }
.progress::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(62, 224, 192, .35); transform: scale(0); transition: transform .15s; }
.progress::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.controls:hover .progress::-webkit-slider-thumb, .progress:focus-visible::-webkit-slider-thumb { transform: scale(1); }
.progress:hover::-webkit-slider-runnable-track { height: 6px; }
.progress:hover::-webkit-slider-thumb { margin-top: -4px; }

/* tap for sound */
.sound-prompt { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 12px; padding: 16px 28px 16px 22px; border-radius: 999px; color: #fff; font: inherit; font-size: 1.15rem; font-weight: 600; cursor: pointer; animation: rise .5s var(--ease) both; transition: transform .2s var(--ease); }
.sound-prompt[hidden] { display: none; }
.sound-prompt:hover { transform: translate(-50%, -50%) scale(1.05); }
.sound-prompt svg { position: relative; width: 26px; height: 26px; fill: var(--brand); }
.pulse { position: absolute; inset: -1px; border-radius: inherit; border: 2px solid var(--brand); animation: pulse 1.8s ease-out infinite; pointer-events: none; }
@keyframes pulse { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.15, 1.5); } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, -40%); } }

.more { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; display: flex; align-items: center; gap: 4px; padding: 8px 12px 8px 16px; border-radius: 999px; color: #fff; font-size: .92rem; font-weight: 500; text-decoration: none; transition: opacity .35s, background .2s; }
.more svg { width: 20px; height: 20px; fill: currentColor; animation: nudge 1.6s ease-in-out infinite; }
.more:hover, .more:focus-visible { background: rgba(20, 20, 24, .8); }
.stage.full .more { display: none; }
@keyframes nudge { 50% { transform: translateY(3px); } }

/* up next */
.upnext { position: absolute; right: 20px; bottom: 110px; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 12px 14px; align-items: center; width: min(420px, calc(100% - 40px)); padding: 12px; border-radius: 16px; overflow: hidden; animation: slide .4s var(--ease) both; }
.upnext[hidden] { display: none; }
.upnext img { width: 132px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.upnext-text { min-width: 0; }
.upnext-text small { display: block; color: var(--brand); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.upnext-text strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.35; }
.upnext-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.upnext-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--brand); transform-origin: left; transform: scaleX(0); }
.upnext.counting .upnext-bar { animation: countdown var(--countdown, 6s) linear forwards; }
@keyframes countdown { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes slide { from { opacity: 0; transform: translateY(16px); } }

.pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border: 0; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font: inherit; font-size: .95rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .15s var(--ease), filter .2s; }
.pill:hover { filter: brightness(1.08); }
.pill:active { transform: scale(.96); }
.pill.ghost { color: #fff; }
.pill svg { width: 20px; height: 20px; fill: currentColor; }

/* now playing */
.list-section { position: relative; isolation: isolate; max-width: 1320px; margin: 0 auto; padding: 36px 20px 64px; }
.ambient { position: absolute; top: 0; left: 50%; width: 100vw; margin-left: -50vw; height: 420px; z-index: -1; overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent); }
.ambient img { width: 100%; height: 100%; object-fit: cover; filter: blur(70px) saturate(1.6); opacity: .45; transform: scale(1.3); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); font-size: .82rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.now-title { margin: 6px 0 0; font-size: clamp(1.4rem, 2.6vw, 2.1rem); line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.now-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.now-desc { margin: 18px 0 0; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); max-width: 900px; }
.now-desc[hidden] { display: none; }
.now-desc p { margin: 0; color: #e4e4e7; font-size: .98rem; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.now-desc.open p { display: block; }
.link-more { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.link-more[hidden] { display: none; }

.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; height: 100%; border-radius: 1px; background: currentColor; transform-origin: bottom; animation: eq 1s ease-in-out infinite; animation-play-state: paused; }
.eq i:nth-child(2) { animation-delay: -.4s; }
.eq i:nth-child(3) { animation-delay: -.7s; }
.is-playing .eq i { animation-play-state: running; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* video cards */
.list-heading { display: flex; align-items: baseline; gap: 8px; margin: 44px 0 18px; font-size: 1.3rem; font-weight: 700; }
.list-heading span { padding: 0 9px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: var(--ink-2); font-size: .85rem; font-weight: 600; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px 18px; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); }
.cards li { animation: rise-card .5s var(--ease) both; }
.cards li:nth-child(2) { animation-delay: .05s; }
.cards li:nth-child(3) { animation-delay: .1s; }
.cards li:nth-child(4) { animation-delay: .15s; }
.cards li:nth-child(n+5) { animation-delay: .2s; }
@keyframes rise-card { from { opacity: 0; transform: translateY(14px); } }
.card { display: block; color: inherit; text-decoration: none; border-radius: 14px; }
.card:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.card-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--card); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); transition: transform .3s var(--ease), box-shadow .3s; }
.card:hover .card-thumb { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0, 0, 0, .5); }
.card-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover .card-thumb img { transform: scale(1.06); }
.card-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .25); opacity: 0; transition: opacity .25s; }
.card-play svg { width: 54px; height: 54px; padding: 13px 11px 13px 15px; border-radius: 50%; background: rgba(255, 255, 255, .92); fill: #111; transform: scale(.8); transition: transform .3s var(--ease); }
.card:hover .card-play { opacity: 1; }
.card:hover .card-play svg { transform: scale(1); }
.card.active .card-thumb { box-shadow: 0 0 0 3px var(--brand), 0 12px 32px rgba(62, 224, 192, .25); }
.card.active .card-play { display: none; }
.badge { position: absolute; left: 10px; top: 10px; display: none; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: .76rem; font-weight: 700; }
.card.active .badge { display: inline-flex; }
.badge .eq { height: 10px; }
.card-external { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--ink-2); font-size: .9rem; }
.card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 12px; font-size: 1.02rem; font-weight: 600; line-height: 1.45; }
.card.active .card-title { color: var(--brand); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 10; padding: 10px 18px; border-radius: 999px; background: #fff; color: #111; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transform: translate(-50%, 140%); opacity: 0; transition: transform .35s var(--ease), opacity .35s; pointer-events: none; max-width: calc(100% - 32px); overflow-wrap: anywhere; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 600px) {
  .time { display: none; }
  .ctl { width: 42px; height: 42px; }
  .controls { padding: 48px 8px max(6px, env(safe-area-inset-bottom)); }
  .upnext { right: 12px; bottom: 96px; width: calc(100% - 24px); grid-template-columns: 104px minmax(0, 1fr); }
  .upnext img { width: 104px; }
  .list-section { padding: 24px 16px 48px; }
  .sound-prompt { font-size: 1.05rem; padding: 14px 24px 14px 18px; }
}
/* Upright phones: a 16:9 player on top with the list right below, as in the YouTube app.
   Full screen still fills the whole screen. */
@media (orientation: portrait) and (max-aspect-ratio: 3/4) {
  .stage:not(.full) { height: auto; aspect-ratio: 16 / 9; }
  .stage:not(.full) .more { display: none; }
  .stage:not(.full) .controls { padding-top: 28px; }
  .stage:not(.full) .vid-title { display: none; }
  .stage:not(.full) .sound-prompt { padding: 10px 18px 10px 14px; font-size: .95rem; gap: 8px; }
  .stage:not(.full) .sound-prompt svg { width: 22px; height: 22px; }
  .stage:not(.full) .upnext { top: 8px; bottom: auto; right: 8px; width: calc(100% - 16px); grid-template-columns: 1fr; gap: 6px; padding: 8px 10px; }
  .stage:not(.full) .upnext img { display: none; }
  .stage:not(.full) .upnext-text strong { -webkit-line-clamp: 1; }
  .stage:not(.full) .upnext .pill { padding: 5px 12px; font-size: .85rem; }
  .list-section { padding-top: 20px; }
}
.stage:fullscreen { height: 100%; }
@media (prefers-reduced-motion: reduce) {
  .watch-page *, .watch-page *::before, .watch-page *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
