:root {
    color-scheme: dark;

    --bg-top: #0c1320;
    --bg-middle: #101c2e;
    --bg-bottom: #07101c;

    --glass: rgba(255, 255, 255, 0.10);
    --glass-strong: rgba(255, 255, 255, 0.16);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-highlight: rgba(255, 255, 255, 0.30);

    --text: #f5f8ff;
    --text-soft: rgba(245, 248, 255, 0.74);
    --text-muted: rgba(245, 248, 255, 0.55);

    --accent: #6eb8ff;
    --accent-strong: #3193f5;
    --accent-soft: rgba(80, 166, 255, 0.22);

    --success: #62d8995d;
    --success-soft: rgba(55, 190, 120, 0.17);
    --success-border: rgba(98, 216, 154, 0.42);

    --warning: #ff976a;
    --warning-soft: rgba(255, 196, 62, 0.16);
    --warning-border: rgba(255, 211, 106, 0.40);

    --danger: #ff818d;
    --danger-soft: rgba(255, 83, 99, 0.16);
    --danger-border: rgba(255, 129, 141, 0.40);

    --shadow:
        0 24px 70px rgba(0, 0, 0, 0.40),
        0 2px 12px rgba(0, 0, 0, 0.24);

    --radius-large: 28px;
    --radius-medium: 20px;
    --radius-small: 14px;

    --page-width: 760px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg-bottom);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding:
        max(20px, env(safe-area-inset-top))
        max(16px, env(safe-area-inset-right))
        max(24px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));

    font-family:
        "Segoe UI Variable",
        "Segoe UI",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;

    color: var(--text);

    background:
        radial-gradient(
            circle at 12% 8%,
            rgba(79, 166, 255, 0.34),
            transparent 34%
        ),
        radial-gradient(
            circle at 88% 18%,
            rgba(177, 106, 255, 0.22),
            transparent 31%
        ),
        radial-gradient(
            circle at 50% 94%,
            rgba(0, 205, 196, 0.14),
            transparent 36%
        ),
        linear-gradient(
            160deg,
            var(--bg-top) 0%,
            var(--bg-middle) 48%,
            var(--bg-bottom) 100%
        );

    background-attachment: fixed;
}

body::before,
body::after {
    position: fixed;
    z-index: -1;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    content: "";
    filter: blur(70px);
    pointer-events: none;
    opacity: 0.45;
}

body::before {
    top: -80px;
    left: -90px;
    background: rgba(66, 150, 255, 0.55);
}

body::after {
    right: -100px;
    bottom: -110px;
    background: rgba(118, 77, 255, 0.35);
}

button,
input {
    font: inherit;
}

.page {
    width: 100%;
    max-width: var(--page-width);
    margin: 0 auto;
}

.page-header {
    margin-bottom: 20px;
    padding: 6px 4px 4px;
    text-align: center;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 8vw, 3rem);
    font-weight: 680;
    line-height: 1.05;
    letter-spacing: -0.045em;
    text-wrap: balance;
}

.page-header p {
    max-width: 520px;
    margin: 10px auto 0;
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.45;
}

.box {
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-bottom: 18px;
    padding: 22px;

    border: 1px solid var(--glass-border);
    border-radius: var(--radius-large);

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.15),
            rgba(255, 255, 255, 0.055)
        );

    box-shadow: var(--shadow);

    -webkit-backdrop-filter: blur(28px) saturate(155%);
    backdrop-filter: blur(28px) saturate(155%);
}

.box::before {
    position: absolute;
    top: 0;
    right: 10%;
    left: 10%;
    height: 1px;
    content: "";
    background:
        linear-gradient(
            90deg,
            transparent,
            var(--glass-highlight),
            transparent
        );
}

.box::after {
    position: absolute;
    top: -80px;
    right: -80px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    content: "";
    background: rgba(255, 255, 255, 0.07);
    filter: blur(12px);
    pointer-events: none;
}

.box h2 {
    position: relative;
    z-index: 1;
    margin: 0 0 18px;
    font-size: 1.35rem;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.box p {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--text-soft);
    line-height: 1.55;
}

.message {
    border-width: 1px;
}

.message-success {
    border-color: var(--success-border);
    background:
        linear-gradient(
            145deg,
            rgba(98, 216, 154, 0.20),
            var(--success-soft)
        );
}

.message-warning {
    border-color: var(--warning-border);
    background:
        linear-gradient(
            145deg,
            rgba(255, 211, 106, 0.19),
            var(--warning-soft)
        );
}

.message-error {
    border-color: var(--danger-border);
    background:
        linear-gradient(
            145deg,
            rgba(255, 129, 141, 0.19),
            var(--danger-soft)
        );
}

.message-success h2 {
    color: #1a9b50;
}

.message-warning h2 {
    color: #8f7325;
}

.message-error h2 {
    color: #ffc0c6;
}

.medium-data {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    margin: 0;
}

.medium-data > div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 14px 15px;

    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-small);

    background: rgba(0, 0, 0, 0.14);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.medium-data dt {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.medium-data dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 560;
    line-height: 1.4;
}

.medium-data dd.barcode {
    font-family:
        ui-monospace,
        "Cascadia Code",
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 1rem;
    letter-spacing: 0.04em;
}

.save-form {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 18px;
    margin-top: 22px;
}

.form-row {
    display: grid;
    gap: 9px;
}

.form-row label {
    color: var(--text-soft);
    font-size: 0.92rem;
    font-weight: 620;
}

.form-row input {
    width: 100%;
    min-height: 64px;
    padding: 14px 18px;

    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-medium);
    outline: none;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.14),
            rgba(255, 255, 255, 0.07)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        0 8px 22px rgba(0, 0, 0, 0.16);

    color: var(--text);
    caret-color: var(--accent);

    font-size: 1.35rem;
    font-weight: 650;
    text-align: center;

    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        background 150ms ease,
        transform 150ms ease;
}

.form-row input::placeholder {
    color: rgba(245, 248, 255, 0.35);
    font-weight: 450;
}

.form-row input:focus {
    border-color: rgba(110, 184, 255, 0.82);

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.18),
            rgba(255, 255, 255, 0.09)
        );

    box-shadow:
        0 0 0 4px rgba(74, 158, 255, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.13),
        0 12px 30px rgba(0, 0, 0, 0.20);
}

.save-button {
    position: relative;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    width: 100%;
    min-height: 66px;
    padding: 15px 22px;

    text-decoration: none;
    appearance: none;

    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: var(--radius-medium);

    background:
        linear-gradient(
            145deg,
            rgba(116, 193, 255, 0.96),
            rgba(42, 132, 238, 0.92)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -1px 0 rgba(0, 0, 0, 0.14),
        0 14px 32px rgba(23, 108, 209, 0.34);

    color: #ffffff;
    cursor: pointer;

    font-size: 1.18rem;
    font-weight: 720;
    letter-spacing: 0.01em;

    -webkit-tap-highlight-color: transparent;

    transition:
        transform 120ms ease,
        filter 120ms ease,
        box-shadow 120ms ease;
}

.save-button::before {
    position: absolute;
    top: 0;
    right: 10%;
    left: 10%;
    height: 1px;
    content: "";
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.75),
            transparent
        );
}

.save-button:hover {
    filter: brightness(1.05);
}

.save-button:active {
    transform: scale(0.985);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        0 7px 18px rgba(23, 108, 209, 0.28);
}

.save-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.92);
    outline-offset: 3px;
}

code {
    position: relative;
    z-index: 1;
    display: block;
    max-width: 100%;
    margin-top: 15px;
    padding: 14px;

    overflow-x: auto;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-small);

    background: rgba(0, 0, 0, 0.24);

    color: #d8ebff;

    font-family:
        ui-monospace,
        "Cascadia Code",
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 0.84rem;
    line-height: 1.5;
    white-space: nowrap;
}

.backend-output {
    position: relative;
    z-index: 1;

    margin: 0;
    padding: 16px;

    overflow-x: auto;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-small);

    background: rgba(0, 0, 0, 0.18);

    color: inherit;

    font-family:
        ui-monospace,
        "Cascadia Code",
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 0.92rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.archive-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;

    margin: -2px 0 2px;
    padding: 7px 11px;

    border: 1px solid var(--glass-border);
    border-radius: 999px;

    background: var(--accent-soft);
    color: var(--text-soft);

    font-size: 0.88rem;
    font-weight: 560;
    line-height: 1.25;
}

.archive-info strong {
    margin-left: 0.35em;
    color: var(--text);
    font-weight: 760;
}


/* ---------------------------------------------------------
   MDB Barcode Checker
   --------------------------------------------------------- */

.page-mdb {
    --page-width: 1120px;
}

.mdb-search-card h2,
.mdb-track-card h2 {
    margin-bottom: 18px;
}

.mdb-search-form {
    margin-top: 0;
}

.form-row select {
    width: 100%;
    min-height: 64px;
    padding: 14px 18px;

    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-medium);
    outline: none;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.14),
            rgba(255, 255, 255, 0.07)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        0 8px 22px rgba(0, 0, 0, 0.16);

    color: var(--text);
    font-size: 1rem;
    font-weight: 620;
}

.form-row select:focus {
    border-color: rgba(110, 184, 255, 0.82);

    box-shadow:
        0 0 0 4px rgba(74, 158, 255, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.13),
        0 12px 30px rgba(0, 0, 0, 0.20);
}

.form-row select option {
    color: #132033;
}

.save-button-secondary {
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.18),
            rgba(255, 255, 255, 0.08)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 10px 24px rgba(0, 0, 0, 0.20);

    color: var(--text);
}

.cd-head {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.cover {
    width: 132px;
    height: 132px;
    object-fit: cover;
    flex-shrink: 0;

    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-medium);

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.10),
            rgba(0, 0, 0, 0.18)
        );

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 16px 38px rgba(0, 0, 0, 0.30);
}

.cover-empty::before {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: var(--text-muted);
    content: "Cover";
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mdb-release-info {
    min-width: 0;
}

.mdb-release-info h2 {
    margin-bottom: 10px;
}

.discogs {
    margin-bottom: 16px !important;
    color: #ffd166 !important;
    font-weight: 720;
}

.mdb-release-data {
    margin-top: 16px;
}

.mdb-result {
    position: relative;
    z-index: 1;

    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: baseline;

    margin-top: 18px;
    padding: 15px 16px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-small);

    background: rgba(0, 0, 0, 0.14);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.percent {
    color: var(--text);
    font-size: clamp(2.1rem, 6vw, 3.4rem);
    font-weight: 780;
    line-height: 1;
    letter-spacing: -0.055em;
}

.counts {
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1.35;
}

.found {
    color: #8fffc0;
    font-weight: 760;
}

.missing {
    color: var(--danger);
    font-weight: 760;
}

.muted,
.small {
    color: var(--text-muted);
}

.small {
    font-size: 0.85rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.hidden {
    display: none;
}

.mdb-table {
    position: relative;
    z-index: 1;

    width: 100%;
    margin-top: 8px;

    border-collapse: collapse;

    color: var(--text-soft);
    font-size: 0.94rem;
}

.mdb-table th,
.mdb-table td {
    padding: 11px 9px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.10);

    text-align: left;
    vertical-align: top;
}

.mdb-table th {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mdb-table tr:last-child td {
    border-bottom: 0;
}

@media (min-width: 760px) {
    .mdb-search-form {
        grid-template-columns: minmax(280px, 1fr) 220px auto auto;
        align-items: end;
    }

    .mdb-search-form .save-button {
        width: auto;
        min-width: 150px;
    }
}

@media (max-width: 700px) {
    .page-mdb .page-header h1 {
        font-size: 1.55rem;
    }

    .cd-head {
        display: block;
    }

    .cover {
        width: 100%;
        max-width: 220px;
        height: auto;
        aspect-ratio: 1 / 1;
        margin-bottom: 16px;
    }

    .mdb-table,
    .mdb-table thead,
    .mdb-table tbody,
    .mdb-table tr,
    .mdb-table th,
    .mdb-table td {
        display: block;
    }

    .mdb-table thead {
        display: none;
    }

    .mdb-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .mdb-table tr {
        margin-bottom: 14px;
        padding: 12px;

        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: var(--radius-small);

        background: rgba(0, 0, 0, 0.14);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .mdb-table td {
        display: grid;
        grid-template-columns: 95px minmax(0, 1fr);
        gap: 12px;

        padding: 8px 0;

        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .mdb-table td:last-child {
        border-bottom: 0;
    }

    .mdb-table td::before {
        color: var(--text-muted);
        font-weight: 720;
    }

    .mdb-table td:nth-child(1)::before {
        content: "TNN";
    }

    .mdb-table td:nth-child(2)::before {
        content: "Interpret";
    }

    .mdb-table td:nth-child(3)::before {
        content: "Titel";
    }

    .mdb-table td:nth-child(4)::before {
        content: "Status";
    }

    .mdb-table td:nth-child(5)::before {
        content: "Treffer";
    }
}

@media (min-width: 560px) {
    body {
        padding-top: 36px;
        padding-right: 24px;
        padding-bottom: 44px;
        padding-left: 24px;
    }

    .page-header {
        margin-bottom: 28px;
    }

    .box {
        padding: 30px;
    }

    .medium-data {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .medium-data > div:first-child {
        grid-column: 1 / -1;
    }

    .form-row input {
        min-height: 68px;
    }

    .save-button {
        min-height: 68px;
    }
}

@media (min-width: 900px) {
    body {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding-top: 64px;
    }

    .page-header h1 {
        font-size: 3.2rem;
    }

    .box {
        border-radius: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;

        --bg-top: #dceaff;
        --bg-middle: #eff5ff;
        --bg-bottom: #d9e4f3;

        --glass: rgba(255, 255, 255, 0.52);
        --glass-strong: rgba(255, 255, 255, 0.72);
        --glass-border: rgba(255, 255, 255, 0.74);
        --glass-highlight: rgba(255, 255, 255, 0.95);

        --text: #132033;
        --text-soft: rgba(19, 32, 51, 0.72);
        --text-muted: rgba(19, 32, 51, 0.52);

        --shadow:
            0 24px 70px rgba(40, 70, 110, 0.20),
            0 2px 12px rgba(30, 60, 100, 0.10);
    }

    body {
        background:
            radial-gradient(
                circle at 12% 8%,
                rgba(77, 157, 255, 0.30),
                transparent 34%
            ),
            radial-gradient(
                circle at 88% 18%,
                rgba(166, 102, 255, 0.18),
                transparent 31%
            ),
            radial-gradient(
                circle at 50% 94%,
                rgba(0, 190, 178, 0.12),
                transparent 36%
            ),
            linear-gradient(
                160deg,
                var(--bg-top) 0%,
                var(--bg-middle) 48%,
                var(--bg-bottom) 100%
            );
    }

    .box {
        background:
            linear-gradient(
                145deg,
                rgba(255, 255, 255, 0.74),
                rgba(255, 255, 255, 0.40)
            );
    }

    .medium-data > div,
    code {
        background: rgba(255, 255, 255, 0.38);
    }

    .form-row input,
    .form-row select {
        background:
            linear-gradient(
                145deg,
                rgba(255, 255, 255, 0.82),
                rgba(255, 255, 255, 0.54)
            );

        color: var(--text);
    }

    code {
        color: #22476f;
    }
}