/* 
 * styles.css - Lofi-Tone
 * Retro Lofi Girl aesthetic — warm, cozy, vintage late-night radio.
 */

/* CSS Variables & Design System */
:root {
  --font-primary: 'Crimson Text', 'Inter', serif;
  --font-heading: 'Special Elite', cursive;

  /* Warm retro color palette — Lofi Girl inspired */
  --theme-color-primary: #e8874a;    /* Warm amber orange */
  --theme-color-secondary: #f5c97a;  /* Candlelight yellow */
  --theme-color-glow: rgba(232, 135, 74, 0.35);

  --bg-color-dark: #1a1008;                       /* Deep coffee black */
  --bg-color-panel: rgba(42, 25, 12, 0.70);       /* Warm parchment glass */
  --border-glass: rgba(245, 201, 122, 0.10);       /* Candlelight border */
  --border-glow: rgba(232, 135, 74, 0.22);         /* Amber glow border */

  --text-primary: #f5eed4;     /* Warm cream white */
  --text-muted: #9c8a6e;       /* Faded sepia */
  --text-glow: rgba(245, 201, 122, 0.90);

  /* Animation Speeds */
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --spin-speed: 6s;
}

/* Global Reset */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden; /* Lock viewport — no page scrollbars */
}

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

body {
  font-family: var(--font-primary);
  font-size: 1.05rem;
  background-color: var(--bg-color-dark);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}


/* Ambient Warm Glow Background — late-night cozy room */
.ambient-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  background: radial-gradient(
    ellipse at 60% 0%,
    #2d1a08 0%,
    #1a1008 50%,
    #0e0a04 100%
  );
}

.ambient-glow-circle {
  position: absolute;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.20;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: background var(--transition-smooth);
}

.glow-circle-1 {
  top: -15%;
  right: -10%;
  background: #c96a1a; /* warm amber */
}

.glow-circle-2 {
  bottom: -20%;
  left: -10%;
  background: #7a3a10; /* deep mahogany */
}

/* Retro film-grain dust overlay */
.space-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    radial-gradient(1px 1px at 40px 60px, rgba(245,201,122,0.4), rgba(0,0,0,0)),
    radial-gradient(1px 1px at 180px 80px, rgba(255,255,255,0.15), rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 90px 220px, rgba(232,135,74,0.3), rgba(0,0,0,0)),
    radial-gradient(1px 1px at 310px 140px, rgba(255,255,255,0.1), rgba(0,0,0,0)),
    radial-gradient(1px 1px at 250px 380px, rgba(245,201,122,0.25), rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 500px 500px;
  opacity: 0.35;
  z-index: -1;
}

/* Layout Core */
header {
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  flex-shrink: 0; /* Never shrink — height is always accounted for */
  border-bottom: 1px solid var(--border-glass);
  background: rgba(26, 16, 8, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.logo {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.6rem;
  letter-spacing: 2px;
  color: var(--theme-color-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow: 0 0 12px var(--theme-color-glow), 0 0 30px rgba(232,135,74,0.2);
}

.logo-badge {
  font-size: 0.65rem;
  font-family: var(--font-heading);
  font-weight: 400;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  border: 1px solid var(--theme-color-primary);
  color: var(--theme-color-primary);
  margin-left: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: pulse-border 2s infinite alternate;
}

/* App Main Panel Setup — KEY FIX: use flex:1 + min-height:0 to fill remaining space after header */
.app-container {
  flex: 1;
  min-height: 0; /* Critical: allows flex child to shrink below content size */
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.25rem;
  padding: 1.25rem 2rem 1.5rem 2rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  z-index: 5;
}

/* Warm parchment glassmorphism Panel */
.glass-panel {
  background: var(--bg-color-panel);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(245,201,122,0.05);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--border-glow);
}

/* Player Console Layout */
.player-console {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 1.25rem;
  justify-content: space-between;
  height: 100%;
  overflow: hidden; /* Strictly no scroll inside player window */
}

.player-main-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 2rem;
}

/* Left Display Panel containing TV Monitor and Cassette */
.cassette-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: rgba(0, 0, 0, 0.20);
  border-radius: 10px;
  padding: 1.25rem;
  border: 1px solid rgba(245,201,122,0.05);
  gap: 1.25rem;
}

/* Retro CRT TV Monitor Screen */
.monitor-container {
  width: 100%;
  max-width: 300px;
  background: #1a1208;
  border: 7px solid #3a2510;
  border-bottom-width: 14px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), inset 0 2px 8px rgba(245,201,122,0.03);
  position: relative;
  overflow: hidden;
}

.crt-screen {
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0,0,0,1);
}

#visual-player {
  width: 100%;
  height: 100%;
  transform: scale(1.15); /* Zoom slightly to crop black bars */
  border: none;
  pointer-events: none; /* Disable YT interactive overlay hover clicks */
}

/* CRT monitor glossy curved filter */
.crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 15%, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 65%),
              linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
              linear-gradient(90deg, rgba(255, 0, 0, 0.05), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.05));
  background-size: 100% 100%, 100% 4px, 6px 100%;
  z-index: 2;
  pointer-events: none;
}

/* Screen scanlines */
.crt-scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 0%,
    rgba(18, 16, 16, 0.12) 50%,
    rgba(18, 16, 16, 0) 100%
  );
  background-size: 100% 12px;
  animation: scanline 12s linear infinite;
  z-index: 3;
  pointer-events: none;
}

.monitor-frame-label {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: 0.5rem;
  letter-spacing: 3px;
  color: #5a3a18;
  font-weight: 400;
  text-transform: uppercase;
}

/* CSS-based Retro Cassette Tape */
.cassette-tape {
  width: 100%;
  max-width: 300px;
  height: 138px;
  background: #1e1208;
  border-radius: 10px;
  border: 3px solid #3a2510;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(245,201,122,0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  transition: transform 0.3s ease;
}

.cassette-tape::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 5%;
  right: 5%;
  bottom: 25%;
  background: linear-gradient(180deg, var(--theme-color-primary) 0%, var(--theme-color-secondary) 100%);
  border-radius: 5px;
  opacity: 0.7;
  z-index: 1;
  transition: var(--transition-smooth);
}

/* Tape Title label */
.cassette-label {
  position: absolute;
  top: 20%;
  left: 8%;
  right: 8%;
  background: #f5eed4;
  color: #2a1208;
  padding: 3px 6px;
  border-radius: 2px;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 0.75rem;
  z-index: 2;
  text-align: center;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 1px;
}

/* Spindle & Window Area */
.cassette-window {
  position: absolute;
  top: 50%;
  left: 20%;
  right: 20%;
  height: 36px;
  background: rgba(0, 0, 0, 0.90);
  border-radius: 4px;
  border: 2px solid #3a2510;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  overflow: hidden;
}

/* Spinning Reels inside cassette window */
.reel {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2a1a08;
  border: 3px dashed var(--theme-color-primary);
  position: relative;
  transition: border-color var(--transition-smooth);
}

.reel::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: #000;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Spinning Animation trigger class */
.playing .reel {
  animation: spin var(--spin-speed) linear infinite;
}

/* Cassette Bottom detail */
.cassette-bottom {
  position: absolute;
  bottom: 0;
  left: 15%;
  right: 15%;
  height: 14px;
  background: #2a1a08;
  border-radius: 4px 4px 0 0;
  border: 2px solid #3a2510;
  border-bottom: none;
  z-index: 1;
}

.cassette-bottom::before {
  content: '';
  position: absolute;
  left: 15%;
  top: 4px;
  width: 6px;
  height: 6px;
  background: #111;
  border-radius: 50%;
  box-shadow: 52px 0 #111, 104px 0 #111;
}

/* Currently Playing Track Label */
.now-playing-info {
  text-align: center;
  width: 100%;
}

.now-playing-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 0.2rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 1px;
}

.now-playing-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.now-playing-desc:empty {
  display: none;
}

/* Player Right Control Panel */
.control-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Section labels */
.panel-section-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--theme-color-secondary);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--transition-smooth);
  opacity: 0.8;
}

.channel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  max-height: 160px;
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-color: rgba(232,135,74,0.2) transparent;
  scrollbar-width: thin;
}

/* Channel button */
.channel-btn {
  background: rgba(232, 135, 74, 0.04);
  border: 1px solid rgba(245,201,122,0.10);
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
  font-family: var(--font-primary);
  font-size: 0.95rem;
}

.channel-btn:hover {
  background: rgba(232, 135, 74, 0.10);
  border-color: rgba(232,135,74,0.25);
}

.channel-btn.active {
  background: rgba(232, 135, 74, 0.12);
  border-color: var(--theme-color-primary);
  box-shadow: 0 0 10px rgba(232, 135, 74, 0.12);
}

.channel-tag {
  font-size: 0.65rem;
  background: rgba(245,201,122,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

.channel-btn.active .channel-tag {
  background: var(--theme-color-primary);
  color: #1a1008;
  font-weight: 600;
}

/* Audio Visualizer Canvas */
.visualizer-container {
  width: 100%;
  height: 70px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  border: 1px solid rgba(245,201,122,0.07);
  overflow: hidden;
  position: relative;
}

#visualizer-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Volume Mixer Section */
.mixer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 0.85rem;
  border: 1px solid rgba(245,201,122,0.07);
}

.mixer-item {
  display: grid;
  grid-template-columns: 80px 1fr 35px;
  align-items: center;
  gap: 0.75rem;
}

.mixer-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Premium Range Input Styling */
.volume-range {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  background: rgba(245, 201, 122, 0.12);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: background 0.3s;
}

.volume-range::-webkit-slider-runnable-track {
  width: 100%;
  height: 5px;
  cursor: pointer;
  border-radius: 3px;
}

.volume-range::-webkit-slider-thumb {
  height: 15px;
  width: 15px;
  border-radius: 50%;
  background: var(--theme-color-secondary);
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -5px;
  box-shadow: 0 0 8px rgba(232, 135, 74, 0.4);
  transition: transform 0.1s, background-color 0.2s;
}

.volume-range::-webkit-slider-thumb:hover {
  background: var(--theme-color-primary);
  transform: scale(1.25);
}

.volume-val {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Player Toolbar (Play, Pause, Progress, Timeline) */
.player-controls-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.01);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  border: 1px solid var(--border-glass);
}

.timeline-container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.time-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.progress-bar-container {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--theme-color-primary), var(--theme-color-secondary));
  border-radius: 2px;
  width: 0%;
  position: relative;
  transition: var(--theme-color-primary) 0.3s, var(--theme-color-secondary) 0.3s;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: -3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px var(--theme-color-secondary);
  opacity: 0;
  transition: opacity 0.2s;
}

.progress-bar-container:hover .progress-bar-fill::after {
  opacity: 1;
}

/* Action Control Buttons Group */
.buttons-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

.control-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.control-btn:hover {
  color: var(--theme-color-secondary);
  transform: scale(1.1);
}

.btn-play-pause {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--theme-color-primary), var(--theme-color-secondary));
  color: #1a1008;
  box-shadow: 0 4px 15px var(--theme-color-glow);
  transition: transform 0.3s, box-shadow 0.3s;
}

.btn-play-pause:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(232, 135, 74, 0.5);
  color: #0e0a04;
}

.btn-meme-drop {
  background: rgba(232, 135, 74, 0.12);
  border: 1px solid rgba(232, 135, 74, 0.35);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: var(--theme-color-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 0 8px rgba(232, 135, 74, 0.10);
  transition: var(--transition-smooth);
}

.btn-meme-drop:hover {
  background: var(--theme-color-primary);
  color: #1a1008;
  border-color: var(--theme-color-primary);
  box-shadow: 0 0 15px rgba(232, 135, 74, 0.40);
}

/* Simulated Live Chat Sidebar */
.chat-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.chat-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #ff3b30;
  border-radius: 50%;
  animation: blink 1s infinite alternate;
}

.chat-viewer-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-color: var(--border-glass) transparent;
  scrollbar-width: thin;
}

/* Individual Chat Message styling */
.chat-msg {
  font-size: 0.85rem;
  line-height: 1.4;
  word-break: break-word;
  animation: fade-in 0.3s ease forwards;
}

.chat-badge {
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
  margin-right: 4px;
  vertical-align: middle;
  text-transform: uppercase;
}

.badge-mod {
  background-color: #00f56a;
  color: #000;
}

.badge-vip {
  background-color: #e91e63;
  color: #fff;
}

.badge-sub {
  background-color: #9146ff;
  color: #fff;
}

.chat-username {
  font-weight: 600;
  margin-right: 6px;
  cursor: pointer;
}

.chat-text {
  color: #e6dfec;
}

/* Modal Popup Dialog Styles */
.glass-modal {
  border: none;
  background: transparent;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.glass-modal[open] {
  opacity: 1;
  pointer-events: auto;
}

.glass-modal::backdrop {
  background: rgba(4, 2, 8, 0.7);
  backdrop-filter: blur(8px);
}

.modal-content {
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transform: scale(0.92);
  transition: transform 0.3s ease;
}

.glass-modal[open] .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.75rem;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.close-btn:hover {
  color: #fff;
}

/* Form Styles */
#custom-channel-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.form-group input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-smooth);
}

.form-group input:focus {
  border-color: var(--theme-color-secondary);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-actions {
  margin-top: 1rem;
}

.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--theme-color-primary), var(--theme-color-secondary));
  border: none;
  padding: 0.8rem;
  border-radius: 8px;
  color: #120c21;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--theme-color-glow);
  transition: var(--transition-smooth);
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.3);
}



/* Keyframes Animations */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes blink {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

@keyframes pulse-border {
  from {
    border-color: rgba(232, 135, 74, 0.3);
    box-shadow: 0 0 5px rgba(232, 135, 74, 0.1);
  }
  to {
    border-color: rgba(232, 135, 74, 0.85);
    box-shadow: 0 0 12px rgba(232, 135, 74, 0.35);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

/* Responsive Media Queries */
@media (max-width: 960px) {
  .mobile-tabs {
    display: flex;
  }

  .hidden-mobile {
    display: none !important;
  }

  .app-container {
    grid-template-columns: 1fr;
    padding: 1rem;
    height: calc(100vh - 120px - 50px);
    min-height: 0;
    max-height: none;
    overflow: hidden;
  }
  
  .chat-sidebar {
    height: 100%;
  }

  .player-console {
    height: 100%;
    padding: 1rem;
    gap: 0.75rem;
  }

  /* Compact side-by-side CRT & Cassette layout */
  .cassette-section {
    flex-direction: row;
    gap: 1rem;
    padding: 0.75rem;
  }

  .monitor-container {
    max-width: 140px;
    border-width: 4px;
    border-bottom-width: 8px;
    border-radius: 10px;
  }

  .cassette-tape {
    max-width: 140px;
    height: 90px;
    border-width: 2px;
    border-radius: 8px;
    padding: 6px;
  }

  .cassette-tape::before {
    top: 10%;
    bottom: 20%;
  }

  .cassette-label {
    font-size: 0.65rem;
    padding: 2px 4px;
  }

  .cassette-window {
    height: 24px;
    padding: 0 8px;
  }

  .reel {
    width: 16px;
    height: 16px;
    border-width: 2px;
  }

  .now-playing-info {
    text-align: left;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .now-playing-title {
    font-size: 1rem;
  }

  .now-playing-desc {
    font-size: 0.75rem;
  }

  /* Horizontal swipeable channel selector */
  .channel-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    gap: 0.5rem;
    max-height: 48px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .channel-grid::-webkit-scrollbar {
    display: none;
  }

  .channel-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  /* Compact controls */
  .visualizer-container {
    height: 40px;
  }

  .mixer-grid {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .mixer-item {
    gap: 0.5rem;
  }

  .mixer-label {
    font-size: 0.75rem;
  }

  .volume-range {
    height: 4px;
  }
}

@media (max-width: 680px) {
  .player-main-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  header {
    padding: 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .logo {
    font-size: 1.5rem;
  }
}

/* Hidden API Players container to bypass browser visibility checks */
.hidden-api-players {
  position: fixed;
  bottom: 10px;
  right: 10px;
  width: 200px;
  height: 150px;
  opacity: 0.001;
  pointer-events: none;
  z-index: -10;
  overflow: hidden;
}

/* Tab Bar Styling */
.mobile-tabs {
  display: none;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem 0.25rem 1rem;
  background: rgba(26, 16, 8, 0.75);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
  z-index: 10;
}

.tab-btn {
  background: rgba(232, 135, 74, 0.04);
  border: 1px solid rgba(245,201,122,0.12);
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  background: rgba(232, 135, 74, 0.10);
  color: var(--text-primary);
  border-color: rgba(232,135,74,0.25);
}

.tab-btn.active {
  background: rgba(232, 135, 74, 0.14);
  border-color: var(--theme-color-primary);
  color: var(--theme-color-secondary);
  box-shadow: 0 0 10px rgba(232, 135, 74, 0.18);
}

/* Start listening overlay */
.start-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 10, 4, 0.72);
  backdrop-filter: blur(8px);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.start-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.start-overlay-inner {
  text-align: center;
  padding: 2.5rem 3rem;
  max-width: 420px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.start-overlay.visible .start-overlay-inner {
  animation: startOverlayPulse 2.5s ease-in-out infinite;
}

@keyframes startOverlayPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.start-overlay-icon {
  color: var(--theme-color-primary);
  margin-bottom: 1rem;
}

.start-overlay-station {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
  letter-spacing: 1px;
}

.start-overlay-hint {
  font-family: var(--font-primary);
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: 0.5px;
}

