:root,
[data-theme="bebop"] {
  --bg: #14100c;
  --bg-panel: #1b1610;
  --bg-elevated: #241d15;
  --ink: #f2e6d0;
  --ink-dim: #a4967c;
  --amber: #e8a33d;
  --amber-bright: #f5b94f;
  --rust: #c1440e;
  --smoke: #3d4a48;
  --border: #332a1f;
  --vinyl: #0a0a0a;
  --font-display: "Bebas Neue", "Arial Narrow", sans-serif;
  --font-mono: "Space Mono", "Courier New", monospace;
  --bg-image:
    radial-gradient(circle at 15% 10%, rgba(232, 163, 61, 0.05), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(193, 68, 14, 0.06), transparent 45%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
}

body {
  background-image: var(--bg-image);
  transition: background-color 0.4s ease, color 0.4s ease;
}

[data-theme] * {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* ===================== THEME: MIKU ===================== */
[data-theme="miku"] {
  --bg: #061417;
  --bg-panel: #0a1f23;
  --bg-elevated: #0e2a2f;
  --ink: #eafffb;
  --ink-dim: #7fc9c4;
  --amber: #39c5bb;
  --amber-bright: #6bf0e3;
  --rust: #ff9dc0;
  --smoke: #2a4a4a;
  --border: #123c3f;
  --vinyl: #041012;
  --font-display: "Baloo 2", "Bebas Neue", sans-serif;
  --font-mono: "Space Mono", "Courier New", monospace;
  --bg-image:
    radial-gradient(circle at 20% 15%, rgba(57, 197, 187, 0.12), transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(255, 157, 192, 0.1), transparent 45%);
}

/* ===================== THEME: FULL OLED ===================== */
[data-theme="oled"] {
  --bg: #000000;
  --bg-panel: #000000;
  --bg-elevated: #0a0a0a;
  --ink: #ffffff;
  --ink-dim: #8a8a8a;
  --amber: #ffffff;
  --amber-bright: #ffffff;
  --rust: #b3b3b3;
  --smoke: #2b2b2b;
  --border: #1c1c1c;
  --vinyl: #000000;
  --font-display: "VT323", "Courier New", monospace;
  --font-mono: "VT323", "Share Tech Mono", monospace;
  --bg-image: none;
}

/* ===================== THEME: LUCKY STAR ===================== */
[data-theme="luckystar"] {
  --bg: #fff6f9;
  --bg-panel: #ffeef5;
  --bg-elevated: #ffe3ee;
  --ink: #4a3b45;
  --ink-dim: #9b7d90;
  --amber: #ff8fb1;
  --amber-bright: #ff6fa0;
  --rust: #7fb8e0;
  --smoke: #d8b7c9;
  --border: #ffd3e4;
  --vinyl: #3a2c33;
  --font-display: "Baloo 2", "Comic Neue", sans-serif;
  --font-mono: "Comic Neue", "Space Mono", monospace;
  --bg-image:
    repeating-linear-gradient(120deg, rgba(255, 143, 177, 0.06) 0 40px, rgba(127, 184, 224, 0.05) 40px 80px, transparent 80px 120px);
}

/* ===================== THEME: LAIN ===================== */
[data-theme="lain"] {
  --bg: #050608;
  --bg-panel: #0a0c10;
  --bg-elevated: #10131a;
  --ink: #c9d3d6;
  --ink-dim: #5c6b70;
  --amber: #8b1e2b;
  --amber-bright: #d13a3a;
  --rust: #35606b;
  --smoke: #1c2226;
  --border: #1a2024;
  --vinyl: #000000;
  --font-display: "Major Mono Display", "Space Mono", monospace;
  --font-mono: "Space Mono", "Courier New", monospace;
  --bg-image:
    radial-gradient(circle at 50% 0%, rgba(139, 30, 43, 0.08), transparent 55%);
}

/* ===================== THEME: IDK ANYMORE ===================== */
[data-theme="idkanymore"] {
  --bg: #17122a;
  --bg-panel: #1e1836;
  --bg-elevated: #271f45;
  --ink: #fefefe;
  --ink-dim: #c9b8ff;
  --amber: #ffd23f;
  --amber-bright: #ff6b9d;
  --rust: #4dd6c1;
  --smoke: #6f5fa8;
  --border: #3a2f66;
  --vinyl: #0a0714;
  --font-display: "Comic Neue", "Bebas Neue", cursive;
  --font-mono: "Comic Neue", "Space Mono", monospace;
  --bg-image:
    conic-gradient(from 0deg at 50% 50%, rgba(255,210,63,0.08), rgba(255,107,157,0.08), rgba(77,214,193,0.08), rgba(255,210,63,0.08));
  animation: idk-hue-drift 20s linear infinite;
}

@keyframes idk-hue-drift {
  to { filter: hue-rotate(360deg); }
}

/* ===================== THEME SWITCHER UI ===================== */
.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.theme-select-wrap {
  flex-shrink: 0;
  position: relative;
}

.theme-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-elevated);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-dim) 50%),
    linear-gradient(135deg, var(--ink-dim) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 9px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  padding: 6px 26px 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  line-height: 1.2;
  display: block;
  width: 100%;
  text-align: left;
}

.theme-select:hover {
  border-color: var(--amber);
  color: var(--amber-bright);
}

.theme-select:focus {
  outline: none;
  border-color: var(--amber);
}

.theme-dropdown-list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 130px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-elevated);
  z-index: 20;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

.theme-dropdown-list.open {
  display: block;
}

.theme-option {
  padding: 7px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  color: var(--ink-dim);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.theme-option:last-child {
  border-bottom: none;
}

.theme-option:hover {
  background: var(--bg-panel);
  color: var(--amber-bright);
}

.theme-option.active {
  background: color-mix(in srgb, var(--amber) 16%, transparent);
  color: var(--amber-bright);
}

/* ===================== THEME FX OVERLAY ===================== */
.theme-fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
}

[data-theme="oled"] .theme-fx {
  opacity: 1;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035) 0px,
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 3px
  );
  animation: oled-flicker 6s infinite steps(1);
}

@keyframes oled-flicker {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: 0.94; }
  98% { opacity: 1; }
}

[data-theme="lain"] .theme-fx {
  opacity: 1;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.015) 0px, transparent 2px, transparent 4px),
    radial-gradient(circle at 50% 50%, transparent 60%, rgba(0,0,0,0.5) 100%);
  animation: lain-glitch 9s infinite;
}

@keyframes lain-glitch {
  0%, 92%, 100% { transform: translate(0, 0); filter: none; }
  92.5% { transform: translate(-2px, 0); filter: hue-rotate(20deg); }
  93% { transform: translate(2px, 0); filter: none; }
}

[data-theme="miku"] .theme-fx {
  opacity: 1;
  background:
    radial-gradient(circle at 30% 20%, rgba(107, 240, 227, 0.05), transparent 30%),
    radial-gradient(circle at 70% 70%, rgba(255, 157, 192, 0.05), transparent 30%);
}

/* ===================== THEME: MIKU shape + glow ===================== */
[data-theme="miku"] .brand-cowboy,
[data-theme="miku"] .note-body h1,
[data-theme="miku"] .note-body h2,
[data-theme="miku"] .note-body h3 {
  text-shadow: 0 0 16px rgba(107, 240, 227, 0.55);
}
[data-theme="miku"] #search-input,
[data-theme="miku"] .vinyl-player,
[data-theme="miku"] .track-list-toggle,
[data-theme="miku"] .theme-select,
[data-theme="miku"] .theme-dropdown-list,
[data-theme="miku"] .theme-option,
[data-theme="miku"] .track-thumb,
[data-theme="miku"] .tree-file-label.active,
[data-theme="miku"] .track-row.active {
  border-radius: 14px;
}
[data-theme="miku"] .disc-label { box-shadow: 0 0 18px rgba(57, 197, 187, 0.4); }
[data-theme="miku"] .transport-play { text-shadow: 0 0 10px rgba(57, 197, 187, 0.6); }

/* ===================== THEME: FULL OLED shape + glow ===================== */
[data-theme="oled"] .brand-cowboy {
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 18px rgba(255, 255, 255, 0.4);
}
[data-theme="oled"] .note-body h1,
[data-theme="oled"] .note-body h2,
[data-theme="oled"] .note-body h3 {
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}
[data-theme="oled"] #search-input,
[data-theme="oled"] .vinyl-player,
[data-theme="oled"] .track-list-toggle,
[data-theme="oled"] .theme-select,
[data-theme="oled"] .theme-dropdown-list,
[data-theme="oled"] .theme-option,
[data-theme="oled"] .track-thumb,
[data-theme="oled"] .disc-label {
  border-radius: 0;
}
[data-theme="oled"] .brand-cowboy::after {
  content: "_";
  animation: oled-cursor 1s steps(1) infinite;
}
@keyframes oled-cursor { 50% { opacity: 0; } }
[data-theme="oled"] .empty-glyph { text-shadow: 0 0 10px rgba(255,255,255,0.6); }

/* VT323 renders visually smaller than the other theme fonts, so bump sizes up */
[data-theme="oled"] .brand-see,
[data-theme="oled"] .brand-space { font-size: 32px; }
[data-theme="oled"] .brand-cowboy { font-size: 48px; }
[data-theme="oled"] #search-input { font-size: 18px; }
[data-theme="oled"] .tree-folder,
[data-theme="oled"] .tree-file { font-size: 20px; }
[data-theme="oled"] .tree-empty { font-size: 17px; }
[data-theme="oled"] .search-group-label { font-size: 14px; }
[data-theme="oled"] .search-result-row { font-size: 20px; }
[data-theme="oled"] .search-result-path { font-size: 15px; }
[data-theme="oled"] .theme-select,
[data-theme="oled"] .theme-option { font-size: 17px; }
[data-theme="oled"] #note-title { font-size: 34px; }
[data-theme="oled"] .note-body { font-size: 21px; }
[data-theme="oled"] .note-body h1 { font-size: 42px; }
[data-theme="oled"] .note-body h2 { font-size: 32px; }
[data-theme="oled"] .note-body h3 { font-size: 26px; }
[data-theme="oled"] .empty-sub { font-size: 18px; }
[data-theme="oled"] .track-list-toggle { font-size: 16px; }
[data-theme="oled"] .track-row-title { font-size: 17px; }
[data-theme="oled"] .track-title { font-size: 17px; }

/* ===================== THEME: LUCKY STAR shape ===================== */
[data-theme="luckystar"] #search-input,
[data-theme="luckystar"] .vinyl-player,
[data-theme="luckystar"] .track-list-toggle,
[data-theme="luckystar"] .theme-select,
[data-theme="luckystar"] .theme-dropdown-list,
[data-theme="luckystar"] .theme-option,
[data-theme="luckystar"] .track-thumb,
[data-theme="luckystar"] .tree-file-label,
[data-theme="luckystar"] .tree-folder-label,
[data-theme="luckystar"] .search-result-row,
[data-theme="luckystar"] .disc-label,
[data-theme="luckystar"] .transport-btn {
  border-radius: 18px;
}
[data-theme="luckystar"] .turntable { box-shadow: inset 0 0 0 3px var(--border), 0 6px 16px rgba(255,143,177,0.25); }
[data-theme="luckystar"] .note-body h1,
[data-theme="luckystar"] .note-body h2,
[data-theme="luckystar"] .note-body h3 { border-bottom-style: dotted; }
[data-theme="luckystar"] .empty-glyph { color: var(--rust); }

/* ===================== THEME: LAIN shape + glitch ===================== */
[data-theme="lain"] .brand-cowboy {
  letter-spacing: 0.08em;
  animation: lain-text-glitch 4s infinite;
}
@keyframes lain-text-glitch {
  0%, 90%, 100% { text-shadow: none; }
  91% { text-shadow: -1px 0 var(--amber-bright), 1px 0 var(--rust); }
  92% { text-shadow: 1px 0 var(--amber-bright), -1px 0 var(--rust); }
  93% { text-shadow: none; }
}
[data-theme="lain"] #search-input,
[data-theme="lain"] .vinyl-player,
[data-theme="lain"] .disc-label,
[data-theme="lain"] .theme-select,
[data-theme="lain"] .theme-dropdown-list,
[data-theme="lain"] .theme-option,
[data-theme="lain"] .track-thumb {
  border-radius: 0;
}
[data-theme="lain"] .tree-file-label::before { content: "◈"; }
[data-theme="lain"] .empty-glyph { color: var(--amber-bright); }

/* ===================== THEME: IDK ANYMORE shape + wobble ===================== */
[data-theme="idkanymore"] #search-input,
[data-theme="idkanymore"] .vinyl-player,
[data-theme="idkanymore"] .track-list-toggle,
[data-theme="idkanymore"] .theme-select,
[data-theme="idkanymore"] .theme-dropdown-list,
[data-theme="idkanymore"] .theme-option,
[data-theme="idkanymore"] .track-thumb,
[data-theme="idkanymore"] .disc-label,
[data-theme="idkanymore"] .transport-btn {
  border-radius: 22px;
}
[data-theme="idkanymore"] .brand-cowboy {
  display: inline-block;
  animation: idk-wobble 2.4s ease-in-out infinite;
}
@keyframes idk-wobble {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}
[data-theme="idkanymore"] .transport-btn:hover,
[data-theme="idkanymore"] .theme-select:hover {
  transform: scale(1.15) rotate(-4deg);
}
[data-theme="idkanymore"] .empty-glyph {
  animation: idk-wobble 1.6s ease-in-out infinite, spin-slow 12s linear infinite;
}

#app {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100vh;
}

#sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-head {
  padding: 22px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--font-display);
  line-height: 0.92;
  letter-spacing: 0.02em;
}

.brand span {
  display: block;
}

.brand-see, .brand-space {
  font-size: 22px;
  color: var(--ink-dim);
}

.brand-cowboy {
  font-size: 34px;
  color: var(--amber-bright);
  text-shadow: 0 0 18px rgba(232, 163, 61, 0.25);
}

.sidebar-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

#search-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 3px;
  outline: none;
}

#search-input:focus {
  border-color: var(--amber);
}

.file-tree {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px 40px;
}

.tree-folder, .tree-file {
  font-size: 13px;
}

.tree-folder-label, .tree-file-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
  color: var(--ink-dim);
  white-space: nowrap;
}

.tree-folder-label:hover, .tree-file-label:hover {
  background: var(--bg-elevated);
  color: var(--ink);
}

.tree-file-label.active {
  background: color-mix(in srgb, var(--amber) 16%, transparent);
  color: var(--amber-bright);
}

.tree-folder-label::before {
  content: "▸";
  font-size: 9px;
  transition: transform 0.15s ease;
  color: var(--rust);
}

.tree-folder.open > .tree-folder-label::before {
  transform: rotate(90deg);
}

.tree-file-label::before {
  content: "ᝰ";
  font-size: 10px;
  color: var(--smoke);
}

.tree-children {
  margin-left: 14px;
  border-left: 1px dashed var(--border);
  padding-left: 6px;
  display: none;
}

.tree-folder.open > .tree-children {
  display: block;
}

.tree-empty {
  padding: 14px 10px;
  font-size: 11px;
  color: var(--smoke);
  line-height: 1.6;
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px 40px;
}

.search-group + .search-group {
  margin-top: 14px;
}

.search-group-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust);
  padding: 4px 10px 8px;
}

.search-result-row {
  display: block;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
  color: var(--ink-dim);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-row:hover {
  background: var(--bg-elevated);
  color: var(--ink);
}

.search-result-path {
  display: block;
  font-size: 10px;
  color: var(--smoke);
  margin-top: 2px;
}

#content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#note-toolbar {
  display: none;
  align-items: center;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-panel), var(--bg));
}

#note-toolbar.visible {
  display: flex;
}

#note-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.note-body {
  flex: 1;
  overflow-y: auto;
  line-height: 1.7;
  font-size: 15px;
}

.note-body-inner {
  padding: 40px 40px 100px;
  max-width: 760px;
  margin: 0 auto;
  transform: translateX(-20px);
}

.empty-state {
  height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-dim);
  text-align: center;
}

.empty-glyph {
  font-size: 48px;
  color: var(--rust);
  margin-bottom: 14px;
  animation: spin-slow 12s linear infinite;
}

.empty-sub {
  font-size: 12px;
  color: var(--smoke);
}

.note-body h1, .note-body h2, .note-body h3 {
  font-family: var(--font-display);
  color: var(--amber-bright);
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-top: 34px;
}

.note-body h1 { font-size: 32px; }
.note-body h2 { font-size: 24px; }
.note-body h3 { font-size: 19px; border-bottom: none; }

.note-body a {
  color: var(--rust);
  text-decoration: none;
  border-bottom: 1px dotted var(--rust);
}

.note-body a:hover {
  color: var(--amber-bright);
  border-color: var(--amber-bright);
}

.note-body code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--amber);
}

.note-body pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--rust);
  padding: 16px;
  overflow-x: auto;
  border-radius: 3px;
}

.note-body pre code {
  border: none;
  background: none;
  padding: 0;
  color: var(--ink);
}

.note-body blockquote {
  margin: 20px 0;
  padding: 6px 18px;
  border-left: 3px solid var(--amber);
  color: var(--ink-dim);
  background: rgba(232, 163, 61, 0.05);
}

.note-body img {
  max-width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.note-body hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 32px 0;
}

.note-body ul, .note-body ol {
  padding-left: 22px;
}

.note-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13px;
}

.note-body th, .note-body td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.note-body th {
  background: var(--bg-elevated);
  color: var(--amber-bright);
  font-family: var(--font-mono);
  font-weight: 700;
}

.note-body tr:nth-child(even) td {
  background: rgba(232, 163, 61, 0.03);
}

.wikilink-missing {
  color: var(--smoke);
  border-bottom: 1px dotted var(--smoke);
  cursor: default;
}

.vinyl-player {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 220px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 14px 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  z-index: 20;
  transform: translate(-50%, -50%);
  transition: top 0.7s cubic-bezier(0.65, 0, 0.35, 1),
              left 0.7s cubic-bezier(0.65, 0, 0.35, 1),
              transform 0.7s cubic-bezier(0.65, 0, 0.35, 1),
              width 0.25s ease, padding 0.25s ease;
}

.vinyl-player.docked {
  top: 18px;
  left: calc(100% - 238px);
  transform: translate(0, 0);
}

.vinyl-player.collapsed {
  width: 190px;
}

.vinyl-player.collapsed .vinyl-stage {
  height: 0;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}

.vinyl-player.pre-dock .track-list-toggle,
.vinyl-player.pre-dock .track-list {
  height: 0;
  opacity: 0;
  margin: 0;
  pointer-events: none;
  overflow: hidden;
}

.vinyl-player.pre-dock .player-head {
  display: none;
}

.turntable,
.disc {
  cursor: pointer;
}
.vinyl-player.pre-dock {
  width: 340px;
  height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 18px;
  padding: 28px;
}

.vinyl-player.pre-dock .vinyl-stage {
  margin-bottom: 0;
  transform: scale(1.3);
  transform-origin: center;
}

.vinyl-player:not(.pre-dock) .vinyl-stage {
  transition: height 0.4s ease 0.15s, opacity 0.4s ease 0.15s, margin 0.4s ease 0.15s;
}

#sidebar,
#content {
  transition: opacity 0.6s ease 0.1s, transform 0.6s ease 0.1s;
}

body.intro #sidebar,
body.intro #content {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.player-head {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 4px;
}

.vinyl-toggle {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-dim);
  font-size: 12px;
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  line-height: 1;
}

.vinyl-toggle:hover {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--amber);
}

.player-mini-icon {
  display: none;
  font-size: 18px;
  color: var(--amber-bright);
}

.vinyl-player.minimized {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.vinyl-player.minimized > *:not(.player-mini-icon) {
  display: none;
}

.vinyl-player.minimized .player-mini-icon {
  display: block;
}

.vinyl-stage {
  position: relative;
  height: 150px;
  margin-bottom: 10px;
  overflow: visible;
  transition: height 0.25s ease, opacity 0.2s ease;
}

.turntable {
  position: absolute;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, #2a241a 0%, #1a1510 70%, #0f0c08 100%);
  box-shadow: inset 0 0 0 1px var(--border), 0 6px 16px rgba(0,0,0,0.4);
}

.disc {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center, var(--vinyl) 0px, #111 1.4px, var(--vinyl) 2.8px);
  animation: spin-vinyl 2.4s linear infinite;
  animation-play-state: paused;
  box-shadow: 0 0 0 1px #000, inset 0 0 20px rgba(0,0,0,0.6);
}

.disc.playing {
  animation-play-state: running;
}

.disc-grooves {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.disc-label {
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  background: var(--rust) center/cover no-repeat;
  border: 2px solid #0a0a0a;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 2;
}

.disc-label.empty::after {
  content: "𑣲𝄞";
  color: rgba(0,0,0,0.4);
  font-size: 20px;
}

.disc-hole {
  position: absolute;
  inset: 47%;
  border-radius: 50%;
  background: var(--bg-panel);
  box-shadow: 0 0 0 1px var(--border);
}

.tonearm {
  position: absolute;
  left: 176px;
  top: 20px;
  width: 0;
  height: 0;
  z-index: 5;
  transform-origin: 0 0;
  transform: rotate(0deg);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tonearm.dropped {
  transform: rotate(50deg);
}

.tonearm-base {
  position: absolute;
  left: -8px;
  top: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2b2b2b;
  border: 1px solid #444;
}

.tonearm-arm {
  position: absolute;
  left: -2px;
  top: 0;
  width: 4px;
  height: 50px;
  background: linear-gradient(180deg, #c9c9c9, #6b6b6b);
  border-radius: 2px;
  transform-origin: top center;
}

.tonearm-head {
  position: absolute;
  bottom: -4px;
  left: -4px;
  width: 12px;
  height: 8px;
  background: #d8d8d8;
  border-radius: 2px;
}

.player-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.track-title {
  font-size: 11px;
  color: var(--amber-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.03em;
}

.progress-bar {
  height: 3px;
  background: var(--bg-elevated);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--rust);
  transition: width 0.2s linear;
}

.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.transport-btn {
  background: transparent;
  border: none;
  color: var(--ink-dim);
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
}

.transport-btn:hover {
  color: var(--amber-bright);
}

.transport-play {
  font-size: 18px;
  color: var(--amber);
}

.track-list-toggle {
  width: 100%;
  margin-top: 10px;
  transition: height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 6px 8px;
  border-radius: 3px;
  cursor: pointer;
  text-align: left;
}

.track-list-toggle:hover {
  color: var(--amber-bright);
  border-color: var(--amber);
}

.track-list {
  display: none;
  margin-top: 6px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-elevated);
}

.track-list.open {
  display: block;
}

.track-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.track-row:last-child {
  border-bottom: none;
}

.track-row:hover {
  background: var(--bg-panel);
}

.track-row.active {
  background: rgba(232, 163, 61, 0.12);
}

.track-row.active .track-row-title {
  color: var(--amber-bright);
}

.track-thumb {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  background: var(--rust) center/cover no-repeat;
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: rgba(0,0,0,0.4);
}

.track-row-title {
  font-size: 11px;
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes spin-vinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media print {
  #sidebar, #note-toolbar, .vinyl-player, audio {
    display: none !important;
  }
  #app {
    display: block;
  }
  .note-body-inner {
    padding: 0;
    max-width: 100%;
    color: #111;
  }
  .note-body h1, .note-body h2, .note-body h3 {
    color: #111;
  }
  body {
    background: #fff;
  }
}

@media (max-width: 860px) {
  #app {
    grid-template-columns: 1fr;
  }
  #sidebar {
    display: none;
  }
  .vinyl-player,
  .vinyl-player.docked {
    top: auto;
    left: auto;
    bottom: 12px;
    right: 12px;
    transform: none;
  }
}
