:root {
    color-scheme: dark;
    --bg: #03060c;
    --panel: #0b101b;
    --panel-soft: #101827;
    --text: #f5f7fb;
    --muted: #aeb8c9;
    --line: #12325c;
    --cyan: #078cff;
    --blue: #006de8;
    --ice: #dfe9f6;
    --steel: #8593a7;
    --lime: #45d9ff;
    --danger: #ff6161;
    --shadow: 0 20px 70px rgba(0, 9, 24, .62);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(0, 109, 232, .24), transparent 30rem),
        radial-gradient(circle at top right, rgba(7, 140, 255, .18), transparent 28rem),
        var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.global-banner {
    width: 100%;
    overflow: hidden;
    border-bottom: 1px solid rgba(7, 140, 255, .42);
    background: #000;
    box-shadow: 0 18px 70px rgba(0, 109, 232, .16);
}

.global-banner img {
    display: block;
    width: 100%;
    height: clamp(118px, 25vw, 270px);
    object-fit: cover;
    object-position: center;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 3rem);
    border-bottom: 1px solid rgba(7, 140, 255, .28);
    background: rgba(3, 6, 12, .9);
    backdrop-filter: blur(18px);
}

.brand {
    color: var(--ice);
    font-weight: 800;
    letter-spacing: 0;
    text-shadow: 0 0 24px rgba(7, 140, 255, .5);
}

.nav,
.actions,
.metric-row {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    color: var(--muted);
}

.nav a:hover {
    color: var(--ice);
}

.shell {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: clamp(1.25rem, 4vw, 3rem);
}

.hero {
    display: grid;
    min-height: calc(100vh - 9rem);
    align-items: center;
    padding: clamp(2rem, 8vw, 6rem) 0;
}

.hero-copy {
    max-width: 720px;
}

.eyebrow {
    margin: 0 0 .5rem;
    color: var(--cyan);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 1rem;
    font-size: clamp(2.35rem, 8vw, 5.4rem);
    line-height: .95;
}

h2 {
    font-size: clamp(1.35rem, 4vw, 2rem);
}

p {
    color: var(--muted);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: .75rem 1rem;
    border: 0;
    border-radius: 8px;
    color: #061018;
    background: linear-gradient(135deg, var(--cyan), var(--ice));
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(7, 140, 255, .24);
}

.button-secondary {
    color: var(--text);
    background: linear-gradient(135deg, #101827, #0b1324);
    border: 1px solid rgba(7, 140, 255, .25);
    box-shadow: none;
}

.button-danger {
    color: #fff;
    background: var(--danger);
    box-shadow: none;
}

.button-small {
    min-height: 2.2rem;
    padding: .5rem .75rem;
    font-size: .9rem;
}

.auth-card,
.panel,
.set-card,
.stat-card,
.empty-state {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(11, 16, 27, .96), rgba(5, 9, 17, .96));
    box-shadow: var(--shadow);
}

.auth-card {
    max-width: 460px;
    margin: 2rem auto;
    padding: clamp(1.25rem, 4vw, 2rem);
}

.auth-separator {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0;
    color: var(--muted);
    font-weight: 800;
}

.auth-separator::before,
.auth-separator::after {
    content: "";
    height: 1px;
    background: var(--line);
}

.form-hint {
    margin: .75rem 0 0;
    font-size: .9rem;
}

.form {
    display: grid;
    gap: 1rem;
}

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

.full {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: .45rem;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 700;
}

.checkline {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.checkline input {
    width: auto;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .8rem .9rem;
    color: var(--text);
    background: #050a13;
    font: inherit;
}

button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

textarea {
    resize: vertical;
}

.flash {
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.flash-success,
.flash-ok {
    border-color: rgba(183, 244, 91, .5);
}

.flash-error,
.flash-warn {
    border-color: rgba(255, 97, 97, .6);
}

.flash-info {
    border-color: rgba(7, 140, 255, .55);
}

.page-head,
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stats-grid,
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

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

.stat-card,
.set-card,
.panel,
.empty-state {
    padding: 1.25rem;
}

.stat-card span,
.card-meta {
    color: var(--muted);
    font-size: .84rem;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    margin-top: .4rem;
    font-size: clamp(1.7rem, 5vw, 2.7rem);
}

.set-card h2,
.set-card h3 {
    margin-bottom: .4rem;
}

.metric-row {
    justify-content: space-between;
    margin-top: .75rem;
    color: var(--muted);
}

.wrap {
    flex-wrap: wrap;
}

.compact {
    justify-content: flex-end;
}

.panel {
    margin-bottom: 1.5rem;
}

.track-list {
    display: grid;
    gap: .75rem;
}

.track-row {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: .9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #050a13;
}

.track-row.is-checked {
    border-color: rgba(7, 140, 255, .55);
    opacity: .82;
}

.track-order {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: 8px;
    color: #061018;
    background: linear-gradient(135deg, var(--cyan), var(--ice));
    font-weight: 900;
}

.track-row span,
.track-row small {
    display: block;
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: .8rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--muted);
    font-size: .8rem;
    text-transform: uppercase;
}

.data-table small {
    color: var(--muted);
}

.changelog-box {
    max-height: 28rem;
    overflow: auto;
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: #050a13;
    font: 0.9rem/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    white-space: pre-wrap;
}

.mini-results {
    display: grid;
    gap: .35rem;
    margin: 1rem 0;
}

.qr-share {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    margin: 1rem 0;
}

.qr-share img,
.qr-public img {
    width: 112px;
    height: 112px;
    padding: .45rem;
    border-radius: 8px;
    background: #fff;
}

.qr-public {
    flex: 0 0 auto;
}

.qr-public img {
    width: clamp(168px, 24vw, 240px);
    height: clamp(168px, 24vw, 240px);
}

.tabs {
    display: inline-flex;
    gap: .35rem;
    margin-bottom: 1rem;
    padding: .25rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #050a13;
}

.tab-button {
    border: 0;
    border-radius: 6px;
    padding: .65rem .9rem;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.tab-button.is-active {
    color: #061018;
    background: linear-gradient(135deg, var(--cyan), var(--ice));
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.dynamic-list {
    display: grid;
    gap: .75rem;
}

.dynamic-list label {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.dropzone {
    place-items: center;
    min-height: 9rem;
    padding: 1.25rem;
    border: 1px dashed rgba(7, 140, 255, .65);
    border-radius: 8px;
    background: rgba(7, 140, 255, .08);
    text-align: center;
    cursor: pointer;
}

.dropzone.is-dragover {
    border-color: var(--ice);
    background: rgba(7, 140, 255, .18);
    box-shadow: 0 0 34px rgba(7, 140, 255, .22);
}

.dropzone-title {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 900;
}

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

.dropzone input[type="file"] {
    max-width: 28rem;
}

form {
    margin: 0;
}

.site-footer {
    display: grid;
    gap: .35rem;
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 3rem) 1.5rem;
    text-align: right;
}

.site-footer small,
.site-footer span {
    display: block;
}

@media (max-width: 820px) {
    .topbar,
    .page-head,
    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .global-banner img {
        height: clamp(92px, 29vw, 150px);
        object-position: center;
    }

    .stats-grid,
    .cards-grid,
    .grid-form {
        grid-template-columns: 1fr;
    }

    .track-row {
        grid-template-columns: 2.75rem minmax(0, 1fr);
    }

    .track-row .actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .qr-share {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .nav,
    .actions {
        width: 100%;
    }

    .button,
    .actions .button {
        width: 100%;
    }

    .global-banner img {
        height: 92px;
        object-position: center;
    }
}
