:root {
  --bg-darkest: #07090e;
  --bg-primary: #0c0f17;
  --bg-secondary: #131824;
  --bg-card: #182030;
  --bg-card-hover: #222b40;
  --bg-active: rgba(0, 210, 255, 0.12);
  --accent-cyan: #00d2ff;
  --accent-blue: #0066ff;
  --accent-purple: #9d4edd;
  --accent-green: #00f59b;
  --accent-red: #ff4757;
  --accent-gold: #ffd166;
  --text-main: #f3f6fa;
  --text-muted: #8b99ad;
  --border-color: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(0, 210, 255, 0.4);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-glow: 0 0 25px rgba(0, 210, 255, 0.25);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-darkest);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  user-select: none;
  overflow: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-darkest);
}
::-webkit-scrollbar-thumb {
  background: #252e42;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* App Shell (Desktop 3-Column Pro Layout) */
#app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-darkest);
}

/* 1. Left Primary Side Navigation (TiviMate Style) */
.side-nav {
  width: 200px;
  background: #090c13;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  flex-shrink: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.brand-icon {
  font-size: 24px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
}

.brand-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.brand-title span {
  color: var(--accent-cyan);
  font-size: 13px;
  background: rgba(0, 210, 255, 0.15);
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 4px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  position: relative;
}

.nav-tab .tab-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.nav-tab:hover {
  background: var(--bg-card);
  color: var(--text-main);
}

.nav-tab.active {
  background: var(--bg-active);
  color: var(--accent-cyan);
  border-color: rgba(0, 210, 255, 0.3);
  font-weight: 700;
}

.nav-tab.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 4px;
  background: var(--accent-cyan);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 10px var(--accent-cyan);
}

.tab-pill {
  font-size: 10px;
  background: var(--accent-red);
  color: #fff;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: auto;
  font-weight: 800;
}

.tab-badge {
  font-size: 11px;
  background: rgba(255, 209, 102, 0.2);
  color: var(--accent-gold);
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: auto;
  font-weight: 700;
}

.nav-separator {
  height: 1px;
  background: var(--border-color);
  margin: 10px 0;
}

.nav-tab.highlight-vr {
  color: #ff4d94;
}
.nav-tab.highlight-vr:hover {
  background: rgba(247, 37, 133, 0.12);
}

.btn-pwa-install {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-green), #00b4d8);
  color: #000;
  border: none;
  padding: 10px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(0, 245, 155, 0.3);
}

/* 2. Center Panel: Categories & Channel List */
.channels-panel {
  width: clamp(280px, 26vw, 360px);
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.panel-header {
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-secondary);
}

.playlist-selector-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.playlist-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
}

.playlist-select {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.playlist-select option {
  background: var(--bg-card);
  color: var(--text-main);
}

.btn-icon-small {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon-small:hover {
  background: var(--accent-cyan);
  color: #000;
}

.search-container {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 12px;
  gap: 8px;
  transition: all 0.2s;
}

.search-container:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.2);
}

.search-glass {
  font-size: 13px;
  opacity: 0.6;
}

.search-container input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  width: 100%;
}

.clear-search-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 2px 4px;
}

.toggle-online-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.toggle-online-filter input {
  accent-color: var(--accent-green);
  cursor: pointer;
}

/* Category Pills Bar */
.categories-bar {
  background: rgba(12, 15, 23, 0.9);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.categories-bar::-webkit-scrollbar {
  display: none;
}

.category-tabs {
  display: flex;
  gap: 6px;
}

.cat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s;
}

.cat-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.cat-pill.active {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
  font-weight: 700;
}

/* Channels Scroll */
.channels-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  -webkit-overflow-scrolling: touch;
}

.channels-loading {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Channel Card */
.channel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.channel-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 210, 255, 0.3);
  transform: translateX(4px);
}

.channel-card.active {
  background: rgba(0, 210, 255, 0.12);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
}

.channel-card.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 4px;
  background: var(--accent-cyan);
  border-radius: 0 4px 4px 0;
}

.card-logo-box {
  width: 44px;
  height: 44px;
  background: #090c13;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.card-logo-box img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.card-meta {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.card-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.channel-fav-star {
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  opacity: 0.35;
  transition: all 0.2s;
  flex-shrink: 0;
}

.channel-fav-star:hover,
.channel-fav-star.is-fav {
  opacity: 1;
  transform: scale(1.15);
  color: var(--accent-gold);
}

/* 3. Right Main Cinema Player */
.player-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 24px;
  overflow-y: auto;
  gap: 16px;
  background: radial-gradient(circle at 60% 20%, #141b2a 0%, #07090e 75%);
}

.cinema-player-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

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

#video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.ambilight-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  filter: blur(45px) brightness(1.4);
  opacity: 0.6;
  transform: scale(1.08);
  pointer-events: none;
  z-index: 1;
}

/* Player Status & Skip Action Overlay */
.player-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 9, 14, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 10;
  padding: 20px;
  text-align: center;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.btn-overlay-skip {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
  transition: all 0.2s;
}

.btn-overlay-skip:hover {
  transform: scale(1.04);
}

/* OSD (On-Screen Display Controls) */
.video-osd {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 35%, transparent 65%, rgba(0,0,0,0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 22px;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.video-viewport:hover .video-osd,
.video-osd.show-osd {
  opacity: 1;
  pointer-events: auto;
}

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

.osd-channel-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.live-dot {
  width: 10px;
  height: 10px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.osd-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

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

.osd-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(6px);
}

.osd-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  transform: scale(1.08);
}

.osd-btn.play-btn {
  width: 46px;
  height: 46px;
  font-size: 18px;
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
}

.osd-btn.vr-btn {
  background: linear-gradient(135deg, #f72585, #7209b7);
  border: none;
  font-weight: 800;
  font-size: 13px;
  width: auto;
  padding: 0 14px;
  border-radius: 20px;
}

.osd-volume {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.osd-volume .osd-btn {
  width: auto;
  height: auto;
  border: none;
  background: transparent;
  padding: 0;
}

#volume-slider {
  width: 70px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

/* Channel Info Bar Below Video */
.channel-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  gap: 16px;
}

.channel-brand-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.channel-big-logo {
  width: 48px;
  height: 48px;
  background: #090c13;
  border-radius: 10px;
  object-fit: contain;
  padding: 3px;
  border: 1px solid var(--border-color);
}

.channel-meta h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.channel-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.badge.blue {
  background: rgba(0, 210, 255, 0.15);
  color: var(--accent-cyan);
}

.badge.green {
  background: rgba(0, 245, 155, 0.15);
  color: var(--accent-green);
}

.badge.purple {
  background: rgba(157, 78, 221, 0.15);
  color: var(--accent-purple);
}

.quick-shortcuts-hint {
  font-size: 12px;
  color: var(--text-muted);
}

kbd {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-main);
}

.pro-tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.tip-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.tip-box.vr-box {
  background: rgba(247, 37, 133, 0.06);
  border-color: rgba(247, 37, 133, 0.25);
}

.tip-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.tip-text strong {
  font-size: 13px;
  display: block;
  margin-bottom: 4px;
  color: var(--text-main);
}

.tip-text p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close-x {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.modal-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-tab-btn.active {
  background: var(--accent-cyan);
  color: #000;
  font-weight: 700;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-group label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.form-group input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent-cyan);
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-group.half {
  flex: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.full-width {
  width: 100%;
}

.modal-or-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 14px 0;
  color: var(--text-muted);
  font-size: 11px;
}

.modal-or-divider::before,
.modal-or-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.modal-or-divider span {
  padding: 0 10px;
}

.btn-file-uploader {
  display: block;
  text-align: center;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  padding: 14px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-file-uploader:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Saved lists in modal */
.saved-lists-section {
  margin-top: 18px;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

.saved-lists-section h4 {
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.saved-lists-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}

.saved-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.saved-list-row button {
  background: transparent;
  border: none;
  color: var(--accent-red);
  cursor: pointer;
}

/* QR Code & Device Modal */
.qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 14px auto;
  padding: 10px;
  background: #ffffff;
  border-radius: 12px;
  width: fit-content;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.qr-image {
  width: 170px;
  height: 170px;
  display: block;
}

.device-links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}

.device-link-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.device-icon {
  font-size: 22px;
}

.device-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.device-info strong {
  font-size: 13px;
  color: var(--text-main);
}

.device-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent-cyan);
  word-break: break-all;
}

.device-info small {
  color: var(--text-muted);
  font-size: 11px;
}

.network-tip {
  background: rgba(0, 210, 255, 0.08);
  border-left: 3px solid var(--accent-cyan);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: #c0d0e5;
  margin-bottom: 14px;
  line-height: 1.4;
}

/* Mobile Bottom Navigation (Hidden on Desktop) */
.mobile-bottom-nav {
  display: none;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM
   ========================================================================== */

@media (max-width: 768px) {
  html, body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #app-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    padding-bottom: calc(62px + var(--safe-bottom));
  }

  .desktop-only {
    display: none !important;
  }

  /* Hide Desktop side nav on mobile */
  .side-nav {
    display: none;
  }

  /* Player on Mobile: Sticky on Top */
  .player-main {
    order: 1;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 150;
    background: #000;
  }

  .cinema-player-card {
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .video-viewport {
    width: 100vw;
    aspect-ratio: 16 / 9;
  }

  .channel-info-bar {
    padding: 10px 14px;
  }

  .channel-big-logo {
    width: 36px;
    height: 36px;
  }

  .channel-meta h2 {
    font-size: 14px;
  }

  .pro-tips-grid {
    display: none;
  }

  /* Center Panel on Mobile: Below Video */
  .channels-panel {
    order: 2;
    width: 100%;
    border-right: none;
    overflow: visible;
  }

  .panel-header {
    padding: 10px 14px;
  }

  .categories-bar {
    position: sticky;
    top: calc((100vw * 9 / 16) + 60px);
    z-index: 140;
  }

  .channels-scroll {
    overflow: visible;
    padding: 10px 12px;
  }

  .channel-card {
    padding: 12px;
  }

  /* Mobile Bottom Navigation */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(56px + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(9, 12, 19, 0.96);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    z-index: 200;
    align-items: center;
    justify-content: space-around;
  }

  .mobile-tab-btn {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    height: 100%;
  }

  .mobile-tab-btn .m-icon {
    font-size: 18px;
  }

  .mobile-tab-btn.active {
    color: var(--accent-cyan);
    font-weight: 700;
  }
}
