:root {
  color-scheme: dark;
  --bg: #0B1A14;
  --panel: #122A1F;
  --text: #F0EDE5;
  --muted: #7B9A8A;
  --accent: #FF6B35;
  --gold: #FFD166;
  --cyan: #00D4AA;
  --line: rgba(0, 212, 170, 0.10);
  --card: #1A3528;
  --card-hover: #224433;
  --glow: rgba(255, 107, 53, 0.25);
  --coral: #FF6B35;
  --teal: #00D4AA;
  --sunset: #FFD166;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 10% -5%, rgba(255, 107, 53, 0.10), transparent 30%),
    radial-gradient(ellipse at 90% 0%, rgba(0, 212, 170, 0.08), transparent 28%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 209, 102, 0.06), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  padding: 0 clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 26, 20, 0.95), rgba(11, 26, 20, 0.80));
  backdrop-filter: blur(28px);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0;
  color: var(--text);
  text-transform: uppercase;
}

.brand span {
  color: #fff;
}

.brand strong {
  color: var(--sunset);
  font-weight: 900;
  text-shadow: 0 0 20px rgba(255, 209, 102, 0.30);
}

.search {
  margin-left: auto;
}

.search input {
  width: min(36vw, 360px);
  height: 38px;
  border: 1px solid var(--line);
  background: rgba(26, 53, 40, 0.6);
  color: var(--text);
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
  transition: border-color 0.2s;
}

.search input:focus {
  border-color: var(--teal);
}

.hero {
  position: relative;
  min-height: 76vh;
  display: flex;
  align-items: flex-end;
  padding: 120px clamp(18px, 4vw, 56px) 72px;
  overflow: hidden;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .55;
}

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 26, 20, 0.92), rgba(11, 26, 20, 0.25) 58%, rgba(11, 26, 20, 0.60)),
    linear-gradient(0deg, var(--bg), transparent 36%);
}

.hero__content {
  position: relative;
  max-width: 720px;
}

.eyebrow {
  color: var(--accent);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 5.5rem);
  line-height: 1;
  color: #fff;
  text-shadow: 0 4px 26px rgba(0, 0, 0, .72);
}

.hero__meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-weight: 600;
}

.hero__description {
  max-width: 58ch;
  color: #dedede;
  line-height: 1.55;
}

.play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 10px;
  padding: 0 24px;
  border-radius: 4px;
  background: linear-gradient(135deg, #fff, var(--sunset));
  color: #080808;
  font-weight: 800;
}

.rows {
  margin-top: -34px;
  padding: 0 clamp(18px, 4vw, 56px) 56px;
  position: relative;
}

.media-row {
  margin-bottom: 34px;
}

.media-row h2 {
  font-size: 1.25rem;
  margin: 0 0 12px;
}

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(154px, 15vw);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.tile {
  display: grid;
  gap: 8px;
}

.poster {
  aspect-ratio: 2 / 3;
  background: var(--panel);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
  transition: transform .18s ease, box-shadow .18s ease;
}

.tile:hover .poster {
  transform: translateY(-3px);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .38);
}

.poster img,
.poster__fallback {
  width: 100%;
  height: 100%;
}

.poster img {
  object-fit: cover;
  display: block;
}

.poster__fallback {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 4rem;
  font-weight: 900;
}

.tile span {
  min-height: 40px;
  color: #e9e9e9;
  font-size: .95rem;
  line-height: 1.25;
}

.player-page {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  padding: 88px clamp(18px, 4vw, 56px) 34px;
}

.player-shell {
  position: relative;
  background: #000;
  align-self: start;
  overflow: hidden;
  border: 1px solid rgba(255, 209, 102, .18);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(11, 26, 20, 0.55), 0 0 0 1px rgba(255, 255, 255, .04) inset;
}

.premium-player {
  isolation: isolate;
}

.premium-player::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .58), transparent 24%, transparent 58%, rgba(0, 0, 0, .82)),
    radial-gradient(circle at 50% 35%, transparent 0, rgba(0, 0, 0, .24) 72%);
  opacity: 0;
  transition: opacity .22s ease;
}

.premium-player:hover::before,
.premium-player:focus-within::before {
  opacity: 1;
}

.premium-player video {
  width: 100%;
  max-height: calc(100svh - 136px);
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: block;
  background: #000;
}

.player-top {
  position: absolute;
  z-index: 2;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .22s ease, transform .22s ease;
}

.premium-player:hover .player-top,
.premium-player:focus-within .player-top {
  opacity: 1;
  transform: translateY(0);
}

.player-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(255, 107, 53, .96), rgba(255, 209, 102, .84));
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.player-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-weight: 900;
  text-shadow: 0 1px 8px rgba(11, 26, 20, 0.55);
}

.player-center {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(0, 0, 0, .58);
  color: #fff;
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
  backdrop-filter: blur(16px);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: opacity .18s ease, transform .18s ease, background .18s ease;
}

.player-center:hover {
  background: rgba(255, 209, 102, .92);
  color: #080808;
  transform: translate(-50%, -50%) scale(1.04);
}

.player-center.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.player-controls {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 10px;
  padding: 52px 18px 16px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .88));
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .22s ease, transform .22s ease;
}

.premium-player:hover .player-controls,
.premium-player:focus-within .player-controls {
  opacity: 1;
  transform: translateY(0);
}

.seek-row,
.control-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.seek {
  flex: 1;
  min-width: 0;
  accent-color: var(--accent);
}

.time {
  width: 52px;
  color: #e7e7e7;
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.icon-btn,
.text-btn,
.speed {
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 4px;
  background: rgba(18, 18, 18, .78);
  color: #fff;
  backdrop-filter: blur(14px);
}

.icon-btn {
  width: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.text-btn {
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.text-btn:disabled {
  cursor: wait;
  opacity: .7;
}

.icon-btn:hover,
.text-btn:hover,
.speed:hover {
  border-color: rgba(255, 255, 255, .36);
  background: rgba(255, 209, 102, .86);
  color: #070707;
}

.volume {
  width: 96px;
  accent-color: var(--accent);
}

.speed {
  padding: 0 8px;
  outline: none;
}

.details {
  align-self: start;
  padding: 18px 0 0;
}

.details h1 {
  font-size: clamp(1.65rem, 3vw, 2.75rem);
  line-height: 1.05;
}

.details p {
  color: #d7d7d7;
  line-height: 1.55;
}

.watch-info {
  padding: 0 clamp(18px, 4vw, 56px) 34px;
}

.watch-info__inner {
  max-width: 980px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: 24px;
}

.watch-info h2 {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 2.4vw, 2.3rem);
}

.watch-description {
  margin: 0;
  max-width: 88ch;
  color: #d9d9d9;
  line-height: 1.65;
  white-space: pre-line;
}

.empty {
  min-height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
}

.hidden {
  display: none;
}

.search-header {
  padding: 88px clamp(18px, 4vw, 56px) 0;
}

.search-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
}

.search-header p {
  color: var(--muted);
  margin-top: 8px;
}

.searching {
  padding: 48px;
  text-align: center;
  color: var(--muted);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 24px clamp(18px, 4vw, 56px) 56px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 28px;
  border-radius: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  transition: background .2s;
}

.page-btn:hover {
  background: var(--line);
}

@media (max-width: 820px) {
  .topbar {
    height: 58px;
    gap: 12px;
    padding: 0 14px;
  }

  .brand {
    font-size: 1.16rem;
  }

  .search input {
    width: min(52vw, 260px);
    height: 36px;
  }

  .hero {
    min-height: 68vh;
    padding: 96px 18px 58px;
  }

  h1 {
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .rail {
    grid-auto-columns: minmax(132px, 38vw);
  }

  .player-page {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 70px 10px 24px;
  }

  .player-shell {
    border-radius: 0;
    margin-inline: -10px;
    border-left: 0;
    border-right: 0;
  }

  .premium-player video {
    max-height: 54svh;
    min-height: 210px;
  }

  .player-top {
    top: 10px;
    left: 10px;
    right: 10px;
    gap: 8px;
  }

  .player-controls {
    gap: 7px;
    padding: 38px 10px 10px;
  }

  .control-row {
    flex-wrap: wrap;
    gap: 7px;
  }

  .volume {
    width: 84px;
    flex: 1 1 84px;
    max-width: 120px;
  }

  .time {
    width: 42px;
    font-size: .7rem;
  }

  .icon-btn {
    width: 38px;
    height: 34px;
    font-size: .64rem;
  }

  .text-btn,
  .speed {
    height: 34px;
    font-size: .76rem;
  }

  .text-btn {
    padding: 0 10px;
  }

  .player-center {
    width: 62px;
    height: 62px;
    font-size: .68rem;
  }

  .details {
    padding: 0 8px;
  }

  .details h1 {
    font-size: clamp(1.45rem, 8vw, 2.25rem);
  }

  .watch-info {
    padding: 0 18px 28px;
  }

  .episode-selector {
    padding: 0 18px 44px;
  }
}

@media (hover: none) {
  .premium-player::before,
  .premium-player .player-top,
  .premium-player .player-controls {
    opacity: 1;
    transform: none;
  }

  .player-center.is-hidden {
    opacity: 0;
  }
}

@media (max-width: 480px) {
  .player-title {
    display: none;
  }

  .player-badge {
    font-size: .64rem;
    padding: 5px 8px;
  }

  .seek-row {
    gap: 6px;
  }

  .speed {
    width: 64px;
  }

  .episode-grid {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  }

  .auth-card {
    padding: 28px 20px;
  }

  .auth-card h1 {
    font-size: 1.8rem;
  }
}

.episode-selector {
  padding: 0 clamp(18px, 4vw, 56px) 56px;
}

.episode-selector h2 {
  font-size: 1.25rem;
  margin: 0 0 12px;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

/* ── Top Downloaded Overlays ─────────────────────────────────── */

.top-downloaded-rail {
  grid-auto-columns: minmax(154px, 15vw);
}

.tile--ranked .poster {
  position: relative;
}

.download-rank {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  min-width: 44px;
  padding: 6px 10px;
  background: linear-gradient(135deg, #FF6B35, #CC5522);
  color: #fff;
  font-size: .9rem;
  font-weight: 900;
  letter-spacing: .5px;
  border-radius: 6px 0 8px 0;
  box-shadow: 0 2px 12px rgba(255, 107, 53, .55);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  line-height: 1;
  pointer-events: none;
}

/* Top 3 get a special gold accent */
.tile--ranked:nth-child(-n+3) .download-rank {
  background: linear-gradient(135deg, #FFD166, #d4a017);
  color: #1a1a1a;
  box-shadow: 0 2px 14px rgba(255, 209, 102, .6);
  text-shadow: none;
  min-width: 50px;
  padding: 7px 11px;
  font-size: 1rem;
}

.download-count {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(8px);
  color: #FFD166;
  font-size: .78rem;
  font-weight: 800;
  border-radius: 8px 0 6px 0;
  pointer-events: none;
  white-space: nowrap;
  line-height: 1;
  border-top: 1px solid rgba(255, 209, 102, .25);
  border-left: 1px solid rgba(255, 209, 102, .25);
}

.download-count::before {
  content: "🔥";
  font-size: .85rem;
}

/* Hover: slight glow on overlays */
.tile--ranked:hover .download-rank {
  box-shadow: 0 2px 20px rgba(255, 107, 53, .8);
}

.tile--ranked:nth-child(-n+3):hover .download-rank {
  box-shadow: 0 2px 22px rgba(255, 209, 102, .85);
}

.tile--ranked:hover .download-count {
  background: rgba(0, 0, 0, .88);
}

/* ── Mobile adjustments for overlays ─────────────────────────── */

@media (max-width: 820px) {
  .download-rank {
    min-width: 36px;
    padding: 4px 7px;
    font-size: .75rem;
  }

  .tile--ranked:nth-child(-n+3) .download-rank {
    min-width: 40px;
    padding: 5px 8px;
    font-size: .82rem;
  }

  .download-count {
    padding: 3px 6px;
    font-size: .68rem;
  }

  .download-count::before {
    font-size: .72rem;
  }
}

.episode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.episode-btn:hover {
  background: var(--line);
}

.episode-btn.active {
  border-color: var(--accent);
  background: rgba(255, 107, 53, .12);
}

.ep-num {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent);
}

.ep-label {
  font-size: .82rem;
  font-weight: 600;
  text-align: center;
}

@media (max-width: 820px) {
  .episode-selector {
    padding: 0 18px 44px;
  }
}

@media (max-width: 480px) {
  .episode-grid {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  }
}

/* ── Auth Pages ──────────────────────────────────────────────── */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 100px 20px 60px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
  background: rgba(21, 21, 21, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 2.2rem;
  text-align: center;
  color: #fff;
}

.auth-subtitle {
  text-align: center;
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.auth-card form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.auth-card input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.62);
  color: var(--text);
  padding: 0 14px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.auth-card input:focus {
  border-color: var(--gold);
}

.auth-card input::placeholder {
  color: rgba(167, 167, 167, 0.6);
}

.auth-btn {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--sunset), var(--coral));
  color: #080808;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.auth-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.auth-btn:active {
  transform: translateY(0);
}

.resend-form {
  margin-top: 10px;
}

.resend-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px;
  height: auto;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.resend-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--gold);
  color: var(--gold);
}

.auth-timer {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 12px;
}

.auth-timer.expired {
  color: var(--accent);
  font-weight: 600;
}

.auth-subtitle {
  text-align: center;
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.auth-switch {
  text-align: center;
  color: var(--muted);
  margin: 20px 0 0;
  font-size: 0.88rem;
}

.auth-switch a {
  color: var(--gold);
  font-weight: 600;
  transition: color 0.2s;
}

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

/* Flash messages */

.flash-msg {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
}

.flash-error {
  background: rgba(255, 107, 53, 0.18);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 53, 0.3);
}

.flash-success {
  background: rgba(255, 209, 102, 0.15);
  color: var(--gold);
  border: 1px solid rgba(255, 209, 102, 0.3);
}

/* Timer */

.auth-timer {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 14px;
}

/* Auth navigation in topbar */

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.topbar-btn {
  padding: 6px 16px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
}

.topbar-btn:hover {
  background: var(--line);
}

.topbar-btn--accent {
  background: linear-gradient(135deg, var(--sunset), var(--coral));
  color: #080808;
  border: none;
}

.topbar-btn--accent:hover {
  opacity: 0.9;
}

/* ── Avatar Menu ───────────────────────────────────────────── */

.avatar-menu {
  position: relative;
}

.avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 209, 102, 0.4);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: linear-gradient(135deg, var(--coral), var(--sunset));
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-circle:hover {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.3);
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* Dropdown */

.avatar-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: rgba(20, 20, 20, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 100;
  overflow: hidden;
}

.avatar-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.avatar-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.avatar-dd-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--coral), var(--sunset));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-dd-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-dd-photo .avatar-initials {
  font-size: 0.82rem;
}

.avatar-dd-name {
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.avatar-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--coral);
}

.avatar-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 4px 0;
}

/* ── Saved Page ─────────────────────────────────────────────── */

.saved-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 20px 48px;
}

.saved-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.6rem;
  margin-bottom: 28px;
  color: var(--text);
}

.saved-title svg {
  color: var(--sunset);
}

.saved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
}

.tile--saved {
  position: relative;
}

.tile__unsave {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: var(--sunset);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, transform 0.15s;
  z-index: 2;
}

.tile--saved:hover .tile__unsave {
  opacity: 1;
}

.tile__unsave:hover {
  transform: scale(1.15);
  background: rgba(0, 0, 0, 0.8);
}

.saved-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 20px;
  color: var(--muted);
  text-align: center;
}

.saved-empty svg {
  opacity: 0.3;
}

/* ── Save Button (on watch page) ───────────────────────────── */

.save-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.save-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.save-btn.active {
  background: rgba(255, 209, 102, 0.15);
  border-color: rgba(255, 209, 102, 0.35);
  color: var(--sunset);
}

/* ── Resume Overlay ────────────────────────────────────────── */

.resume-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 26, 20, 0.85);
  backdrop-filter: blur(8px);
  z-index: 5;
  animation: fadeIn 0.3s ease;
}

.resume-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 36px;
  text-align: center;
  max-width: 360px;
}

.resume-box p {
  margin: 0 0 20px;
  font-size: 1.05rem;
  color: var(--text);
}

.resume-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.resume-yes {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--coral), var(--sunset));
  color: #0B1A14;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.resume-yes:hover {
  opacity: 0.9;
}

.resume-no {
  padding: 10px 24px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.resume-no:hover {
  color: var(--text);
  border-color: var(--muted);
}

/* ── Vote Buttons ──────────────────────────────────────────── */

.vote-bar {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.vote-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.vote-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.vote-btn--like.active {
  background: rgba(76, 175, 80, 0.15);
  border-color: rgba(76, 175, 80, 0.35);
  color: #4caf50;
}

.vote-btn--dislike.active {
  background: rgba(244, 67, 54, 0.15);
  border-color: rgba(244, 67, 54, 0.35);
  color: #f44336;
}

.vote-count {
  min-width: 12px;
  text-align: center;
}

/* ── Comments Section ──────────────────────────────────────── */

.comments-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.comments-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  margin-bottom: 24px;
  color: var(--text);
}

.comments-count {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
}

.comment-form {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
}

.comment-form__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--coral), var(--sunset));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.comment-form__avatar .avatar-initials {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.comment-form__input-wrap {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 12px;
  transition: border-color 0.2s;
}

.comment-form__input-wrap:focus-within {
  border-color: rgba(255, 209, 102, 0.35);
}

.comment-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.4;
}

.comment-input::placeholder {
  color: var(--muted);
}

.comment-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--gold);
  color: #080808;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.15s;
}

.comment-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.comment-send:not(:disabled):hover {
  transform: scale(1.08);
}

.comment-send--reply {
  width: 32px;
  height: 32px;
}

/* Comment items */

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comment {
  display: flex;
  gap: 12px;
  padding: 14px 0;
}

.comment--reply {
  padding-left: 20px;
  border-left: 2px solid rgba(255, 255, 255, 0.06);
  margin-left: 18px;
}

.comment__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--coral), var(--sunset));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.comment__avatar .avatar-initials {
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.comment__body {
  flex: 1;
  min-width: 0;
}

.comment__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.comment__user {
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
}

.comment__time {
  color: var(--muted);
  font-size: 0.75rem;
}

.comment__text {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.comment__actions {
  margin-top: 6px;
}

.comment-reply-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.15s;
}

.comment-reply-btn:hover {
  color: var(--gold);
}

.comment__replies {
  margin-top: 4px;
}

.comment__reply-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 6px 10px;
}

.comment-input--reply {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 20px;
  max-height: 80px;
  line-height: 1.3;
}

.comment-input--reply::placeholder {
  color: var(--muted);
}

/* ── Auth Divider & Telegram Button ─────────────────────────── */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-divider span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.telegram-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 50px;
  border: 1px solid rgba(0, 136, 204, 0.35);
  border-radius: 6px;
  background: linear-gradient(135deg, #2AABEE, #229ED9);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0, 136, 204, 0.25);
  text-decoration: none;
}

.telegram-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 136, 204, 0.35);
}

.telegram-btn:active {
  transform: translateY(0);
}

/* ── Telegram Callback Page ────────────────────────────────── */

.telegram-callback {
  text-align: center;
}

.telegram-callback h1 {
  margin: 16px 0 8px;
  font-size: 1.6rem;
}

.tg-callback-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border: 3px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.tg-callback-spinner.tg-spinner-done {
  animation: none;
  border-color: #4caf50;
  border-top-color: #4caf50;
}

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

.tg-callback-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 24px 0;
  text-align: left;
}

.tg-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.tg-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 136, 204, 0.2);
  color: #2AABEE;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}

.tg-callback-expire {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 12px;
}

.tg-callback-expire #countdown {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

