/* ══════════════════════════════════════════════════════════
   SHARED TOKENS
══════════════════════════════════════════════════════════ */
:root {
  --bg: #0f1118;
  --bg-soft: #141414;
  --panel: #1f2230;
  --panel-alt: #2a2f42;
  --text: #f2f4f8;
  --muted: #aab2c7;
  --accent: #5865f2;
  --accent-soft: #7289da;
  --danger: #e50914;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: #141414;
  min-height: 100vh;
}

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

/* ══════════════════════════════════════════════════════════
   HOME BODY (overrides shared body)
══════════════════════════════════════════════════════════ */
body.home-body {
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

/* ── NAV ───────────────────────────────────────────────── */
.nf-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4%;
  height: 68px;
  background: linear-gradient(180deg, rgba(0,0,0,.85) 0%, transparent 100%);
  transition: background 0.35s ease;
}

.nf-nav.scrolled {
  background: rgba(10, 10, 16, 0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}

.nf-nav-left { display: flex; align-items: center; gap: 40px; }

.nf-logo {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 0 24px rgba(229,9,20,.35);
}

.nf-logo span { color: var(--danger); }

.nf-nav-links {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 28px;
}

.nf-nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  transition: color 0.15s;
}

.nf-nav-links a:hover,
.nf-nav-links a.active {
  color: #fff;
}

.nf-nav-right { display: flex; align-items: center; gap: 18px; }

.nf-icon-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.nf-icon-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.nf-avatar {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #7b5ea7 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(88,101,242,.4);
}

/* ── Search bar ─────────────────────────────────────────── */
.nf-search-wrap {
  display: flex;
  align-items: center;
  position: relative;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: border-color 0.22s ease, background 0.22s ease;
  height: 36px;
}

.nf-search-wrap.open {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
}

.nf-search-toggle {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.nf-search-input {
  width: 0;
  opacity: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 0.93rem;
  padding: 0;
  outline: none;
  overflow: hidden;
  transition: width 0.32s ease, opacity 0.25s ease, padding 0.32s ease;
  white-space: nowrap;
}

.nf-search-wrap.open .nf-search-input {
  width: 280px;
  opacity: 1;
  padding: 0 10px;
}

.nf-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.nf-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, color 0.15s;
  flex-shrink: 0;
}

.nf-search-wrap.open .nf-search-clear {
  opacity: 1;
  pointer-events: all;
}

.nf-search-clear:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* No results message */
.nf-no-results {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.95rem;
  padding: 16px 0 0;
  margin: 0;
}

/* ── HERO ───────────────────────────────────────────────── */
.nf-hero {
  position: relative;
  height: 88vh;
  min-height: 560px;
  overflow: hidden;
}

.nf-hero-bg {
  position: absolute;
  inset: 0;
  transition: background 0.6s ease;
}

.nf-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.4) 50%, transparent 100%),
    linear-gradient(0deg, rgba(20,20,20,1) 0%, transparent 25%);
}

.nf-hero-content {
  position: relative;
  z-index: 2;
  padding: 0 6%;
  max-width: 660px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 100px;
}

.nf-hero-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.nf-hero-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.9);
}

.nf-hero-title {
  margin: 0;
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.5px;
  text-shadow: 0 4px 20px rgba(0,0,0,.6);
}

.nf-hero-subtitle {
  margin: 8px 0 0;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  letter-spacing: 0.3px;
}

.nf-hero-desc {
  margin: 14px 0 0;
  font-size: 0.97rem;
  color: rgba(255,255,255,.82);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nf-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: rgba(255,255,255,.7);
}

.nf-badge-rating {
  padding: 2px 7px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
}

.nf-genre-chip {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  font-size: 0.78rem;
  color: rgba(255,255,255,.8);
}

.nf-hero-btns {
  display: flex;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* ── SHARED BUTTONS ────────────────────────────────────── */
.nf-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 26px;
  border: none;
  border-radius: 6px;
  background: #fff;
  color: #000;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.nf-btn-primary:hover {
  background: rgba(255,255,255,.85);
  transform: translateY(-1px);
}

.nf-btn-primary:active { transform: scale(.97); }

.nf-btn-primary.nf-btn-disabled {
  background: rgba(255,255,255,.25);
  color: rgba(255,255,255,.6);
  cursor: not-allowed;
}

.nf-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 26px;
  border: none;
  border-radius: 6px;
  background: rgba(109,109,110,.7);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s ease, transform 0.1s ease;
}

.nf-btn-secondary:hover {
  background: rgba(109,109,110,.95);
  transform: translateY(-1px);
}

/* ── MAIN CATALOGUE ─────────────────────────────────────── */
.nf-main {
  padding: 0 4% 60px;
  position: relative;
  z-index: 1;
}

.nf-row {
  margin-top: 40px;
}

.nf-row-title {
  margin: 0 0 18px;
  font-size: 1.22rem;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  letter-spacing: 0.2px;
}

.nf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

/* ── FILM CARD ──────────────────────────────────────────── */
.nf-card {
  border-radius: 8px;
  overflow: visible;
  cursor: pointer;
  transition: transform 0.32s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.32s ease;
  position: relative;
  z-index: 1;
}

.nf-card:hover {
  transform: scale(1.13);
  z-index: 10;
  box-shadow:
    0 22px 55px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.12);
}

.nf-card-poster {
  height: 150px;
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 10px;
  position: relative;
  overflow: hidden;
  transition: border-radius 0.28s ease;
}

.nf-card:hover .nf-card-poster {
  border-radius: 8px 8px 0 0;
}

/* Small watermark title in poster — hide on hover */
.nf-card-poster-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.35);
  position: relative;
  z-index: 1;
  transition: opacity 0.2s ease;
}

.nf-card:hover .nf-card-poster-title {
  opacity: 0;
}

.nf-card-soon-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(229, 9, 20, 0.9);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  z-index: 5;
}

/* ── Hover overlay ─────────────────────────────────────── */
.nf-card-hover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.0)  25%,
    rgba(0, 0, 0, 0.88) 72%,
    rgba(0, 0, 0, 0.98) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  opacity: 0;
  transition: opacity 0.26s ease;
  border-radius: 8px 8px 0 0;
}

/* Subtle centered play icon as a ghost hint */
.nf-card-hover-overlay::before {
  content: "▶";
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  font-size: 2.4rem;
  color: rgba(255, 255, 255, 0.0);
  pointer-events: none;
  transition: color 0.22s ease, transform 0.26s ease;
}

.nf-card:hover .nf-card-hover-overlay {
  opacity: 1;
}

.nf-card:hover .nf-card-hover-overlay::before {
  color: rgba(255, 255, 255, 0.12);
  transform: translate(-50%, -50%) scale(1);
}

.nf-card-hover-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nf-card-hover-meta {
  font-size: 0.74rem;
  color: #46d369;
  font-weight: 600;
  margin-bottom: 3px;
}

.nf-card-hover-genres {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 10px;
}

.nf-card-hover-btns {
  display: flex;
  gap: 7px;
  align-items: center;
}

/* Circle buttons */
.nf-chover-play,
.nf-chover-info {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  flex-shrink: 0;
}

.nf-chover-play {
  background: #fff;
  color: #000;
  border-color: #fff;
  font-size: 0.8rem;
  padding-left: 2px; /* optical centering of play icon */
}

.nf-chover-play:hover {
  background: rgba(255, 255, 255, 0.88);
  transform: scale(1.1);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.35);
}

.nf-chover-info {
  background: rgba(40, 40, 40, 0.65);
  color: #fff;
  backdrop-filter: blur(4px);
}

.nf-chover-info:hover {
  background: rgba(80, 80, 80, 0.75);
  border-color: #fff;
  transform: scale(1.1);
}

.nf-chover-play.nf-btn-disabled {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Card info body (slides in smoothly) ──────────────── */
.nf-card-body {
  background: #1e1e1e;
  border-radius: 0 0 8px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0 12px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease, padding 0.28s ease, opacity 0.2s ease;
  opacity: 0;
}

.nf-card:hover .nf-card-body {
  max-height: 100px;
  padding: 10px 12px 12px;
  opacity: 1;
}

.nf-card-title {
  margin: 0 0 2px;
  font-size: 0.87rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nf-card-sub {
  margin: 0 0 8px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
}

.nf-card-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.nf-chip {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
}


.nf-chip-rating {
  background: rgba(229,9,20,.2);
  color: #ff6b6b;
  border: 1px solid rgba(229,9,20,.35);
}

/* ══════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════ */
.nf-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.nf-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.nf-modal {
  --film-accent: #5865f2;
  --film-glow: rgba(88,101,242,.4);
  position: relative;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 12px;
  background: #181818;
  box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 30px 80px rgba(0,0,0,.7);
  transform: translateY(20px) scale(.97);
  transition: transform 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}

.nf-modal-overlay.open .nf-modal {
  transform: translateY(0) scale(1);
}

.nf-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 10;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(30,30,30,.9);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.15);
  transition: background 0.15s, transform 0.1s;
}

.nf-modal-close:hover {
  background: rgba(60,60,60,.9);
  transform: scale(1.1);
}

/* Banner */
.nf-modal-banner {
  height: 280px;
  position: relative;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.nf-modal-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #181818 0%, transparent 55%);
}

.nf-modal-banner-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 24px 30px;
}

.nf-modal-logo {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 16px rgba(0,0,0,.6);
  transition: color 0.3s;
}

/* Body */
.nf-modal-body {
  padding: 0 30px 30px;
}

.nf-modal-top {
  margin-bottom: 20px;
}

.nf-modal-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.nf-modal-rating {
  padding: 2px 8px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 4px;
  font-size: 0.77rem;
  font-weight: 700;
  color: rgba(255,255,255,.85);
}

.nf-modal-year,
.nf-modal-dur {
  font-size: 0.88rem;
  color: #46d369;
  font-weight: 600;
}

.nf-modal-msgs {
  font-size: 0.82rem;
  color: rgba(255,255,255,.5);
}

.nf-modal-genres {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nf-modal-genre {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.15);
}

/* Split layout */
.nf-modal-split {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 32px;
  align-items: start;
}

.nf-modal-desc {
  margin: 0 0 8px;
  font-size: 0.93rem;
  line-height: 1.6;
  color: rgba(255,255,255,.85);
}

.nf-modal-long-desc {
  margin: 0 0 22px;
  font-size: 0.83rem;
  line-height: 1.55;
  color: rgba(255,255,255,.45);
  font-style: italic;
}

.nf-modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.nf-modal-actions .nf-btn-primary {
  font-size: 0.9rem;
  height: 42px;
  padding: 0 22px;
  box-shadow: 0 4px 20px var(--film-glow);
}

.nf-modal-info-line {
  margin: 0 0 10px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: rgba(255,255,255,.55);
}

.nf-info-label {
  color: rgba(255,255,255,.35);
  margin-right: 4px;
}

.nf-modal-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.nf-modal-tag {
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 3px;
  background: rgba(255,255,255,.08);
  color: var(--film-accent);
  border: 1px solid var(--film-accent);
  opacity: 0.85;
}

@media (max-width: 700px) {
  .nf-modal-split { grid-template-columns: 1fr; gap: 16px; }
  .nf-modal-banner { height: 200px; }
  .nf-hero-content { padding-bottom: 60px; padding-left: 5%; padding-right: 5%; max-width: 100%; }
  .nf-nav-links { display: none; }
  .nf-main { padding: 0 4% 40px; }
}

.player-wrapper {
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 56px 1fr;
  background: radial-gradient(circle at 20% 0%, #252c45 0%, #1a1f31 35%, #121625 100%);
}

.player-topbar {
  background: linear-gradient(180deg, rgba(18, 22, 36, 0.96) 0%, rgba(14, 17, 28, 0.96) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  backdrop-filter: blur(8px);
}

.player-topbar a {
  color: #d7dcf1;
  font-weight: 600;
}

.player-topbar a:hover {
  color: #ffffff;
}

.player-layout {
  display: grid;
  grid-template-columns: 72px 240px 1fr;
  min-height: 0;
  height: 100%;
}

.discord-icons {
  background: linear-gradient(180deg, #10131c 0%, #0d1018 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px;
}

.server-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3a4362 0%, #242b42 100%);
  margin: 8px auto;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.channels {
  background: linear-gradient(180deg, #171b28 0%, #141826 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px;
}

.channels h3 {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.channel-item {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.93rem;
  color: #d8dff3;
}

.chat-area {
  background: linear-gradient(180deg, #212536 0%, #1a1e2d 100%);
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
  overflow: hidden;
}

.chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  letter-spacing: 0.2px;
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(29, 33, 48, 0.98) 0%, rgba(28, 32, 46, 0.98) 100%);
  backdrop-filter: blur(6px);
}

.chat-feed {
  padding: 14px 16px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-feed::-webkit-scrollbar {
  width: 10px;
}

.chat-feed::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.chat-feed::-webkit-scrollbar-thumb {
  background: rgba(142, 155, 199, 0.35);
  border-radius: 999px;
}

.chat-feed::-webkit-scrollbar-thumb:hover {
  background: rgba(142, 155, 199, 0.55);
}

.msg {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  margin-bottom: 13px;
}

.msg.compact {
  margin-top: -4px;
}

.msg.compact > img {
  visibility: hidden;
}

.msg > img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: #2e3448;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.msg-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.msg-name {
  font-weight: 600;
  color: #f8f9ff;
}

.msg-time {
  color: #aeb8d4;
  font-size: 0.78rem;
}

.msg-text {
  margin-top: 3px;
  color: #ebeffa;
  line-height: 1.45;
  word-break: break-word;
}

.msg.compact .msg-head {
  display: none;
}

.msg.compact .msg-text {
  margin-top: 0;
}

.msg-text .md-bold {
  font-weight: 700;
}

.msg-text .md-italic {
  font-style: italic;
}

.msg-text .md-title {
  margin: 2px 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.msg-text .md-subtitle {
  margin: 2px 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.msg-text a {
  color: #78b8ff;
  text-decoration: none;
}

.msg-text a:hover {
  color: #9ccaff;
  text-decoration: underline;
}

.media-wrap {
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  max-width: 560px;
  background: linear-gradient(180deg, #11162a 0%, #101423 100%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.media-wrap img,
.media-wrap video,
.media-wrap iframe {
  display: block;
  width: 100%;
  max-height: 420px;
  border: 0;
}

.media-wrap img {
  object-fit: cover;
}

.media-wrap video {
  background: #000;
}

.media-wrap iframe {
  aspect-ratio: 16 / 9;
}

.media-loading {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 20%, rgba(255, 255, 255, 0.11) 45%, rgba(255, 255, 255, 0.04) 70%);
  background-size: 220% 100%;
  animation: mediaLoading 1.1s linear infinite;
}

@keyframes mediaLoading {
  0% {
    background-position: 0% 0;
  }
  100% {
    background-position: -220% 0;
  }
}

.external-media {
  min-height: 180px;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  padding: 16px;
  background: linear-gradient(180deg, #151c33 0%, #101629 100%);
}

.external-media-title {
  color: #d9e1ff;
  font-weight: 600;
}

.external-media-link {
  justify-self: center;
  background: linear-gradient(180deg, #3a4670 0%, #2d3758 100%);
  border: 1px solid rgba(180, 196, 255, 0.45);
  border-radius: 10px;
  color: #f4f7ff;
  padding: 8px 12px;
  font-weight: 600;
}

.external-media-link:hover {
  background: linear-gradient(180deg, #455385 0%, #374367 100%);
}

/* ── Controls bar ───────────────────────────────────────────── */
.controls {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(12, 14, 22, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 -2px 32px rgba(0, 0, 0, 0.55);
}

/* Left group: playback buttons */
.controls-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Right group: speed + info badges */
.controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Generic icon button */
.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  color: #fff;
}

/* Play — accent fill */
#playBtn {
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(88, 101, 242, 0);
}
#playBtn:hover {
  background: #6672ff;
  box-shadow: 0 0 14px rgba(88, 101, 242, 0.6);
  transform: translateY(-1px);
}
#playBtn:active  { transform: scale(0.96); }

/* Pause — neutral dark */
#pauseBtn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}
#pauseBtn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}
#pauseBtn:active { transform: scale(0.96); }

/* Reset — subtle red tint */
#resetBtn {
  background: rgba(255, 77, 103, 0.12);
  border-color: rgba(255, 77, 103, 0.28);
  color: #ff8fa0;
}
#resetBtn:hover {
  background: rgba(255, 77, 103, 0.24);
  border-color: rgba(255, 77, 103, 0.5);
  color: #ffb3bf;
  transform: translateY(-1px);
}
#resetBtn:active { transform: scale(0.96); }

/* Speed divider */
.controls-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 4px;
}

/* Speed label */
.controls label {
  color: #8b96b8;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Speed select */
.controls select {
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #d8dfff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b96b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.controls select:hover {
  background-color: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.24);
}
.controls select:focus-visible {
  outline: 2px solid rgba(88, 101, 242, 0.7);
  outline-offset: 2px;
}

/* Progress badge */
.progress {
  color: #8b96b8;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

/* Time badge */
.time-info {
  color: #c4ceff;
  font-size: 0.88rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.18);
  border: 1px solid rgba(88, 101, 242, 0.4);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .player-wrapper {
    grid-template-rows: 52px 1fr;
  }

  .player-topbar {
    padding: 0 12px;
    font-size: 0.92rem;
  }

  .player-layout {
    grid-template-columns: 56px 1fr;
  }

  .channels {
    display: none;
  }

  .chat-feed {
    padding: 10px;
  }

  .msg {
    gap: 9px;
  }

  .media-wrap {
    max-width: 100%;
  }

  .controls {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
  }

  .controls-left {
    flex: 1;
    justify-content: center;
  }

  .controls-right {
    flex: 1;
    justify-content: center;
  }

  .ctrl-btn {
    height: 34px;
    padding: 0 12px;
    font-size: 0.8rem;
  }

  .controls select {
    height: 30px;
    font-size: 0.8rem;
  }
}
