.action-menu.twostep {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.action-menu .menu-group {
    position: relative;
}

.action-menu .menu-main {
    padding: 14px 18px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    color: #03101a;
    font-weight: 800;
    cursor: pointer;
    font-size: 1rem;
    min-width: 180px;
}

.action-menu .menu-main.secondary-button {
    background: linear-gradient(90deg, #9bc1ff, #79a2ff);
}

.action-menu .menu-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 110%;
    min-width: 240px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    z-index: 10;
    flex-direction: column;
    gap: 0;
    padding: 10px 0;
}

.action-menu .menu-group.open .menu-dropdown {
    display: flex;
}

.action-menu .menu-dropdown button {
    display: block;
    width: 100%;
    border-radius: 0;
    border: none;
    background: none;
    color: var(--text);
    text-align: left;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.action-menu .menu-dropdown button:hover {
    background: rgba(124, 241, 200, 0.08);
    color: var(--accent);
}

.action-menu .menu-dropdown .danger-button:hover {
    background: rgba(255, 123, 138, 0.12);
    color: var(--danger);
}

@media (max-width: 960px) {
    .action-menu.twostep {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    .action-menu .menu-dropdown {
        position: static;
        min-width: 0;
        box-shadow: none;
        border-radius: 0 0 16px 16px;
    }
}
/* Horizontal action menu for Spotify/Sync/Cover/Cleanup */
.action-menu {
    display: flex;
    gap: 18px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.action-menu .primary-button,
.action-menu .secondary-button,
.action-menu .danger-button {
    margin-bottom: 0;
    min-width: 180px;
}

@media (max-width: 960px) {
    .action-menu {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 14px;
    }
    .action-menu .primary-button,
    .action-menu .secondary-button,
    .action-menu .danger-button {
        min-width: 0;
        width: 100%;
    }
}
:root {
    color-scheme: dark;
    --bg: #090b16;
    --bg-soft: rgba(14, 18, 38, 0.84);
    --surface: rgba(18, 24, 48, 0.9);
    --surface-strong: #131b39;
    --text: #f5f7ff;
    --muted: #a9b0d1;
    --border: rgba(145, 160, 255, 0.18);
    --accent: #7cf1c8;
    --accent-strong: #58d9ff;
    --danger: #ff7b8a;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(124, 241, 200, 0.15), transparent 30%),
        radial-gradient(circle at top right, rgba(88, 217, 255, 0.16), transparent 34%),
        linear-gradient(160deg, #050611 0%, #0a1020 45%, #05060d 100%);
    color: var(--text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    padding: 32px;
}

.app-shell {
    max-width: 1240px;
    margin: 0 auto;
}

.hero {
    display: flex;
    gap: 24px;
    justify-content: space-between;
    align-items: end;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(25, 32, 63, 0.92), rgba(15, 20, 42, 0.86));
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.3rem, 5vw, 4.4rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.78rem;
}

.hero-copy {
    max-width: 58ch;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.hero-meta {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 220px;
}

.hero-meta span,
.panel-note,
#statusText,
.card-subtitle,
.leaderboard .secondary {
    color: var(--muted);
}

.layout {
    display: grid;
    grid-template-columns: minmax(240px, 0.78fr) minmax(0, 1.8fr) minmax(260px, 0.9fr);
    gap: 24px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.panel-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 18px;
}

.panel-head h2 {
    margin: 0;
    font-size: 1.35rem;
}

.stats-panel {
    margin-bottom: 24px;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-line span {
    color: var(--muted);
}

.stat-line strong {
    font-size: 1rem;
}

.stats-progress-wrap {
    margin-top: 12px;
}

.match-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.duel-stack {
    display: grid;
    gap: 18px;
}

.match-card {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 24px;
    text-align: left;
    background: linear-gradient(180deg, rgba(22, 29, 58, 0.98), rgba(12, 16, 35, 0.95));
    color: var(--text);
    cursor: pointer;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: space-between;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.card-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.match-card:hover,
.match-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(124, 241, 200, 0.45);
    outline: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
}

.card-label {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(124, 241, 200, 0.12);
    color: var(--accent);
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.card-title {
    font-size: 1.55rem;
    line-height: 1.1;
}

.card-subtitle {
    font-size: 0.95rem;
}

.card-rating {
    display: inline-flex;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(88, 217, 255, 0.12);
    color: var(--accent-strong);
    font-weight: 700;
}

.panel-note {
    margin: 18px 0 0;
}

.panel-separator {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 18px 0;
}

.leftbar,
.rightbar {
    display: grid;
    align-content: start;
}

.stack-form {
    display: grid;
    gap: 14px;
}

.stack-form label {
    display: grid;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--muted);
}

.stack-form input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
}

.stack-form input:focus {
    outline: 2px solid rgba(124, 241, 200, 0.34);
    border-color: rgba(124, 241, 200, 0.32);
}

.primary-button {
    padding: 14px 18px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    color: #03101a;
    font-weight: 800;
    cursor: pointer;
}

.secondary-button {
    margin-bottom: 10px;
    background: linear-gradient(90deg, #9bc1ff, #79a2ff);
}

.danger-button {
    margin-bottom: 10px;
    background: linear-gradient(90deg, #ff8a8a, #ff5f7a);
    color: #2a0610;
}

.leaderboard {
    display: grid;
    gap: 8px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.leaderboard-main {
    min-width: 0;
}

.leaderboard-item strong {
    display: block;
    font-size: 0.96rem;
}

.leaderboard-item .secondary {
    font-size: 0.85rem;
}

.trend-indicator {
    display: inline-block;
    width: 1.2ch;
    margin-right: 8px;
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
}

.trend-up {
    color: var(--accent);
}

.trend-down {
    color: var(--danger);
}

.trend-same {
    color: var(--muted);
}

.message {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(124, 241, 200, 0.09);
    border: 1px solid rgba(124, 241, 200, 0.18);
    color: var(--text);
}

.message.error {
    background: rgba(255, 123, 138, 0.12);
    border-color: rgba(255, 123, 138, 0.2);
}

@media (max-width: 960px) {
    body {
        padding: 18px;
    }

    .hero,
    .layout,
    .match-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-line {
        align-items: flex-start;
        flex-direction: column;
    }

    .layout {
        gap: 18px;
    }

    .hero {
        align-items: start;
    }
}
