html,body{margin:0; padding: 0px; height: 100%;
background: #E5A814;
  background: linear-gradient(0deg,rgba(229, 168, 20, 1) 0%, rgba(216, 53, 128, 1) 100%);
  color:#fff;font-family:Arial,sans-serif}

.bgDContainer{
  min-height: calc(100dvh + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: linear-gradient(0deg,rgba(229, 168, 20, 1) 0%, rgba(216, 53, 128, 1) 100%);
}

  a:link, a:visited, a:active{ color:#FFFFFF; text-decoration:none; }

#loader,#intro{
  position:fixed;inset:0;display:flex;align-items:center;justify-content:center;
  z-index:999;flex-direction:column;text-align:center;padding:20px

  background: rgba(229,168,20,0.96);
  backdrop-filter: blur(2px);
}
#loader{background: rgba(216, 53, 128, 0.96);}



#intro-actions .spinner{ margin:0px auto; }

#stage{display:none;position:relative;height:100dvh}

/* Layout wrapper */
.stage-wrap{
  height:100%;
  display:grid;
  position:relative;
  grid-template-rows: 1fr auto;
  align-items:center;
  justify-items:center;

  box-sizing:border-box;
}

/* Keep export view in the same grid cell as the stage */
#mainStage{ grid-row:1; grid-column:1; }
#exportStageView{ grid-row:1; grid-column:1; }

.export-view-stage{
  background:transparent;
  overflow:visible;
}

/* Export card animation (fade in + slow zoom) */
#exportStageView .export-card{
  width:calc(100% - 28px);
  max-height:calc(100% - 28px);
  border-radius:16px;
  padding:14px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  box-sizing:border-box;

  opacity:0;
  transform:scale(.94);
  transition: opacity .35s ease, transform .65s ease;
}
#exportStageView.isactive .export-card{
  opacity:1;
  transform:scale(1);
}

#exportStageView .tap-to-share{
  margin-top:4px;
  font-size:0.85em;
  opacity:.85;
  text-align:center;
  color:#fff;
}


/* Responsive sizing based on BOTH width and height */
:root{
  --maxW: 520px;
  --pad: 5px;          /* stage-wrap left+right padding total */
  --vpad: 45px;         /* stage-wrap top+bottom padding total */
  --gap: 5px;
  --bandH:10px;        /* approx bottom band height */
  --arW: 1080;
  --arH: 1920;
}

/* Stage scales to fit viewport width AND height (so full stage + band fits) */
.stage{
  /* available height for the stage (viewport minus padding/gap/bottom band) */
  --availH: calc(100dvh - var(--vpad) - var(--gap) - var(--bandH));
  /* width constrained by viewport width and a desktop cap */
  --wFromVW: min(calc(100vw - var(--pad)), var(--maxW));
  /* width derived from height via aspect ratio */
  --wFromH: calc(var(--availH) * (var(--arW) / var(--arH)));
  /* final width uses whichever is smaller so it always fits */
  width: min(var(--wFromVW), var(--wFromH));

  aspect-ratio: calc(var(--arW) / var(--arH));
  position:relative;
  border-radius:18px;
  overflow:hidden;
  touch-action:none;
  user-select:none;
  box-shadow:0 12px 40px rgba(0,0,0,.45);
}

/* Keep everything visible even on short screens (down to 600px) */
@media (max-height: 600px){
/*  :root{ --bandH: 52px; }
*/ 
 .stage-wrap{ gap:10px; padding:10px; }
  .bottom-band{ padding:8px 10px; }
  .btn{ padding:9px 12px; }
}

/* Disable selection/highlight */
.stage, .stage *{
  user-select:none;
  -webkit-user-select:none;
  -webkit-touch-callout:none;
  -webkit-tap-highlight-color:transparent;
}

/* Layer stack */
.layer{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:contain;
  pointer-events:none;
  -webkit-user-drag:none;
  user-drag:none;
}

.hidden-layer{opacity:0;visibility:hidden;}

/* Swipe surface (excludes toolbar) */
:root{ --toolbar-h: 88px; --arrow-size: 46px; }
.swipe-surface{
  position:absolute;
  left:0; right:0; top:0;
  bottom: var(--toolbar-h);
  z-index:25;
  pointer-events:auto;
  touch-action:none; /* we manage swipe; ignore vertical */
}

/* Always-visible arrows */
.nav-arrow{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width: var(--arrow-size);
  height: var(--arrow-size);
  border-radius:999px;
  border:1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.20);
  color:#fff;
  z-index:35;
  display:grid;
  place-items:center;
  cursor:pointer;
  backdrop-filter: blur(6px);
}
.nav-arrow svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
.nav-left{ left:12px; }
.nav-right{ right:12px; }
.nav-arrow:active{ transform:translateY(-50%) scale(0.97); }

/* Toolbar inside stage */
.toolbar{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom: 60px;
  height: var(--toolbar-h);
  width: min(92%, 520px);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  z-index:40;
  pointer-events:auto;
}
.toolbtn{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  border:none;
  background: transparent;
  color: rgba(255,255,255,.88);
  cursor:pointer;
  padding:0;
  min-width:0;
}
.toolbtn .icon{
  width:48px;height:48px;
  border-radius:999px;
  background: rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.25);
  display:grid;
  place-items:center;
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
}
.toolbtn svg{ width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
.toolbtn .label{
  font-size:12px;
  line-height:1;
  letter-spacing:.4px;
  text-transform:uppercase;
  text-shadow: 0px 0px 10px rgb(0 0 0);
}
.toolbtn.is-active .icon{
    background: #d83580;
    border-color: #d83580;
  box-shadow: 0 10px 22px rgba(0,0,0,.22);

}
.toolbtn.is-active .label{
    font-weight: 700;
    opacity:1;
}
.toolbtn.is-active{ color:#fff; }

/* Keep bottom band centered under the stage on all devices */

/* Bottom band matches stage width */
.bottom-band{
  width:auto;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  padding:14px 10px 14px 18px;
  position: absolute;
  bottom: 0px;
  left: 0px;
  right: 0px;
  background-color: #d83580;
}

.bottom-band .export-btn{
  display:flex; 
  gap:10px; 
  align-items:center;
  font-size: 0.8e;

}

.name-pill{
  font-weight:400;
  letter-spacing:.2px;
  color:#FFFFFF;
  font-size: 0.7em;
}
.name-pill #memberName{ font-size: 1.6em; font-weight:800;}
.export-btn .btn{ font-size: 0.8em; padding: 7px 12px }

.btn{
  border:0;
  border-radius:999px;
  padding:10px 14px;
  font-weight:700;
  background:transparent;
  color:#FFFFFF;
  cursor:pointer;
  border:1px solid #FFFFFF;
}
.btn:active{transform:translateY(1px);}

/* Export modal */
#exportModal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.7);
  z-index:1000;
  padding:16px;
  box-sizing:border-box;
}

#exportModal{ display:none; }
#exportModal.isactive{ display:flex; }

.modal.exportModal {
  align-items: center;
}
 .modal-card{
    position:relative;
margin:auto;
  width:min(92vw,520px);
  max-height:90vh;
  background:#d83580;
  border-radius:16px;
  padding:14px;
  box-shadow:0 14px 50px rgba(0,0,0,.6);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  box-sizing:border-box;
}
.modal-card h3{margin:6px 0 10px 0}
.modal-img{
  width:auto;
  max-width:100%;
  max-height:80vh;
  height:auto;
  border-radius:12px;
  display:block;
  margin:0 auto;
  object-fit:contain;
}
.modal-actions{
  display:flex;
  gap:10px;
  margin-top:2px;
  justify-content:flex-end;
  flex-wrap:wrap;
}
a.btn{ text-decoration:none; display:inline-block; }
/* Portrait-only message on mobile when rotated */
#rotateOverlay{
  position:fixed;
  inset:0;
  z-index:2000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  box-sizing:border-box;
  text-align:center;
}
.rotate-card{
  width:min(92vw,520px);
  padding:18px 16px;
}
.rotate-card h2{margin:0 0 10px 0}
.rotate-card p{margin:0;opacity:.9;line-height:1.4}

@font-face {
  font-family: "Nimbus Sans Extended";
  src: local("Nimbus Sans Extended"), local("NimbusSans-Extended"),
       local("Nimbus Sans L"), local("NimbusSansL");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "Nimbus Sans Extended";
  src: local("Nimbus Sans Extended Bold"), local("NimbusSans-Extended-Bold"),
       local("Nimbus Sans L Bold"), local("NimbusSansL-Bold");
  font-weight: 700;
  font-style: normal;
}
html, body, button, input, p, h1, h2, h3, h4, h5, h6, span, div {
 components: all;
  font-family: "Nimbus Sans Extended", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: .04em;
}
/* Kinks 60 logo in top-left of stage */
.stage-logo{
  position:absolute;
  top:15px;
  left:20px;
  width:16.7%;       /* 80px at 480px stage width */
  max-width:80px;
  height:auto;
  z-index:30;
  pointer-events:none;
}
/* Intro logo */
.intro-logo{
  display:block;
  margin:0 auto 18px auto;
  width:120px;
  max-width:40vw;
  height:auto;
}

.intro-text{ margin:0px auto; width: 90%; max-width: 500px; }
.spotify-embed{ max-width: 500px;  width: 90%; margin: 0px auto; padding-top: 0px;}

/* Reference logo sizing for export (matches stage logic: 80px @ 480px stage) */
:root{
  --logoRatio: 0.1667; /* 80 / 480 */
}

}
#btnAudio{
  min-width:44px;
  padding:10px 12px;
}
#btnAudio.btn{ padding:15px 14px; }

/* Volume button lives in the bottom-left corner of the whole #stage */
#btnAudio{
  display: none;
  position:absolute;
  top:25px;
  right: 25px;
  z-index:950;
}
/* Stage logo */
.stage-logo{
  position:absolute;
  top:10px;
  left:20px;
  width:16.7%;
  max-width:80px;
  height:auto;
  z-index:30;
  pointer-events:none;
}

.desktop-logo{ display: none; }
.desktop-dfof{ display: none; }
/* Speaker icon styling */
#btnAudio img{
  width:22px;
  height:auto;
  filter: brightness(0) invert(1);
  display:block;
}


footer{
  position: absolute;
  bottom: 10px;
  right: 10px;
  left: 10px;
  color: #FFFFFF;
  text-align: center;
  z-index: 999;
  font-size: 8px;
  line-height: 10px;
  transition: all 2s ;
}


footer a:link, footer a:visited, footer a:active{
  color: #FFFFFF;
}

@media (min-width: 1200px){
  .stage-logo{ display: none; }
  .desktop-logo{ position: absolute; bottom:30px; right:30px; display: block; width: 100px; }
  .desktop-dfof{ position: absolute; top:30px; left:30px; display: block; width: 300px; }

}

@media (max-width: 780px){
  #btnAudio{
      left:auto;
      bottom: auto;
      right: 20px;
      top: 20px;
      padding: 10px 9px !important;
  }
  .toolbtn .label{ font-size:10px; }
  footer{ font-size: 7px; 
  }
  .intro-dfof{ width: 90%; max-width:300px }

  .intro-text { font-size: 0.8em; }
  .bottom-band{ padding:10px 10px 10px 14px !important; }
}

@media (max-width: 380px){


}


.save-loader{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  background:rgba(0,0,0,.35);
  border-radius:16px;
}

/* Fullscreen saving overlay (shown only between clicking Share/Save and modal reveal) */
#savingOverlay{
  position:fixed;
  inset:0;
  display:none;              /* hidden on page load */
  align-items:center;
  justify-content:center;
  z-index:99999;
}
#savingOverlay .saving-card{
  padding:18px 20px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-width:120px;
  background-color: #d83580;
  border-radius: 18px;
}
#savingOverlay .saving-text{ font-size:14px; opacity:.95; }
.spinner{
  width:46px;
  height:46px;
  border:4px solid rgba(255,255,255,.35);
  border-top-color:#fff;
  border-radius:50%;
  animation:spin 0.9s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }
a.is-disabled{
  pointer-events:none;
  opacity:.6;
  filter:grayscale(0.2);
}


/* ---- Music player overlay ---- */
#musicToggle{
  position:fixed;
  top:12px;
  right:12px;
  width:44px;
  height:44px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.20);
  background-image: url('../ui/equalizer.gif');
  background-size: 70%;
  background-position: center;
  background-repeat: no-repeat;
  color:#fff;
  z-index: 1200;
  display:none; /* shown after intro */
  place-items:center;
  cursor:pointer;
  backdrop-filter: blur(6px);
}
#musicToggle svg{ width:22px; height:22px; fill: currentColor; }

#musicOverlay{
  position:fixed;
  left:0; right:0;
  top:0;
  transform: translateY(-110%);
  transition: transform .28s ease;
  z-index: 1199;
  padding: 10px 12px 12px;
  pointer-events:none;
}
#musicOverlay.isOpen{
  transform: translateY(0);
  pointer-events:auto;
}
#musicOverlay .musicShell{
  max-width: 520px;
  margin: 0 auto;
  border-radius: 16px;
  padding: 10px;
}

#musicOverlay .row{ display:flex; gap:12px; flex-wrap: wrap; align-items:center; margin: 10px 0; }
#musicOverlay .card{  padding: 10vh 12px;  }
#musicOverlay button{ padding: 10px 12px; cursor:pointer; border-radius: 12px; border: 1px solid rgba(255,255,255,1); background: rgba(255,255,255,.10); color:#fff; }

#musicOverlay .iconBtn{
  width:65px;
  height:  height:44px;
;
  padding:0;
  display:grid;
  place-items:center;
}
#musicOverlay .iconBtn svg{
  width:22px;
  height:22px;
  fill: currentColor;
}
#musicOverlay #transportRow{
  justify-content:center;
  padding-top: 40px;
  padding-bottom: 40px;
}

#musicOverlay button:disabled{ opacity: .5; cursor:not-allowed; }
#musicOverlay input[type="range"]{ width: 100%; }
#nowPlaying{ font-weight: 700; margin-bottom: 6px; 
  font-size: 1.5em;}



/* ---- Music overlay UX overrides (v7) ---- */
#musicOverlay{
  position:fixed;
  inset:0;
  padding: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  transform: translateY(-110%);
  transition: transform .28s ease;
  z-index: 1199;
  pointer-events:none;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
}
#musicOverlay.isOpen{
  transform: translateY(0);
  pointer-events:auto;
}
#musicOverlay .musicShell{
  width: min(520px, 92vw);
  margin: 0 auto;
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow:none;
}
#musicOverlay .card{
  width: 100%;
}
#nowPlaying{
  text-align:center;
  width: 90%;
  margin: 0 auto 10px auto;
  word-break: break-word;
}
#musicOverlay #transportRow{
  justify-content:center;
  gap: 14px;
}
#musicOverlay .iconBtn{
  width:52px;
  height:52px;
  border-radius:999px;
}
#musicOverlay button{
  border-radius:999px;
}
#musicOverlay input[type="range"]{
  accent-color: rgba(216, 53, 128, 1);
}
/* center + constrain volume row */
#musicOverlay .row.volRow{
  justify-content:center;
  flex-direction: column;
}
#musicOverlay .row.volRow input[type="range"]{
  width: 50%;
  max-width: 140px;
}

#musicOverlay .volTitle{ display:block; text-align: center; font-size: 0.8em;}

#timeInline{
  text-align:center;
  opacity:.9;
  margin: 10px auto 10px auto;
  font-size: 0.95em;

}


/* ---- Music overlay final overrides (v9) ---- */
#musicOverlay{
  inset: 0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}
#musicOverlay .musicShell{
  width: min(520px, 92vw) !important;
  padding: 10vh 0 !important;
}
#musicOverlay .card{
  width: 100% !important;
}
#musicOverlay .playerlogoContainer{ text-align: center; padding-bottom: 20px;}
#musicOverlay .player-logo{ width:100px; }

#nowPlaying{
  text-align:center !important;
  width: 90% !important;
  margin: 0 auto 10px auto !important;
  font-size: 1.3em !important;
}
#musicOverlay .row.volRow input[type="range"]{
  width: 50% !important;
}
#musicOverlay input[type="range"]{
  accent-color: rgba(216, 53, 128, 1) !important;
}


/* Loader progress bar */
#loader{ position:fixed; }
#loadBar{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom: max(40px, env(safe-area-inset-bottom));
  width: min(360px, 76vw);
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.25);
  overflow:hidden;
}
#loadBarFill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: rgba(216, 53, 128, 1);
  transition: width 220ms linear;
}


/* Optional on-screen debug console */
.debug-console-panel{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  height:33dvh;
  min-height:180px;
  background:rgba(10,10,10,.96);
  color:#fff;
  z-index:3000;
  transform:translateY(calc(100% - 1px));
  transition:transform .25s ease;
  box-shadow:0 -12px 30px rgba(0,0,0,.38);
  border-top:1px solid rgba(255,255,255,.14);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.debug-console-panel.is-open{
  transform:translateY(0);
}

.debug-console-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 14px;
  border-bottom:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
}

.debug-console-title{
  font-size:12px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.debug-console-clear{
  appearance:none;
  border:1px solid rgba(255,255,255,.24);
  background:transparent;
  color:#fff;
  border-radius:999px;
  padding:6px 10px;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
}

.debug-console-body{
  height:calc(100% - 45px);
  overflow:auto;
  padding:10px 14px 18px;
  box-sizing:border-box;
}

.debug-console-entry{
  font-size:11px;
  line-height:1.45;
  white-space:pre-wrap;
  word-break:break-word;
  padding:0 0 8px;
  margin:0 0 8px;
  border-bottom:1px solid rgba(255,255,255,.07);
}

.debug-console-entry.warn{
  color:#ffd479;
}

.debug-console-toggle{
  position:fixed;
  left:12px;
  bottom:12px;
  width:42px;
  height:42px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(10,10,10,.9);
  color:#fff;
  z-index:3001;
  display:grid;
  place-items:center;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  box-shadow:0 10px 24px rgba(0,0,0,.28);
}

.debug-console-toggle.is-open{
  bottom:calc(33dvh - 52px);
}
