/* ============================================================
   VINYL CALENDAR — Style Sheet
   Dark, moody, premium aesthetic inspired by vinyl & journals
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────────── */
:root {
  --bg-base: #0e0d0b;
  --bg-surface: #151412;
  --bg-card: #1c1a17;
  --bg-hover: #211f1b;
  --bg-modal: #181614;

  --ink-primary: #e8e2d9;
  --ink-secondary: #9b9287;
  --ink-muted: #5c5650;
  --ink-faint: #2e2c29;

  --accent-warm: #c8a97e;
  --accent-glow: #d4b896;
  --accent-amber: #b8860b;

  --spotify-green: #1DB954;
  --apple-pink: #fc3c44;
  --youtube-red: #FF0000;

  --vinyl-black: #0a0908;
  --vinyl-groove: #1a1816;
  --vinyl-shine: #2d2a25;

  --border-subtle: rgba(200, 169, 126, 0.08);
  --border-mid: rgba(200, 169, 126, 0.15);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-round: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.65);

  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'DM Mono', monospace;

  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-base);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Grain overlay ────────────────────────────────────────────── */
.grain-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  animation: grainShift 0.8s steps(1) infinite;
}

@keyframes grainShift {

  0%,
  100% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(-2px, 1px);
  }

  50% {
    transform: translate(1px, -1px);
  }

  75% {
    transform: translate(-1px, 2px);
  }
}

/* ══════════════════════════════════════════════════════════════ */
/* AUTH SCREEN                                                    */
/* ══════════════════════════════════════════════════════════════ */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  overflow: hidden;
}

/* big decorative vinyl behind auth card */
.auth-bg-vinyl {
  position: absolute;
  right: -10vw;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.08;
  pointer-events: none;
}

.auth-vinyl-record {
  width: min(70vw, 600px);
  height: min(70vw, 600px);
  border-radius: 50%;
  background: var(--vinyl-black);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ambientSpin 30s linear infinite;
}

.auth-vinyl-grooves {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at center,
      var(--vinyl-groove) 0px,
      var(--vinyl-black) 2px,
      var(--vinyl-groove) 4px);
}

.auth-vinyl-label {
  width: 36%;
  height: 36%;
  border-radius: 50%;
  background: var(--accent-warm);
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-vinyl-hole {
  width: 8%;
  height: 8%;
  border-radius: 50%;
  background: var(--bg-base);
}

/* Auth card */
.auth-card {
  position: relative;
  z-index: 10;
  max-width: 440px;
  width: 100%;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.auth-logo-icon {
  font-size: 1.6rem;
  color: var(--accent-warm);
  animation: logoSpin 12s linear infinite;
}

.auth-logo-text {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--ink-primary);
  letter-spacing: -0.02em;
}

.auth-tagline {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: 1rem;
}

.auth-headline {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 3.6rem);
  line-height: 1.1;
  color: var(--ink-primary);
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.auth-headline em {
  color: var(--accent-warm);
  font-style: italic;
}

.auth-sub {
  font-size: 0.9rem;
  color: var(--ink-secondary);
  line-height: 1.6;
  margin-bottom: 2.5rem;
  font-weight: 300;
  max-width: 340px;
}

.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.auth-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s var(--ease-smooth);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.auth-btn-text {
  flex: 1;
}

.auth-btn-arrow {
  margin-left: auto;
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.2s var(--ease-smooth);
  font-size: 1rem;
  color: var(--accent-warm);
}

.auth-btn:hover .auth-btn-arrow {
  opacity: 1;
  transform: translateX(0);
}

.auth-btn:hover {
  transform: translateX(5px);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
}

/* Loading state */
.auth-btn-loading {
  opacity: 0.7;
  pointer-events: none;
  cursor: not-allowed !important;
}

.auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-warm);
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes authSpin {
  to {
    transform: rotate(360deg);
  }
}

.auth-btn-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.auth-spotify .auth-btn-icon {
  color: var(--spotify-green);
}

.auth-apple .auth-btn-icon {
  color: var(--apple-pink);
}

.auth-youtube .auth-btn-icon {
  color: var(--youtube-red);
}

.auth-spotify:hover {
  border-color: rgba(29, 185, 84, 0.3);
  box-shadow: 0 0 0 1px rgba(29, 185, 84, 0.1);
}

.auth-apple:hover {
  border-color: rgba(252, 60, 68, 0.3);
  box-shadow: 0 0 0 1px rgba(252, 60, 68, 0.1);
}

.auth-youtube:hover {
  border-color: rgba(255, 0, 0, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 0, 0, 0.1);
}

.auth-skip {
  margin-top: 0.5rem;
}

.auth-skip-btn {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
  padding: 0;
}

.auth-skip-btn:hover {
  color: var(--ink-secondary);
}

/* ── User Pill in header ────────────────────────────────────── */
.user-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-round);
  padding: 0.3rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-secondary);
  letter-spacing: 0.06em;
}

.user-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-muted);
}

.user-pill-dot.spotify {
  background: var(--spotify-green);
}

.user-pill-dot.apple {
  background: var(--apple-pink);
}

.user-pill-dot.youtube {
  background: var(--youtube-red);
}

.user-pill-logout {
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 0.6rem;
  padding: 0;
  margin-left: 0.2rem;
  transition: color 0.2s;
  line-height: 1;
}

.user-pill-logout:hover {
  color: var(--ink-primary);
}

/* ── Header ───────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14, 13, 11, 0.85);
  backdrop-filter: blur(20px) saturate(1.3);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}

.logo-icon {
  font-size: 1.4rem;
  color: var(--accent-warm);
  animation: logoSpin 12s linear infinite;
}

@keyframes logoSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--ink-primary);
  letter-spacing: -0.02em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-btn {
  background: none;
  border: 1px solid var(--border-mid);
  color: var(--ink-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-round);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-smooth);
}

.nav-btn:hover {
  border-color: var(--accent-warm);
  color: var(--accent-warm);
  background: rgba(200, 169, 126, 0.08);
}

.month-display {
  text-align: center;
  min-width: 140px;
}

.month-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--ink-primary);
  letter-spacing: -0.01em;
}

.year-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-secondary);
  margin-left: 0.5rem;
  letter-spacing: 0.05em;
}

/* ── Calendar Book ────────────────────────────────────────────── */
.calendar-container {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.calendar-book {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 680px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-subtle);
  background: var(--bg-card);
  position: relative;
}

/* Spine */
.calendar-book::after {
  content: '';
  position: absolute;
  left: 260px;
  top: 5%;
  bottom: 5%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border-mid) 20%, var(--border-mid) 80%, transparent);
  pointer-events: none;
}

/* ── Book Left Page ───────────────────────────────────────────── */
.book-left {
  background: linear-gradient(160deg, #17150f 0%, #121008 100%);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
}

.book-left-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 2rem;
}

.month-large-display {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.month-number {
  font-family: var(--font-serif);
  font-size: 6rem;
  line-height: 1;
  color: var(--accent-warm);
  opacity: 0.9;
  letter-spacing: -0.04em;
}

.month-name-vertical {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-muted);
  writing-mode: vertical-rl;
  padding-top: 0.5rem;
}

.side-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--ink-primary);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Ambient vinyl on left */
.ambient-vinyl-display {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding-bottom: 0.5rem;
}

.ambient-vinyl {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--vinyl-black);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 8px 24px rgba(0, 0, 0, 0.6);
  animation: ambientSpin 20s linear infinite;
}

@keyframes ambientSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.ambient-grooves {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at center,
      var(--vinyl-groove) 0px,
      var(--vinyl-black) 1px,
      var(--vinyl-groove) 3px);
}

.ambient-label {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-warm);
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ambient-hole {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bg-base);
}

.ambient-text {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.8;
}

/* ── Book Right Page (Calendar Grid) ─────────────────────────── */
.book-right {
  background: var(--bg-surface);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 0.5rem;
}

.weekday {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
  padding: 0.5rem 0;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  flex: 1;
  gap: 2px;
}

/* ── Day Cell ─────────────────────────────────────────────────── */
.day-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  padding: 0.4rem;
  cursor: pointer;
  position: relative;
  transition: background 0.2s var(--ease-smooth), transform 0.15s var(--ease-smooth);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  border: 1px solid transparent;
}

.day-cell.other-month {
  opacity: 0.2;
  pointer-events: none;
}

.day-cell:not(.other-month):hover {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
}

.day-cell:not(.other-month):hover .day-add-hint {
  opacity: 1;
}

.day-cell.today {
  border-color: var(--border-mid) !important;
  background: rgba(200, 169, 126, 0.06);
}

.day-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
  line-height: 1;
  z-index: 1;
  position: relative;
}

.day-cell.today .day-number {
  color: var(--accent-warm);
  font-weight: 500;
}

.day-add-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 1.2rem;
  color: var(--ink-muted);
}

/* ── Mini Vinyl on Day Cell ───────────────────────────────────── */
.mini-vinyl-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1rem;
}

.mini-vinyl {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--vinyl-black);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s;
  animation: miniSpinPause 4s ease-in-out infinite;
}

/* Clip indicator dot on mini vinyl */
.mini-vinyl.has-clip::after {
  content: '✂';
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-warm);
  font-size: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 0 0 2px var(--bg-base);
}

@keyframes miniSpinPause {

  0%,
  60% {
    transform: rotate(0deg);
  }

  80% {
    transform: rotate(20deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

.day-cell:hover .mini-vinyl {
  animation: none;
  transform: scale(1.12) rotate(15deg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(200, 169, 126, 0.2);
}

.mini-grooves {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at center,
      var(--vinyl-groove) 0px,
      var(--vinyl-black) 1px,
      var(--vinyl-groove) 2.5px);
}

.mini-label {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.mini-hole {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--bg-base);
}

.mini-title {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--ink-secondary);
  position: absolute;
  bottom: 0.2rem;
  left: 0;
  right: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.2rem;
  z-index: 1;
  line-height: 1.2;
}

/* ── Modals ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-smooth);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-panel {
  background: var(--bg-modal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 440px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s var(--ease-bounce);
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faint) transparent;
}

.modal-overlay.open .modal-panel {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--ink-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-round);
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  border-color: var(--ink-secondary);
  color: var(--ink-primary);
}

.modal-header {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-date-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-warm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--ink-primary);
  letter-spacing: -0.02em;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--ink-secondary);
  font-weight: 300;
}

/* ── Vinyl preview in add modal ───────────────────────────────── */
.modal-vinyl-preview {
  display: flex;
  justify-content: center;
  margin: 1rem 0 1.5rem;
}

.vinyl-preview-record {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--vinyl-black);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 12px 32px rgba(0, 0, 0, 0.7);
}

.spinning-idle {
  animation: slowSpin 8s linear infinite;
}

@keyframes slowSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.vp-grooves {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at center,
      var(--vinyl-groove) 0px,
      var(--vinyl-black) 1.5px,
      var(--vinyl-groove) 3px);
}

.vp-label {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-warm);
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s var(--ease-smooth);
}

.vp-hole {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bg-base);
}

/* ── Form inputs ──────────────────────────────────────────────── */
.input-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.optional {
  color: var(--ink-muted);
  font-size: 0.6rem;
  text-transform: none;
  letter-spacing: 0;
}

.text-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  resize: none;
}

.text-input::placeholder {
  color: var(--ink-muted);
}

.text-input:focus {
  border-color: var(--accent-warm);
  background: rgba(200, 169, 126, 0.04);
}

.textarea {
  min-height: 70px;
}

/* ── Upload tabs ──────────────────────────────────────────────── */
.upload-section {
  margin-bottom: 1.2rem;
}

.upload-tabs {
  display: flex;
  gap: 0;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.upload-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.5rem 0.2rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tab-icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.upload-tab.active {
  background: var(--accent-warm);
  color: var(--bg-base);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.file-drop-zone {
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
  border-color: var(--accent-warm);
  background: rgba(200, 169, 126, 0.05);
}

.drop-icon {
  font-size: 1.6rem;
  color: var(--ink-muted);
}

.drop-text {
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

.drop-subtext {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
}

.file-selected {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(200, 169, 126, 0.08);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
}

.file-icon {
  color: var(--accent-warm);
  font-size: 0.9rem;
}

.file-name {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-remove {
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.file-remove:hover {
  color: var(--ink-primary);
}

.link-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 0.85rem;
  transition: border-color 0.2s;
  margin-bottom: 0.5rem;
}

.link-input-wrap:focus-within {
  border-color: var(--accent-warm);
}

.link-icon {
  color: var(--accent-warm);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.link-input {
  background: none;
  border: none;
  padding: 0.65rem 0;
}

.link-note {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════ */
/* CLIP / TIMEFRAME SELECTOR                                      */
/* ══════════════════════════════════════════════════════════════ */
.clip-section {
  margin-top: 0.85rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.clip-section .input-label {
  display: block;
  margin-bottom: 0.75rem;
}

/* Waveform + range handles (for file clips) */
.clip-range-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.clip-waveform {
  position: relative;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
}

.clip-waveform-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
}

/* Generated waveform bars via JS */
.waveform-bar {
  flex: 1;
  border-radius: 1px;
  background: var(--ink-faint);
  transition: background 0.2s;
}

.waveform-bar.in-clip {
  background: var(--accent-warm);
  opacity: 0.7;
}

.clip-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(200, 169, 126, 0.12);
  border-left: 2px solid var(--accent-warm);
  border-right: 2px solid var(--accent-warm);
  pointer-events: none;
  transition: left 0.05s, width 0.05s;
}

/* Range sliders overlay */
.clip-handle {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  margin: 0;
  padding: 0;
}

.clip-handle::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  width: 20px;
  height: 48px;
}

.clip-handle::-moz-range-thumb {
  pointer-events: auto;
  width: 20px;
  height: 48px;
  border: none;
  background: none;
}

.clip-handle-start {
  z-index: 3;
}

.clip-handle-end {
  z-index: 2;
}

.clip-time-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-secondary);
}

.clip-duration-badge {
  background: rgba(200, 169, 126, 0.12);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-round);
  padding: 0.15rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--accent-warm);
  letter-spacing: 0.04em;
}

/* Manual mm:ss inputs (for external links) */
.clip-manual-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.clip-manual-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.clip-manual-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.clip-manual-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.clip-manual-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  transition: border-color 0.2s;
}

.clip-manual-inputs:focus-within {
  border-color: var(--accent-warm);
}

.clip-num-input {
  background: none;
  border: none;
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  width: 32px;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.clip-num-input::-webkit-outer-spin-button,
.clip-num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.clip-colon {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1;
}

.clip-arrow {
  color: var(--ink-muted);
  font-size: 0.85rem;
  padding: 0 0.25rem;
  margin-top: 1.5rem;
}

.clip-duration-info {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-warm);
  letter-spacing: 0.06em;
  text-align: center;
  padding: 0.3rem 0.75rem;
  background: rgba(200, 169, 126, 0.06);
  border-radius: var(--radius-round);
  border: 1px solid var(--border-subtle);
}

/* ── Color swatches ───────────────────────────────────────────── */
.color-section {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.color-swatches {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s var(--ease-bounce);
  padding: 0;
}

.swatch:hover {
  transform: scale(1.15);
}

.swatch.active {
  border-color: var(--ink-primary);
  box-shadow: 0 0 0 2px var(--bg-modal), 0 0 0 4px var(--ink-secondary);
  transform: scale(1.1);
}

/* ── Save button ──────────────────────────────────────────────── */
.save-btn {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: var(--accent-warm);
  color: var(--bg-base);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  letter-spacing: 0.02em;
  transition: all 0.2s var(--ease-smooth);
}

.save-btn:hover {
  background: var(--accent-glow);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(200, 169, 126, 0.4);
}

.save-btn:active {
  transform: translateY(0);
}

.save-icon {
  font-size: 1rem;
  animation: saveSpin 3s linear infinite;
}

@keyframes saveSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ══════════════════════════════════════════════════════════════ */
/* PLAY MODAL                                                     */
/* ══════════════════════════════════════════════════════════════ */
.play-panel {
  max-width: 380px;
  text-align: center;
}

/* Clip badge */
.clip-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: -0.5rem auto 1rem;
  padding: 0.3rem 0.85rem;
  background: rgba(200, 169, 126, 0.1);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-round);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-warm);
  letter-spacing: 0.06em;
}

.clip-badge-icon {
  font-size: 0.7rem;
}

/* ── Player Stage ─────────────────────────────────────────────── */
.player-stage {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 1.5rem;
}

.player-record-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.player-vinyl {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--vinyl-black);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 16px 48px rgba(0, 0, 0, 0.8),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: box-shadow 0.4s var(--ease-smooth), transform 0.3s var(--ease-bounce);
}

.player-vinyl:hover {
  box-shadow:
    0 0 0 1px rgba(200, 169, 126, 0.15),
    0 20px 56px rgba(0, 0, 0, 0.85),
    0 0 30px rgba(200, 169, 126, 0.08);
}

.player-vinyl.playing {
  animation: playerSpin 2.2s linear infinite;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 20px 60px rgba(0, 0, 0, 0.9),
    0 0 40px rgba(200, 169, 126, 0.18);
  cursor: pointer;
}

/* Lift animation when stopping */
.player-vinyl.lifting {
  animation: vinylLift 0.55s var(--ease-bounce) forwards;
}

@keyframes vinylLift {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.04) translateY(-3px);
  }

  100% {
    transform: scale(1) translateY(0);
  }
}

/* Nudge when clicked but no audio */
@keyframes vinylNudge {
  0% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(4deg);
  }

  75% {
    transform: rotate(-4deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

.vinyl-nudge {
  animation: vinylNudge 0.4s var(--ease-bounce) forwards !important;
}

/* Play hint overlay on vinyl */
.vinyl-play-hint {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  transition: opacity 0.25s var(--ease-smooth), background 0.25s;
  z-index: 10;
  pointer-events: none;
}

.player-vinyl:hover .vinyl-play-hint {
  opacity: 1;
  background: rgba(0, 0, 0, 0.28);
}

.player-vinyl.playing:hover .vinyl-play-hint .vinyl-hint-icon {
  content: '⏸';
}

.vinyl-hint-icon {
  font-size: 1.8rem;
  color: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
  transition: transform 0.2s var(--ease-bounce);
}

.player-vinyl:hover .vinyl-hint-icon {
  transform: scale(1.15);
}

@keyframes playerSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.player-grooves {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at center,
      var(--vinyl-groove) 0px,
      var(--vinyl-black) 1.5px,
      var(--vinyl-groove) 3.5px);
}

.player-label {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: background 0.4s;
}

.player-hole {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-base);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.player-label-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  color: rgba(0, 0, 0, 0.5);
  text-align: center;
  padding: 0 4px;
  word-break: break-word;
  line-height: 1.2;
  z-index: 1;
}

.player-shadow {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 20px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  filter: blur(10px);
}

/* ── Tonearm ──────────────────────────────────────────────────── */
.player-arm-container {
  position: absolute;
  top: 2px;
  right: -2px;
  width: 96px;
  height: 96px;
  z-index: 10;
}

.tonearm {
  position: absolute;
  top: 0;
  right: 0;
  transform-origin: 18px 18px;
  /* Resting position — arm swung OUT to the right/up */
  transform: rotate(-40deg);
  transition: transform 0.9s cubic-bezier(0.34, 1.1, 0.64, 1);
}

/* Arm on the record */
.tonearm.playing {
  transform: rotate(-5deg);
}

.tonearm-pivot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #aaa, #3a3a3a);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: absolute;
  top: 0;
  right: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  z-index: 3;
}

.tonearm-body {
  width: 3px;
  height: 72px;
  background: linear-gradient(170deg, #aaa 0%, #666 40%, #3a3a3a 100%);
  border-radius: 2px;
  position: absolute;
  top: 9px;
  right: 7.5px;
  transform-origin: top center;
  transform: rotate(18deg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.tonearm-head {
  width: 14px;
  height: 14px;
  border: 1.5px solid #777;
  border-radius: 3px;
  position: absolute;
  bottom: -2px;
  right: 0px;
  background: radial-gradient(circle at 35% 35%, #bbb, #333);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);
  /* needle tip */
}

.tonearm-head::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5px;
  height: 6px;
  background: linear-gradient(to bottom, #ccc, #888);
  border-radius: 1px;
}

/* ── Player Info ──────────────────────────────────────────────── */
.player-info {
  margin-bottom: 1.5rem;
}

.player-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-warm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.player-title,
#playModalTitle {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--ink-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  text-align: center;
}

.player-note {
  font-size: 0.82rem;
  color: var(--ink-secondary);
  line-height: 1.6;
  min-height: 1.2rem;
}

/* ── Player Controls ──────────────────────────────────────────── */
.player-controls {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
}

.progress-wrap {
  margin-bottom: 1rem;
}

.progress-bar-bg {
  height: 3px;
  background: var(--ink-faint);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  overflow: visible;
  margin-bottom: 0.4rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-amber), var(--accent-warm));
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  right: -4px;
  top: -3px;
  width: 9px;
  height: 9px;
  background: var(--accent-warm);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(200, 169, 126, 0.6);
}

/* Clip overlay on progress bar */
.progress-clip-overlay {
  position: absolute;
  top: -3px;
  height: 9px;
  background: rgba(200, 169, 126, 0.2);
  border-left: 2px solid var(--accent-warm);
  border-right: 2px solid var(--accent-warm);
  border-radius: 2px;
  pointer-events: none;
}

.time-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-muted);
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.ctrl-btn {
  background: none;
  border: 1px solid var(--border-mid);
  color: var(--ink-secondary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-smooth);
}

.ctrl-btn:hover {
  border-color: var(--accent-warm);
  color: var(--accent-warm);
  background: rgba(200, 169, 126, 0.08);
}

.play-pause-btn {
  width: 56px;
  height: 56px;
  font-size: 1.15rem;
  background: var(--accent-warm);
  border-color: var(--accent-warm);
  color: var(--bg-base);
  transition: all 0.2s var(--ease-bounce);
}

.play-pause-btn.playing {
  background: rgba(200, 169, 126, 0.15);
  border-color: var(--accent-warm);
  color: var(--accent-warm);
}

.play-pause-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent-glow);
  color: var(--bg-base);
  box-shadow: 0 4px 20px rgba(200, 169, 126, 0.5);
  transform: scale(1.08);
}

.play-pause-btn.playing:hover {
  background: var(--accent-warm);
  color: var(--bg-base);
}

.pp-icon {
  display: inline-block;
  transition: transform 0.15s var(--ease-bounce);
}

.play-pause-btn:active .pp-icon {
  transform: scale(0.85);
}

/* ── Embedded player (Spotify / YouTube / Apple) ─────────────── */
.embedded-player-wrap {
  width: 100%;
  margin: 0.5rem 0 0.75rem;
}

.embedded-player-container {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
}

.embedded-player-container iframe,
.embedded-player-container>div {
  display: block;
  width: 100%;
  border-radius: var(--radius-md);
}

.spotify-embed-iframe,
.apple-embed-iframe {
  display: block;
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
}

/* YouTube iframe gets rounded corners */
.embedded-player-container iframe[src*="youtube"] {
  border-radius: var(--radius-md);
}

.embed-clip-note {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  text-align: center;
  padding: 0.5rem 0 0.25rem;
}

.embed-open-link-row {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.embed-open-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-round);
  border: 1px solid transparent;
  transition: all 0.2s var(--ease-smooth);
}

.embed-open-link:hover {
  color: var(--ink-secondary);
  border-color: var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
}

/* ── External link ────────────────────────────────────────────── */

.external-link-area {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.external-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-round);
  color: var(--accent-warm);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  transition: all 0.2s;
}

.external-link-btn:hover {
  background: rgba(200, 169, 126, 0.1);
  border-color: var(--accent-warm);
}

.external-link-icon-img {
  width: 13px;
  height: 13px;
}

.ext-note {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
  text-align: center;
}

/* ── Delete button ────────────────────────────────────────────── */
.delete-btn {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
  width: 100%;
  text-align: center;
  padding: 0.25rem;
}

.delete-btn:hover {
  color: #c07070;
}

/* ── Toast ────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-round);
  color: var(--ink-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.6rem 1.2rem;
  z-index: 2000;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s var(--ease-bounce);
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 700px) {
  .calendar-book {
    grid-template-columns: 1fr;
  }

  .book-left {
    display: none;
  }

  .book-right {
    border-radius: var(--radius-xl);
  }

  .calendar-book::after {
    display: none;
  }

  .auth-bg-vinyl {
    display: none;
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 0 1rem;
  }

  .calendar-container {
    padding: 0 0.75rem;
    margin: 1.5rem auto;
  }

  .book-right {
    padding: 1rem 0.75rem;
  }

  .mini-vinyl {
    width: 40px;
    height: 40px;
  }

  .mini-label {
    width: 16px;
    height: 16px;
  }

  .upload-tab {
    font-size: 0.55rem;
  }
}

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--ink-faint);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ink-muted);
}

/* ── Selection ────────────────────────────────────────────────── */
::selection {
  background: rgba(200, 169, 126, 0.25);
  color: var(--ink-primary);
}

/* ── Site Footer ─────────────────────────────────────────────── */
.site-footer {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 2rem;
}

.footer-github {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-round);
  transition: all 0.3s var(--ease-smooth);
  background: rgba(255, 255, 255, 0.02);
}

.footer-github:hover {
  color: var(--ink-secondary);
  border-color: var(--border-mid);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.footer-gh-icon {
  opacity: 0.5;
  transition: opacity 0.3s;
}

.footer-github:hover .footer-gh-icon {
  opacity: 0.8;
}

.footer-star {
  color: var(--accent-warm);
  opacity: 0.6;
  transition: opacity 0.3s;
  margin-left: 2px;
}

.footer-github:hover .footer-star {
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════════ */
/* RESPONSIVE DESIGN                                              */
/* ══════════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 900px) ──────────────────────────────────────── */
@media (max-width: 900px) {
  .calendar-book {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .book-left {
    display: none;
  }

  .calendar-book::after {
    display: none;
  }

  .calendar-container {
    margin: 1.5rem auto;
  }

  .header-inner {
    padding: 0 1rem;
  }
}

/* ── Mobile (≤ 768px) ──────────────────────────────────────── */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .header-inner {
    height: 56px;
    padding: 0 0.75rem;
    gap: 0.5rem;
  }

  .logo-text {
    font-size: 1.25rem;
  }

  .logo-icon {
    font-size: 1.2rem;
  }

  .month-display {
    min-width: 100px;
  }

  .month-name {
    font-size: 1rem;
  }

  .year-name {
    font-size: 0.65rem;
  }

  .nav-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .user-pill {
    padding: 0.25rem 0.5rem;
    font-size: 0.6rem;
  }

  .user-pill-label {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .calendar-container {
    padding: 0 0.5rem;
    margin: 1rem auto;
  }

  .book-right {
    padding: 0.75rem;
  }

  .weekday {
    font-size: 0.55rem;
    letter-spacing: 0.06em;
    padding: 0.35rem 0;
  }

  .day-cell {
    padding: 0.25rem;
    border-radius: var(--radius-sm);
  }

  .day-number {
    font-size: 0.6rem;
  }

  .mini-vinyl {
    width: 36px;
    height: 36px;
  }

  .mini-label {
    width: 14px;
    height: 14px;
  }

  .mini-hole {
    width: 3px;
    height: 3px;
  }

  .mini-title {
    font-size: 0.45rem;
    bottom: 0.1rem;
  }

  .mini-vinyl-wrap {
    padding-top: 0.75rem;
  }

  .day-add-hint {
    font-size: 0.9rem;
  }

  /* Modal responsive */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-panel {
    max-width: 100%;
    max-height: 95vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.5rem 1rem;
  }

  .modal-title {
    font-size: 1.3rem;
  }

  .modal-subtitle {
    font-size: 0.8rem;
  }

  /* Play modal responsive */
  .play-modal-panel {
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.25rem 1rem;
  }

  .player-vinyl-container {
    width: 200px;
    height: 200px;
  }

  .player-vinyl {
    width: 200px;
    height: 200px;
  }

  .player-label {
    width: 70px;
    height: 70px;
  }

  .player-label-text {
    font-size: 0.4rem;
  }

  .tonearm {
    width: 80px;
    right: 20px;
    top: -8px;
  }

  /* Auth screen responsive */
  .auth-content {
    padding: 2rem 1.5rem;
  }

  .auth-hero-title {
    font-size: 2.2rem;
  }

  .auth-hero-accent {
    font-size: 2.2rem;
  }

  .auth-hero-desc {
    font-size: 0.85rem;
  }

  .auth-btn {
    padding: 0.85rem 1rem;
    font-size: 0.8rem;
  }

  /* Footer */
  .site-footer {
    padding: 1rem 0.5rem 1.5rem;
  }

  .footer-github {
    font-size: 0.6rem;
  }

  /* Clip section */
  .clip-section {
    padding: 0.75rem;
  }

  .clip-manual-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .clip-manual-field {
    width: 100%;
  }
}

/* ── Small phones (≤ 480px) ────────────────────────────────── */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .header-inner {
    height: 50px;
    padding: 0 0.5rem;
  }

  .logo-text {
    font-size: 1.1rem;
  }

  .header-nav {
    gap: 0.5rem;
  }

  .month-display {
    min-width: 80px;
  }

  .month-name {
    font-size: 0.85rem;
  }

  .nav-btn {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  .user-pill {
    padding: 0.2rem 0.4rem;
    font-size: 0.55rem;
    gap: 0.25rem;
  }

  .user-pill-label {
    max-width: 60px;
  }

  .user-pill-dot {
    width: 5px;
    height: 5px;
  }

  .calendar-container {
    padding: 0 0.25rem;
    margin: 0.5rem auto;
  }

  .book-right {
    padding: 0.5rem;
  }

  .days-grid {
    gap: 1px;
  }

  .day-cell {
    padding: 0.15rem;
    aspect-ratio: auto;
    min-height: 52px;
  }

  .day-number {
    font-size: 0.5rem;
  }

  .mini-vinyl {
    width: 28px;
    height: 28px;
  }

  .mini-label {
    width: 10px;
    height: 10px;
  }

  .mini-hole {
    width: 2px;
    height: 2px;
  }

  .mini-title {
    font-size: 0.35rem;
    display: none;
  }

  .mini-vinyl-wrap {
    padding-top: 0.5rem;
  }

  .weekday {
    font-size: 0.45rem;
    letter-spacing: 0.03em;
  }

  /* Auth */
  .auth-content {
    padding: 1.5rem 1rem;
  }

  .auth-hero-title {
    font-size: 1.8rem;
  }

  .auth-hero-accent {
    font-size: 1.8rem;
  }

  .auth-buttons {
    gap: 0.6rem;
  }

  .auth-btn {
    padding: 0.75rem 0.8rem;
    font-size: 0.75rem;
  }

  /* Modal */
  .modal-panel {
    padding: 1.25rem 0.75rem;
  }

  .play-modal-panel {
    padding: 1rem 0.75rem;
  }

  .player-vinyl-container {
    width: 160px;
    height: 160px;
  }

  .player-vinyl {
    width: 160px;
    height: 160px;
  }

  .player-label {
    width: 56px;
    height: 56px;
  }

  .tonearm {
    width: 65px;
    right: 15px;
    top: -6px;
  }

  .player-track-title {
    font-size: 1.2rem;
  }

  /* Input sections */
  .upload-tabs {
    gap: 0.25rem;
  }

  .upload-tab {
    font-size: 0.6rem;
    padding: 0.4rem 0.5rem;
  }

  .save-memory-btn {
    font-size: 0.8rem;
    padding: 0.85rem;
  }

  /* Footer */
  .footer-star {
    display: none;
  }
}