
:root{
  --pd-bg:#0b0b0c;
  --pd-stage:#121214;
  --pd-text:#f4f4f6;
  --pd-muted:#b8b8c2;
  --pd-accent:#ff4d4d;
  --pd-chord:#ffd700;
  --pd-radius:18px;
  --pd-stickyTop: 0px;
}

.pd-app{
  background: radial-gradient(1200px 500px at 50% 10%, rgba(255,255,255,.06), rgba(0,0,0,0)) , var(--pd-bg);
  color:var(--pd-text);
  padding: 12px 10px 36px;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;

  /* Break out of theme container so stage can truly go full width on PC */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);

}

.pd-stage{
  /* Wider stage on modern 16:9 / ultrawide screens (previous 1280px felt ~4:3) */
  width: min(calc(100vw - 20px), 1920px);
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,0)) , var(--pd-stage);
  border-radius: var(--pd-radius);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  overflow: visible;
}

/* Keep comfortable margins on smaller screens */
@media (max-width: 640px){
  .pd-stage{ width: calc(100vw - 12px); }
}

/* Top preview row (NOT sticky) */
.pd-previews-wrap{
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.pd-previews-title{
  font-size: 12px;
  font-weight: 800;
  color: rgba(255,255,255,.85);
  margin-bottom: 10px;
}
.pd-previews{
  display:flex;
  gap: 10px;
  overflow-x:auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}


/* Sticky header ONLY: player + moving timeline */
.pd-sticky{
  position: sticky;
  top: var(--pd-stickyTop);
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(18,18,20,.84);
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.pd-sticky-inner{ padding: 12px 14px 10px; }
.pd-audio{ width:100%; }

/* Timeline */
.pd-timeline{ margin-top: 10px; }
.pd-tl-title{
  font-size: 12px;
  font-weight: 800;
  color: rgba(255,255,255,.80);
  margin-bottom: 8px;
}
.pd-tl-lane{
  position: relative;
  height: 52px;
  border-radius: 14px;
  background: rgba(0,0,0,.22);
  overflow: hidden;
  cursor: pointer;
}
.pd-tl-now{
  position:absolute;
  left: 10px;
  top: 8px;
  font-size: 11px;
  color: rgba(255,255,255,.78);
  z-index: 2;
}
.pd-tl-dur{
  position:absolute;
  right: 10px;
  top: 8px;
  font-size: 11px;
  color: rgba(255,255,255,.78);
  z-index: 2;
}
.pd-tl-playhead{
  position:absolute;
  top: 6px;
  bottom: 6px;
  width: 2px;
  left: 10%;
  background: var(--pd-accent);
  border-radius: 99px;
  z-index: 3;
}
.pd-tl-stream{
  position:absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  z-index: 1;
}
.pd-tl-badge{
  position:absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  color: rgba(0,0,0,.88);
  font-weight: 950;
  font-size: 16px;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
  opacity: .96;
}
.pd-tl-badge.is-active{ background: rgba(255,215,0,.95); }

/* Title + body */
.pd-songtitle{
  padding: 14px 14px 6px;
  font-size: 20px;
  font-weight: 950;
}
.pd-body{ padding: 8px 14px 16px; }
.pd-sheet{ padding-top: 10px; }

/* Lyrics rows */
.pd-row{
  position: relative;
  margin: 12px 0 18px;
  border-radius: 14px;
  padding: 52px 8px 8px;
}
.pd-row.is-active-row{
  background: rgba(255,255,255,.035);
  outline: 1px solid rgba(255,255,255,.07);
}
.pd-row-inner{
  /* Bigger lyrics (responsive) */
  font-size: clamp(36px, 3.2vw, 54px);
  line-height: 1.55;
}
.pd-word{
  display:inline-block;
  white-space:pre;
  transition: color .16s ease, text-shadow .16s ease;
}
.pd-word.is-active{
  color: var(--pd-accent);
  text-shadow: 0 0 12px rgba(255,77,77,.52);
}

/* Chords above lyrics */
.pd-chord-layer{
  position:absolute;
  left: 0;
  right: 0;
  top: 14px;
  height: 34px;
  pointer-events:none;
}
.pd-ch{
  position:absolute;
  top: 0;
  transform: translateX(-2px);
  font-weight: 500;
  /* Match larger lyric scale */
  font-size: clamp(28px, 2.0vw, 38px);
  line-height: 1;
  color: rgba(255,215,0,.92);
  text-shadow: 0 2px 12px rgba(0,0,0,.55);
}
.pd-ch.is-active-chord{
  color: rgba(255,77,77,.98);
  transform: translateX(-2px) scale(1.05);
}
.pd-gap-ch{ color: rgba(123,220,255,.95); }

/* Intro / solo rows */
.pd-solo-row{
  background: rgba(123,220,255,.08);
  border: 1px dashed rgba(123,220,255,.35);
  border-radius: 14px;
  padding: 14px 12px 10px;
  margin: -4px 0 10px;
}
.pd-solo-row .pd-row-inner{ font-size: 15px; color: var(--pd-muted); margin-top: 6px; }
.pd-solo-row .pd-chord-layer{ position:relative; height:auto; min-height:22px; margin-bottom:4px; top:auto; }
.pd-solo-row .pd-ch{ position:relative; display:inline-block; margin-right:14px; top:auto; left:auto; transform:none; font-size: 20px; }

/* Floating chord diagram panel */
.pd-float{
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 320px;
  z-index: 60;
  border-radius: 16px;
  background: rgba(18,18,20,.92);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 20px 70px rgba(0,0,0,.60);
  backdrop-filter: blur(12px);
  overflow: hidden;
  touch-action: none;
}
.pd-float-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  cursor: move;
  background: rgba(255,255,255,.03);
}
.pd-float-name{ font-weight: 950; font-size: 15px; color: var(--pd-chord); }
.pd-float-btns{ display:flex; gap: 8px; }
.pd-btn{
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.90);
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s ease;
}
.pd-btn:hover{
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.22);
}
.pd-float-body{ padding: 10px 12px 12px; }

/* Dual chord layout: Current + Next */
.pd-float-chords{
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.pd-float-current{
  flex: 1.4;
  min-width: 0;
}
.pd-float-next{
  flex: 1;
  min-width: 0;
  padding: 8px;
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.06);
  opacity: 0.5;
  transition: opacity .2s ease;
}
.pd-float-next.has-next{
  opacity: 1;
  background: rgba(255,215,0,.08);
  border-color: rgba(255,215,0,.20);
}
.pd-float-label{
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,.55);
  margin-bottom: 6px;
}
.pd-float-current .pd-float-label{
  color: var(--pd-accent);
}
.pd-float-next .pd-float-label{
  color: rgba(255,215,0,.70);
}
.pd-float-svg svg{
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.pd-float-next-svg svg{
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  max-height: 100px;
}
.pd-float-next-name{
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  color: rgba(255,255,255,.80);
  margin-top: 6px;
}
.pd-float-next.has-next .pd-float-next-name{
  color: var(--pd-chord);
}
.pd-float-meta{
  display:flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.60);
  font-size: 11px;
}

/* Hide next chord on smaller screens */
@media (max-width: 1200px){
  .pd-float{ width: 280px; }
  .pd-float-next{ display: none; }
  .pd-float-current{ flex: 1; }
}
@media (max-width: 820px){
  .pd-float{ width: 220px; right: 10px; bottom: 10px; }
}

@media (max-width: 820px){
  .pd-stage{ width: calc(100vw - 12px); }
  /* Slightly larger on tablets/phones too */
  .pd-row-inner, .pd-ch{ font-size: 24px; }
  .pd-row{ padding-top: 48px; }
  .pd-songtitle{ font-size: 18px; }
  .pd-float{ right: 10px; bottom: 10px; width: 220px; }
}


/* Mobile tuning for better line length (reduce font a bit + reduce padding so lines wrap less) */
@media (max-width: 600px){
  .pd-app{ padding: 8px 6px 22px; }
  .pd-stage{ width: calc(100vw - 12px); }
  .pd-row-inner{ font-size: clamp(22px, 5.4vw, 30px); line-height: 1.55; }
  .pd-ch{ font-size: clamp(20px, 5.0vw, 28px); }
}


/* Audio track switch (instrumental / guide vocal) */
.pd-audio-switch{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin:10px 0 8px;}
.pd-audio-btn{padding:10px 16px;border-radius:10px;}
@media (max-width:600px){
  .pd-audio-switch{gap:8px;margin:8px 0 6px;}
  .pd-audio-btn{padding:9px 14px;font-size:14px;}
}


/* v31 diagram: remove legacy head buttons if present */
#pdFloat .pd-float-btns{ display:none !important; }
@media (max-width: 600px){
  /* Disable floating chord diagram panel on mobile */
  .pd-float{ display:none !important; }
}
@media (max-width: 600px){

  /* Make sticky header a 2-column layout */
  .pd-sticky-inner{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: center;
  }

  /* Audio player stays in left column and becomes smaller */
  .pd-audio{
    width: 100%;
    max-width: 100%;
  }

  /* Buttons go to the right column and wrap */
  .pd-audio-switch{
    margin: 0 !important;
    justify-content: flex-end;
    gap: 6px;
  }

  /* Make the 3 buttons smaller */
  .pd-audio-btn{
    padding: 7px 10px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
  }
}
@media (max-width: 600px){

  /* Hide button text but keep emoji */
  .pd-audio-btn{
    font-size: 0 !important;     /* hide text */
    padding: 8px !important;
  }

  .pd-audio-btn::first-letter{
    font-size: 18px !important;  /* keep emoji visible */
  }

}
@media (max-width: 600px){
  .pd-tl-title{ display:none !important; }
}
@media (max-width: 600px){

  /* Keep timeline full width */
  .pd-timeline{
    grid-column: 1 / -1;
  }

  /* Make sticky layout cleaner */
  .pd-sticky-inner{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
  }

  .pd-audio{
    flex: 1 1 55%;
  }

  .pd-audio-switch{
    flex: 1 1 40%;
    justify-content: flex-end;
  }

}
@media (max-width: 600px){
  .pd-tl-lane{
    height: 38px;
  }
}
@media (max-width: 600px){

  /* 1) Disable floating chord diagram on mobile */
  .pd-float{ display:none !important; }

  /* 2) Sticky header layout: audio left, buttons right; timeline full width */
  .pd-sticky-inner{
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "audio switch"
      "timeline timeline";
    gap: 10px;
    align-items: center;
  }

  .pd-audio{ grid-area: audio; width: 100% !important; }
  .pd-audio-switch{
    grid-area: switch;
    justify-content: flex-end !important;
    margin: 0 !important;
    gap: 8px !important;
  }
  .pd-timeline{ grid-area: timeline; width: 100% !important; }

  /* 3) Make audio control less tall (Chrome/Android usually respects this) */
  .pd-audio{ height: 38px; }

  /* 4) Hide timeline title text ("Chord timeline") */
  .pd-tl-title{ display:none !important; }

  /* 5) ICON-ONLY buttons: hide labels, keep symbols */
  .pd-audio-btn{
    padding: 8px 10px !important;
    border-radius: 10px !important;
    font-size: 14px !important; /* controls emoji size */
    line-height: 1 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0 !important;
  }
  .pd-audio-btn .pd-label{ display:none !important; }
  .pd-audio-btn .pd-ico{ font-size: 18px; }

  /* 6) If you want the lane less tall */
  .pd-tl-lane{ height: 44px !important; }
}
@media (max-width: 600px){
  .pd-tl-badge{
    padding: 6px 9px;
    font-size: 12px;
  }

  /* Preview row: hidden when playing (JS toggles), smooth transition */
  .pd-previews-wrap{
    transition: opacity .25s ease, height .25s ease, margin .25s ease, padding .25s ease;
    overflow: hidden;
  }
  .pd-previews-wrap[style*="none"]{
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
  }

  /* Make timeline even more compact */
  .pd-timeline{
    margin-top: 6px;
  }
  .pd-tl-lane{
    height: 36px !important;
    border-radius: 10px;
  }

  /* Reduce lyric row padding */
  .pd-row{
    margin: 8px 0 12px;
    padding: 42px 6px 6px;
    border-radius: 12px;
  }

  /* Slightly reduce chord layer height */
  .pd-chord-layer{
    height: 30px;
    top: 10px;
  }

  /* YouTube-style fullscreen: hide controls, show on mouse move */
.pd-stage.is-fs .pd-controls{
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease;
}
.pd-stage.is-fs.is-controls .pd-controls{
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* In fullscreen keep these visible */
.pd-stage.is-fs .pd-timeline{ display:block !important; }
.pd-stage.is-fs .pd-float{ display:block !important; }

/* Optional: hide the chord preview strip */
.pd-stage.is-fs .pd-previews{ display:none !important; }

/* Put a gradient behind controls so they’re readable */
.pd-stage.is-fs .pd-sticky-inner{
  background: linear-gradient(to bottom, rgba(0,0,0,.70), rgba(0,0,0,0));
}
}
/* =========================
   Fullscreen mode behavior
   ========================= */

/* If your JS adds a class (most likely): */
.pd-is-fs .pd-previews-wrap,
.pd-is-fs #pdAudio,
.pd-is-fs .pd-audio-switch {
  display: none !important;
}

/* Keep timeline + float panel visible in fullscreen */
.pd-is-fs .pd-timeline,
.pd-is-fs #pdFloat {
  display: block !important;
}

/* Also handle native fullscreen pseudo-class (covers some browsers/TV setups) */
:fullscreen .pd-previews-wrap,
:fullscreen #pdAudio,
:fullscreen .pd-audio-switch {
  display: none !important;
}

:fullscreen .pd-timeline,
:fullscreen #pdFloat {
  display: block !important;
}

/* WebKit fullscreen fallback (some Chrome/TV builds) */
:-webkit-full-screen .pd-previews-wrap,
:-webkit-full-screen #pdAudio,
:-webkit-full-screen .pd-audio-switch {
  display: none !important;
}

:-webkit-full-screen .pd-timeline,
:-webkit-full-screen #pdFloat {
  display: block !important;
}

/* =========================
   Chord Modal (Large Diagram)
   ========================= */
.pd-chord-modal{
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pd-modal-in .25s ease;
}
.pd-chord-modal.is-closing{
  animation: pd-modal-out .2s ease forwards;
}
@keyframes pd-modal-in{
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pd-modal-out{
  from { opacity: 1; }
  to { opacity: 0; }
}
.pd-chord-modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
}
.pd-chord-modal-content{
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,0)), var(--pd-stage);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 24px;
  padding: 28px 32px 24px;
  box-shadow: 0 30px 100px rgba(0,0,0,.70);
  text-align: center;
  min-width: 280px;
  max-width: 90vw;
  animation: pd-modal-content-in .3s ease;
}
@keyframes pd-modal-content-in{
  from { transform: scale(.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.pd-chord-modal-close{
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(255,255,255,.60);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all .15s ease;
}
.pd-chord-modal-close:hover{
  color: rgba(255,255,255,.95);
  background: rgba(255,255,255,.08);
}
.pd-chord-modal-title{
  font-size: 28px;
  font-weight: 950;
  color: var(--pd-chord);
  margin-bottom: 20px;
  text-shadow: 0 2px 20px rgba(255,215,0,.25);
}
.pd-chord-modal-diagram svg{
  width: 280px;
  height: auto;
  max-width: 70vw;
  max-height: 60vh;
}
.pd-chord-modal-hint{
  margin-top: 18px;
  font-size: 12px;
  color: rgba(255,255,255,.45);
}

/* =========================
   Preview Cards (Clickable)
   ========================= */
.pd-preview-card{
  flex: 0 0 auto;
  width: 104px;
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
  padding: 10px 10px 8px;
  cursor: pointer;
  user-select: none;
  transition: all .18s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.pd-preview-card::before{
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,215,0,.08), transparent 60%);
  opacity: 0;
  transition: opacity .2s ease;
}
.pd-preview-card:hover{
  transform: translateY(-4px) scale(1.03);
  border-color: rgba(255,215,0,.35);
  box-shadow: 0 16px 44px rgba(0,0,0,.45), 0 0 30px rgba(255,215,0,.10);
}
.pd-preview-card:hover::before{
  opacity: 1;
}
.pd-preview-card:active{
  transform: translateY(-2px) scale(1.01);
}
.pd-preview-name{
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 8px;
  color: rgba(255,255,255,.95);
  text-align: center;
  letter-spacing: 0.02em;
}
.pd-preview-svg svg{
  width: 88px;
  height: 70px;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.3));
}

/* Mobile adjustments for preview cards */
@media (max-width: 600px){
  .pd-preview-card{ width: 92px; padding: 8px 8px 6px; }
  .pd-preview-svg svg{ width: 78px; height: 62px; }
  .pd-preview-name{ font-size: 12px; }
}