/* Nyelvdob — warm-dark single theme. The drum (teal) is the hero; one amber accent. */

* { box-sizing: border-box; }

:root {
  --bg: #201a12;
  --bg-raise: #2a2318;
  --text: #f0e6d2;
  --text-dim: #a89a7e;
  --accent: #e3b458;      /* mustard amber — the couch */
  --accent-ink: #201a12;
  --teal: #3d7f86;        /* the drum */
  --teal-deep: #2c5f66;
  --line: #3a3123;
  --radius: 14px;
}

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 6px;
}
h1 { font-size: 1.15rem; margin: 0; letter-spacing: 0.02em; font-weight: 650; }

.header-controls { display: flex; gap: 10px; align-items: center; }
.key-label { display: flex; gap: 6px; align-items: center; font-size: 0.8rem; color: var(--text-dim); }
select {
  background: var(--bg-raise); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; font-size: 0.9rem;
}

main { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; }

.drum-wrap { display: flex; justify-content: center; }
#drum {
  width: min(94vw, 54dvh, 560px);
  aspect-ratio: 1;
  touch-action: manipulation;
  user-select: none;
}
#drum svg { width: 100%; height: 100%; display: block; }

/* tongues */
.tongue { cursor: pointer; }
.tongue .pad { transition: filter 0.15s ease; }
.tongue.lit .pad { filter: brightness(1.65) saturate(1.2); }
.tongue .halo { opacity: 0; transform-origin: center; transform-box: fill-box; }
@media (prefers-reduced-motion: no-preference) {
  .tongue.lit .halo { animation: halo 0.7s ease-out; }
  @keyframes halo {
    0%   { opacity: 0.9; transform: scale(0.6); }
    100% { opacity: 0;   transform: scale(1.5); }
  }
}

.panel-wrap {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px 16px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.tabs { display: flex; gap: 4px; margin-bottom: 10px; overflow-x: auto; }
.tab {
  background: none; border: none; color: var(--text-dim);
  font-size: 0.92rem; padding: 8px 12px; border-radius: 9px; cursor: pointer;
  white-space: nowrap; font-weight: 550;
}
.tab.active { background: var(--accent); color: var(--accent-ink); }
.tab:not(.active):hover { color: var(--text); }

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

.hint { color: var(--text-dim); font-size: 0.9rem; line-height: 1.5; margin: 6px 0 10px; }
.hint.small { font-size: 0.8rem; }
.mono { font-variant-numeric: tabular-nums; }

.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }

button {
  font: inherit; cursor: pointer; border-radius: 10px;
  border: 1px solid var(--line); padding: 8px 14px;
}
button:active { transform: translateY(1px); }
.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 650; }
.ghost { background: transparent; color: var(--text); }
.toggle { background: transparent; color: var(--text); }
.toggle.on { background: var(--teal); border-color: transparent; color: #fff; }

input[type="search"] {
  font: inherit; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  width: 100%; margin: 4px 0 2px;
}
input[type="text"], textarea {
  font: inherit; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  width: 100%;
}
input[type="text"] { flex: 1; min-width: 140px; width: auto; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.tempo-label { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-dim); flex: 1; min-width: 180px; }
input[type="range"] { flex: 1; accent-color: var(--accent); }

/* ---------- notation ---------- */
.notation {
  margin-top: 8px;
  font-size: 1.25rem;
  line-height: 2.3;
}
.notation .line { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-bottom: 4px; }
.notation .grp { display: inline-flex; gap: 7px; }
.tok {
  display: inline-flex; flex-direction: column-reverse; align-items: center;
  min-width: 1.1em; padding: 1px 3px; border-radius: 6px;
  font-variant-numeric: tabular-nums;
  position: relative;
}
.tok.now { background: var(--accent); color: var(--accent-ink); }
.tok .nt { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.tok .nt .dot { font-size: 0.5em; line-height: 0.55; }
.tok .nt .dot.none { visibility: hidden; }
.tok.chord { border: 1px solid var(--line); border-radius: 8px; padding: 2px 5px; }
.tok.offrange { color: #d97b6c; }
.notation.writable { min-height: 3.2em; background: var(--bg); border-radius: 10px; padding: 8px 12px; border: 1px dashed var(--line); }
.caret { display: inline-block; width: 2px; height: 1.4em; background: var(--accent); vertical-align: middle; animation: blink 1.1s step-end infinite; }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- songs ---------- */
#songList .sec-title {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-dim); margin: 14px 0 6px;
}
#songList .sec-title:first-child { margin-top: 4px; }
.song-item {
  display: flex; width: 100%; text-align: left; align-items: baseline; gap: 10px;
  background: none; border: none; border-bottom: 1px solid var(--line);
  padding: 10px 4px; border-radius: 0; color: var(--text); font-size: 1rem;
}
.song-item:hover { color: var(--accent); }
.song-item .by { margin-left: auto; color: var(--text-dim); font-size: 0.8rem; }
.song-head { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.song-head h2 { font-size: 1.05rem; margin: 0; font-weight: 650; }

.text-editor { margin: 10px 0; }
.text-editor summary { color: var(--text-dim); font-size: 0.85rem; cursor: pointer; }
.text-editor textarea { margin-top: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.95rem; }

footer {
  text-align: center; color: var(--text-dim); font-size: 0.75rem; padding: 10px 0 14px;
}

/* ---------- wide screens: drum beside panel ---------- */
@media (min-width: 1024px) {
  main {
    flex-direction: row; align-items: flex-start; justify-content: center;
    gap: 28px; padding: 12px 24px 24px;
  }
  .drum-wrap { position: sticky; top: 16px; }
  #drum { width: min(44vw, 80dvh, 620px); }
  .panel-wrap { margin: 0; max-width: 560px; }
}
