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

:root {
  --bg: #090b0f;
  --surface: rgba(19, 23, 29, 0.82);
  --surface-strong: rgba(25, 31, 38, 0.94);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f7f8f8;
  --muted: #a8b0b8;
  --subtle: #737d86;
  --teal: #16c7b7;
  --teal-deep: #0d9488;
  --amber: #f5c451;
  --danger: #fb7185;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.45);
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(145deg, #090b0f 0%, #11161c 48%, #0c1116 100%);
  background-size: 42px 42px, 42px 42px, auto;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 15, 0.78);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  width: min(1240px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--teal);
  background: rgba(22, 199, 183, 0.11);
  border: 1px solid rgba(22, 199, 183, 0.28);
}

.stream-status {
  min-width: 94px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
}

.page-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 18px;
}

.watch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}

.player-stage {
  min-width: 0;
}

.player-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #000;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 16 / 9;
}

#artplayer {
  width: 100%;
  height: 100%;
  background: #000;
}

.art-video-player {
  --art-theme: var(--teal);
  width: 100% !important;
  height: 100% !important;
  font-family: "Inter", sans-serif !important;
}

.art-video-player .art-controls {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.12), transparent);
}

.art-video-player .art-control,
.art-video-player .art-setting-item,
.art-video-player .art-contextmenu-item {
  border-radius: var(--radius-sm);
}

.art-video-player .art-bottom {
  padding: 0 14px 10px;
}

.loading-indicator {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  z-index: 8;
  color: var(--text);
  background: rgba(0, 0, 0, 0.68);
  pointer-events: none;
}

.loading-indicator.hidden {
  display: none;
}

.loading-indicator.error {
  color: var(--danger);
}

.loader {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.details-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.eyebrow,
.meta-label {
  display: block;
  color: var(--subtle);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.file-name {
  margin-top: 7px;
  font-size: clamp(1.25rem, 2vw, 1.68rem);
  line-height: 1.25;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.meta-item {
  min-width: 0;
  padding: 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.meta-item strong,
.resume-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 0.96rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.resume-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(245, 196, 81, 0.1);
  border: 1px solid rgba(245, 196, 81, 0.24);
}

.resume-panel.hidden {
  display: none;
}

.resume-actions {
  display: flex;
  gap: 8px;
}

.small-btn,
.action-btn {
  border: 0;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.small-btn {
  min-height: 34px;
  padding: 0 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.84rem;
  font-weight: 800;
}

.small-btn.primary {
  color: #051412;
  background: var(--amber);
  border-color: transparent;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.action-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-weight: 800;
}

.action-btn svg {
  stroke-width: 2;
  flex: 0 0 auto;
}

.action-btn.primary {
  color: #041412;
  background: linear-gradient(135deg, var(--teal), #7dd3c7);
  box-shadow: 0 12px 28px rgba(22, 199, 183, 0.22);
}

.action-btn.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
}

.action-btn:hover,
.small-btn:hover {
  transform: translateY(-1px);
}

.action-btn.secondary:hover,
.small-btn:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--line-strong);
}

.action-btn:active,
.small-btn:active {
  transform: translateY(0);
}

.premium-share-btn {
  position: relative;
  min-height: 59px;
  overflow: hidden;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.045)),
    radial-gradient(circle at 18% 18%, rgba(22, 199, 183, 0.32), transparent 34%),
    linear-gradient(145deg, rgba(17, 24, 39, 0.92), rgba(7, 11, 18, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -18px 34px rgba(0, 0, 0, 0.22),
    0 16px 34px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(22, 199, 183, 0.08);
  isolation: isolate;
}

.premium-share-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.28) 38%, transparent 70%);
  opacity: 0;
  transform: translateX(-75%);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.65s ease;
}

.premium-share-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(22, 199, 183, 0.48), rgba(124, 124, 255, 0.38), rgba(245, 196, 81, 0.22));
  opacity: 0.5;
  filter: blur(16px);
  transform: scale(0.92);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.share-icon-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  place-items: center;
  border-radius: 50%;
  color: #07110f;
  background: linear-gradient(135deg, #f8fffd, #16c7b7 54%, #0d9488);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 18px rgba(22, 199, 183, 0.24);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.share-icon-wrap::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.34);
  opacity: 0.7;
}

.premium-share-btn .share-icon {
  position: relative;
  z-index: 1;
  stroke-width: 2.2;
}

.share-label {
  position: relative;
  z-index: 2;
  color: #f7f8f8;
  font-size: 0.95rem;
  font-weight: 850;
  letter-spacing: 0;
  text-shadow: 0 1px 12px rgba(22, 199, 183, 0.18);
}

.premium-share-btn:hover {
  border-color: rgba(22, 199, 183, 0.5);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.07)),
    radial-gradient(circle at 18% 18%, rgba(22, 199, 183, 0.42), transparent 36%),
    linear-gradient(145deg, rgba(18, 28, 42, 0.96), rgba(8, 13, 20, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -18px 34px rgba(0, 0, 0, 0.2),
    0 18px 38px rgba(0, 0, 0, 0.34),
    0 0 24px rgba(22, 199, 183, 0.12);
}

.premium-share-btn:hover::before {
  opacity: 1;
  transform: translateX(75%);
}

.premium-share-btn:hover::after {
  opacity: 0.86;
  transform: scale(1);
}

.premium-share-btn:hover .share-icon-wrap {
  transform: translateY(-1px) rotate(-8deg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 10px 24px rgba(22, 199, 183, 0.32);
}

.premium-share-btn:focus-visible {
  outline: 2px solid rgba(22, 199, 183, 0.58);
  outline-offset: 3px;
}

.premium-share-btn:active {
  border-color: rgba(22, 199, 183, 0.42);
  transform: translateY(0);
}

.premium-share-btn.copied {
  border-color: rgba(35, 174, 35, 0.65);
}

.premium-share-btn.copied .share-icon-wrap {
  color: #06140a;
  background: linear-gradient(135deg, #ecfff1, #23ae23);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 18px rgba(35, 174, 35, 0.24);
}

/* Modern Sparkle Download Button */
.btn-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.btn {
  --border-radius: var(--radius-md);
  --padding: 4px;
  --transition: 0.4s;
  --button-color: rgba(255, 255, 255, 0.05); /* Glassy background */
  --highlight-color-hue: 174deg; /* Teal accent to match theme */

  user-select: none;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 48px;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 800;

  background-color: var(--button-color);
  color: var(--text);

  box-shadow:
    /* inset */
    inset 0px 1px 1px rgba(255, 255, 255, 0.1),
    inset 0px 2px 2px rgba(255, 255, 255, 0.05),
    /* drop */
    0px 4px 12px rgba(0, 0, 0, 0.1);

  border: 1px solid var(--line);
  border-radius: var(--border-radius);
  cursor: pointer;
  position: relative;
  overflow: visible;

  transition:
    box-shadow var(--transition),
    border-color var(--transition),
    background-color var(--transition),
    transform 0.18s ease;
}

.btn::before {
  content: "";
  position: absolute;
  top: calc(0px - var(--padding));
  left: calc(0px - var(--padding));
  width: calc(100% + var(--padding) * 2);
  height: calc(100% + var(--padding) * 2);
  border-radius: calc(var(--border-radius) + var(--padding));
  pointer-events: none;
  background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.6));

  z-index: -1;
  transition:
    box-shadow var(--transition),
    filter var(--transition);
  box-shadow:
    0 -8px 8px -6px rgba(0, 0, 0, 0) inset,
    0 -16px 16px -8px rgba(0, 0, 0, 0) inset,
    1px 1px 1px rgba(255, 255, 255, 0.1),
    2px 2px 2px rgba(255, 255, 255, 0.05),
    -1px -1px 1px rgba(0, 0, 0, 0.2),
    -2px -2px 2px rgba(0, 0, 0, 0.1);
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
  background-image: linear-gradient(
    0deg,
    #fff,
    hsl(var(--highlight-color-hue), 100%, 70%),
    hsla(var(--highlight-color-hue), 100%, 70%, 50%),
    8%,
    transparent
  );
  background-position: 0 0;
  opacity: 0;
  transition:
    opacity var(--transition),
    filter var(--transition);
}

.btn-letter {
  position: relative;
  display: inline-block;
  color: rgba(255, 255, 255, 0.6);
  --delay: 0s;
  animation: letter-anim 2s ease-in-out infinite;
  animation-delay: var(--delay);
  transition:
    color var(--transition),
    text-shadow var(--transition),
    opacity var(--transition);
}

@keyframes letter-anim {
  50% {
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
    color: #fff;
  }
}

.btn-svg {
  flex-shrink: 0;
  height: 20px;
  width: 20px;
  margin-right: 0.5rem;
  fill: #e8e8e8;
  animation: flicker 2s linear infinite;
  animation-delay: 0.5s;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.6));
  transition:
    fill var(--transition),
    filter var(--transition),
    opacity var(--transition);
}

@keyframes flicker {
  50% {
    opacity: 0.3;
  }
}

.txt-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 6.4em;
  height: 100%;
}

.txt-1,
.txt-2 {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
}

.txt-1 {
  animation: appear-anim 1s ease-in-out forwards;
}

.txt-2 {
  opacity: 0;
}

@keyframes appear-anim {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.btn:focus .txt-1,
.btn.downloading .txt-1 {
  animation: opacity-anim 0.3s ease-in-out forwards;
  animation-delay: 1s;
}

.btn:focus .txt-2,
.btn.downloading .txt-2 {
  animation: opacity-anim 0.3s ease-in-out reverse forwards;
  animation-delay: 1s;
}

@keyframes opacity-anim {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.btn:focus .btn-letter,
.btn.downloading .btn-letter {
  animation:
    focused-letter-anim 1s ease-in-out forwards,
    letter-anim 1.2s ease-in-out infinite;
  animation-delay: var(--delay), calc(var(--delay) + 1s);
}

@keyframes focused-letter-anim {
  0%,
  100% {
    filter: blur(0px);
  }
  50% {
    transform: scale(2);
    filter: blur(10px) brightness(150%)
      drop-shadow(-36px 12px 12px hsl(var(--highlight-color-hue), 100%, 70%));
  }
}

.btn:focus .btn-svg,
.btn.downloading .btn-svg {
  animation-duration: 1.2s;
  animation-delay: 0.2s;
}

.btn:focus::before,
.btn.downloading::before {
  box-shadow:
    0 -8px 12px -6px rgba(255, 255, 255, 0.15) inset,
    0 -16px 16px -8px hsla(var(--highlight-color-hue), 100%, 70%, 20%) inset,
    1px 1px 1px rgba(255, 255, 255, 0.15),
    2px 2px 2px rgba(255, 255, 255, 0.05),
    -1px -1px 1px rgba(0, 0, 0, 0.2),
    -2px -2px 2px rgba(0, 0, 0, 0.1);
}

.btn:focus::after,
.btn.downloading::after {
  opacity: 0.6;
  mask-image: linear-gradient(0deg, #fff, transparent);
  -webkit-mask-image: linear-gradient(0deg, #fff, transparent);
  filter: brightness(100%);
}

/* Animation delays for .btn-letter elements using custom properties */
.btn-letter:nth-child(1) { --delay: 0s; }
.btn-letter:nth-child(2) { --delay: 0.08s; }
.btn-letter:nth-child(3) { --delay: 0.16s; }
.btn-letter:nth-child(4) { --delay: 0.24s; }
.btn-letter:nth-child(5) { --delay: 0.32s; }
.btn-letter:nth-child(6) { --delay: 0.4s; }
.btn-letter:nth-child(7) { --delay: 0.48s; }
.btn-letter:nth-child(8) { --delay: 0.56s; }
.btn-letter:nth-child(9) { --delay: 0.64s; }
.btn-letter:nth-child(10) { --delay: 0.72s; }
.btn-letter:nth-child(11) { --delay: 0.8s; }
.btn-letter:nth-child(12) { --delay: 0.88s; }
.btn-letter:nth-child(13) { --delay: 0.96s; }

/* Active state */
.btn:active {
  border-color: hsla(var(--highlight-color-hue), 100%, 80%, 70%);
  background-color: hsla(var(--highlight-color-hue), 50%, 20%, 0.3);
  transform: translateY(0);
}

.btn:active::before {
  box-shadow:
    0 -8px 12px -6px rgba(255, 255, 255, 0.5) inset,
    0 -16px 16px -8px hsla(var(--highlight-color-hue), 100%, 70%, 80%) inset,
    1px 1px 1px rgba(255, 255, 255, 0.2),
    2px 2px 2px rgba(255, 255, 255, 0.1),
    -1px -1px 1px rgba(0, 0, 0, 0.2),
    -2px -2px 2px rgba(0, 0, 0, 0.1);
}

.btn:active::after {
  opacity: 1;
  mask-image: linear-gradient(0deg, #fff, transparent);
  -webkit-mask-image: linear-gradient(0deg, #fff, transparent);
  filter: brightness(200%);
}

.btn:active .btn-letter {
  text-shadow: 0 0 1px hsla(var(--highlight-color-hue), 100%, 90%, 90%);
  animation: none;
}

/* Hover state */
.btn:hover {
  border-color: hsla(var(--highlight-color-hue), 100%, 80%, 40%);
  transform: translateY(-1px);
}

.btn:hover::before {
  box-shadow:
    0 -8px 8px -6px rgba(255, 255, 255, 0.5) inset,
    0 -16px 16px -8px hsla(var(--highlight-color-hue), 100%, 70%, 30%) inset,
    1px 1px 1px rgba(255, 255, 255, 0.1),
    2px 2px 2px rgba(255, 255, 255, 0.05),
    -1px -1px 1px rgba(0, 0, 0, 0.2),
    -2px -2px 2px rgba(0, 0, 0, 0.1);
}

.btn:hover::after {
  opacity: 1;
  mask-image: linear-gradient(0deg, #fff, transparent);
  -webkit-mask-image: linear-gradient(0deg, #fff, transparent);
}

.btn:hover .btn-svg {
  fill: #fff;
  filter: drop-shadow(0 0 3px hsl(var(--highlight-color-hue), 100%, 70%))
    drop-shadow(0 -4px 6px rgba(0, 0, 0, 0.5));
  animation: none;
}

/* Download button pill */
.btn-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.download-btn {
  --download-accent: rgb(91, 91, 240);
  --download-accent-deep: #3333a8;

  width: 100%;
  max-width: 160px;
  height: 59px;
  min-height: 59px;
  padding: 5px;
  justify-content: flex-start;
  overflow: hidden;
  border: 2px solid var(--download-accent);
  border-radius: 50px;
  background: transparent;
  box-shadow: none;
  color: #fff;
}

.download-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 8px;
  height: 8px;
  margin: auto;
  border-radius: 999px;
  background-color: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  box-shadow: none;
  filter: none;
  transition: all 0.4s ease;
}

.download-btn::after {
  content: none;
}

.download-circle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  overflow: hidden;
  border-radius: 50%;
  background-color: var(--download-accent);
  box-shadow: 0 0 0 0 rgb(255, 255, 255);
  transition: all 0.4s ease;
}

.download-circle::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  background-color: var(--download-accent-deep);
  transition: all 0.4s ease;
}

.download-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  color: #fff;
  transform: translate(-50%, -50%);
  transition: all 0.4s ease;
}

.download-square {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  aspect-ratio: 1;
  border-radius: 2px;
  background-color: #fff;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%);
  transition: all 0.4s ease;
}

.download-title {
  position: absolute;
  right: 18px;
  top: 50%;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  transform: translateY(-50%);
  transition: all 0.4s ease;
}

.download-title:last-child {
  opacity: 0;
  visibility: hidden;
}

.download-btn:hover {
  border-color: rgb(124, 124, 255);
  background: rgba(91, 91, 240, 0.08);
  transform: translateY(-1px);
}

.download-btn:hover::before,
.download-btn:focus::before {
  box-shadow: none;
  filter: none;
}

.download-btn:hover::after,
.download-btn:focus::after,
.download-btn:active::after {
  content: none;
}

.download-btn:focus-visible {
  outline: 2px solid rgba(124, 124, 255, 0.65);
  outline-offset: 3px;
}

.download-btn:active {
  border-color: var(--download-accent);
  background: rgba(91, 91, 240, 0.14);
  transform: translateY(0);
}

.download-btn.downloading {
  width: 57px;
  animation: download-installed 0.4s ease 3.5s forwards;
}

.download-btn.downloading::before {
  box-shadow: none;
  filter: none;
  animation: download-rotate 3s ease-in-out 0.4s forwards;
}

.download-btn.downloading .download-circle {
  rotate: 180deg;
  animation:
    download-pulse 1s forwards,
    download-circle-delete 0.2s ease 3.5s forwards;
}

.download-btn.downloading .download-circle::before {
  animation: download-installing 3s ease-in-out forwards;
}

.download-btn.downloading .download-icon {
  opacity: 0;
  visibility: hidden;
}

.download-btn.downloading .download-square {
  opacity: 1;
  visibility: visible;
}

.download-btn.downloading .download-title {
  opacity: 0;
  visibility: hidden;
}

.download-btn.downloading .download-title:last-child {
  animation: download-show-open-message 0.4s ease 3.5s forwards;
}

@keyframes download-pulse {
  0% {
    scale: 0.95;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  70% {
    scale: 1;
    box-shadow: 0 0 0 16px rgba(255, 255, 255, 0);
  }
  100% {
    scale: 0.95;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

@keyframes download-installing {
  from {
    height: 0;
  }
  to {
    height: 100%;
  }
}

@keyframes download-rotate {
  0% {
    opacity: 1;
    visibility: visible;
    transform: rotate(-90deg) translate(27px) rotate(0);
  }
  99% {
    opacity: 1;
    visibility: visible;
    transform: rotate(270deg) translate(27px) rotate(270deg);
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes download-installed {
  100% {
    width: 100%;
    border-color: rgb(35, 174, 35);
  }
}

@keyframes download-circle-delete {
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes download-show-open-message {
  100% {
    right: 56px;
    opacity: 1;
    visibility: visible;
  }
}

.footer {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--subtle);
  font-size: 0.88rem;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text);
}

.telegram-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(420px, calc(100% - 36px));
  transform: translateY(calc(100% + 28px));
  transition: transform 0.28s ease;
}

.telegram-banner.show {
  transform: translateY(0);
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(22, 199, 183, 0.24);
  background: var(--surface-strong);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

.banner-text {
  min-width: 0;
  flex: 1;
}

.banner-text strong,
.banner-text span {
  display: block;
}

.banner-text strong {
  font-size: 0.92rem;
}

.banner-text span {
  color: var(--muted);
  font-size: 0.82rem;
}

.banner-btn,
.banner-close {
  border: 0;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-weight: 800;
}

.banner-btn {
  min-height: 36px;
  padding: 0 14px;
  color: #041412;
  background: var(--teal);
}

.banner-close {
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 980px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }

  .details-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
    align-items: start;
  }

  .meta-grid,
  .action-buttons {
    grid-column: span 1;
  }

  .resume-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .topbar-inner,
  .page-shell,
  .footer {
    width: min(100% - 24px, 1240px);
  }

  .topbar-inner {
    min-height: 60px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .page-shell {
    padding-top: 16px;
  }

  .player-frame {
    border-radius: var(--radius-md);
  }

  .details-panel {
    display: flex;
    padding: 16px;
    width: 100%;
  }

  .meta-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-buttons {
    grid-template-columns: 1fr;
  }

  .resume-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .resume-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .telegram-banner {
    right: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
  }

  .banner-content {
    flex-wrap: wrap;
  }

  .banner-text {
    flex-basis: 100%;
  }
}

@media (max-width: 420px) {
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .meta-item {
    padding: 14px 15px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .topbar {
    position: static;
  }

  .page-shell {
    padding-top: 14px;
  }

  .watch-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .details-panel {
    display: flex;
    gap: 12px;
    padding: 14px;
  }
}

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