:root {
  --shell: #e8e2d4;
  --label-paper: #f7f3e8;
  --panel: #fbf8f0;
  --line: #c9c0ac;
  --line-soft: #e6ded0;
  --ink: #2b2620;
  --ink-muted: #6b6355;
  --ink-faint: #8a8272;
  --accent-a: #c1442d;
  --accent-b: #2c6e63;
  --danger: #a94a3a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--shell);
  font-family: 'IBM Plex Mono', monospace;
  color: var(--ink);
  padding: 32px 20px 60px;
}

.wrap { max-width: 900px; margin: 0 auto; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.logo { height: 62px; width: auto; }
.tagline {
  font-family: 'IBM Plex Mono', monospace;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0;
}

main { display: block; }

/* Tape length buttons */
.tape-buttons { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tape-btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tape-btn.active { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.tape-btn:hover:not(.active) { border-color: #a89d84; }

/* Mode toggle */
.mode-toggle { display: flex; gap: 6px; margin-bottom: 10px; }
.mode-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
}
.mode-btn.active { border-color: var(--ink); background: var(--ink); color: var(--panel); }

/* Panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 20px;
}
.search-row { display: flex; gap: 8px; margin-bottom: 12px; }
input, select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-family: 'IBM Plex Mono', monospace;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--accent-b); outline-offset: 1px; }
.search-row input { flex: 1; }
.btn-dark {
  padding: 8px 18px;
  border-radius: 4px;
  border: none;
  background: var(--ink);
  color: var(--panel);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
}
.btn-dark:hover { background: #171310; }
.btn-dark:disabled { cursor: wait; opacity: 0.8; }
.error-text { font-size: 12.5px; color: var(--danger); margin-bottom: 8px; }
.source-note { margin: 10px 0 0; font-size: 11px; color: var(--ink-faint); }

/* Result / song rows */
.result-row, .song-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  margin-bottom: 6px;
  background: var(--label-paper);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}
.song-row { padding: 8px 10px; background: var(--panel); border-color: var(--line); cursor: grab; }
.song-row:active { cursor: grabbing; }
.play-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
}
.play-btn:disabled { border-color: var(--line); color: var(--line); cursor: not-allowed; }
.play-btn.playing { background: var(--ink); color: var(--panel); }
.row-title { flex: 1; min-width: 0; }
.row-title .t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-title .a { font-size: 11.5px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-time { font-size: 11.5px; color: var(--ink-muted); }
.add-a, .add-b {
  padding: 5px 9px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11.5px;
  cursor: pointer;
  background: transparent;
}
.add-a { border: 1.5px solid var(--accent-a); color: var(--accent-a); }
.add-a:hover { background: var(--accent-a); color: var(--panel); }
.add-b { border: 1.5px solid var(--accent-b); color: var(--accent-b); }
.add-b:hover { background: var(--accent-b); color: var(--panel); }
.remove-btn { border: none; background: transparent; color: var(--danger); cursor: pointer; font-size: 14px; width: 22px; height: 22px; }

/* Manual form */
.form-grid { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; }
.field label { font-size: 11px; color: var(--ink-muted); margin-bottom: 3px; }

/* Sides */
.sides { display: flex; gap: 16px; flex-wrap: wrap; }
.side {
  flex: 1; min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background-image: repeating-linear-gradient(var(--label-paper) 0px, var(--label-paper) 27px, var(--line-soft) 28px);
  background-color: var(--label-paper);
}
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.side-title-group { display: flex; align-items: center; gap: 10px; }
.reel { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; }
.reel .hub { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); }
.side-title { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: 1px; }
.side-remaining { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; padding: 4px 8px; border-radius: 4px; background: var(--line-soft); }
.side-remaining.over { background: var(--danger); color: var(--panel); }
.empty-hint { font-size: 12.5px; color: var(--ink-faint); padding: 10px 4px; }

.footnote { margin-top: 18px; font-size: 11.5px; color: var(--ink-faint); }

/* Footer */
.site-footer {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-faint);
}
.footer-links { display: flex; gap: 8px; align-items: center; }
.footer-links a { color: var(--ink-muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-version { font-size: 11px; color: var(--ink-faint); }

/* Small screens */
@media (max-width: 480px) {
  .logo { height: 50px; }
  .search-row { flex-direction: column; }
  .form-grid { flex-direction: column; align-items: stretch; }
  .field { width: 100% !important; }
}

/* Legal pages (Impressum, Datenschutz) */
.legal { max-width: 640px; }
.legal h1 { font-family: 'Oswald', sans-serif; font-size: 26px; margin-bottom: 6px; }
.legal .stand { font-size: 12px; color: var(--ink-faint); margin-bottom: 22px; }
.legal h2 { font-family: 'Oswald', sans-serif; font-size: 18px; margin: 28px 0 10px; }
.legal p, .legal li { line-height: 1.6; margin: 0 0 12px; font-size: 14px; }
.legal ul { margin: 0 0 14px; padding-left: 20px; }
.legal a { color: var(--ink); }
.back-link { display: inline-block; margin-bottom: 24px; font-size: 13px; color: var(--ink-muted); text-decoration: none; }
.back-link:hover { color: var(--ink); text-decoration: underline; }

/* Changelog */
.version-entry { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line-soft); }
.version-entry:last-of-type { border-bottom: none; }
.version-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.version-tag {
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 18px;
  color: var(--panel); background: var(--ink); padding: 2px 10px; border-radius: 4px;
}
.version-date { font-size: 12px; color: var(--ink-faint); }
.version-entry ul { margin-top: 10px; }
.version-entry li { font-size: 14px; }
.version-planned { font-size: 12.5px; color: var(--ink-muted); font-style: italic; margin-top: 10px; }
