/* ==========================================================================
   WAVIX — MATERIAL 3 / GOOGLE TV DESIGN SYSTEM & STYLESHEET
   Systematic implementation of Material 3 tonal palettes, elevation,
   typography, shape tokens, TV 10-foot UI, and fluid motion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens: Colors, Typography, Shapes, Elevation & Motion
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette — Material 3 Dark (Default for TV & Video Streaming) */
  --md-sys-color-primary: #a8c7fa;
  --md-sys-color-on-primary: #062e5b;
  --md-sys-color-primary-container: #1b4577;
  --md-sys-color-on-primary-container: #d3e4ff;

  --md-sys-color-secondary: #bdc7dc;
  --md-sys-color-on-secondary: #273141;
  --md-sys-color-secondary-container: #3e4758;
  --md-sys-color-on-secondary-container: #d9e3f8;

  --md-sys-color-tertiary: #d8bde6;
  --md-sys-color-on-tertiary: #3c2948;
  --md-sys-color-tertiary-container: #533f60;
  --md-sys-color-on-tertiary-container: #f5daff;

  --md-sys-color-surface: #101318;
  --md-sys-color-on-surface: #e1e2e9;
  --md-sys-color-surface-variant: #43474e;
  --md-sys-color-on-surface-variant: #c3c6cf;

  --md-sys-color-surface-container-lowest: #0b0e13;
  --md-sys-color-surface-container-low: #181c20;
  --md-sys-color-surface-container: #1c2024;
  --md-sys-color-surface-container-high: #272a2f;
  --md-sys-color-surface-container-highest: #32353a;

  --md-sys-color-outline: #8d9199;
  --md-sys-color-outline-variant: #43474e;

  --md-sys-color-error: #ffb4ab;
  --md-sys-color-on-error: #690005;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;

  --md-sys-color-live: #ff5449;
  --md-sys-color-live-container: #93000a;

  /* Category Tonal Accents */
  --cat-news: #38bdf8;
  --cat-news-container: rgba(56, 189, 248, 0.16);
  --cat-sports: #34d399;
  --cat-sports-container: rgba(52, 211, 153, 0.16);
  --cat-entertainment: #c084fc;
  --cat-entertainment-container: rgba(192, 132, 252, 0.16);
  --cat-kids: #fbbf24;
  --cat-kids-container: rgba(251, 191, 36, 0.16);
  --cat-music: #f472b6;
  --cat-music-container: rgba(244, 114, 182, 0.16);
  --cat-documentary: #2dd4bf;
  --cat-documentary-container: rgba(45, 212, 191, 0.16);
  --cat-general: #818cf8;
  --cat-general-container: rgba(129, 140, 248, 0.16);

  /* Shape Scale */
  --md-sys-shape-corner-none: 0px;
  --md-sys-shape-corner-extra-small: 4px;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-full: 9999px;

  /* Elevation (Restrained Material 3 Tonal Shadows) */
  --md-sys-elevation-1: 0 1px 3px 1px rgba(0, 0, 0, 0.35), 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --md-sys-elevation-2: 0 2px 6px 2px rgba(0, 0, 0, 0.35), 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --md-sys-elevation-3: 0 4px 8px 3px rgba(0, 0, 0, 0.35), 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --md-sys-elevation-4: 0 6px 10px 4px rgba(0, 0, 0, 0.35), 0 2px 3px 0 rgba(0, 0, 0, 0.4);
  --md-sys-elevation-5: 0 8px 14px 6px rgba(0, 0, 0, 0.4), 0 4px 4px 0 rgba(0, 0, 0, 0.45);

  /* Focus Glow for TV remote & keyboard navigation */
  --tv-focus-ring: 0 0 0 3px var(--md-sys-color-primary), 0 8px 24px rgba(168, 199, 250, 0.35);

  /* Motion Tokens */
  --md-sys-motion-duration-short1: 50ms;
  --md-sys-motion-duration-short2: 100ms;
  --md-sys-motion-duration-short3: 150ms;
  --md-sys-motion-duration-short4: 200ms;
  --md-sys-motion-duration-medium1: 250ms;
  --md-sys-motion-duration-medium2: 300ms;
  --md-sys-motion-duration-medium3: 350ms;
  --md-sys-motion-duration-medium4: 400ms;
  --md-sys-motion-duration-long1: 450ms;
  --md-sys-motion-duration-long2: 500ms;

  --md-sys-motion-easing-standard: cubic-bezier(0.2, 0.0, 0, 1.0);
  --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0.0, 0, 1.0);
  --md-sys-motion-easing-decelerated: cubic-bezier(0.05, 0.7, 0.1, 1.0);
  --md-sys-motion-easing-accelerated: cubic-bezier(0.3, 0.0, 0.8, 0.15);

  /* Typography */
  --md-font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Light Theme Overrides */
body[data-theme="light"] {
  --md-sys-color-primary: #005faf;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #d4e3ff;
  --md-sys-color-on-primary-container: #001c3b;

  --md-sys-color-secondary: #555f71;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #d9e3f8;
  --md-sys-color-on-secondary-container: #121c2b;

  --md-sys-color-tertiary: #6e5676;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #f7d8ff;
  --md-sys-color-on-tertiary-container: #271430;

  --md-sys-color-surface: #fdfcff;
  --md-sys-color-on-surface: #1a1c1e;
  --md-sys-color-surface-variant: #e0e2ec;
  --md-sys-color-on-surface-variant: #43474e;

  --md-sys-color-surface-container-lowest: #ffffff;
  --md-sys-color-surface-container-low: #f3f3fa;
  --md-sys-color-surface-container: #ededf4;
  --md-sys-color-surface-container-high: #e7e8ee;
  --md-sys-color-surface-container-highest: #e1e2e8;

  --md-sys-color-outline: #74777f;
  --md-sys-color-outline-variant: #c4c6cf;

  --md-sys-color-error: #ba1a1a;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;

  --md-sys-elevation-1: 0 1px 3px 1px rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.08);
  --md-sys-elevation-2: 0 2px 6px 2px rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.08);
  --md-sys-elevation-3: 0 4px 8px 3px rgba(0, 0, 0, 0.1), 0 1px 3px 0 rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   2. Reset & Global Base Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: var(--md-font-family);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Universal scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--md-sys-color-surface-variant);
  border-radius: var(--md-sys-shape-corner-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--md-sys-color-outline);
}

/* Material Symbols Helper */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  display: inline-block;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  vertical-align: middle;
  user-select: none;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   3. FIRST-RUN MODE SELECTOR SCREEN
   -------------------------------------------------------------------------- */
.mode-selector-scrim {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(11, 14, 18, 0.95);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  transition: opacity var(--md-sys-motion-duration-medium3) var(--md-sys-motion-easing-standard),
              visibility var(--md-sys-motion-duration-medium3);
}

.mode-selector-scrim.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mode-selector-dialog {
  max-width: 960px;
  width: 100%;
  background-color: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-extra-large);
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-sys-elevation-4);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  text-align: center;
  animation: modalEnter var(--md-sys-motion-duration-medium3) var(--md-sys-motion-easing-decelerated);
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.mode-selector-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.mode-selector-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--md-sys-shape-corner-full);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.mode-selector-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  letter-spacing: -0.5px;
}

.mode-selector-desc {
  font-size: 16px;
  color: var(--md-sys-color-on-surface-variant);
  max-width: 600px;
}

.mode-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .mode-cards-grid {
    grid-template-columns: 1fr;
  }
  .mode-selector-dialog {
    padding: 24px 16px;
  }
}

.mode-card {
  position: relative;
  background-color: var(--md-sys-color-surface-container-high);
  border: 2px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
  outline: none;
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--md-sys-color-primary);
  background-color: var(--md-sys-color-surface-container-highest);
  box-shadow: var(--md-sys-elevation-3);
}

.mode-card:focus-visible,
.mode-card.keyboard-focused {
  border-color: var(--md-sys-color-primary);
  box-shadow: var(--tv-focus-ring);
  transform: scale(1.02);
}

.mode-card-icon-wrap {
  width: 76px;
  height: 76px;
  border-radius: var(--md-sys-shape-corner-full);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-card-icon-wrap .material-symbols-outlined {
  font-size: 42px;
}

.mode-card-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.mode-card-text {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.5;
  min-height: 42px;
}

.mode-card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.mode-feature-chip {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  border-radius: var(--md-sys-shape-corner-full);
}

.mode-card-btn {
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  transition: background-color var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}

.mode-card:hover .mode-card-btn {
  filter: brightness(1.1);
}

/* --------------------------------------------------------------------------
   4. NORMAL MODE (RESPONSIVE WEB EXPERIENCE)
   -------------------------------------------------------------------------- */
.normal-mode-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.normal-mode-root.hidden {
  display: none !important;
}

/* Top App Bar */
.m3-top-app-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--md-sys-color-surface-container);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--md-sys-elevation-1);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--md-sys-shape-corner-medium);
  background: linear-gradient(135deg, #a8c7fa, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #04294f;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.4);
}

.brand-icon .material-symbols-outlined {
  font-size: 24px;
  font-weight: 700;
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--md-sys-color-on-surface);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--md-sys-color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Search bar in Top Bar */
.search-bar-wrap {
  flex: 1;
  max-width: 520px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-field {
  width: 100%;
  height: 44px;
  background-color: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-full);
  padding: 0 44px 0 44px;
  color: var(--md-sys-color-on-surface);
  font-size: 14px;
  outline: none;
  transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.search-input-field:focus {
  background-color: var(--md-sys-color-surface-container-highest);
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px rgba(168, 199, 250, 0.25);
}

.search-icon-left {
  position: absolute;
  left: 14px;
  color: var(--md-sys-color-on-surface-variant);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--md-sys-shape-corner-full);
}

.search-clear-btn:hover {
  color: var(--md-sys-color-on-surface);
  background-color: rgba(255, 255, 255, 0.1);
}

/* Top bar actions */
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m3-button {
  height: 40px;
  padding: 0 16px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
  outline: none;
}

.m3-button-filled {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.m3-button-filled:hover {
  filter: brightness(1.08);
}

.m3-button-tonal {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.m3-button-tonal:hover {
  background-color: var(--md-sys-color-surface-container-highest);
}

.m3-button-outlined {
  border-color: var(--md-sys-color-outline-variant);
  background-color: transparent;
  color: var(--md-sys-color-on-surface);
}

.m3-button-outlined:hover {
  background-color: var(--md-sys-color-surface-container-high);
}

.m3-icon-button {
  width: 40px;
  height: 40px;
  border-radius: var(--md-sys-shape-corner-full);
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
  outline: none;
}

.m3-icon-button:hover {
  background-color: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
}

.m3-icon-button:focus-visible {
  box-shadow: var(--tv-focus-ring);
}

/* Normal Mode Main Body */
.normal-main-content {
  flex: 1;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

@media (max-width: 640px) {
  .normal-main-content {
    padding: 12px;
    gap: 20px;
  }
  .m3-top-app-bar {
    padding: 0 12px;
  }
}

/* Featured / Live Player Card in Normal Mode */
.normal-player-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.player-card {
  background-color: #000000;
  border-radius: var(--md-sys-shape-corner-large);
  border: 1px solid var(--md-sys-color-outline-variant);
  overflow: hidden;
  box-shadow: var(--md-sys-elevation-2);
  display: flex;
  flex-direction: column;
}

.video-viewport-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-viewport-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Player Overlays (Loading, Error, Idle) */
.stream-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(16, 19, 24, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 16px;
  z-index: 20;
}

.stream-overlay.hidden {
  display: none !important;
}

.m3-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--md-sys-color-surface-variant);
  border-top-color: var(--md-sys-color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.overlay-status-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.overlay-status-desc {
  font-size: 14px;
  color: var(--md-sys-color-on-surface-variant);
  max-width: 420px;
}

.overlay-actions-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* Player Floating Controls */
.video-controls-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 10;
  opacity: 0;
  transition: opacity var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.video-viewport-wrapper:hover .video-controls-bar,
.video-controls-bar:focus-within,
.video-controls-bar.force-visible {
  opacity: 1;
}

.controls-cluster-left,
.controls-cluster-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--md-sys-shape-corner-full);
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--md-sys-motion-duration-short1);
}

.ctrl-btn:hover {
  background-color: rgba(255, 255, 255, 0.28);
}

.ctrl-btn .material-symbols-outlined {
  font-size: 20px;
}

/* Volume Slider */
.vol-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.m3-slider {
  width: 80px;
  height: 4px;
  accent-color: var(--md-sys-color-primary);
  cursor: pointer;
}

/* Live Badge */
.live-broadcast-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--md-sys-shape-corner-full);
  background-color: var(--md-sys-color-live-container);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.live-beacon-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #ffffff;
  animation: livePulse 1.4s ease-in-out infinite;
}

@keyframes livePulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 8px #ff5449; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Channel Details Card Under Player */
.channel-meta-card {
  padding: 16px 20px;
  background-color: var(--md-sys-color-surface-container);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.channel-meta-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.meta-logo-box {
  width: 52px;
  height: 52px;
  border-radius: var(--md-sys-shape-corner-medium);
  background-color: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.meta-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.meta-logo-fallback {
  font-size: 18px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
}

.meta-text-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.meta-channel-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-tags-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.m3-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--md-sys-shape-corner-small);
  font-size: 12px;
  font-weight: 500;
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
}

.m3-chip-category {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 600;
}

.meta-channel-status {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
}

.meta-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.star-favorite-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-outline);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}

.star-favorite-btn:hover {
  background-color: var(--md-sys-color-surface-container-highest);
  color: #facc15;
}

.star-favorite-btn.favorited {
  background-color: rgba(250, 204, 21, 0.16);
  border-color: #facc15;
  color: #facc15;
}

.star-favorite-btn.favorited .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

/* --------------------------------------------------------------------------
   5. CHANNEL EXPLORER & BROWSING (NORMAL MODE)
   -------------------------------------------------------------------------- */
.browser-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Category Filter Rail */
.categories-rail-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.cat-scroll-arrow {
  position: absolute;
  z-index: 10;
  width: 32px;
  height: 32px;
  border-radius: var(--md-sys-shape-corner-full);
  background-color: var(--md-sys-color-surface-container-highest);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--md-sys-elevation-2);
}

.cat-scroll-arrow.left { left: 0; }
.cat-scroll-arrow.right { right: 0; }

.categories-track {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px 38px;
  scrollbar-width: none;
}

.categories-track::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex-shrink: 0;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--md-sys-shape-corner-small);
  border: 1px solid var(--md-sys-color-outline-variant);
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
  outline: none;
}

.filter-pill:hover {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.filter-pill.active {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: var(--md-sys-color-primary);
  font-weight: 600;
}

.filter-pill:focus-visible {
  box-shadow: var(--tv-focus-ring);
}

/* Category Accent Indicators */
.cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Explorer Section Title & Count */
.explorer-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.explorer-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.explorer-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.explorer-count-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  border-radius: var(--md-sys-shape-corner-full);
}

/* Responsive Channel Grid */
.channel-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

@media (max-width: 480px) {
  .channel-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Channel Card Component (Normal Mode) */
.m3-channel-card {
  position: relative;
  background-color: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  outline: none;
}

.m3-channel-card:hover {
  background-color: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-primary);
  transform: translateY(-2px);
  box-shadow: var(--md-sys-elevation-2);
}

.m3-channel-card:focus-visible {
  border-color: var(--md-sys-color-primary);
  box-shadow: var(--tv-focus-ring);
  transform: scale(1.02);
}

.m3-channel-card.active-playing {
  background-color: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-primary);
}

.m3-channel-card.active-playing .card-channel-name {
  color: var(--md-sys-color-on-primary-container);
}

.card-logo-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--md-sys-shape-corner-small);
  background-color: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.card-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

.card-fallback {
  font-size: 15px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  letter-spacing: -0.5px;
}

.card-info-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-channel-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-channel-group {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-fav-star {
  background: none;
  border: none;
  color: var(--md-sys-color-outline);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--md-sys-shape-corner-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--md-sys-motion-duration-short1);
}

.card-fav-star:hover,
.card-fav-star.favorited {
  color: #facc15;
}

.card-fav-star.favorited .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

/* Empty State */
.m3-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  background-color: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-large);
  border: 1px dashed var(--md-sys-color-outline-variant);
  gap: 16px;
}

.empty-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-icon-wrap .material-symbols-outlined {
  font-size: 32px;
}

/* Infinite Sentinel */
.scroll-sentinel {
  height: 40px;
  width: 100%;
}

/* --------------------------------------------------------------------------
   6. TV MODE (10-FOOT SOFA TELEVISION EXPERIENCE)
   -------------------------------------------------------------------------- */
.tv-mode-root {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 500;
  background-color: #000000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tv-mode-root.hidden {
  display: none !important;
}

/* TV Video Player Fill */
.tv-viewport-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: #000000;
  z-index: 1;
}

.tv-viewport-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* TV Top Information Bar */
.tv-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.88), transparent);
  z-index: 50;
  transition: opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-standard);
}

.tv-top-bar.idle-hidden {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.tv-top-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tv-brand-badge {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tv-brand-badge .material-symbols-outlined {
  color: var(--md-sys-color-primary);
  font-size: 28px;
}

.tv-section-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--md-sys-color-primary);
  padding: 4px 12px;
  background-color: rgba(168, 199, 250, 0.16);
  border-radius: var(--md-sys-shape-corner-full);
}

.tv-top-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tv-clock {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.tv-action-btn {
  height: 44px;
  padding: 0 16px;
  border-radius: var(--md-sys-shape-corner-full);
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  outline: none;
  transition: all var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}

.tv-action-btn:hover,
.tv-action-btn:focus-visible,
.tv-action-btn.tv-focused {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--tv-focus-ring);
  transform: scale(1.05);
}

/* TV Bottom Channel Guide & Overlay */
.tv-bottom-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.75) 60%, transparent 100%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: opacity var(--md-sys-motion-duration-medium3) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-medium3) var(--md-sys-motion-easing-standard);
}

.tv-bottom-overlay.idle-hidden {
  opacity: 0;
  transform: translateY(30px);
  pointer-events: none;
}

/* TV Active Channel Info Banner */
.tv-current-channel-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.tv-banner-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.tv-banner-logo-box {
  width: 72px;
  height: 72px;
  border-radius: var(--md-sys-shape-corner-medium);
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.tv-banner-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.tv-banner-fallback {
  font-size: 26px;
  font-weight: 800;
  color: var(--md-sys-color-primary);
}

.tv-banner-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tv-banner-name {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.tv-banner-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tv-category-chip {
  padding: 4px 12px;
  border-radius: var(--md-sys-shape-corner-small);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.tv-banner-status {
  font-size: 14px;
  color: #a1a1aa;
}

/* TV Category Tabs Strip */
.tv-category-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
}

.tv-category-strip::-webkit-scrollbar {
  display: none;
}

.tv-cat-btn {
  height: 42px;
  padding: 0 20px;
  border-radius: var(--md-sys-shape-corner-full);
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #d4d4d8;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  transition: all var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-standard);
}

.tv-cat-btn:hover,
.tv-cat-btn:focus-visible,
.tv-cat-btn.tv-focused {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  box-shadow: var(--tv-focus-ring);
  transform: scale(1.05);
}

.tv-cat-btn.active {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: var(--md-sys-color-primary);
}

/* TV Horizontal Channel Rail */
.tv-channel-rail {
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 4px 16px 4px;
  scroll-behavior: smooth;
}

.tv-channel-rail::-webkit-scrollbar {
  display: none;
}

.tv-channel-tile {
  flex-shrink: 0;
  width: 220px;
  height: 120px;
  border-radius: var(--md-sys-shape-corner-large);
  background-color: rgba(28, 32, 37, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.15);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  outline: none;
  transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
  position: relative;
  overflow: hidden;
}

.tv-channel-tile:hover,
.tv-channel-tile:focus-visible,
.tv-channel-tile.tv-focused {
  border-color: var(--md-sys-color-primary);
  background-color: var(--md-sys-color-surface-container-highest);
  box-shadow: var(--tv-focus-ring);
  transform: scale(1.08) translateY(-4px);
  z-index: 10;
}

.tv-channel-tile.is-active-playing {
  border-color: var(--md-sys-color-primary);
  background-color: var(--md-sys-color-primary-container);
}

.tile-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tile-logo-box {
  width: 44px;
  height: 44px;
  border-radius: var(--md-sys-shape-corner-small);
  background-color: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tile-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
}

.tile-fallback {
  font-size: 16px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
}

.tile-live-badge {
  font-size: 10px;
  font-weight: 700;
  color: #ff5449;
  letter-spacing: 0.5px;
}

.tile-bottom-info {
  display: flex;
  flex-direction: column;
}

.tile-channel-name {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-channel-group {
  font-size: 12px;
  color: #a1a1aa;
}

/* --------------------------------------------------------------------------
   7. CHANNEL ZAP TRANSITION OVERLAY
   -------------------------------------------------------------------------- */
.channel-zap-overlay {
  position: absolute;
  top: 100px;
  left: 40px;
  z-index: 60;
  background-color: rgba(16, 19, 24, 0.92);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--md-sys-elevation-4);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.channel-zap-overlay.visible {
  opacity: 1;
  transform: translateY(0);
}

.zap-logo-box {
  width: 56px;
  height: 56px;
  border-radius: var(--md-sys-shape-corner-medium);
  background-color: var(--md-sys-color-surface-container-high);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.zap-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.zap-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.zap-channel-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.zap-channel-group {
  font-size: 13px;
  color: var(--md-sys-color-primary);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   8. TV STARTUP ANIMATION OVERLAY
   -------------------------------------------------------------------------- */
.tv-startup-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 1;
  transition: opacity 0.4s ease-out;
}

.tv-startup-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.startup-glow-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--md-sys-color-primary);
  box-shadow: 0 0 24px 8px rgba(168, 199, 250, 0.7);
  animation: pulseStartup 1.2s ease-in-out infinite alternate;
}

@keyframes pulseStartup {
  from { transform: scale(0.8); opacity: 0.6; }
  to { transform: scale(1.4); opacity: 1; }
}

.startup-text {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   9. SETTINGS & REMOTE GUIDE DIALOGS
   -------------------------------------------------------------------------- */
.m3-dialog-scrim {
  position: fixed;
  inset: 0;
  z-index: 800;
  background-color: rgba(11, 14, 18, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  transition: opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.m3-dialog-scrim.hidden {
  opacity: 0;
  pointer-events: none;
}

.m3-dialog-card {
  max-width: 680px;
  width: 100%;
  max-height: 88vh;
  background-color: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-corner-extra-large);
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-sys-elevation-4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalEnter var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-decelerated);
}

.m3-dialog-header {
  padding: 24px 28px 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.dialog-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialog-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.m3-dialog-body {
  padding: 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--md-sys-color-primary);
  margin-bottom: 12px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-label-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-label-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.settings-label-desc {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
}

/* Material Switch */
.m3-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
}

.m3-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--md-sys-color-surface-container-highest);
  border: 2px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-full);
  transition: all var(--md-sys-motion-duration-short3);
}

.switch-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: var(--md-sys-color-outline);
  border-radius: 50%;
  transition: all var(--md-sys-motion-duration-short3);
}

.m3-switch input:checked + .switch-slider {
  background-color: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
}

.m3-switch input:checked + .switch-slider::before {
  transform: translateX(22px);
  background-color: var(--md-sys-color-on-primary);
}

/* Keyboard Guide Keycaps Table */
.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-corner-medium);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.shortcut-keycap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  background-color: var(--md-sys-color-surface-container-highest);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-extra-small);
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  box-shadow: 0 2px 0 var(--md-sys-color-outline);
}

.shortcut-desc {
  font-size: 13px;
  color: var(--md-sys-color-on-surface);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   10. TOAST NOTIFICATION (MATERIAL 3 SNACKBAR)
   -------------------------------------------------------------------------- */
.m3-toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.m3-toast {
  min-width: 300px;
  padding: 14px 20px;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background-color: var(--md-sys-color-surface-container-highest);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
  box-shadow: var(--md-sys-elevation-3);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  animation: toastEnter 0.25s var(--md-sys-motion-easing-decelerated);
}

@keyframes toastEnter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.m3-toast .material-symbols-outlined {
  color: var(--md-sys-color-primary);
  font-size: 20px;
}

/* --------------------------------------------------------------------------
   11. ACCESSIBILITY & PREFERS-REDUCED-MOTION
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   12. LOGO, WATERMARK & TV VOLUME OSD
   -------------------------------------------------------------------------- */
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

.brand-logo-inline {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.tv-brand-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* Mini TV Channel Watermark Bug */
.video-watermark {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 15;
  pointer-events: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.85;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.75));
  transition: opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.video-watermark .watermark-img {
  height: 34px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
}

.tv-viewport-container .video-watermark {
  top: 28px;
  right: 36px;
  z-index: 15;
}

.tv-viewport-container .video-watermark .watermark-img {
  height: 48px;
  max-width: 140px;
}

/* Autoplay Muted Notification Pill */
.autoplay-unmute-pill {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  background-color: rgba(16, 19, 24, 0.88);
  border: 1px solid var(--md-sys-color-primary);
  border-radius: var(--md-sys-shape-corner-full);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--md-sys-color-primary);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  backdrop-filter: blur(8px);
  animation: pulsePill 2s infinite ease-in-out;
  transition: transform 0.2s, background-color 0.2s;
}

.autoplay-unmute-pill:hover {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  transform: translateX(-50%) scale(1.04);
}

@keyframes pulsePill {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.7; }
}

/* TV Volume On-Screen Display (OSD / HUD) */
.tv-volume-osd {
  position: absolute;
  top: 96px;
  right: 40px;
  z-index: 70;
  background-color: rgba(16, 19, 24, 0.92);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--md-sys-elevation-4);
  backdrop-filter: blur(14px);
  min-width: 230px;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: opacity var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard),
              transform var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard);
}

.tv-volume-osd.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tv-volume-osd-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--md-sys-shape-corner-full);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tv-volume-osd-icon-wrap .material-symbols-outlined {
  font-size: 26px;
}

.tv-volume-osd-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tv-volume-osd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tv-volume-osd-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 700;
}

.tv-volume-osd-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.tv-volume-osd-track {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.16);
  border-radius: var(--md-sys-shape-corner-full);
  overflow: hidden;
}

.tv-volume-osd-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--md-sys-color-primary), #38bdf8);
  border-radius: var(--md-sys-shape-corner-full);
  transition: width 0.12s ease-out;
}

/* --------------------------------------------------------------------------
   13. ABOUT WAVIX & DEVELOPER MODAL (GOOGLE M3 STYLING)
   -------------------------------------------------------------------------- */
.about-dialog-card {
  max-width: 580px;
}

.about-dialog-body {
  padding: 24px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about-dev-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  background-color: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-sys-shape-corner-large);
  border: 1px solid var(--md-sys-color-outline-variant);
}

/* Animated Google M3 Rotating Gradient Avatar Border */
.m3-animated-avatar-wrapper {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: m3GlowBreath 3.5s ease-in-out infinite alternate;
}

.m3-animated-border-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #a8c7fa 0%,
    #38bdf8 25%,
    #80e5ff 50%,
    #c58af9 75%,
    #a8c7fa 100%
  );
  animation: m3RingRotate 4.5s linear infinite;
}

.m3-animated-border-ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--md-sys-color-surface-container-high);
}

.m3-dev-avatar {
  position: relative;
  z-index: 2;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--md-sys-color-surface-container-high);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

@keyframes m3RingRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes m3GlowBreath {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.35));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(197, 138, 249, 0.55));
  }
}

.about-dev-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.about-dev-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-dev-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.about-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: var(--md-sys-shape-corner-full);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.about-dev-alias {
  font-size: 13px;
  color: var(--md-sys-color-primary);
  font-weight: 500;
}

.about-dev-bio {
  font-size: 12.5px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.4;
  margin-top: 2px;
}

.about-text-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  line-height: 1.6;
}

.about-lead-text {
  font-size: 14.5px;
  color: var(--md-sys-color-on-surface);
  line-height: 1.6;
}

.about-sub-text {
  font-size: 13.5px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.6;
}

/* Channel Request Contact Card */
.about-contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background-color: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--md-sys-shape-corner-medium);
}

.about-contact-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--md-sys-shape-corner-full);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.about-contact-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.about-contact-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.about-contact-sub {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
}

.about-email-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--md-sys-color-primary);
  text-decoration: none;
  margin-top: 4px;
  transition: color 0.2s;
}

.about-email-link:hover {
  text-decoration: underline;
  color: #38bdf8;
}

/* Buttons at the End */
.about-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

.about-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--md-sys-shape-corner-full);
}

@media (max-width: 520px) {
  .about-links-grid {
    grid-template-columns: 1fr;
  }
  .about-dev-profile {
    flex-direction: column;
    text-align: center;
  }
  .about-dev-name-row {
    justify-content: center;
  }
}

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