html, body {
  margin: 0;
  background: black;
  overflow: hidden;
  font-family: 'Titillium Web', sans-serif;
  color: #d7d7d7;
}

canvas {
  position: fixed;
  inset: 0;
}

.logo {
  position: fixed;
  top: 16px;
  left: 16px;
  width: 60px;
  cursor: pointer;
  z-index: 10;
}

.text {
  position: fixed;
  bottom: 16px;
  right: 16px;
  left: auto;
  top: auto;
  font-family: 'Titillium Web', sans-serif;
  font-size: 12px;
  line-height: 1;
  text-align: right;
  background: rgba(0,0,0,0.72);
  padding: 10px 14px;
  border-radius: 6px;
  max-width: 320px;
  word-wrap: break-word;
  z-index: 10;
}

.text a {
  display: inline-block;
  max-width: 100%;
  color: #cecece;
  text-decoration: none;
}

.text a:hover {
  color: white;
}

.divider {
  color: #00ff6a;
  margin: 0 4px;
}

.meta {
  position: fixed;
  top: 48px;
  right: 16px;
  font-family: 'Micro 5', monospace;
  font-size: 24px;
  text-align: right;
  z-index: 10;
}

.live {
  position: fixed;
  top: 16px;
  right: 16px;
  font-family: 'Micro 5', monospace;
  font-size: 24px;
  color: #00ff6a;
  z-index: 10;
}

.jam {
  display: inline-block;
  padding: 8px 12px;
  background: #00ff6a;
  color: #000;
  text-decoration: none;
  border-radius: 4px;
  font-size: 20px;
  font-family: 'Micro 5', monospace;
  cursor: pointer;
  border: none;
}

.secondaryJam {
  display: inline-block;
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  background: #222;
  color: #d7d7d7;
  border: 1px solid rgba(0,255,106,0.35);
  border-radius: 4px;
  font-size: 16px;
  font-family: 'Micro 5', monospace;
  cursor: pointer;
}

.secondaryJam:hover {
  color: #00ff6a;
  border-color: rgba(0,255,106,0.7);
}

#commandLegend {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,255,106,0.25);
  color: #aaa;
  font-family: 'Titillium Web', sans-serif;
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
}

#commandLegend strong {
  color: #00ff6a;
  font-family: 'Micro 5', monospace;
  font-size: 15px;
  font-weight: normal;
  margin-right: 4px;
}

.live.on {
  color: #00ff6a;
  animation: pulse 2s infinite;
}

.live.off {
  color: #ff4d4d;
}

.meta .jam {
  margin-top: 6px;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  font-family: 'Titillium Web', sans-serif;
}

.modal.show {
  display: flex;
}

.modal-box {
  background: #000;
  border: 1px solid #00ff6a;
  padding: 24px;
  width: 320px;
  text-align: center;
  border-radius: 8px;
}

.modal-box h2 {
  margin-bottom: 16px;
  color: #00ff6a;
  font-family: 'Micro 5', monospace;
  font-size: 50px;
}

.modal-box p {
  font-size: 14px;
  margin: 6px 0;
  color: #d7d7d7;
}

.modal-actions {
  margin-top: 16px;
}

.modal-actions button {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border-radius: 6px;
  border: none;
  font-family: 'Titillium Web', sans-serif;
  cursor: pointer;
}

.modal-actions button:first-child {
  background: #00ff6a;
  color: #000;
  font-weight: 600;
}

.modal-actions .secondary {
  background: #222;
  color: #aaa;
}

#startWrap {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  text-align: center;
}

#startUI {
  background: rgba(0,0,0,0.88);
  border: 1px solid #00ff6a;
  border-radius: 8px;
  padding: 22px;
  text-align: center;
  max-width: 340px;
}

#startUI h1 {
  margin: 0 0 12px 0;
  color: #00ff6a;
  font-family: 'Micro 5', monospace;
  font-size: 54px;
  line-height: 0.9;
}

#startUI p {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: #d7d7d7;
}

#aboutSpixelfy {
  display: inline-block;
  margin-top: 14px;
  color: #d7d7d7;
  font-size: 12px;
  text-decoration: none;
  opacity: 0.75;
}

#aboutSpixelfy:hover {
  color: #00ff6a;
  opacity: 1;
}

/*
  ===================================================
  SHARE CONTROLS
  Desktop button sits under JAMMING on the right.
  Mobile button sits above the metrics on the left.
  ===================================================
*/

#shareToggle {
  position: fixed;
  right: 16px;
  top: 48px;
  left: auto;
  bottom: auto;
  transform: none;
  z-index: 13;
  display: none;
  border: 1px solid rgba(0,255,106,0.45);
  border-radius: 6px;
  background: rgba(0,0,0,0.85);
  color: #00ff6a;
  padding: 7px 10px;
  font-family: 'Micro 5', monospace;
  font-size: 18px;
  cursor: pointer;
}

#shareNote {
  position: fixed;
  right: 16px;
  top: 86px;
  left: auto;
  bottom: auto;
  transform: none;
  z-index: 12;
  background: rgba(0,0,0,0.85);
  border: 1px solid rgba(0,255,106,0.45);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 15px;
  color: #d7d7d7;
  width: 280px;
  max-width: 280px;
  box-sizing: border-box;
  text-align: center;
  display: none;
}

#shareNote button {
  margin-top: 8px;
  width: 100%;
  border: none;
  border-radius: 4px;
  background: #00ff6a;
  color: black;
  padding: 7px 10px;
  font-family: 'Micro 5', monospace;
  font-size: 22px;
  cursor: pointer;
}

#shareNote.collapsed {
  display: none !important;
}

#shareNoteHeader {
  display: flex;
  justify-content: flex-end;
}

#shareClose {
  border: none;
  background: transparent !important;
  color: #d7d7d7 !important;
  font-size: 16px !important;
  cursor: pointer;
  padding: 0 !important;
  margin: 0 0 6px 0 !important;
  width: auto !important;
  font-family: 'Titillium Web', sans-serif !important;
}

#modeLabel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
  pointer-events: none;
  opacity: 0;
  background: rgba(0,0,0,0.78);
  border: 1px solid rgba(0,255,106,0.65);
  color: #00ff6a;
  border-radius: 6px;
  padding: 8px 14px;
  font-family: 'Micro 5', monospace;
  font-size: 34px;
  letter-spacing: 0.02em;
  transition: opacity 0.2s ease;
}

#modeLabel.show {
  opacity: 1;
}

/*
  ===================================================
  HOST PAUSED / NO MUSIC STATE
  ===================================================
*/

.hostPausedBox {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 25;
  width: min(320px, calc(100vw - 48px));
  pointer-events: auto;
}

.hostPausedBox.hidden {
  display: none;
}

.hostPausedInner {
  background: rgba(0,0,0,0.88);
  border: 1px solid rgba(0,255,106,0.65);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.hostPausedInner h2 {
  margin: 0 0 10px 0;
  color: #00ff6a;
  font-family: 'Micro 5', monospace;
  font-size: 38px;
  line-height: 0.9;
  font-weight: normal;
}

.hostPausedInner p {
  margin: 0 0 14px 0;
  color: #d7d7d7;
  font-family: 'Titillium Web', sans-serif;
  font-size: 13px;
  line-height: 1.35;
}

#listenerTag {
  position: fixed;
  right: 16px;
  bottom: 50px;
  z-index: 11;
  color: #fcf000;
  font-family: 'Titillium Web', sans-serif;
  font-size: 11px;
  line-height: 1;
  text-align: right;
  background: rgba(0,0,0,0.72);
  border-radius: 6px;
  padding: 5px 9px;
  pointer-events: none;
}

@media (max-width: 600px) {
  #listenerTag {
    right: 12px;
    bottom: 50px;
  }
}

/*
  ===================================================
  METRICS LINE
  Same box treatment as song title.
  ===================================================
*/

#metricsLine {
  position: fixed;
  left: 16px;
  bottom: 16px;
  top: auto;
  transform: none;
  z-index: 12;
  color: #d7d7d7;
  font-family: 'Titillium Web', sans-serif;
  font-size: 12px;
  line-height: 1;
  text-align: left;
  background: rgba(0,0,0,0.72);
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  white-space: nowrap;
  pointer-events: none;
}

.metricsDivider {
  color: #00ff6a;
  margin: 0 4px;
}

/*
  ===================================================
  MOBILE
  ===================================================
*/

@media (max-width: 600px) {
  .logo {
    width: 64px;
  }

  .live {
    font-size: 20px;
    top: 18px;
    right: 12px;
  }

  .meta {
    top: 44px;
    right: 12px;
    font-size: 21px;
  }

    .text {
      position: fixed;
      bottom: 12px;
      right: 12px;
      left: 12px;
      top: auto;
      max-width: none;
      width: auto;
      font-size: 12px;
      line-height: 1.15;
      padding: 10px 14px;
      text-align: right;
      display: block;
    }
    
     #metricsLine {
        left: 12px;
        top: calc(50vh + 50vw + 10px);
        bottom: auto;
        transform: none;
        font-size: 12px;
        line-height: 1;
        padding: 10px 14px;
        width: auto;
        max-width: calc(100vw - 24px);
        box-sizing: border-box;
        white-space: nowrap;
      }
    }

    #shareToggle {
      right: 12px;
      top: 46px;
      left: auto;
      bottom: auto;
      transform: none;
      font-size: 16px;
    }

    #shareNote {
      right: 12px;
      left: auto;
      top: 82px;
      bottom: auto;
      width: 280px;
      max-width: calc(100vw - 24px);
      transform: none;
      box-sizing: border-box;
      text-align: center;
    }

  #startUI {
    width: calc(100vw - 48px);
    max-width: 300px;
    box-sizing: border-box;
    padding: 22px 18px;
  }

  #startUI h1 {
    font-size: 50px;
  }

  #startUI p {
    font-size: 15px;
    line-height: 1.35;
  }

  #modeLabel {
    font-size: 28px;
  }
}

/*
  ===================================================
  PORTRAIT LOCK
  Soft-lock mobile landscape.
  ===================================================
*/

#portraitLock {
  display: none;
}

@media (max-width: 900px) and (orientation: landscape) and (hover: none) and (pointer: coarse) {
  #portraitLock {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
    color: #00ff6a;
    font-family: 'Titillium Web', sans-serif;
    font-size: 18px;
    text-align: center;
    line-height: 1.35;
    padding: 24px;
  }

  #portraitLock strong {
    font-family: 'Micro 5', monospace;
    font-size: 42px;
    font-weight: normal;
  }
}

body.cleanMode .logo,
body.cleanMode .live,
body.cleanMode .meta,
body.cleanMode .text,
body.cleanMode #metricsLine,
body.cleanMode #shareToggle,
body.cleanMode #shareNote,
body.cleanMode #listenerTag,
body.cleanMode #modeLabel {
  display: none !important;
}