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

html, body { height: 100%; }

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  background:
    radial-gradient(130% 105% at 50% 18%, #262e55 0%, #1a2040 52%, #10142b 100%);
  color: #e8e2d2;
  font-family: "Avenir Next", Avenir, Futura, "Century Gothic", "Trebuchet MS", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#bgstars { position: fixed; inset: 0; pointer-events: none; }
#bgstars .star {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: #cdd6f2;
  animation: tw 4s ease-in-out infinite;
}

@keyframes tw {
  0%, 100% { opacity: 0.12; }
  50%      { opacity: 0.75; }
}

header { text-align: center; padding-top: 30px; z-index: 2; }

h1 {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: #e8e2d2;
  opacity: 0.88;
}

#nowplaying {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: #f0b9a5;
  opacity: 0;
  transition: opacity 1.4s ease;
}
#nowplaying.on { opacity: 0.9; }

#stage {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

#scene {
  height: 100%;
  max-height: calc(100vh - 150px);
  max-width: 96vw;
  display: block;
  touch-action: none;
}

.labelText {
  font-family: "Avenir Next", Futura, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.34em;
  fill: rgba(233, 228, 214, 0.78);
}
.labelSmall { font-size: 7.5px; letter-spacing: 0.28em; fill: rgba(233,228,214,0.5); }

#labelStars .tw { animation: tw 3.5s ease-in-out infinite; }

#waterHit { cursor: pointer; }
#armGrab { cursor: grab; }
#tonearm.dragging #armGrab { cursor: grabbing; }

#tipGlow {
  opacity: 0;
  animation: pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
#tipGlow.off { animation: none; opacity: 0 !important; }

@keyframes pulse {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  45%      { opacity: 0.85; transform: scale(1.15); }
}
#tipGlow { transform-box: fill-box; transform-origin: center; }

/* ---- volume + rpm (SVG, left of the record) ---- */
#volHit, #rpmHit { cursor: pointer; }

.rpmTxt {
  font-family: "Avenir Next", Futura, sans-serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  fill: rgba(233, 228, 214, 0.4);
  transition: fill 0.4s ease;
  pointer-events: none;
}
.rpmTxt.sel { fill: #efb18f; }

/* ---- track selector ---- */
#tracks {
  position: absolute;
  left: 28px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 3;
}
.trk {
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font: inherit;
}
.trk .disc {
  width: 24px; height: 24px;
  border-radius: 50%;
  flex: none;
  background: radial-gradient(circle, var(--lbl, #0b0e24) 0 30%, var(--c, #365d92) 32% 100%);
  box-shadow: 0 0 0 2px rgba(233, 228, 214, 0.14), 0 3px 8px rgba(4, 8, 24, 0.5);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.trk:hover .disc { transform: scale(1.12); }
.trk.sel .disc { box-shadow: 0 0 0 2px #efb18f, 0 3px 8px rgba(4, 8, 24, 0.5); }
.trk .tname {
  font-size: 9px;
  letter-spacing: 0.24em;
  color: #e8e2d2;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.35s ease, max-width 0.35s ease;
}
.trk.sel .tname, .trk:hover .tname { opacity: 0.75; max-width: 180px; }

#addTrack {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  padding: 4px;
}
#addTrack .plus {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.6px dashed rgba(233, 228, 214, 0.35);
  color: rgba(233, 228, 214, 0.55);
  font-size: 15px;
  line-height: 21px;
  text-align: center;
  flex: none;
  transition: border-color 0.3s, color 0.3s;
}
#addTrack .addTxt {
  font-size: 9px;
  letter-spacing: 0.24em;
  color: #e8e2d2;
  opacity: 0.3;
  white-space: nowrap;
  transition: opacity 0.3s;
}
#addTrack:hover .plus, body.dropping #addTrack .plus { border-color: #efb18f; color: #efb18f; }
#addTrack:hover .addTxt, body.dropping #addTrack .addTxt { opacity: 0.8; }
#addTrack input { display: none; }

/* ---- tutorial (spotlight walkthrough) ---- */
#tutToggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  cursor: pointer;
  user-select: none;
}
.tt-label {
  font-size: 9px;
  letter-spacing: 0.32em;
  color: rgba(233, 228, 214, 0.45);
  transition: color 0.35s ease;
}
.tt-pill {
  position: relative;
  width: 34px; height: 18px;
  border-radius: 9px;
  background: rgba(233, 228, 214, 0.14);
  transition: background 0.35s ease;
}
.tt-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #ece5d6;
  box-shadow: 0 2px 5px rgba(4, 8, 24, 0.5);
  transition: left 0.35s cubic-bezier(0.5, 0, 0.25, 1);
}
#tutToggle:hover .tt-label { color: rgba(233, 228, 214, 0.8); }
#tutToggle.on .tt-label { color: #efb18f; }
#tutToggle.on .tt-pill { background: rgba(239, 177, 143, 0.45); }
#tutToggle.on .tt-knob { left: 19px; }

#tut { position: fixed; inset: 0; z-index: 60; cursor: pointer; }
#tut[hidden] { display: none; }

.tut-hole {
  position: absolute;
  border-radius: 50%;
  box-shadow: 0 0 0 200vmax rgba(5, 8, 24, 0.84);
  outline: 1.5px solid rgba(239, 177, 143, 0.55);
  outline-offset: 4px;
  transition: all 0.55s cubic-bezier(0.5, 0, 0.25, 1);
  pointer-events: none;
}

.tut-svg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.tut-svg line { stroke: #efb18f; stroke-width: 1.6; stroke-dasharray: 4 6; stroke-linecap: round; }
.tut-svg polygon { fill: #efb18f; }

.tut-card {
  position: absolute;
  max-width: 290px;
  background: rgba(14, 18, 38, 0.96);
  border: 1px solid rgba(239, 177, 143, 0.35);
  border-radius: 12px;
  padding: 16px 20px;
  transition: left 0.55s cubic-bezier(0.5, 0, 0.25, 1), top 0.55s cubic-bezier(0.5, 0, 0.25, 1);
  box-shadow: 0 10px 40px rgba(3, 5, 16, 0.6);
  cursor: default;
}
.tut-step {
  font-size: 9px;
  letter-spacing: 0.3em;
  color: #efb18f;
  margin-bottom: 9px;
}
.tut-text {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  line-height: 2;
  color: #e8e2d2;
  opacity: 0.92;
}
.tut-btns {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  margin-top: 13px;
}
.tut-btns button {
  background: none;
  border: none;
  font: 10px "Avenir Next", Futura, sans-serif;
  letter-spacing: 0.28em;
  color: #efb18f;
  cursor: pointer;
  padding: 4px 2px;
}
#tutSkip { color: rgba(233, 228, 214, 0.45); }
#tutSkip:hover { color: rgba(233, 228, 214, 0.8); }
#tutNext:hover { color: #f6c9a8; }

/* ---- shooting stars ---- */
.shoot {
  position: absolute;
  width: 74px; height: 2px;
  border-radius: 2px;
  background: linear-gradient(to left, #eef1ff, rgba(238, 241, 255, 0));
  opacity: 0;
  pointer-events: none;
}

footer { padding-bottom: 26px; z-index: 2; }

#hint {
  font-size: 10px;
  letter-spacing: 0.26em;
  text-align: center;
  opacity: 0.5;
  transition: opacity 0.6s ease;
  padding: 0 20px;
}
#hint.swap { opacity: 0; }
