@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,500;1,9..144,600&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #0d0c11;             /* near-black, faint lavender tint */
  --surface: #16141b;
  --surface-raised: #241f2e;  /* dark lavender-tinted shade — used for shading/hover surfaces */
  --border: #322c3d;
  --text: #f1eff3;
  --muted: #918c99;
  --accent: #9a84cf;          /* same lavender family, brightened for contrast on dark */
  --accent-dim: #b6a3dd;
  --danger: #c1615c;          /* muted red, only for destructive/lockdown actions */
  --on-accent: #16141b;       /* text color used on top of the accent color */
  --radius: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, .display {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

.mono { font-family: 'IBM Plex Mono', monospace; }

a { color: var(--accent-dim); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.wrap-wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

/* ---------- eyebrow label — headline-style, deliberately uppercase ---------- */
.reel-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.reel-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

/* ---------- announcement banner ---------- */
.announcement {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #241f2e, #2c2437);
  border: 1px solid #3c3350;
  color: var(--text);
  padding: 14px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 24px;
  box-shadow: 0 2px 14px rgba(154, 132, 207, 0.18);
  opacity: 0;
  transform: translateY(-6px);
  max-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease, padding 0.3s ease, border-width 0.3s ease, margin 0.3s ease;
}
.announcement.visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 80px;
  padding-top: 14px;
  padding-bottom: 14px;
  border-width: 1px;
}
.announcement-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent-dim);
}

/* ---------- gate / pin form ---------- */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
  text-align: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.gate-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.gate h1 { font-size: 30px; }
.gate p.sub { color: var(--muted); margin-top: 6px; font-size: 14px; }

.pin-input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 22px;
  letter-spacing: 0.2em;
  text-align: center;
  padding: 16px 18px;
  border-radius: var(--radius);
  width: 240px;
}
.pin-input:focus { border-color: var(--accent); }

.btn {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
  padding: 12px 22px;
  border-radius: var(--radius);
  cursor: pointer;
  text-transform: lowercase;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 7px 12px; font-size: 12px; }

.error-msg {
  color: var(--danger);
  font-size: 13px;
  font-family: 'IBM Plex Mono', monospace;
}
.locked-msg {
  color: var(--danger);
  font-size: 13px;
  font-family: 'IBM Plex Mono', monospace;
  max-width: 320px;
}

/* ---------- home / landing ---------- */
.home-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.home-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(480px circle at 25% 20%, rgba(154,132,207,0.20), transparent 60%),
    radial-gradient(560px circle at 78% 75%, rgba(182,163,221,0.16), transparent 60%),
    radial-gradient(400px circle at 50% 95%, rgba(154,132,207,0.12), transparent 60%);
  animation: driftGlow 16s ease-in-out infinite alternate;
}
@keyframes driftGlow {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-2%, 2%) scale(1.05); }
}
.home-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.home-hero h1 {
  font-size: 52px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text), var(--accent-dim));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.home-hero .sub { color: var(--muted); max-width: 420px; font-size: 15px; }

/* ---------- retro / scenecore layer (entry + home screens only) ---------- */
.starfield {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.starfield .star {
  position: absolute;
  border-radius: 50%;
  background: #e9dcff;
  box-shadow: 0 0 6px 1px rgba(233, 220, 255, 0.8);
  animation: twinkle ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

.cursor-sparkle {
  position: fixed;
  z-index: 9999;
  border-radius: 50%;
  pointer-events: none;
  animation: sparkleFloat 0.7s ease-out forwards;
}
@keyframes sparkleFloat {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2); }
}

.shimmer-text {
  background: linear-gradient(100deg, var(--text) 40%, #fff 50%, var(--accent-dim) 52%, var(--text) 62%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmerSweep 4.5s ease-in-out infinite;
}
@keyframes shimmerSweep {
  0% { background-position: 200% 0; }
  60%, 100% { background-position: -50% 0; }
}

.retro-marquee {
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
  padding: 8px 0;
  background: var(--surface-raised);
  border-radius: 999px;
}
.retro-marquee-track {
  display: inline-block;
  white-space: nowrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dim);
  animation: marqueeScroll 14s linear infinite;
  padding-left: 100%;
}
@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

.y2k-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dim);
  border: 1px solid var(--accent);
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-raised);
  animation: badgeBlink 1.8s steps(1) infinite;
}
@keyframes badgeBlink {
  0%, 49% { box-shadow: 0 0 0 rgba(154,132,207,0); }
  50%, 100% { box-shadow: 0 0 12px rgba(154,132,207,0.5); }
}

.hit-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}
.hit-counter-digits {
  background: var(--surface-raised);
  border: 1px solid var(--accent);
  color: var(--accent-dim);
  text-shadow: 0 0 8px rgba(154, 132, 207, 0.55);
  letter-spacing: 0.15em;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 13px;
}

/* ---------- library ---------- */
.library-head { margin-bottom: 32px; display: flex; justify-content: space-between; align-items: baseline; }
.library-head h1 { font-size: 30px; }

.track-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.track-card .art {
  width: 56px; height: 56px;
  background: var(--surface-raised);
  border-radius: var(--radius);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
}
.track-card .meta { flex: 1; min-width: 0; }
.track-card .title { font-family: 'Fraunces', serif; font-size: 18px; }
.track-card .sub { color: var(--muted); font-size: 12.5px; font-family: 'IBM Plex Mono', monospace; margin-top: 3px; text-transform: lowercase; }
.track-card .likes { color: var(--muted); font-size: 12px; font-family: 'IBM Plex Mono', monospace; white-space: nowrap; }

/* ---------- song / player page ---------- */
.song-head { display: flex; gap: 20px; align-items: flex-end; margin-bottom: 28px; }
.song-head .art {
  width: 120px; height: 120px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.song-head h1 { font-size: 34px; }
.song-head .artist { color: var(--muted); margin-top: 4px; text-transform: lowercase; }

.tape-facts {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: center;
  margin: 22px 0 8px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.tape-facts .fact { font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
.tape-facts .fact .k { color: var(--muted); display: block; letter-spacing: 0.1em; text-transform: uppercase; font-size: 10px; margin-bottom: 3px; }

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  margin-left: auto;
  transition: color 0.15s, border-color 0.15s;
}
.like-btn.liked { color: var(--accent-dim); border-color: var(--accent); }
.like-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.player {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
}
.player-controls { display: flex; align-items: center; gap: 16px; }
.play-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--on-accent);
}
.time-display { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--muted); white-space: nowrap; }

.waveform-wrap { position: relative; flex: 1; cursor: pointer; touch-action: none; user-select: none; }
canvas#waveform { width: 100%; height: 64px; display: block; }

.now-comment {
  min-height: 34px;
  margin-top: 14px;
  padding: 8px 0 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.now-comment.visible { opacity: 1; }
.now-comment .who { color: var(--accent-dim); font-family: 'IBM Plex Mono', monospace; font-size: 11px; margin-right: 8px; }

.volume-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.volume-row svg { color: var(--muted); width: 15px; height: 15px; flex-shrink: 0; }
.volume-row input[type=range] {
  -webkit-appearance: none;
  width: 100px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
.volume-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.volume-row input[type=range]::-moz-range-thumb {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.stem-toggle { display: flex; gap: 8px; margin-top: 16px; }
.stem-toggle button {
  flex: 1;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
}
.stem-toggle button.active { color: var(--accent-dim); border-color: var(--accent); }

.section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 36px 0 12px;
}

.lyrics {
  white-space: pre-wrap;
  font-family: 'Fraunces', serif;
  font-size: 16px;
  line-height: 1.75;
  color: #d6d2dc;
}

/* ---------- comments ---------- */
.comment-form {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}
.comment-form input[type=text] {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px; /* iOS zooms the page on focus for anything smaller, which feels like typing is broken */
}
.comment-form input[name=username] { width: 140px; }
.comment-form input[name=body] { flex: 1; min-width: 200px; }
.comment-form .pin-time-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--accent-dim);
  background: var(--surface-raised);
  border: 1px solid var(--accent);
  padding: 9px 12px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
}
.comment-form .pin-time-chip:hover { background: rgba(154, 132, 207, 0.18); }
.comment-form .btn { border-radius: 999px; }
@media (max-width: 480px) {
  .comment-form input[name=username],
  .comment-form input[name=body] {
    width: 100%;
    min-width: 0;
  }
  .comment-form .pin-time-chip,
  .comment-form .btn { flex: 1; }
}

.comment {
  display: flex;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.15s, transform 0.15s;
}
.comment:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}
.comment .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.comment .comment-main { flex: 1; min-width: 0; }
.comment .comment-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment .who { font-weight: 600; font-size: 13px; }
.comment .stamp {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  color: var(--accent-dim);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.comment .stamp:hover { border-color: var(--accent); }
.comment .body { font-size: 13.5px; color: #d6d2dc; margin-top: 4px; line-height: 1.5; }

/* ---------- note popup (shown once, when a one-time link carries a note) ---------- */
.note-overlay {
  position: fixed; inset: 0;
  background: rgba(10,9,13,0.78);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.note-overlay.visible { opacity: 1; pointer-events: auto; }
.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s ease;
}
.note-overlay.visible .note-card { transform: translateY(0) scale(1); }
.note-card .from { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px; }
.note-card .msg { font-family: 'Fraunces', serif; font-size: 19px; line-height: 1.5; margin-bottom: 20px; color: var(--text); }

/* ---------- admin ---------- */
.admin-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.admin-nav .links { display: flex; gap: 14px; align-items: center; }
.lockdown-banner {
  background: var(--danger);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  margin-bottom: 24px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 24px;
}
.panel h3 { text-transform: lowercase; }
.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-family: 'IBM Plex Mono', monospace; }
.field input[type=text], .field input[type=number], .field textarea, .field input[type=file] {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
}
.field textarea { min-height: 100px; font-family: 'IBM Plex Mono', monospace; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: break-word; }
th { color: var(--muted); font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; }
.copy-link { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; background: var(--bg); padding: 6px 8px; border-radius: var(--radius); border: 1px solid var(--border); word-break: break-all; display: block; }
.badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  display: inline-block;
}
.badge.unused { background: rgba(154,132,207,0.16); color: var(--accent-dim); }
.badge.used { background: rgba(145,140,153,0.16); color: var(--muted); }
.badge.locked { background: rgba(193,97,92,0.16); color: var(--danger); }

.expired-wrap { text-align: center; }

/* ---------- timeline ---------- */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
}
.post-meta { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.post-author { color: var(--accent-dim); font-weight: 600; }
.post-body { font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; margin-bottom: 12px; }

.post-media-grid {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  border-radius: 10px;
  overflow: hidden;
}
.post-media-grid.count-1 { grid-template-columns: 1fr; }
.post-media-grid.count-2 { grid-template-columns: 1fr 1fr; }
.post-media-grid.count-3 { grid-template-columns: 1fr 1fr; }
.post-media-grid.count-3 .post-image:first-child { grid-row: span 2; }
.post-media-grid.count-4 { grid-template-columns: 1fr 1fr; }
.post-image {
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-raised);
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.post-media-grid.count-1 .post-image { aspect-ratio: 16 / 10; }
.post-image:hover { filter: brightness(1.08); }

.post-video-wrap, .post-audio-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--surface-raised);
}
.post-video-wrap video { width: 100%; display: block; max-height: 480px; background: #000; }
.post-audio-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.post-audio-icon { width: 22px; height: 22px; color: var(--accent-dim); flex-shrink: 0; }
.post-audio-wrap audio { width: 100%; }

.post-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--accent-dim);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  margin: 0 6px 12px 0;
}
.post-file-chip:hover { border-color: var(--accent); text-decoration: none; }

.post-like-btn { margin-left: 0; }

.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(10,9,13,0.9);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 24px;
}
.lightbox-overlay.visible { opacity: 1; pointer-events: auto; }
.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  cursor: zoom-out;
}

/* ---------- drag-and-drop / paste file upload ---------- */
.dropzone {
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 14px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent-dim); }
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(154, 132, 207, 0.08);
}
.dropzone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.dropzone-hint {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  overflow-wrap: break-word;
}
.dropzone-hint.has-files { color: var(--accent-dim); }

/* ---------- emoji picker (retro forum smiley-box style) ---------- */
.emoji-picker-wrap { position: relative; }
.emoji-toggle-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: transform 0.15s, border-color 0.15s;
}
.emoji-toggle-btn img { width: 18px; height: 18px; }
.emoji-toggle-btn:hover { transform: scale(1.1); border-color: var(--accent); }

.emoji-panel {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  z-index: 50;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  width: 280px;
  max-width: 80vw;
  max-height: 260px;
  overflow-y: auto;
  animation: emojiPop 0.15s ease-out;
}
.emoji-panel.open { display: grid; }
@keyframes emojiPop {
  from { opacity: 0; transform: translateY(4px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.emoji-option {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 18px;
  padding: 4px;
  cursor: pointer;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emoji-option img { width: 20px; height: 20px; }
.emoji-option:hover { background: var(--surface-raised); border-color: var(--border); }

.inline-emoji {
  width: 18px;
  height: 18px;
  vertical-align: -4px;
  margin: 0 1px;
}
.emoji-picker-wrap textarea { padding-bottom: 40px; }
.comment-form .emoji-picker-wrap { flex: 1; min-width: 200px; }
.comment-form .emoji-picker-wrap input[name=body] { width: 100%; padding-right: 42px; }
.comment-form .emoji-picker-wrap .emoji-toggle-btn { bottom: 5px; }
@media (max-width: 480px) {
  .comment-form .emoji-picker-wrap { width: 100%; min-width: 0; }
}

/* generic lowercase for UI chrome text — never applied to user-generated content */
.ui-label { text-transform: lowercase; }

/* ---------- display names (distinguishes display name from login name) ---------- */
.cursive-name {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.05em;
  color: var(--accent-dim);
}
h1.cursive-name { font-size: 36px; }

/* ---------- persistent corner admin link ---------- */
.admin-corner-link {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: lowercase;
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.admin-corner-link:hover { border-color: var(--accent); text-decoration: none; }

/* ---------- shared nav row + form layout helpers ---------- */
.nav-links { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.stack-form { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 340px; }
.stack-form .field { text-align: left; }

/* ---------- entry screen forum/library choice ---------- */
.entry-choice { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------- profile page ---------- */
.profile-banner {
  height: 160px;
  border-radius: 14px;
  background: var(--surface-raised);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  position: relative;
  margin-top: 18px;
}
.profile-avatar {
  position: absolute;
  bottom: -30px;
  left: 24px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 3px solid var(--bg);
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 26px;
  color: var(--on-accent);
}
.profile-header { margin-top: 46px; margin-bottom: 8px; }
.profile-username { color: var(--muted); font-size: 12px; margin-top: 2px; }

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--text);
}
.badge-chip img { width: 16px; height: 16px; border-radius: 3px; }

/* ---------- timeline post composer ---------- */
.post-composer { margin-bottom: 20px; }
.post-composer textarea { min-height: 70px; }

/* ---------- CMD-style deploy terminal ---------- */
.cmd-terminal {
  background: #050506;
  color: #b6ffcf;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 14px;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* =========================================================
   MOBILE RESPONSIVE PASS
   ========================================================= */
@media (max-width: 640px) {
  .wrap, .wrap-wide { padding: 32px 16px 72px; }

  .home-hero h1, .gate h1.shimmer-text { font-size: 34px; }
  .home-hero .sub { font-size: 14px; }
  h1.cursive-name { font-size: 30px; }

  .library-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .admin-nav { flex-direction: column; align-items: flex-start; gap: 12px; }
  .admin-nav .links { flex-wrap: wrap; }

  .song-head { flex-direction: column; align-items: flex-start; }
  .song-head .art { width: 90px; height: 90px; }
  .song-head > div { width: 100%; flex-direction: column; align-items: flex-start !important; gap: 10px; }
  .like-btn { margin-left: 0; }

  .tape-facts { gap: 14px; }

  .player-controls { flex-wrap: wrap; }
  .waveform-wrap { flex-basis: 100%; order: 3; }
  .time-display { order: 2; }

  .grid-2 { grid-template-columns: 1fr; }

  table { table-layout: auto; }
  .panel table { display: block; overflow-x: auto; white-space: nowrap; }
  .panel table td, .panel table th { white-space: normal; }

  .post-media-grid.count-2, .post-media-grid.count-3, .post-media-grid.count-4 {
    grid-template-columns: 1fr 1fr;
  }

  .admin-corner-link { top: 10px; right: 10px; font-size: 10px; padding: 6px 10px; }

  .profile-banner { height: 110px; }
  .profile-avatar { width: 60px; height: 60px; left: 16px; bottom: -24px; font-size: 20px; }
  .profile-header { margin-top: 36px; }

  .entry-choice { flex-direction: column; width: 100%; }
  .entry-choice a, .entry-choice button { width: 100%; }

  .comment-form { flex-direction: column; }
  .emoji-panel { right: auto; left: 0; width: 240px; grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 400px) {
  .y2k-badge { font-size: 9px; padding: 4px 9px; }
  .hit-counter { flex-direction: column; gap: 4px; }
}
