html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: #101114;
}

body {
    overflow-x: hidden;
}

button,
input,
textarea {
    font: inherit;
}

#blazor-error-ui {
    background: #b32121;
    color: white;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none;
    left: 0;
    padding: .75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .reload {
        color: white;
        font-weight: 700;
        margin-left: 1rem;
    }

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: .75rem;
    }

/* Root */

.mq-root {
    min-height: 100vh;
    padding: 24px;
    color: var(--mq-text);
    background: radial-gradient(circle at top left, var(--mq-glow), transparent 35%), radial-gradient(circle at top right, rgba(255,255,255,.08), transparent 30%), var(--mq-bg);
}


    .mq-root.theme-dark {
        --mq-bg: #0d0a10;
        --mq-surface: #17121b;
        --mq-card: #211926;
        --mq-card-soft: #2b2031;
        --mq-text: #f6f1f7;
        --mq-muted: #b8aabf;
        --mq-primary: #ff4fd8;
        --mq-primary-text: #220018;
        --mq-accent: #7c5cff;
        --mq-border: #44324d;
        --mq-glow: rgba(255, 79, 216, .20);
    }

    .mq-root.theme-glam {
        --mq-bg: #ffe8f5;
        --mq-surface: #fff3fa;
        --mq-card: #ffd8ef;
        --mq-card-soft: #ffc6e8;
        --mq-text: #4b2140;
        --mq-muted: #865a79;
        --mq-primary: #ff4fb5;
        --mq-primary-text: #ffffff;
        --mq-accent: #ffb347;
        --mq-border: #f1b6d8;
        --mq-glow: rgba(255, 79, 181, .15);
    }

/* Header */

.mq-setup-layout,
.mq-header {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

    .mq-header h1 {
        margin: 0;
        font-size: 38px;
        font-weight: 800;
    }

    .mq-header p {
        margin: 4px 0 0;
        color: var(--mq-muted);
    }

.mq-theme-switcher {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    gap: 6px;
    padding: 6px;
    background: var(--mq-surface);
    border: 1px solid var(--mq-border);
    border-radius: 999px;
    z-index: 1000;
    width: auto;
}

.mq-theme-btn {
    border: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: transparent;
    color: var(--mq-muted);
    cursor: pointer;
}

.mq-theme-switcher form {
    display: flex;
    margin: 0;
}

.mq-header-separator {
    width: 1px;
    margin: 4px 2px;
    background: var(--mq-border);
}

.mq-logout-btn:hover {
    background: var(--mq-card-soft);
    color: var(--mq-text);
}

    .mq-theme-btn.active {
        background: var(--mq-primary);
        color: var(--mq-primary-text);
        font-weight: 700;
    }

/* Buttons */

.mq-btn,
.mq-spotify-login {
    border: 0;
    border-radius: 12px;
    padding: 11px 18px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

    .mq-btn:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

.mq-btn-primary,
.mq-btn-success {
    background: var(--mq-primary);
    color: var(--mq-primary-text);
}

.mq-btn-warning {
    background: #ffbe0b;
    color: #211600;
}

.mq-btn-muted {
    background: var(--mq-card-soft);
    color: var(--mq-text);
}

.mq-btn-info {
    background: var(--mq-accent);
    color: white;
}

.mq-full {
    width: 100%;
    margin-top: 16px;
}

/* Login */

.mq-login-screen,
.mq-game-screen {
    min-height: 70vh;
    display: grid;
    place-items: center;
    text-align: center;
}

.mq-spotify-login {
    display: inline-block;
    margin-top: 20px;
    background: var(--mq-primary);
    color: var(--mq-primary-text);
    font-size: 22px;
    padding: 18px 34px;
}

/* Setup */

.mq-setup-layout {
    display: grid;
    grid-template-columns: minmax(520px, 820px) 320px;
    gap: 24px;
    align-items: start;
}

.mq-section-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

    .mq-section-header h2 {
        margin: 0;
        font-size: 30px;
    }

    .mq-section-header p {
        margin: 4px 0 0;
        color: var(--mq-muted);
    }

.mq-search,
.mq-input,
.mq-textarea {
    width: 100%;
    border: 1px solid var(--mq-border);
    background: var(--mq-surface);
    color: var(--mq-text);
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
}

.mq-search {
    max-width: 320px;
}

.mq-textarea {
    min-height: 110px;
    resize: vertical;
}

/* Playlists */

.mq-playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.mq-playlist-card {
    position: relative;
    display: flex;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    background: var(--mq-card);
    border: 1px solid var(--mq-border);
    cursor: pointer;
    transition: .15s ease;
}

    .mq-playlist-card:hover {
        transform: translateY(-2px);
        background: var(--mq-card-soft);
    }

    .mq-playlist-card.selected {
        border-color: var(--mq-primary);
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--mq-primary) 35%, transparent);
    }

.mq-playlist-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.mq-playlist-card {
    padding: 10px;
    border-radius: 14px;
}

.mq-playlist-image {
    width: 64px;
    height: 64px;
    border-radius: 10px;
}

.mq-playlist-info h4 {
    margin: 0 0 8px;
    font-size: 17px;
}

.mq-playlist-info p,
.mq-playlist-info small {
    margin: 0;
    color: var(--mq-muted);
}

.mq-selected-badge {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--mq-primary);
    color: var(--mq-primary-text);
    font-weight: 900;
}

/* Side panel */

.mq-side-panel {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 24px;
}

.mq-panel-card,
.mq-game-card {
    background: var(--mq-card);
    border: 1px solid var(--mq-border);
    border-radius: 22px;
    padding: 22px;
}

    .mq-panel-card h3 {
        margin-top: 0;
    }

    .mq-panel-card label {
        display: block;
        margin: 14px 0 6px;
        color: var(--mq-muted);
    }

.mq-selected-count {
    color: var(--mq-muted);
    margin-bottom: 14px;
}

.mq-message {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--mq-card-soft);
    color: var(--mq-muted);
}

.mq-empty {
    padding: 40px;
    border-radius: 18px;
    background: var(--mq-card);
    color: var(--mq-muted);
    text-align: center;
}

/* Game */

.mq-game-card {
    width: min(720px, 100%);
    text-align: center;
    padding: 44px;
}

.mq-progress {
    color: var(--mq-muted);
    margin-bottom: 18px;
}

.mq-big-icon {
    font-size: 72px;
}

.mq-countdown {
    font-size: 120px;
    font-weight: 900;
    line-height: 1;
    /*color: var(--mq-primary);*/
    color: var(--mq-accent);
}

.mq-game-controls {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.mq-answer-image {
    width: 240px;
    height: 240px;
    object-fit: cover;
    border-radius: 24px;
    margin-bottom: 22px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

.mq-answer p {
    color: var(--mq-muted);
    margin: 0;
}

.mq-answer h2 {
    margin: 8px 0 4px;
    font-size: 36px;
}

.mq-answer h3 {
    margin: 0;
    color: var(--mq-primary);
}

.mq-next-timer {
    margin-top: 22px;
    color: var(--mq-muted);
    font-size: 20px;
}

/* Mobile */

@media (max-width: 900px) {
    .mq-root {
        padding: 20px;
    }

    .mq-setup-layout {
        grid-template-columns: 1fr;
    }

    .mq-side-panel {
        position: static;
    }

    .mq-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .mq-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .mq-search {
        max-width: none;
    }
}

.mq-root.theme-glam .mq-panel-card,
.mq-root.theme-glam .mq-playlist-card,
.mq-root.theme-glam .mq-game-card {
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(255, 79, 181, .15);
}

.mq-volume {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

    .mq-volume input {
        width: 250px;
    }

.mq-btn-danger {
    background: #dc3545;
    color: white;
}

.mq-floating-unicorn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 140px;
    z-index: 50;
    pointer-events: none;
    animation: unicornFloat 4s ease-in-out infinite;
}

@keyframes unicornFloat {

    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }

    100% {
        transform: translateY(0);
    }
}

.theme-glam {
    position: relative;
}

    .theme-glam::before {
        content: "";
        position: fixed;
        inset: 0;
        background-image: url('/images/unicorns/unicorn-logo.png'), url('/images/unicorns/pepe-unicorn.png');
        background-position: left 100px top 180px, right 400px bottom 120px;
        background-size: 180px, 120px;
        background-repeat: no-repeat;
        opacity: 0.08;
        pointer-events: none;
        z-index: 0;
    }

.mq-root > * {
    position: relative;
    z-index: 1;
}

.mq-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mq-title-unicorn {
    width: 48px;
    height: 48px;
}

.mq-playlist-unicorn-wrap {
    margin-top: 28px;
    display: flex;
    justify-content: center;
}

.mq-playlist-unicorn {
    width: 150px;
    pointer-events: none;
    animation: unicornFloat 4s ease-in-out infinite;
}

@keyframes unicornFloat {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0);
    }
}

.mq-playlist-actions {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transform: translateY(4px);
    transition: .15s ease;
}

.mq-playlist-card:hover .mq-playlist-actions {
    opacity: 1;
    transform: translateY(0);
}

.mq-playlist-action-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--mq-border);
    border-radius: 999px;
    background: var(--mq-card-soft);
    color: var(--mq-text);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

    .mq-playlist-action-btn:hover {
        background: var(--mq-primary);
        color: var(--mq-primary-text);
    }

    .mq-playlist-action-btn.danger:hover {
        background: #dc3545;
        color: white;
    }

    .mq-playlist-action-btn:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

.mq-voice-btn {
    margin-left: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 9px;
    border-radius: 10px;
    line-height: 1;
    transition: 0.15s ease;
}

    .mq-voice-btn:hover {
        background: rgba(255, 255, 255, 0.16);
    }

    .mq-voice-btn:active {
        transform: scale(0.95);
    }


/* =========================
   Create game / Settings
   ========================= */

.mq-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

    .mq-panel-header h3 {
        margin: 0;
        font-size: 20px;
        font-weight: 700;
        letter-spacing: -0.02em;
    }

/* Gear button */

.mq-settings-button {
    width: 38px;
    height: 38px;
    border: 1px solid var(--mq-border);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--mq-card-soft), var(--mq-card));
    color: var(--mq-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

    .mq-settings-button:hover {
        transform: translateY(-1px);
        border-color: color-mix(in srgb, var(--mq-primary) 50%, var(--mq-border));
        background: linear-gradient( 180deg, color-mix(in srgb, var(--mq-card-soft) 78%, var(--mq-primary) 22%), var(--mq-card) );
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--mq-primary) 18%, transparent), 0 8px 24px rgba(0, 0, 0, 0.22);
    }

    .mq-settings-button:active {
        transform: scale(0.96);
    }

    .mq-settings-button:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--mq-primary) 32%, transparent), 0 8px 24px rgba(0, 0, 0, 0.22);
    }

/* Modal */

.mq-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(9, 7, 12, 0.62);
    backdrop-filter: blur(10px);
    animation: mqFadeIn .18s ease;
}

.mq-modal {
    width: min(100%, 480px);
    background: linear-gradient( 180deg, color-mix(in srgb, var(--mq-card) 88%, white 12%), var(--mq-card) );
    border: 1px solid var(--mq-border);
    border-radius: 24px;
    padding: 22px;
    color: var(--mq-text);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34), 0 0 0 1px color-mix(in srgb, var(--mq-primary) 10%, transparent);
    animation: mqModalPop .2s ease;
}

.mq-root.theme-glam .mq-modal {
    box-shadow: 0 16px 50px rgba(255, 79, 181, 0.18), 0 0 0 1px color-mix(in srgb, var(--mq-primary) 12%, transparent);
}

/* Header */

.mq-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

    .mq-modal-header h3 {
        margin: 0;
        font-size: 30px;
        font-weight: 800;
        letter-spacing: -0.03em;
    }

/* Close button */

.mq-modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--mq-border);
    border-radius: 12px;
    background: var(--mq-surface);
    color: var(--mq-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

    .mq-modal-close:hover {
        transform: rotate(90deg);
        background: var(--mq-card-soft);
        border-color: color-mix(in srgb, var(--mq-primary) 45%, var(--mq-border));
    }

    .mq-modal-close:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--mq-primary) 30%, transparent);
    }

/* Settings fields */

.mq-settings-grid {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}

.mq-field {
    display: grid;
    gap: 6px;
}

    .mq-field label {
        margin: 0;
        font-size: 14px;
        font-weight: 600;
        color: var(--mq-muted);
    }

    .mq-field .mq-input {
        height: 46px;
        padding: 0 14px;
        border-radius: 14px;
        background: color-mix(in srgb, var(--mq-surface) 88%, transparent);
        border: 1px solid var(--mq-border);
        transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
    }

        .mq-field .mq-input:hover {
            border-color: color-mix(in srgb, var(--mq-primary) 30%, var(--mq-border));
        }

        .mq-field .mq-input:focus {
            outline: none;
            border-color: color-mix(in srgb, var(--mq-primary) 60%, var(--mq-border));
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--mq-primary) 18%, transparent);
            background: var(--mq-surface);
        }

    /* Optional: cleaner number inputs */
    .mq-field input[type="number"] {
        appearance: textfield;
        -moz-appearance: textfield;
    }

        .mq-field input[type="number"]::-webkit-outer-spin-button,
        .mq-field input[type="number"]::-webkit-inner-spin-button {
            margin: 0;
        }

/* Actions */

.mq-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

    .mq-modal-actions .mq-btn {
        min-width: 96px;
    }

        .mq-modal-actions .mq-btn:not(.mq-btn-primary) {
            background: var(--mq-card-soft);
            color: var(--mq-text);
        }

/* Error */

.mq-message-error {
    background: rgba(220, 53, 69, 0.12);
    color: #ffb6bf;
    border: 1px solid rgba(220, 53, 69, 0.28);
}

/* Animations */

@keyframes mqFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes mqModalPop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile */

@media (max-width: 640px) {
    .mq-modal-backdrop {
        padding: 14px;
        align-items: flex-end;
    }

    .mq-modal {
        width: 100%;
        border-radius: 22px 22px 0 0;
        padding: 18px;
    }

    .mq-modal-header h3 {
        font-size: 24px;
    }

    .mq-modal-actions {
        flex-direction: column-reverse;
    }

        .mq-modal-actions .mq-btn {
            width: 100%;
        }
}

.mq-settings-button span {
    display: inline-block;
    transition: transform .2s ease;
}

.mq-settings-button:hover span {
    transform: rotate(45deg);
}

/* Local audio file picker */

.mq-file-picker {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.mq-file-button {
    position: relative;
    min-height: 42px;
    margin: 0 !important;
    padding: 0 14px;
    border: 1px solid var(--mq-border);
    border-radius: 12px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--mq-card-soft);
    color: var(--mq-text) !important;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    overflow: hidden;
    transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

    .mq-file-button:hover {
        transform: translateY(-1px);
        border-color: color-mix( in srgb, var(--mq-primary) 55%, var(--mq-border) );
        background: color-mix( in srgb, var(--mq-card-soft) 82%, var(--mq-primary) 18% );
        box-shadow: 0 0 0 3px color-mix( in srgb, var(--mq-primary) 14%, transparent );
    }

    .mq-file-button:active {
        transform: scale(.97);
    }

    .mq-file-button:focus-within {
        border-color: var(--mq-primary);
        box-shadow: 0 0 0 3px color-mix( in srgb, var(--mq-primary) 22%, transparent );
    }

.mq-file-icon {
    width: 23px;
    height: 23px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    background: var(--mq-primary);
    color: var(--mq-primary-text);
    font-size: 13px;
    line-height: 1;
}

.mq-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.mq-file-info {
    min-width: 0;
    height: 42px;
    padding: 0 13px;
    border: 1px solid var(--mq-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    background: var(--mq-surface);
    color: var(--mq-text);
    overflow: hidden;
}

.mq-file-placeholder,
.mq-file-selected {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mq-file-placeholder {
    color: var(--mq-muted);
}

.mq-file-selected {
    color: var(--mq-text);
    font-weight: 600;
}

@media (max-width: 480px) {
    .mq-file-picker {
        grid-template-columns: 1fr;
    }

    .mq-file-button {
        width: 100%;
    }
}