/* ════════════════════════════════════════════════════════
   FFXIV Stage Manager — Styles
   Dark theme with purple + gold accents
   ════════════════════════════════════════════════════════ */

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

:root {
  --bg:          #0a0a10;
  --surface:     #131320;
  --surface-2:   #1a1a2e;
  --surface-3:   #22223a;
  --border:      #2a2a40;
  --border-light:#3a3a55;
  --primary:     #a855f7;
  --primary-dim: #7c3aed;
  --primary-bg:  rgba(168, 85, 247, 0.12);
  --gold:        #ffd700;
  --gold-bg:     rgba(255, 215, 0, 0.10);
  --green:       #4ade80;
  --red:         #f87171;
  --blue:        #3bb2ff;
  --text:        #e0e0e8;
  --text-muted:  #8888a0;
  --text-dim:    #555570;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --font:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:   'JetBrains Mono', 'Courier New', monospace;
  --nav-h:       52px;
  --player-h:    64px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* ── Typography ── */
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
.text-muted { color: var(--text-muted); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: var(--radius); cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  padding: 8px 16px; transition: all 0.15s;
}
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.btn-primary {
  background: var(--primary); color: #fff;
}
.btn-primary:hover { background: var(--primary-dim); }

.btn-ghost {
  background: transparent; color: var(--text-muted); border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-light); }

.btn-danger { background: rgba(248,113,113,0.15); color: var(--red); }
.btn-danger:hover { background: rgba(248,113,113,0.25); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 5px 8px; min-width: 28px; justify-content: center; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.btn-icon:hover { color: var(--text); border-color: var(--border-light); }

/* ── Inputs ── */
input[type="text"], input[type="number"], input[type="url"], textarea, select {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 12px; font-family: var(--font); font-size: 13px;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary);
}
textarea { resize: vertical; min-height: 80px; }

select { cursor: pointer; }

/* ── Views ── */
.view { display: none; }
.view.active { display: flex; flex-direction: column; }

/* ════════════════════════════════════════════════════════
   TOP NAV
   ════════════════════════════════════════════════════════ */
.top-nav {
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px; gap: 16px;
  flex-shrink: 0; z-index: 100;
}

.nav-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px;
  color: var(--primary); cursor: pointer;
  white-space: nowrap;
}
.brand-icon { font-size: 20px; }
.brand-icon-img { width: 28px; height: 28px; object-fit: contain; }

.nav-center {
  flex: 1; display: flex; align-items: center; gap: 8px;
  justify-content: center;
}
.nav-select {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 12px; font-size: 13px; max-width: 240px;
}
.nav-separator { color: var(--text-dim); font-size: 18px; }

.nav-actions { display: flex; gap: 8px; }

/* ════════════════════════════════════════════════════════
   VIEW: SHOWS
   ════════════════════════════════════════════════════════ */
#view-shows {
  height: calc(100vh - var(--nav-h));
  align-items: center; justify-content: center;
}

.shows-container {
  text-align: center; max-width: 800px; width: 100%; padding: 40px 20px;
}
.shows-header { margin-bottom: 32px; }
.shows-header h1 { margin-bottom: 8px; }

.shows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 24px; text-align: left;
}

.show-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px; cursor: pointer;
  transition: all 0.2s;
}
.show-card:hover {
  border-color: var(--primary);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(168, 85, 247, 0.12);
}
.show-card h3 { margin-bottom: 4px; }
.show-card .show-card-meta { font-size: 12px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════
   VIEW: DASHBOARD
   ════════════════════════════════════════════════════════ */
#view-dashboard {
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}

.dashboard-container { max-width: 960px; margin: 0 auto; padding: 32px 24px; width: 100%; }
.dashboard-header { margin-bottom: 24px; }
.dashboard-header h2 { margin-bottom: 4px; }

.dashboard-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.tab-btn {
  background: none; border: none;
  color: var(--text-muted); font-family: var(--font);
  font-size: 14px; font-weight: 500;
  padding: 10px 18px; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

/* Songs list */
.songs-list { display: flex; flex-direction: column; gap: 8px; }

.song-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  cursor: pointer; transition: all 0.15s;
}
.song-card:hover {
  border-color: var(--primary); background: var(--surface-2);
}
.song-card .song-number {
  width: 28px; height: 28px;
  border-radius: 50%; background: var(--primary-bg);
  color: var(--primary); font-weight: 600; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.song-card .song-info { flex: 1; min-width: 0; }
.song-card .song-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-card .song-meta { font-size: 12px; color: var(--text-muted); }
.song-card .song-cast-avatars { display: flex; gap: 2px; flex-shrink: 0; }
.song-card .song-cast-avatars img,
.song-card .song-cast-avatars .mini-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--border); object-fit: cover;
  background: var(--surface-3);
}
.song-card .song-actions { flex-shrink: 0; }

/* Cast grid */
.cast-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.cast-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  text-align: center; transition: all 0.15s;
  position: relative;
}
.cast-card:hover { border-color: var(--border-light); background: var(--surface-2); }
.cast-card .cast-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  border: 3px solid var(--border); object-fit: cover;
  margin: 0 auto 10px; display: block;
  background: var(--surface-3);
}
.cast-card .cast-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.cast-card .cast-world { font-size: 12px; color: var(--text-muted); }
.cast-card .cast-role { font-size: 11px; color: var(--primary); margin-top: 4px; }
.cast-card .cast-color-dot {
  width: 10px; height: 10px; border-radius: 50%;
  position: absolute; top: 10px; right: 10px;
  border: 1px solid rgba(255,255,255,0.1);
}
.cast-card .cast-delete {
  position: absolute; top: 8px; left: 8px;
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 14px; padding: 2px;
  opacity: 0; transition: opacity 0.15s;
}
.cast-card:hover .cast-delete { opacity: 1; }
.cast-card .cast-delete:hover { color: var(--red); }

.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--text-dim); font-size: 14px;
}
.empty-state-sm {
  text-align: center; padding: 20px 10px;
  color: var(--text-dim); font-size: 12px;
}

/* ════════════════════════════════════════════════════════
   VIEW: REHEARSAL
   ════════════════════════════════════════════════════════ */
#view-rehearsal {
  height: calc(100vh - var(--nav-h));
}

.rehearsal-layout {
  flex: 1; display: flex; overflow: hidden;
  min-height: 0;
}

/* Slides panel */
.slides-panel {
  width: 120px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.panel-title { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; }

.slides-list {
  flex: 1; overflow-y: auto; padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}

.slide-thumb {
  aspect-ratio: 12 / 7;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer; position: relative;
  overflow: hidden; transition: all 0.15s;
}
.slide-thumb:hover { border-color: var(--border-light); }
.slide-thumb.active { border-color: var(--primary); box-shadow: 0 0 12px rgba(168,85,247,0.25); }
.slide-thumb .slide-num {
  position: absolute; top: 2px; left: 4px;
  font-size: 10px; font-weight: 700; color: var(--text-dim);
}
.slide-thumb svg { width: 100%; height: 100%; }
.slide-delete-btn {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; border: none; border-radius: 50%;
  background: rgba(248,113,113,0.85); color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  padding: 0; z-index: 2;
}
.slide-thumb:hover .slide-delete-btn { display: flex; }

/* Lyrics panel */
.lyrics-panel {
  width: 220px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.lyrics-list {
  flex: 1; overflow-y: auto; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}

.lyric-line {
  padding: 4px 8px; border-radius: 4px;
  font-size: 13px; line-height: 1.6;
  color: var(--text-dim); cursor: pointer;
  transition: all 0.2s;
}
.lyric-line:hover { color: var(--text-muted); background: rgba(255,255,255,0.03); }
.lyric-line.active {
  color: var(--text); background: var(--primary-bg);
  font-weight: 500;
}
.lyric-line.past { color: var(--text-muted); }

.lyric-section {
  font-size: 11px; font-weight: 700;
  color: var(--primary); letter-spacing: 1px;
  text-transform: uppercase; padding: 8px 8px 2px;
  margin-top: 6px;
}

/* Stage area */
.stage-area {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; position: relative;
}

.stage-toolbar {
  height: 40px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 10px; gap: 4px; flex-shrink: 0;
}

.tool-btn {
  width: 32px; height: 32px;
  background: none; border: 1px solid transparent;
  border-radius: 6px; color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.tool-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.tool-btn.active { background: var(--primary-bg); color: var(--primary); border-color: var(--primary-dim); }

.tool-separator {
  width: 1px; height: 20px; background: var(--border); margin: 0 4px;
}
.tool-spacer { flex: 1; }

.tool-select {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 8px; font-size: 12px;
}

.tool-props {
  display: flex; align-items: center; gap: 8px;
}
.tool-props label {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-muted);
}
.tool-props input[type="color"] {
  width: 24px; height: 24px; border: 1px solid var(--border);
  border-radius: 4px; cursor: pointer; padding: 0; background: none;
}
.tool-props input[type="number"] {
  width: 60px; padding: 3px 6px; font-size: 12px;
}

.stage-viewport {
  flex: 1; background: #0d0d15;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  padding: 12px;
}

#stageSvg {
  width: 100%; height: 100%;
  max-width: 100%; max-height: 100%;
  border-radius: var(--radius);
}

.stage-floor { fill: #2a2a35; stroke: #444460; stroke-width: 2; }

.slide-label-bar {
  height: 28px; background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; font-size: 12px; color: var(--text-muted);
  flex-shrink: 0;
}
.slide-timestamp { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.slide-label-editable,
.slide-ts-editable {
  cursor: pointer; border-radius: 3px; padding: 1px 4px;
  transition: background 0.15s;
}
.slide-label-editable:hover,
.slide-ts-editable:hover { background: var(--surface-2); color: var(--text); }

/* ── Emote cue popup ── */
.emote-cue-popup {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: linear-gradient(135deg, #805ad5, #d53f8c);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  padding: 16px 36px;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(128, 90, 213, 0.5);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  text-align: center;
  letter-spacing: 1px;
}
.emote-cue-popup.active {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
.emote-cue-icon {
  width: 48px; height: 48px;
  vertical-align: middle;
  image-rendering: pixelated;
  margin-right: 6px;
}

/* ── Emote lines in lyrics panel ── */
.lyric-emote {
  color: #d69e2e;
  font-style: italic;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.emote-icon {
  width: 28px; height: 28px;
  vertical-align: middle;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.emote-name {
  color: #ecc94b;
  font-weight: 700;
}

/* ════════════════════════════════════════════════════════
   AUDIO PLAYER BAR
   ════════════════════════════════════════════════════════ */
.audio-player-bar {
  height: var(--player-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px; gap: 16px;
  flex-shrink: 0;
}

.player-info {
  width: 200px; flex-shrink: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; flex-direction: column; gap: 2px;
}
.player-song-title { font-size: 13px; font-weight: 500; }

/* ── Sync status ── */
.sync-status {
  font-size: 11px;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
  cursor: default;
}
.sync-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.sync-dot-off      { background: var(--text-muted); opacity: 0.4; }
.sync-dot-on       { background: #48bb78; box-shadow: 0 0 6px #48bb7888; }
.sync-dot-conductor { background: #ecc94b; box-shadow: 0 0 6px #ecc94b88; }

.player-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.player-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: all 0.15s;
}
.player-btn:hover { background: var(--surface-3); border-color: var(--border-light); }
.player-btn-play {
  width: 40px; height: 40px; font-size: 16px;
  background: var(--primary); border-color: var(--primary);
  color: #fff;
}
.player-btn-play:hover { background: var(--primary-dim); }

.player-progress {
  flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0;
}
.player-time { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

.progress-bar-container {
  flex: 1; position: relative; height: 32px;
  display: flex; align-items: center;
}
.progress-bar-bg {
  width: 100%; height: 4px;
  background: var(--surface-3); border-radius: 2px;
  position: relative; overflow: visible;
}
.progress-bar-fill {
  height: 100%; background: var(--primary); border-radius: 2px;
  width: 0; transition: width 0.1s linear;
}
.progress-bar-markers {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}
.progress-marker {
  position: absolute; top: -3px;
  width: 2px; height: 10px;
  background: var(--gold); border-radius: 1px;
  opacity: 0.5;
}
.progress-bar-input {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer; margin: 0;
}

.player-extra { flex-shrink: 0; }
.player-upload-label {
  cursor: pointer; font-size: 18px;
  opacity: 0.5; transition: opacity 0.15s;
}
.player-upload-label:hover { opacity: 1; }

/* ════════════════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 480px; max-width: 90vw; max-height: 85vh;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  animation: modalIn 0.2s ease-out;
}
.modal.modal-lg { width: 700px; }

@keyframes modalIn {
  from { transform: translateY(12px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; }

.modal-body {
  padding: 20px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 14px;
}

.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--border);
}

.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; padding: 4px;
}
.modal-close:hover { color: var(--text); }

/* Form helpers inside modals */
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-help { font-size: 11px; color: var(--text-dim); }

/* Inline tag list for cast assignment */
.cast-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cast-tag {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 10px; font-size: 12px;
  cursor: pointer; transition: all 0.15s;
}
.cast-tag img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.cast-tag.selected { background: var(--primary-bg); border-color: var(--primary); color: var(--primary); }
.cast-tag:hover { border-color: var(--border-light); }

/* ════════════════════════════════════════════════════════
   SVG STAGE ELEMENTS
   ════════════════════════════════════════════════════════ */
.stage-shape { cursor: pointer; transition: opacity 0.15s; }
.stage-shape:hover { opacity: 0.85; }
.stage-shape.selected { stroke: var(--primary) !important; stroke-width: 3 !important; stroke-dasharray: 6 3; }

.stage-cast-group { cursor: pointer; }
.stage-cast-group:hover .cast-ring { stroke: var(--gold); stroke-width: 3; }
.stage-cast-group .cast-ring { fill: none; stroke: rgba(255,255,255,0.2); stroke-width: 2; transition: all 0.15s; }
.stage-cast-group.selected .cast-ring { stroke: var(--primary); stroke-width: 3; }

/* Current user's cast member glow */
.stage-cast-group.cast-me .cast-ring {
  stroke: var(--gold); stroke-width: 3;
  filter: drop-shadow(0 0 6px var(--gold)) drop-shadow(0 0 12px var(--gold));
  animation: cast-me-pulse 2s ease-in-out infinite;
}
.stage-cast-group.cast-me .stage-cast-label { opacity: 1; }
@keyframes cast-me-pulse {
  0%, 100% { filter: drop-shadow(0 0 4px var(--gold)) drop-shadow(0 0 8px var(--gold)); }
  50%      { filter: drop-shadow(0 0 8px var(--gold)) drop-shadow(0 0 18px var(--gold)); }
}

.stage-cast-label {
  font-size: 16px; font-weight: 700; text-anchor: middle;
  pointer-events: none; opacity: 0;
  transition: opacity 0.2s;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.9)) drop-shadow(0 0 6px rgba(0,0,0,0.7));
}
.stage-cast-group:hover .stage-cast-label { opacity: 1; }

.stage-arrow {
  stroke: #e53e3e; stroke-width: 3; fill: none;
  marker-end: url(#arrowhead);
  cursor: pointer; transition: opacity 0.15s;
}
.stage-arrow:hover { opacity: 0.7; }
.stage-arrow.selected { stroke: var(--primary); stroke-dasharray: 6 3; }

.stage-text-label {
  font-size: 13px; fill: #aaa; cursor: pointer;
  font-family: var(--font);
}
.stage-text-label.selected { fill: var(--primary); }

.resize-handle {
  fill: var(--primary); stroke: #fff; stroke-width: 1.5;
  pointer-events: all; opacity: 0.9;
}
.resize-handle:hover { fill: #c084fc; opacity: 1; }

.rotate-handle {
  fill: #22d3ee; stroke: #fff; stroke-width: 1.5;
  pointer-events: all; cursor: grab; opacity: 0.9;
}
.rotate-handle:hover { fill: #67e8f9; opacity: 1; }
.rotate-line {
  stroke: #22d3ee; stroke-width: 1.5; stroke-dasharray: 4 3;
  pointer-events: none; opacity: 0.7;
}
.marquee-rect {
  fill: rgba(168, 85, 247, 0.1); stroke: var(--primary);
  stroke-width: 1.5; stroke-dasharray: 6 3;
  pointer-events: none;
}

/* ════════════════════════════════════════════════════════
   SCROLLBAR
   ════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ════════════════════════════════════════════════════════
   LYRICS EDITOR (inside modal)
   ════════════════════════════════════════════════════════ */
.lyrics-editor-table {
  width: 100%; border-collapse: collapse;
}
.lyrics-editor-table th {
  text-align: left; font-size: 11px; font-weight: 600;
  color: var(--text-dim); padding: 4px 8px;
  border-bottom: 1px solid var(--border);
}
.lyrics-editor-table td { padding: 3px 4px; }
.lyrics-editor-table input {
  width: 100%; padding: 4px 8px; font-size: 12px;
}
.lyrics-editor-table .ts-input { width: 70px; font-family: var(--font-mono); text-align: center; }
.lyrics-add-row {
  margin-top: 8px;
}

/* Loading spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════
   LOGIN VIEW
   ════════════════════════════════════════════════════════ */
#view-login {
  height: 100vh;
  align-items: center; justify-content: center;
  background: var(--bg);
}

.login-container {
  width: 100%; max-width: 420px; padding: 20px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

.login-header {
  text-align: center; margin-bottom: 28px;
}
.login-header h1 {
  font-size: 24px; margin-top: 12px; margin-bottom: 6px;
  color: var(--text);
}

.login-tabs {
  display: none; /* unused with Discord OAuth */
}
.login-tab { display: none; }

/* Discord button */
.btn-discord {
  background: #5865F2; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; font-size: 15px;
  border-radius: var(--radius); border: none;
  padding: 14px 24px; cursor: pointer;
  transition: background 0.15s;
}
.btn-discord:hover { background: #4752c4; }
.btn-discord:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-discord svg { flex-shrink: 0; }

.login-form {
  display: flex; flex-direction: column; gap: 14px;
}

.auth-error {
  font-size: 13px; padding: 8px 12px;
  background: rgba(248, 113, 113, 0.08);
  border-radius: var(--radius);
  text-align: center;
}

.login-footer {
  text-align: center; margin-top: 20px;
  font-size: 12px;
}

/* Nav user area */
.nav-user {
  display: inline-flex; align-items: center; gap: 10px;
}
.nav-cast-picker {
  max-width: 150px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 4px; padding: 3px 6px;
}
.nav-user-email {
  font-size: 12px; color: var(--text-muted);
  max-width: 160px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
