/* --- Motion and contrast preferences --- */
@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;
    }

    .typewriter-cursor {
        animation: none !important;
        opacity: 1;
    }
}

@media (prefers-contrast: more) {
    .nav-btn,
    .toy-instruction,
    #hint {
        color: #cbd5e1;
    }

    .utility-btn,
    #reset-bubbles,
    .glass-panel {
        border-color: #94a3b8;
    }
}

@media (forced-colors: active) {
    :where(a, button, [tabindex]):focus-visible {
        outline-color: Highlight;
    }

    .utility-controls,
    .settings-panel,
    .settings-close,
    .settings-action,
    .focus-exit,
    .toy-about summary,
    .toy-about-body,
    .glass-panel,
    .utility-btn,
    #nav-bar,
    .nav-btn,
    #reset-bubbles,
    #bubble-grid,
    .bubble-progress,
    .noscript-message,
    #typewriter-paper,
    .scene-hint,
    .bubble,
    .tw-key {
        border: 1px solid CanvasText;
        box-shadow: none;
        backdrop-filter: none;
    }

    .glass-panel,
    .settings-panel,
    .toy-about-body,
    #bubble-grid,
    .bubble-progress,
    #typewriter-paper,
    .scene-hint,
    .noscript-message {
        background: Canvas;
        color: CanvasText;
    }

    .utility-btn,
    #reset-bubbles,
    .tw-clear,
    .nav-btn,
    .bubble,
    .tw-key {
        background: ButtonFace;
        color: ButtonText;
    }

    .nav-btn[aria-current="page"],
    .nav-btn.active {
        background: Highlight;
        color: HighlightText;
    }

    .start-copy,
    .toy-instruction,
    .tw-status,
    #hint {
        color: CanvasText;
    }

    .typewriter-cursor {
        background: CanvasText;
    }

    .bubble-progress-text {
        color: CanvasText;
    }

    .pop-ring,
    .pop-particle {
        display: none;
    }

    .game-card-link,
    .featured-game,
    .benefit-card,
    .game-filters,
    .filter-button,
    .button,
    .faq-list details {
        border-color: CanvasText;
        box-shadow: none;
        backdrop-filter: none;
    }

    .game-card-link,
    .featured-game,
    .benefit-card,
    .game-filters,
    .button-primary,
    .button-quiet {
        background: Canvas;
        color: CanvasText;
    }

    .hero-intro,
    .section-heading > p,
    .card-body p,
    .benefit-card p,
    .faq-section > div:first-child > p:last-child,
    .faq-list details p,
    .footer-inner > p,
    .footer-inner > nav a,
    .footer-inner > small,
    .eyebrow,
    .card-tags span,
    .card-action {
        color: CanvasText;
    }

    .filter-button.active,
    .filter-button[aria-pressed="true"] {
        background: Highlight;
        color: HighlightText;
    }

    .bubble.popped {
        border-style: dashed;
        opacity: 1;
    }
}
