
  @import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;1,400&family=Inter:wght@300;400;500&display=swap');

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --accent: rgba(240,235,227,0.9);
    --muted: rgba(240,235,227,0.35);
    --faint: rgba(240,235,227,0.12);
    --bg: #0a0a0a;
  }

  html, body {
    height: 100%;
    overscroll-behavior: none;
  }

  body {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: #f0ebe3;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
  }

  /* ── Ambient background ── */
  .ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    transition: background 4s ease;
    background: radial-gradient(ellipse 80% 60% at 50% 40%, #1a1010 0%, var(--bg) 70%);
  }

  .grain {
    position: fixed;
    inset: 0;
    z-index: 1;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px;
    pointer-events: none;
  }

  /* ── Top bar ── */
  .topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    padding-top: max(20px, env(safe-area-inset-top));
  }

  .station-label {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .live-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #e74c3c;
    animation: pulse 2.2s ease-in-out infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
  }

  /* ── Main layout ── */
  .app {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 72px;
    width: 100%;
    max-width: 860px;
    padding: 0 32px;
  }

  /* ── Player card ── */
  .player {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
    animation: fadeUp 0.8s cubic-bezier(0.22,1,0.36,1) both;
    z-index: 10;
  }

  /* ── Album art ── */
  .art-wrapper {
    position: relative;
    width: 220px; height: 220px;
    margin-bottom: 28px;
    margin-left: auto;
  margin-right: auto;
  }

  .art-glow {
    position: absolute;
    inset: -20px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 2s ease, background 2s ease;
    filter: blur(32px);
    z-index: -1;
  }

  .art-glow.active { opacity: 0.4; }

  .art-frame {
    width: 220px; height: 220px;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
  }

  .art-frame:hover { transform: scale(1.03) rotate(-0.4deg); }

  .art-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.7s ease;
  }

  .art-placeholder {
    width: 100%; height: 100%;
    background: #161210;
    display: flex; align-items: center; justify-content: center;
  }

  .art-placeholder svg { opacity: 0.1; }

  /* ── Track info ── */
  .track-info {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
  }

  .track-title {
    font-family: 'Playfair Display', serif;
    font-size: 19px;
    font-weight: 500;
    line-height: 1.3;
    color: #f0ebe3;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .track-artist {
    font-size: 11px;
    font-weight: 400;
    color: var(--muted);
    letter-spacing: 0.06em;
  }

  /* ── Progress ── */
  .progress-area { width: 100%; margin-bottom: 24px; }

  .progress-bar-bg {
    width: 100%; height: 1.5px;
    background: var(--faint);
    border-radius: 2px;
    margin-bottom: 8px;
    cursor: pointer;
  }

  .progress-bar-fill {
    height: 100%;
    background: rgba(240,235,227,0.5);
    border-radius: 2px;
    width: 0%;
    transition: width 1s linear;
  }

  .progress-times {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: rgba(240,235,227,0.2);
    font-weight: 300;
    letter-spacing: 0.02em;
  }

  /* ── Controls ── */
  .controls {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
  }

  .ctrl-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--faint);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
    outline: none;
    flex-shrink: 0;
  }

  .ctrl-btn:hover, .ctrl-btn.active {
    border-color: rgba(240,235,227,0.35);
    color: rgba(240,235,227,0.85);
  }

  .play-btn {
    width: 60px; height: 60px;
    border-radius: 50%;
    border: 1.5px solid rgba(240,235,227,0.18);
    background: transparent;
    color: #f0ebe3;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.22s ease;
    outline: none;
  }

  .play-btn:hover {
    border-color: rgba(240,235,227,0.45);
    background: rgba(240,235,227,0.04);
    transform: scale(1.05);
  }

  .play-btn svg { width: 20px; height: 20px; fill: #f0ebe3; margin-left: 2px; }
  .play-btn.playing svg { margin-left: 0; }

  /* ── Up next ── */
  .next-area {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
  }

  .next-area.visible { opacity: 1; transform: translateY(0); }

  .next-thumb {
    width: 30px; height: 30px;
    border-radius: 2px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--faint);
  }

  .next-thumb img { width: 100%; height: 100%; object-fit: cover; display: none; }

  .next-meta { overflow: hidden; }

  .next-label {
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(240,235,227,0.2);
    margin-bottom: 1px;
  }

  .next-title {
    font-size: 11px;
    color: rgba(240,235,227,0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ── Volume ── */
  .volume-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    width: 100%;
    opacity: 0.6;
    transition: opacity 0.2s;
  }

  .volume-row:hover { opacity: 1; }

  .vol-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 1.5px;
    background: rgba(240,235,227,0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
  }

  .vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(240,235,227,0.6);
    cursor: pointer;
    transition: transform 0.15s;
  }

  .vol-slider::-webkit-slider-thumb:hover { transform: scale(1.4); }

  /* ══════════════════════════════════════
     LYRICS — Desktop side panel
  ══════════════════════════════════════ */
  .lyrics-panel {
    width: 360px;
    height: 520px;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateX(16px);
    pointer-events: none;
    transition: opacity 0.45s ease, transform 0.45s ease;
    flex-shrink: 0;
    pointer-events: none; /* Add this by default */
  }

  .lyrics-panel.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    pointer-events: auto; /* Only enable when visible */
  }

  .lyrics-panel::before, .lyrics-panel::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 100px;
    z-index: 2;
    pointer-events: none;
  }


  .lyrics-scroll {
    height: 100%;
    overflow: hidden;
    padding: 180px 0 180px 4px;
  }

  .lyrics-inner {
    transition: transform 0.75s cubic-bezier(0.22,1,0.36,1);
  }

  .lyric-line {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    line-height: 1.55;
    color: rgba(240,235,227,0.14);
    margin-bottom: 6px;
    padding: 2px 0;
    transition: color 0.45s ease, font-size 0.4s ease, opacity 0.45s ease;
    cursor: default;
    user-select: none;
  }

  .lyric-line.near-2 { color: rgba(240,235,227,0.25); }
  .lyric-line.near-1 { color: rgba(240,235,227,0.48); font-size: 17.5px; }

  .lyric-line.active {
    color: #f0ebe3;
    font-size: 20px;
    font-style: italic;
  }

  .lyric-line.empty {
    font-size: 13px;
    margin-bottom: 14px;
    color: rgba(240,235,227,0.08);
  }

  .lyric-line.empty::before { content: '·  ·  ·'; }

  .lyrics-status {
    font-size: 11px;
    color: rgba(240,235,227,0.2);
    text-align: center;
    letter-spacing: 0.1em;
    padding-top: 24px;
    font-style: italic;
  }

  /* ══════════════════════════════════════
     MOBILE LYRICS — Bottom sheet
  ══════════════════════════════════════ */
  .lyrics-sheet {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 30;
    height: 72dvh;
    background: #111;
    border-radius: 20px 20px 0 0;
    border-top: 0.5px solid rgba(240,235,227,0.08);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .lyrics-sheet.open { transform: translateY(0); }

  .sheet-handle {
    width: 36px; height: 4px;
    border-radius: 2px;
    background: rgba(240,235,227,0.15);
    margin: 12px auto 0;
  }

  .sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px 10px;
  }

  .sheet-title {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .sheet-close {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid var(--faint);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    outline: none;
  }

  .sheet-lyrics-scroll {
    height: calc(100% - 70px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 24px 60px;
    scroll-behavior: smooth;
  }

  .sheet-lyrics-scroll::-webkit-scrollbar { display: none; }

  /* Mobile lyric line styles */
  .sheet-lyric-line {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    line-height: 1.6;
    color: rgba(240,235,227,0.18);
    margin-bottom: 8px;
    transition: color 0.4s ease, font-size 0.35s ease;
    cursor: default;
    user-select: none;
  }

  .sheet-lyric-line.near { color: rgba(240,235,227,0.4); }

  .sheet-lyric-line.active {
    color: #f0ebe3;
    font-size: 22px;
    font-style: italic;
  }

  .sheet-lyric-line.empty {
    font-size: 14px;
    color: rgba(240,235,227,0.08);
    margin-bottom: 16px;
  }

  .sheet-lyric-line.empty::before { content: '·  ·  ·'; }

  /* Sheet backdrop */
  .sheet-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 29;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .sheet-backdrop.open { opacity: 1; }

  /* ══════════════════════════════════════
     RESPONSIVE
  ══════════════════════════════════════ */
@media (max-width: 680px) {
    .app { 
      gap: 0 !important; /* Remove the desktop gap */
      padding: 0 16px;   /* Reduce padding so the player has room */
      justify-content: center;
      width: 100%;
    }
    .reaction-bar {
        position: relative;
        z-index: 50; /* Force this to the very front */
        pointer-events: auto; /* Ensure events aren't being disabled by a parent */
    }
    .lyrics-panel { 
        display: none !important; 
        position: absolute;      /* Move it out of the flex flow just in case */
    }
    .ctrl-btn {
        width: 44px;  /* Larger tap target for mobile */
        height: 44px;
    }
    .reaction-btn {
        padding: 12px 10px; /* Increase vertical padding for a larger "tap target" */
    }
}
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }



  /* ── Reaction bar ── */
.reaction-bar {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap; /* This allows emojis to go to a second row instead of breaking the layout */
}

.reaction-btn {
    background: var(--faint);
    border: 1px solid rgba(240,235,227,0.08);
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    outline: none;
    color: var(--muted);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.reaction-btn:hover {
    background: rgba(240,235,227,0.08);
    border-color: rgba(240,235,227,0.18);
    transform: scale(1.08);
}

.reaction-btn:active { transform: scale(0.94); }

.reaction-btn .emoji { font-size: 16px; line-height: 1; }

.reaction-btn .count {
    font-size: 11px;
    font-weight: 500;
    color: rgba(240,235,227,0.4);
    min-width: 8px;
}

.reaction-btn.pop {
    animation: reactionPop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes reactionPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* ── Floating emoji ── */
.floater {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    font-size: 28px;
    animation: floatUp 2.2s cubic-bezier(0.22,1,0.36,1) forwards;
    user-select: none;
}

@keyframes floatUp {
    0%   { opacity: 1;   transform: translateY(0)    scale(1)    rotate(0deg); }
    60%  { opacity: 0.9; transform: translateY(-120px) scale(1.2) rotate(var(--rot)); }
    100% { opacity: 0;   transform: translateY(-220px) scale(0.8) rotate(var(--rot2)); }
}

/* Mobile reaction bar tweaks */
@media (max-width: 680px) {
    .reaction-bar { gap: 6px; margin-top: 20px; }
    .reaction-btn { padding: 5px 10px; }
    .reaction-btn .emoji { font-size: 15px; }
}
