/* ============================================================
   Clockwork Dulcimer — dark steam-punk theme
   Wood grain + brass, no external assets.
   ============================================================ */

:root {
  --bg:        #14100c;
  --bg-2:      #1c1712;
  --panel:     #241c14;
  --panel-2:   #2b2118;
  --wood:      #3a2a1b;
  --wood-hi:   #4a3623;
  --brass:     #c8963c;
  --brass-hi:  #e6b95c;
  --brass-dim: #8a6a2f;
  --ink:       #e8dcc3;
  --ink-dim:   #a8977a;
  --glow:      rgba(230, 185, 92, .55);
  --line:      rgba(200, 150, 60, .28);
  --active:    #f0cf7a;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(200,150,60,.08), transparent 60%),
    radial-gradient(1000px 700px at 110% 110%, rgba(200,150,60,.06), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  overflow: hidden;
}

/* ---------- background gears ---------- */
.gear {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  opacity: .05;
  pointer-events: none;
  background:
    repeating-conic-gradient(var(--brass) 0 12deg, transparent 12deg 30deg);
  -webkit-mask:
    radial-gradient(circle, transparent 0 30%, #000 30% 34%, transparent 34% 58%, #000 58% 100%);
  mask:
    radial-gradient(circle, transparent 0 30%, #000 30% 34%, transparent 34% 58%, #000 58% 100%);
  animation: spin 90s linear infinite;
}
.gear-tl { top: -140px; left: -140px; }
.gear-br { bottom: -160px; right: -160px; animation-direction: reverse; width: 520px; height: 520px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- panels ---------- */
.panels {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 14px;
  padding: 14px 14px 0 14px;
  min-height: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  /* wood grain: layered repeating gradients */
  background:
    repeating-linear-gradient(92deg,
      rgba(0,0,0,.16) 0 2px, transparent 2px 7px,
      rgba(255,255,255,.02) 7px 9px, transparent 9px 22px),
    repeating-linear-gradient(88deg,
      rgba(0,0,0,.10) 0 40px, rgba(255,255,255,.015) 40px 80px),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 30px rgba(0,0,0,.5);
}

.panel-left { align-items: stretch; }

/* ---------- left: logo + song list ---------- */
.logo-wrap {
  text-align: center;
  padding: 26px 18px 14px;
  border-bottom: 1px solid var(--line);
}

#logo {
  width: 150px;
  max-height: 150px;
  object-fit: contain;
  border-radius: 50%;
  border: 3px solid var(--brass-dim);
  box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 0 26px var(--glow), inset 0 0 18px rgba(0,0,0,.55);
  background: #0d0a07;
}

#band {
  margin: 16px 0 2px;
  font-size: 1.35rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brass-hi);
  text-shadow: 0 0 14px var(--glow);
}

.songlist {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.songlist li {
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  color: var(--ink);
  display: flex;
  gap: 10px;
  align-items: baseline;
  transition: background .15s, border-color .15s;
}

.songlist li:hover {
  background: rgba(200,150,60,.08);
  border-color: var(--line);
}

.songlist li.active {
  background: rgba(200,150,60,.16);
  border-color: var(--brass-dim);
  color: var(--active);
}

.songlist .num {
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  min-width: 1.6em;
}

.songlist li.active .num { color: var(--brass); }
.songlist .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- right: lyrics ---------- */
.panel-right { overflow: hidden; }

.lyric-title {
  margin: 0;
  padding: 22px 28px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 1.3rem;
  letter-spacing: .06em;
  color: var(--brass-hi);
  text-shadow: 0 0 12px var(--glow);
}

.lyrics {
  flex: 1;
  overflow-y: auto;
  padding: 26px 34px;
  font-size: 1.12rem;
  line-height: 1.9;
}

.lyrics-empty { color: var(--ink-dim); font-style: italic; }

.lyric-line {
  color: var(--ink-dim);
  padding: 2px 10px;
  border-radius: 4px;
  transition: color .12s, background .12s, transform .12s;
}

.lyric-line.active {
  color: var(--active);
  background: rgba(200,150,60,.14);
  box-shadow: inset 2px 0 0 var(--brass);
  text-shadow: 0 0 10px var(--glow);
}

/* ---------- bottom player bar ---------- */
.playerbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  margin: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    repeating-linear-gradient(90deg,
      rgba(0,0,0,.14) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, #33261a, #241c14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 -4px 20px rgba(0,0,0,.4);
}

#btn-play {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--brass-dim);
  background: radial-gradient(circle at 35% 30%, var(--brass-hi), var(--brass) 55%, #6e5222);
  color: #1c130a;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 0 16px var(--glow), inset 0 1px 1px rgba(255,255,255,.4);
  flex: none;
}
#btn-play:active { transform: scale(.96); }

.track-meta {
  min-width: 160px;
  max-width: 260px;
  flex: none;
}
#player-title {
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  letter-spacing: .04em;
}

.progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.time {
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  min-width: 3.2em;
  text-align: center;
  font-size: .9rem;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brass) var(--fill, 0%), #4a3a22 var(--fill, 0%));
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--brass-hi), var(--brass));
  border: 1px solid #1c130a;
  box-shadow: 0 0 8px var(--glow);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brass);
  border: 1px solid #1c130a;
  box-shadow: 0 0 8px var(--glow);
}

#volume { max-width: 110px; flex: none; }

/* ---------- narrow screens: stack panels ---------- */
@media (max-width: 760px) {
  .panels { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-y: auto; }
  .panel-left { max-height: 45vh; }
  .playerbar { flex-wrap: wrap; }
  .track-meta { min-width: 0; flex: 1; }
}
