/* ============================================================
   CCG MOBILE MODE ALIGNMENT
   ------------------------------------------------------------
   Gives C64 and Amiga modes identical mobile control geometry.
============================================================ */

@media (max-width: 960px) {
    html[data-ccg-mode] .ccg-header-inner,
    body[data-ccg-mode] .ccg-header-inner {
        align-items: center !important;
    }

    html[data-ccg-mode] .ccg-header-actions,
    body[data-ccg-mode] .ccg-header-actions {
        min-width: 0 !important;
        align-items: center !important;
        justify-content: flex-end !important;
        margin: 0 !important;
        transform: none !important;
    }

    html[data-ccg-mode] .ccg-mode-toggle,
    body[data-ccg-mode] .ccg-mode-toggle {
        width: clamp(214px, 52vw, 270px) !important;
        max-width: calc(100vw - 32px) !important;
        align-self: center !important;
        margin: 0 auto !important;
        padding: 4px !important;
        transform: none !important;
        box-sizing: border-box !important;
    }

    html[data-ccg-mode] .ccg-mode-toggle__pill,
    body[data-ccg-mode] .ccg-mode-toggle__pill {
        position: relative !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        width: 100% !important;
        min-width: 0 !important;
        gap: 6px !important;
        padding: 6px 8px !important;
        margin: 0 !important;
        transform: none !important;
        box-sizing: border-box !important;
    }

    html[data-ccg-mode] .ccg-mode-toggle__label,
    body[data-ccg-mode] .ccg-mode-toggle__label {
        min-width: 0 !important;
        padding: 6px 8px !important;
        margin: 0 !important;
        font-size: 0.6rem !important;
        letter-spacing: 0.1em !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    html[data-ccg-mode] .ccg-mode-toggle__thumb,
    body[data-ccg-mode] .ccg-mode-toggle__thumb {
        top: 4px !important;
        right: auto !important;
        bottom: 4px !important;
        left: 4px !important;
        width: calc(50% - 7px) !important;
        height: auto !important;
        transform: none !important;
        box-sizing: border-box !important;
    }

    html[data-ccg-mode="amiga"] .ccg-mode-toggle__thumb,
    body[data-ccg-mode="amiga"] .ccg-mode-toggle__thumb {
        left: calc(50% + 3px) !important;
        transform: none !important;
    }

    html[data-ccg-mode="c64"] .ccg-mode-toggle__thumb,
    body[data-ccg-mode="c64"] .ccg-mode-toggle__thumb {
        left: 4px !important;
        transform: none !important;
    }
}

@media (max-width: 520px) {
    html[data-ccg-mode] .ccg-mode-toggle,
    body[data-ccg-mode] .ccg-mode-toggle {
        width: min(246px, calc(100vw - 28px)) !important;
        max-width: 100% !important;
    }

    html[data-ccg-mode] .ccg-mode-toggle__label,
    body[data-ccg-mode] .ccg-mode-toggle__label {
        padding-inline: 6px !important;
        font-size: 0.54rem !important;
        letter-spacing: 0.07em !important;
    }
}
