:root {
    --bg-main: #0c0d11;
    --bg-card: #151821;
    --bg-hover: #1f2330;
    --border-subtle: #262a38;
    --border-gold: rgba(212, 175, 55, 0.4);
    --border-gold-active: #d4af37;
    --text-main: #f0f2f5;
    --text-muted: #8b92a5;
    --accent: #d4af37;
    --accent-hover: #e6c35c;
    --col-public-bg: rgba(212, 175, 55, 0.035);
    --col-public-border: rgba(212, 175, 55, 0.22);
    --star-active: #d4af37;
    --star-inactive: #414756;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0 1.25rem 4rem 1.25rem;
}

.container,
.top-nav-bar {
    max-width: 1720px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.top-nav-bar {
    padding: 0.6rem 0.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.82rem;
}

.top-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
    cursor: pointer;
}

.top-nav-link:hover {
    color: var(--accent);
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.header-left h1 {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 0.35rem;
}

.desc-details {
    margin-top: 0.4rem;
}

.desc-details summary {
    font-size: 0.82rem;
    color: var(--accent);
    cursor: pointer;
    user-select: none;
    outline: none;
}

.desc-details summary:hover {
    text-decoration: underline;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
    max-width: 55rem;
    margin-top: 0.5rem;
    padding: 0.6rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 0.4rem;
}

.header-right {
    display: flex;
    gap: 0.6rem;
}

.btn-header {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 0.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-header:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.player-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #11131a;
    border: 1px solid var(--border-subtle);
    border-top: 2px solid var(--accent);
    border-radius: 0.5rem;
    padding: 1.4rem 1.6rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1.6rem;
    box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.75);
    min-height: 9.5rem;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

.btn-ctrl {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: #fff;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.45rem;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-ctrl:hover {
    background: var(--border-subtle);
    color: var(--accent);
}

.btn-action-sm {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 0.55rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 0.4rem;
    cursor: pointer;
    white-space: nowrap;
}

.btn-action-sm:hover {
    border-color: var(--accent);
}

.btn-gold {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}

.btn-gold:hover {
    background: var(--accent-hover);
    color: #000;
}

.mode-switch-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.55rem 0.85rem;
    border: 1px dashed var(--border-subtle);
    border-radius: 0.4rem;
    user-select: none;
    flex-shrink: 0;
}

.mode-switch-wrap input {
    cursor: pointer;
    width: 1.05rem;
    height: 1.05rem;
}

body.mode-mix-active .mode-switch-wrap {
    color: var(--accent);
    border-color: var(--accent);
    border-style: solid;
}

.player-meta {
    flex: 1;
    min-width: 14rem;
}

.player-track-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.player-track-sub {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* --- Einheitlicher 16:9 Media-Container für Suno-Iframe und Videos --- */
.player-media-wrap {
    width: 25rem;
    min-width: 22rem;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
    position: relative;
}

.player-media-wrap iframe,
.player-media-wrap video {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

#desktopLocalAudio {
    display: none;
}

.desktop-status-row {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.badge-status-dt {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-status-dt.active-suno { border-color: var(--accent); color: var(--accent); background: rgba(212, 175, 55, 0.08); }
.badge-status-dt.active-mp3 { border-color: #729fcf; color: #729fcf; background: rgba(114, 159, 207, 0.08); }
.badge-status-dt.active-clip { border-color: #729fcf; color: #729fcf; background: rgba(114, 159, 207, 0.08); }

.sticky-scroll-wrap {
    position: sticky;
    top: 10.2rem;
    z-index: 95;
    overflow-x: auto;
    overflow-y: hidden;
    height: 0.75rem;
    background: var(--bg-main);
    display: none;
}

.sticky-scroll-spacer {
    height: 1px;
}

.matrix-wrap {
    overflow: auto;
    max-height: calc(100vh - 12rem);
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    background: var(--bg-card);
}

#matrixTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.84rem;
}

#matrixTable th,
#matrixTable td {
    border-bottom: 1px solid var(--border-subtle);
    border-right: 1px solid var(--border-subtle);
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
}

#matrixTable th:last-child,
#matrixTable td:last-child {
    border-right: none;
}

#matrixTable thead tr th {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #191c26;
    border-bottom: 2px solid var(--border-subtle);
}

#matrixTable th {
    font-weight: 600;
    color: #fff;
    text-align: left;
    white-space: nowrap;
    user-select: none;
}

#matrixTable tbody tr:hover {
    background: rgba(255, 255, 255, 0.015);
}

#matrixTable th:nth-child(1),
#matrixTable td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 20;
    background: #141720;
    width: 2.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

#matrixTable th:nth-child(2),
#matrixTable td:nth-child(2) {
    position: sticky;
    left: 2.5rem;
    z-index: 20;
    background: #141720;
    min-width: 12.5rem;
    border-right: 2px solid var(--border-subtle);
}

#matrixTable thead th:nth-child(1) {
    z-index: 40;
    background: #1b1e2a;
    left: 0;
}

#matrixTable thead th:nth-child(2) {
    z-index: 40;
    background: #1b1e2a;
    left: 2.5rem;
}

.col-header {
    min-width: 11rem;
}

th.col-public {
    background: #232014 !important;
    border-top: 2px solid var(--accent) !important;
}

td.col-public {
    background-color: var(--col-public-bg);
}

#matrixTable tbody tr:hover td.col-public {
    background-color: rgba(212, 175, 55, 0.06);
}

.col-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.88rem;
    color: #fff;
    font-weight: 700;
}

.col-desc-text {
    font-size: 0.74rem;
    color: #dbe2ef;
    margin: 0.25rem 0 0.2rem 0;
    font-weight: normal;
    white-space: normal;
    max-width: 13rem;
    line-height: 1.35;
}

.col-meta-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-weight: normal;
}

.btn-play-all {
    background: #242938;
    border: 1px solid var(--border-subtle);
    color: #ccd2e0;
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.3rem;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    text-align: center;
}

.btn-play-all:hover {
    background: var(--border-subtle);
    color: var(--accent);
}

.badge-public {
    background: var(--accent);
    color: #000;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0.1rem 0.35rem;
    border-radius: 0.2rem;
    text-decoration: none;
    letter-spacing: 0.03em;
}

th.col-playing {
    background: #2d2613 !important;
    border-top: 2px solid var(--accent) !important;
}

th.col-playing .btn-play-all {
    background: var(--accent) !important;
    color: #000 !important;
    border-color: var(--accent) !important;
    font-weight: 700;
}

td.col-playing-cell {
    background-color: rgba(212, 175, 55, 0.08) !important;
    box-shadow: inset 1px 0 0 var(--border-gold-active), inset -1px 0 0 var(--border-gold-active) !important;
}

td.row-playing-cell {
    background-color: rgba(212, 175, 55, 0.08) !important;
    box-shadow: inset 0 1px 0 var(--border-gold-active), inset 0 -1px 0 var(--border-gold-active) !important;
}

td.row-playing-cell:first-child {
    box-shadow: inset 3px 0 0 var(--accent), inset 0 1px 0 var(--border-gold-active), inset 0 -1px 0 var(--border-gold-active) !important;
    color: var(--accent) !important;
}

.btn-evo-row.is-playing {
    background: var(--accent) !important;
    color: #000 !important;
    border-color: var(--accent) !important;
    font-weight: 700;
}

.track-num {
    font-weight: 700;
    font-size: 0.82rem;
}

.track-sub-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

.overall-badge {
    font-size: 0.7rem;
    color: var(--accent);
    background: rgba(212, 175, 55, 0.08);
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.btn-evo-row {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.68rem;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    cursor: pointer;
}

.btn-evo-row:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.cell-cluster {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.cell-select-cb {
    display: none;
    cursor: pointer;
    width: 0.95rem;
    height: 0.95rem;
    accent-color: var(--accent);
}

body.mode-mix-active .cell-select-cb {
    display: inline-block;
}

.cell-btn {
    background: #1f2330;
    border: 1px solid var(--border-subtle);
    color: #fff;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.cell-btn:hover {
    background: var(--border-subtle);
    color: var(--accent);
}

.cell-btn.is-playing {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #000 !important;
    font-weight: bold;
    animation: pulsePlay 2s infinite;
}

.cell-btn.active-mix {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

@keyframes pulsePlay {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.cell-duration {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.btn-cell-lyrics {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.72rem;
    padding: 0.15rem 0.3rem;
    border-radius: 0.25rem;
    cursor: pointer;
    line-height: 1;
}

.btn-cell-lyrics:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.cell-empty {
    color: #3b4050;
    font-size: 0.85rem;
    display: inline-block;
    padding-left: 0.4rem;
}

.rate-badge-wrap {
    position: relative;
    display: inline-block;
}

.rate-badge {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    border-radius: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.rate-badge:hover {
    border-color: var(--border-subtle);
    color: var(--accent);
}

.rate-popover {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    background: #141720;
    border: 1px solid var(--border-subtle);
    border-radius: 0.4rem;
    padding: 0.35rem 0.5rem;
    box-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.6);
    margin-top: 0.2rem;
}

.rate-popover.open {
    display: block;
}

.stars {
    display: flex;
    gap: 0.2rem;
}

.star {
    cursor: pointer;
    color: var(--star-inactive);
    font-size: 0.95rem;
    transition: color 0.1s ease;
}

.star.filled {
    color: var(--star-active);
}

.star:hover,
.star:hover ~ .star {
    color: var(--accent-hover);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.modal-overlay.open {
    display: flex;
}

.modal-card {
    background: #151821;
    border: 1px solid var(--border-subtle);
    border-radius: 0.5rem;
    width: 100%;
    max-width: 38rem;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.7);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem;
}

.btn-close:hover {
    color: #fff;
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #d8dce6;
    white-space: pre-line;
}

.modal-body-html {
    white-space: normal;
}

.modal-body-html h2 {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.4rem;
}

.modal-body-html h3 {
    font-size: 1rem;
    color: var(--accent);
    margin: 1rem 0 0.35rem 0;
}

.modal-body-html p, 
.modal-body-html ul {
    margin-bottom: 0.75rem;
    color: #c5cad6;
}

.modal-body-html ul {
    padding-left: 1.25rem;
}

.modal-body-html li {
    margin-bottom: 0.35rem;
}

.modal-body-html code {
    background: #0d0f14;
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.82rem;
    border: 1px solid var(--border-subtle);
}

.cookie-consent-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    background: #11131a;
    border-top: 1px solid var(--border-subtle);
    padding: 0.65rem 1.25rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: 0 -0.4rem 1.5rem rgba(0, 0, 0, 0.5);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.cookie-consent-bar.is-visible {
    display: flex;
}

.cookie-consent-text a {
    color: var(--accent);
    text-decoration: none;
}

.cookie-consent-text a:hover {
    text-decoration: underline;
}

.btn-cookie-ok {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 0.35rem 0.9rem;
    font-weight: 700;
    font-size: 0.78rem;
    border-radius: 0.3rem;
    cursor: pointer;
    white-space: nowrap;
}

.btn-cookie-ok:hover {
    background: var(--accent-hover);
}

.player-nav-grid {
    display: grid !important;
    grid-template-columns: 2.2rem 2.2rem !important;
    grid-template-rows: 1.6rem 1.6rem !important;
    gap: 0.35rem !important;
    margin-right: 0.35rem;
}

.player-nav-grid .btn-ctrl {
    width: 2.2rem !important;
    height: 1.6rem !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0.85rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0.35rem !important;
}

.ctrl-column-group {
    display: inline-flex !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
    vertical-align: middle;
}

.btn-portal-fixed {
    width: 9.6rem !important;
    min-width: 9.6rem !important;
    max-width: 9.6rem !important;
    height: 1.6rem !important;
    min-height: 1.6rem !important;
    padding: 0 0.5rem !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    font-size: 0.82rem !important;
    margin: 0 !important;
    border-radius: 0.35rem !important;
}

a.btn-portal-fixed {
    line-height: 1.6rem !important;
    text-decoration: none !important;
}

.mode-switch-wrap.btn-portal-fixed {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-main) !important;
    cursor: pointer !important;
    gap: 0.45rem !important;
    user-select: none !important;
}

.mode-switch-wrap.btn-portal-fixed:hover {
    border-color: var(--accent) !important;
}

.mode-switch-wrap.btn-portal-fixed input[type="checkbox"] {
    margin: 0 !important;
    cursor: pointer !important;
}

.btn-booklet-disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}