/* Tonarchiv – Gestaltung
   Bild: ein Bandarchiv-Pult. Dunkles Gehäuse, Bernstein für alles,
   was vorhanden ist, Schreibmaschinenschrift für Zahlen und Daten. */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
    --ink:      #15171b;
    --panel:    #1d2026;
    --panel-2:  #23272e;
    --line:     #31363f;
    --line-hi:  #444b57;
    --paper:    #e6e3dc;
    --muted:    #8e939c;
    --amber:    #d9a441;
    --amber-dim:#6a5427;
    --red:      #c85a4a;
    --moss:     #7ba38c;

    --display: 'Barlow Condensed', 'Oswald', Impact, sans-serif;
    --body:    'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono:    'IBM Plex Mono', ui-monospace, 'Courier New', monospace;

    --radius: 3px;
}

* { box-sizing: border-box; }

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

body {
    background: var(--ink);
    color: var(--paper);
    font-family: var(--body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--paper); }

/* ------------------------------------------------------------ Kopf --- */

.topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    font-family: var(--display);
    font-size: 25px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--paper);
}

.tally {
    margin: 0;
    margin-left: auto;
    display: flex;
    gap: 18px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 28px 24px 80px;
}

.backlink {
    display: inline-block;
    margin-bottom: 18px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
}
.backlink:hover { color: var(--amber); }

/* ------------------------------------------------ Formularelemente --- */

input[type=text],
input[type=search],
input[type=url],
input[type=date],
input[type=password],
select,
textarea {
    width: 100%;
    padding: 9px 11px;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--paper);
    font-family: var(--body);
    font-size: 14px;
}

textarea {
    resize: vertical;
    line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--amber);
    outline-offset: 1px;
    border-color: var(--amber);
}

label {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

label input,
label textarea,
label select {
    margin-top: 5px;
    font-family: var(--body);
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--paper);
}

.checkline {
    display: flex;
    align-items: center;
    gap: 9px;
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--body);
    font-size: 14px;
    color: var(--paper);
}
.checkline input { width: auto; margin: 0; }

.btn {
    display: inline-block;
    padding: 9px 16px;
    background: var(--panel-2);
    border: 1px solid var(--line-hi);
    border-radius: var(--radius);
    color: var(--paper);
    font-family: var(--display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { border-color: var(--amber); color: var(--amber); }

.btn-primary {
    background: var(--amber);
    border-color: var(--amber);
    color: #1a1509;
}
.btn-primary:hover { background: #e8b455; border-color: #e8b455; color: #1a1509; }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }

.btn-danger { background: transparent; border-color: #5c322b; color: var(--red); }
.btn-danger:hover { border-color: var(--red); color: var(--red); }

.btn-small { padding: 4px 9px; font-size: 12px; letter-spacing: 0.06em; }

.actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.stack { display: flex; flex-direction: column; gap: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 200px; gap: 13px; }
.inline { display: inline; margin: 0; }

.hint {
    font-size: 13px;
    color: var(--muted);
    margin: 6px 0;
}

.stamp {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}

.empty {
    padding: 28px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}

/* -------------------------------------------------------- Übersicht --- */

.filterbar {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.filterbar input[type=search] { flex: 1 1 260px; }
.filterbar select { flex: 0 1 220px; }

.newtrack {
    margin-bottom: 26px;
    padding: 14px 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.newtrack summary {
    cursor: pointer;
    font-family: var(--display);
    font-size: 16px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
}
.newtrack[open] summary { color: var(--paper); margin-bottom: 13px; }

.row-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.row-form input[type=text] { flex: 1 1 180px; }
.row-form input[type=date] { flex: 0 0 165px; }

.tracklist {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
}

.trackrow {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
}
.trackrow:hover { background: var(--panel); }

.trackrow-main {
    flex: 1 1 auto;
    display: flex;
    align-items: baseline;
    gap: 11px;
    min-width: 0;
    text-decoration: none;
}

.trackrow-title {
    font-family: var(--display);
    font-size: 21px;
    font-weight: 600;
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.trackrow:hover .trackrow-title { color: var(--amber); }

.tag {
    flex: 0 0 auto;
    padding: 2px 7px;
    border: 1px solid var(--line-hi);
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Die Lämpchenreihe: was liegt vom Track wirklich hier? */
.coverage { display: flex; gap: 4px; flex: 0 0 auto; }

.cov {
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 2px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.09em;
    color: #4b515c;
    background: #191c21;
}
.cov-on {
    color: var(--amber);
    border-color: var(--amber-dim);
    background: rgba(217, 164, 65, 0.09);
    box-shadow: 0 0 9px rgba(217, 164, 65, 0.16) inset;
}

.meta {
    flex: 0 0 auto;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    min-width: 130px;
    text-align: right;
}

/* ----------------------------------------------------------- Detail --- */

.trackhead {
    padding: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.trackhead-form { display: flex; flex-direction: column; gap: 15px; }

.input-title {
    font-family: var(--display);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid transparent;
    border-bottom-color: var(--line);
}
.input-title:hover { border-bottom-color: var(--line-hi); }

.danger-form { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

.section-title {
    font-family: var(--display);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.19em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 14px;
}

.version {
    margin-top: 18px;
    padding: 17px 19px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line-hi);
    border-radius: var(--radius);
}
.version.is-master { border-left-color: var(--amber); }

.version-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}
.version-head h3 {
    margin: 0;
    font-family: var(--display);
    font-size: 21px;
    font-weight: 600;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.chip {
    padding: 2px 8px;
    border: 1px solid var(--line-hi);
    border-radius: 2px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
}
.chip-master { color: var(--amber); border-color: var(--amber-dim); }

.filelist { margin-bottom: 13px; }

.filerow {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
}

.kind {
    flex: 0 0 58px;
    padding: 2px 0;
    text-align: center;
    border: 1px solid var(--line-hi);
    border-radius: 2px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}
.kind-mp3   { color: var(--amber); border-color: var(--amber-dim); }
.kind-wav   { color: var(--moss);  border-color: #3c5449; }
.kind-stems { color: #9b8bc4;      border-color: #453d5c; }

.filename {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.filesize {
    flex: 0 0 auto;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}

.player {
    width: 100%;
    height: 34px;
    margin: 7px 0 12px;
    filter: invert(0.88) hue-rotate(180deg);
}

/* -------------------------------------------------------- Dropzone --- */

.dropzone {
    padding: 22px;
    border: 1px dashed var(--line-hi);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
.dropzone:hover { border-color: var(--amber-dim); }
.dropzone.is-over {
    border-color: var(--amber);
    background: rgba(217, 164, 65, 0.06);
}

.dropzone-label {
    margin: 0;
    font-family: var(--display);
    font-size: 17px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}
.dropzone-label span {
    display: block;
    margin-top: 3px;
    font-family: var(--body);
    font-size: 12px;
    letter-spacing: 0;
    text-transform: none;
}

.queue { list-style: none; margin: 14px 0 0; padding: 0; text-align: left; }

.queue-item {
    display: grid;
    grid-template-columns: 1fr 80px 130px 110px;
    align-items: center;
    gap: 11px;
    padding: 6px 0;
    font-size: 13px;
    border-top: 1px solid var(--line);
}

.queue-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.queue-size,
.queue-state {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    text-align: right;
}

.queue-bar {
    display: block;
    height: 5px;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: 2px;
    overflow: hidden;
}
.queue-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--amber);
    transition: width 0.15s linear;
}

.queue-item.is-done   .queue-state { color: var(--moss); }
.queue-item.is-failed .queue-state { color: var(--red); text-align: left; }
.queue-item.is-failed .queue-bar i { background: var(--red); }

.version-meta {
    margin-top: 15px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
}
.version-meta summary {
    cursor: pointer;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 13px;
}
.version-meta[open] summary { color: var(--amber); }

/* ------------------------------------------- Anmeldung, Einrichtung --- */

.page-narrow {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 30px 20px;
}

.sheet {
    width: 100%;
    max-width: 620px;
    padding: 34px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.sheet-login { max-width: 380px; }

.eyebrow {
    margin: 0;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.19em;
    text-transform: uppercase;
    color: var(--amber);
}

.display {
    margin: 5px 0 18px;
    font-family: var(--display);
    font-size: 40px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1;
}

.setup-block { margin-top: 26px; }
.setup-block h2 {
    font-family: var(--display);
    font-size: 17px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 9px;
}

.status {
    font-family: var(--mono);
    font-size: 12px;
    padding: 8px 11px;
    border-radius: var(--radius);
    margin: 7px 0;
}
.status-ok  { color: var(--moss); background: rgba(123, 163, 140, 0.09); }
.status-bad { color: var(--red);  background: rgba(200, 90, 74, 0.09); }

.codeblock {
    padding: 13px;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 12px;
    color: var(--amber);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ------------------------------------------------------------ klein --- */

@media (max-width: 720px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .trackrow { flex-wrap: wrap; gap: 9px; }
    .meta { min-width: 0; text-align: left; }
    .queue-item { grid-template-columns: 1fr 90px; }
    .queue-bar { grid-column: 1 / -1; }
    .display { font-size: 31px; }
    .input-title { font-size: 23px; }
    .tally { gap: 11px; }
    .tally span:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* --- Play-Knoepfe & Mini-Player (Listen-Wiedergabe) --------------------- */
.playbtn {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line, #3a3a3a);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.playbtn:hover { border-color: var(--accent, #d9a441); color: var(--accent, #d9a441); }
.playbtn-empty { opacity: 0.25; cursor: default; }
.playbtn-empty:hover { border-color: var(--line, #3a3a3a); color: inherit; }

.trackrow { align-items: center; gap: 0.75rem; }

.miniplayer {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.6rem 1.2rem;
    background: var(--panel, #191919);
    border-top: 1px solid var(--line, #3a3a3a);
    z-index: 50;
}
.mp-title {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.mp-close {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    color: inherit;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.7;
}
.mp-close:hover { opacity: 1; }
