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

/* ─── Space / starfield background ──────────────────────── */
body {
  background-color: #00003a;
  background-image:
    radial-gradient(1px 1px at 10% 15%, #fff 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 60%, #fff 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 40% 30%, #fff 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 80%, #ffe 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 10%, #fff 0%, transparent 100%),
    radial-gradient(2px 2px at 80% 50%, #ffe 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 75%, #fff 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 90%, #fff 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 60% 45%, #fff 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 5%, #ffe 0%, transparent 100%);
  cursor: none;
  font-family: 'Caveat', cursive;
  min-height: 100vh;
}

/* ─── Marquee header ────────────────────────────────────── */
.marquee-bar {
  background: #ff00ff;
  color: #ffff00;
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  padding: 4px 0;
  border-bottom: 3px solid #00ffff;
  border-top: 3px solid #00ffff;
}

/* ─── Main scene ────────────────────────────────────────── */
.scene {
  max-width: 1000px;
  margin: 20px auto;
  padding: 0 12px;
}

/* ─── Notebook wrapper ──────────────────────────────────── */
.notebook-wrapper {
  position: relative;
}

.notebook-bg {
  width: 100%;
  height: auto;
  display: block;
  border: 4px solid #00ffff;
  box-shadow: 0 0 24px #ff00ff, 0 0 60px rgba(0,255,255,0.3);
}

/* ─── Page overlays — full-size transparent containers ──── */
.left-page,
.right-page {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* ─── "Endless Jam" scrawl ──────────────────────────────── */
/* left floor: 31.6%, 34.9% → anchor bottom there */
.endless-jam-scrawl {
  position: absolute;
  left: 23.4%; top: 19.5%;
  font-family: 'Caveat Brush', cursive;
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  color: #1a1a7e;
  transform: rotate(-1.5deg);
  line-height: 1;
  pointer-events: none;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.4);
}

/* ─── Loading indicator ─────────────────────────────────── */
/* matches song title area: floor 41% */
#loading-state {
  position: absolute;
  left: 24.0%; top: 27.7%;
  pointer-events: none;
}

/* ─── Track overlay (full-size transparent container) ───── */
.track-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.track-overlay.hidden { display: none; }

/* ─── VT text / blink ───────────────────────────────────── */
.vt-text {
  font-family: 'VT323', monospace;
  color: #00ffcc;
  font-size: clamp(1rem, 2vw, 1.4rem);
  text-shadow: 0 0 8px #00ffcc;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}
.blink { animation: blink 1.2s ease-in-out infinite; }

/* ─── Track name ────────────────────────────────────────── */
/* left floor: 31.6%, 41.0% → anchor bottom, width to 49.1% = 17.5% */
.track-name-label {
  position: absolute;
  left: 24.0%; top: 27.7%;
  width: 21.2%;
  font-family: 'Caveat', cursive;
  font-size: clamp(0.95rem, 2vw, 1.5rem);
  color: #1a1a5e;
  line-height: 1.3;
  word-break: break-word;
  pointer-events: none;
}

/* ─── Date hint ─────────────────────────────────────────── */
/* left floor: 31.4%, 48.6% → anchor bottom */
.date-hint {
  position: absolute;
  left: 24.3%; top: 38.7%;
  width: 20.7%;
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  color: #3a3a8a;
  font-style: italic;
  pointer-events: none;
}

/* ─── Tap hint ──────────────────────────────────────────── */
.tap-hint {
  position: absolute;
  left: calc(32.1% + 29px); top: 54%;
  transform: translateX(-50%);
  font-size: clamp(0.7rem, 1.4vw, 0.9rem);
  color: #00ffff;
  font-style: italic;
  pointer-events: none;
  white-space: nowrap;
}
.tap-hint.hidden { display: none; }

/* ─── iPod-style controls ───────────────────────────────── */
/* bottom-left: 37.3%, 60.8% → anchor bottom */
/* Passthrough overlay — buttons positioned individually */
.ipod-controls {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

#play-btn {
  position: absolute;
  left: calc(32.1% + 4px); top: calc(46.2% + 4px);
}

#next-btn {
  position: absolute;
  left: 40.5%; top: 47.5%;
}

.ctrl-btn {
  background: rgba(255,255,255,0.15);
  border: 2px solid #1a1a5e;
  border-radius: 50%;
  width: clamp(28px, 5vw, 38px);
  height: clamp(28px, 5vw, 38px);
  font-size: clamp(0.75rem, 1.6vw, 1rem);
  color: #1a1a5e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  font-family: inherit;
  pointer-events: all;
}
.ctrl-btn:hover { background: rgba(26, 26, 94, 0.15); }
.skip-btn { border-radius: 6px; }

/* ─── Vertical volume slider ────────────────────────────── */
/* top: 33.8%,51.0% — bottom: 33.5%,57.0% → center 33.7%,54% — length 6% of height */
.volume-slider {
  position: absolute;
  left: 26.3%; top: calc(50.3% + 2.5px);
  transform: translate(-50%, -50%) rotate(-90deg);
  width: clamp(50px, calc(6vw - 5px), 73px);
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(26,26,94,0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  pointer-events: all;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1a1a5e;
  cursor: pointer;
}
.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1a1a5e;
  border: none;
  cursor: pointer;
}

/* ─── Song Feels heading ────────────────────────────────── */
/* left floor: 31.2%, 64.7% → anchor bottom */
.song-feels-heading {
  position: absolute;
  left: 23.2%; top: 56.3%;
  font-family: 'Caveat', cursive;
  font-size: clamp(0.85rem, 1.8vw, 1.2rem);
  color: #1a1a7e;
  font-style: italic;
  pointer-events: none;
}

/* ─── Comments list (shared base) ──────────────────────── */
.comments-list {
  list-style: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: all;
  scrollbar-width: none;
}
.comments-list::-webkit-scrollbar { display: none; }

/* Desktop: Song Feels list — 2.5% gap between heading floor (64.7%) and input top (67.2%) */
#comments-list {
  position: absolute;
  left: 23.5%; top: 62.7%;
  width: 21.7%;
  height: 10.4%;
  max-height: none;
}

/* Desktop: Guestbook list — top-left 54.3%,38.4% / bottom-right 70.7%,65.4% */
#guestbook-list {
  position: absolute;
  left: 54.6%; top: 27.0%;
  width: 24.1%;
  height: 33.1%;
  max-height: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(26,26,94,0.3) transparent;
}
#guestbook-list::-webkit-scrollbar { display: block; width: 4px; }
#guestbook-list::-webkit-scrollbar-thumb { background: rgba(26,26,94,0.3); border-radius: 2px; }

.comment-item { pointer-events: none; }

.comment-text {
  font-family: 'Caveat', cursive;
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  color: #1a1a5e;
  line-height: 1.85;
}

.comment-time {
  font-size: clamp(0.6rem, 1.1vw, 0.75rem);
  color: #888;
  font-style: italic;
}

.comment-empty {
  font-family: 'Caveat', cursive;
  font-size: clamp(0.7rem, 1.4vw, 0.9rem);
  color: #aaa;
  font-style: italic;
}

/* ─── Comment inputs ────────────────────────────────────── */
.comment-input {
  background: rgba(255,255,255,0.15);
  border: 2px dashed rgba(26,26,94,0.4);
  border-radius: 4px;
  font-family: 'Caveat', cursive;
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  color: #1a1a5e;
  resize: none;
  outline: none;
  padding: 4px 6px;
  line-height: 1.85;
  width: 100%;
}
.comment-input:focus {
  border-color: rgba(26,26,94,0.7);
  background: rgba(255,255,255,0.25);
}
.comment-input::placeholder { color: rgba(26, 26, 94, 0.45); }

/* Desktop — Song Feels textarea */
/* upper-left: 31.0%,67.2% / lower-right: 49.1%,74.8% → width 18.1%, height 7.6% */
#comment-input {
  position: absolute;
  left: 23.5%; top: 74.0%;
  width: 21.9%;
  pointer-events: all;
}

/* Desktop — Song Feels post button */
/* top-left: 30.9%, 77.7% */
#comment-submit {
  position: absolute;
  left: 41.0%; top: 82.1%;
  pointer-events: all;
}

/* Desktop — Guestbook textarea */
/* upper-left: 53.2%,66.6% / lower-right: 70.9%,75.6% → width 17.7%, height 9% */
#guestbook-input {
  position: absolute;
  left: 54.9%; top: 61.9%;
  width: 23.8%;
  pointer-events: all;
}

/* Desktop — Guestbook submit button */
/* top-left: 54.1%, 76.6% */
#guestbook-submit {
  position: absolute;
  left: 70.7%; top: 75.8%;
  pointer-events: all;
}

/* ─── Post button ────────────────────────────────────────── */
.post-btn {
  align-self: flex-start;
  background: none;
  border: 1px solid #1a1a5e;
  border-radius: 3px;
  font-family: 'Caveat', cursive;
  font-size: clamp(0.7rem, 1.4vw, 0.9rem);
  color: #1a1a5e;
  padding: 1px 8px;
  cursor: pointer;
  transition: background 0.15s;
  pointer-events: all;
}
.post-btn:hover { background: rgba(26,26,94,0.1); }

/* ─── Right page — Guest Book ────────────────────────────── */
/* left floor: 54.6%, 34.6% → anchor bottom */
.guestbook-title {
  position: absolute;
  left: 59.9%; top: 20.2%;
  font-family: 'Caveat', cursive;
  font-size: clamp(1.2rem, 2.5vw, 1.9rem);
  color: #1a1a7e;
  font-weight: 400;
  transform: rotate(0.5deg);
  line-height: 1;
  pointer-events: none;
}

/* Subtitle: no room on desktop between list end (65.4%) and input top (66.6%) */
.guestbook-subtitle {
  font-family: 'Caveat', cursive;
  font-size: clamp(0.65rem, 1.3vw, 0.85rem);
  color: #555599;
  font-style: italic;
  line-height: 1.3;
  pointer-events: none;
}

/* ─── Send a Note / Share link ───────────────────────────── */
/* point: 75.1%, 27.3% */
.send-note-link {
  position: absolute;
  left: calc(86.7% - 10px); top: calc(11.8% + 5px);
  font-family: 'Caveat', cursive;
  font-size: clamp(0.6rem, 1.2vw, 0.85rem);
  color: #ff00ff;
  text-decoration: none;
  pointer-events: all;
  font-style: italic;
  transform: rotate(1deg);
}
.send-note-link:hover { text-decoration: underline; }

/* ─── Ninja star share button ───────────────────────────── */
.ninja-star {
  position: absolute;
  bottom: 4%;
  right: 3%;
  width: clamp(36px, 5vw, 52px);
  height: clamp(36px, 5vw, 52px);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.3s;
}
.ninja-star:hover { transform: rotate(45deg) scale(1.1); }
.ninja-star:active { transform: rotate(90deg) scale(0.95); }

.star-h, .star-v, .star-d1, .star-d2 {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 55%;
  height: 28%;
  background: #ff4500;
  border: 1.5px solid #cc3300;
  transform-origin: center;
  border-radius: 3px;
}
.star-h  { transform: translate(-50%, -50%) rotate(0deg); }
.star-v  { transform: translate(-50%, -50%) rotate(90deg); }
.star-d1 { transform: translate(-50%, -50%) rotate(45deg); }
.star-d2 { transform: translate(-50%, -50%) rotate(135deg); }

.star-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30%;
  height: 30%;
  background: #ff6600;
  border: 1.5px solid #cc3300;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.share-toast {
  position: absolute;
  bottom: 12%;
  right: 2%;
  background: #ffff00;
  color: #000;
  font-family: 'VT323', monospace;
  font-size: 1rem;
  padding: 3px 10px;
  border: 2px solid #ff00ff;
  pointer-events: none;
}
.share-toast.hidden { display: none; }

/* ─── Error banner ──────────────────────────────────────── */
.error-banner {
  background: #ff0066;
  color: #ffff00;
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  text-align: center;
  padding: 8px;
  margin-top: 8px;
  border: 2px solid #ffff00;
}
.error-banner.hidden { display: none; }

/* ─── Marquee link ──────────────────────────────────────── */
.marquee-link {
  color: #00ffff;
  text-decoration: none;
  font-weight: bold;
}
.marquee-link:hover { text-decoration: underline; }

/* ─── Toasts ────────────────────────────────────────────── */
.guestbook-toast {
  position: fixed;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fffde7;
  border: 2px solid #1a1a5e;
  border-radius: 4px;
  font-family: 'Caveat', cursive;
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  color: #1a1a5e;
  padding: 14px 28px;
  z-index: 1000;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.9s ease;
  box-shadow: 3px 3px 0 rgba(26,26,94,0.15);
  white-space: nowrap;
}
.guestbook-toast.hidden { display: none; }
.guestbook-toast.fading { opacity: 0; }

/* ─── Contact section ───────────────────────────────────── */
.contact-section {
  max-width: 1000px;
  margin: 24px auto 0;
  padding: 0 12px 40px;
}

.contact-inner {
  background: rgba(255,255,255,0.05);
  border: 3px solid #ff00ff;
  box-shadow: 0 0 20px rgba(255,0,255,0.3);
  padding: 28px 32px;
}

.contact-heading {
  font-family: 'VT323', monospace;
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: #ffff00;
  text-shadow: 0 0 10px #ffff00;
  margin-bottom: 6px;
  font-weight: normal;
}

.contact-sub {
  font-family: 'Caveat', cursive;
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  color: #00ffff;
  margin-bottom: 18px;
  font-style: italic;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-field {
  background: rgba(0,0,0,0.4);
  border: 1px solid #ff00ff;
  color: #fff;
  font-family: 'Caveat', cursive;
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  padding: 8px 12px;
  outline: none;
  width: 100%;
}
.contact-field:focus { border-color: #00ffff; }
.contact-field::placeholder { color: rgba(255,255,255,0.4); }

.contact-msg { resize: vertical; }

.contact-submit {
  align-self: flex-start;
  background: #ff00ff;
  color: #ffff00;
  border: 2px solid #ffff00;
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  padding: 6px 24px;
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: background 0.15s;
}
.contact-submit:hover { background: #cc00cc; }

/* ─── Cursor canvas (injected by JS) ────────────────────── */
#cursor-canvas {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
}

/* ─── Mobile — stack content below image ───────────────── */
@media (max-width: 700px) {
  body { cursor: auto; }

  .left-page, .right-page, .ninja-star, .share-toast { display: none; }

  .mobile-content {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .mobile-panel {
    background: #fffde7;
    border: 2px solid #1a1a5e;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mobile-panel + .mobile-panel { border-top: none; }

  .mobile-heading {
    font-family: 'Caveat Brush', cursive;
    font-size: 1.5rem;
    color: #1a1a7e;
  }

  .mobile-sub {
    font-family: 'Caveat', cursive;
    font-size: 0.9rem;
    color: #555599;
    font-style: italic;
  }

  .contact-inner { padding: 20px 16px; }
  .scene { margin: 8px auto; padding: 0 6px; }
}

@media (min-width: 701px) {
  .mobile-content { display: none; }
  /* No vertical room between guestbook list and input — hide subtitle on desktop */
  .guestbook-subtitle { display: none; }
}
