/* Shared responsive layer for interactive plays and activity views. */

:root {
    --play-gutter-lg: clamp(18px, 2vw, 28px);
    --play-gutter-md: clamp(14px, 3vw, 22px);
    --play-gutter-sm: 12px;
    --play-panel-gap: clamp(12px, 2vw, 24px);
    --play-radius: 20px;
    --play-radius-sm: 14px;
    --play-touch-target: 44px;
    --play-sidebar-width: clamp(220px, 24vw, 300px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

:where(
    .ck-main--universal-student,
    .student-play-card,
    .enc-gallery-card,
    .game-shell,
    .app-card,
    .game-board-container,
    .app-content,
    .cv-body-wrap,
    .cv-content,
    .cv-sidebar,
    .ws-layout-split,
    #sqb-app,
    #sqb-game-screen,
    #sqb-game-area,
    #sqb-question-panel,
    #sqb-answers-grid
) {
    min-width: 0;
    max-width: 100%;
}

:where(
    .ck-main--universal-student,
    .student-play-card,
    .enc-gallery-card,
    .game-shell,
    .app-card,
    .game-board-container,
    .app-content,
    .cv-content,
    .cv-sidebar
) > * {
    min-width: 0;
}

:where(
    .ck-main--universal-student,
    .student-play-card,
    .enc-gallery-card,
    .game-shell,
    .app-card,
    .game-board-container,
    .app-content,
    .cv-content,
    .cv-sidebar
)[style*="100vw"] {
    width: 100% !important;
    max-width: 100% !important;
}

:where(
    .ck-main--universal-student,
    .student-play-card,
    .enc-gallery-card,
    .game-shell,
    .app-card,
    .game-board-container,
    .app-content,
    .cv-content
) :where(img, svg, video, canvas, iframe) {
    display: block;
    max-width: 100%;
}

:where(
    .ck-main--universal-student,
    .student-play-card,
    .enc-gallery-card,
    .game-shell,
    .app-card,
    .game-board-container,
    .app-content,
    .cv-content
) :where(img, svg, video) {
    height: auto;
}

:where(
    .ck-main--universal-student,
    .student-play-card,
    .enc-gallery-card,
    .game-shell,
    .app-card,
    .game-board-container,
    .app-content,
    .cv-content
) iframe {
    width: 100%;
    min-height: min(56vw, 420px);
    border: 0;
}

:where(
    .ck-main--universal-student,
    .student-play-card,
    .enc-gallery-card,
    .game-shell,
    .app-card,
    .game-board-container,
    .app-content,
    .cv-content
) canvas {
    height: auto;
}

:where(
    .enc-title-band,
    .enc-statusbar,
    .ws-bottom-actions,
    .sqb-stats,
    .sqb-side-stats,
    .sqb-hud,
    .game-toolbar,
    .play-toolbar,
    .question-actions
) {
    gap: 12px;
}

:where(.enc-title-band h1, #sqb-question-text, .question-text, .prompt-text, .cv-info-card) {
    overflow-wrap: anywhere;
}

:where(.cv-sidebar) {
    width: min(100%, var(--play-sidebar-width));
}

:where(.ws-layout-split, .play-grid-auto) {
    gap: var(--play-panel-gap);
}

.play-grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

:where(
    .play-scroll-x,
    .play-board-scroll,
    .board-scroll,
    .responsive-table-shell,
    .table-responsive,
    .overflow-x-auto,
    .ws-canvas-wrap,
    #wsGridPanel
) {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.play-stack-mobile {
    display: flex;
    flex-wrap: wrap;
    gap: var(--play-panel-gap);
}

.play-modal-card {
    width: min(92vw, 680px);
    max-height: min(86svh, 860px);
    overflow: auto;
}

:where(
    .ck-main--universal-student,
    .student-play-card,
    .enc-gallery-card,
    .game-shell,
    .app-card,
    .cv-content
) :where(
    button,
    .btn,
    [role="button"],
    input[type="button"],
    input[type="submit"],
    input[type="reset"],
    .ws-btn,
    .sqb-game-btn,
    .btn-fullscreen-standard,
    .btn-fullscreen-toggle
) {
    min-height: var(--play-touch-target);
    max-width: 100%;
    white-space: normal;
}

:where(
    .ck-main--universal-student,
    .student-play-card,
    .enc-gallery-card,
    .game-shell,
    .app-card,
    .cv-content
) :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    width: 100%;
    max-width: 100%;
    min-height: var(--play-touch-target);
}

@media (max-width: 1024px) {
    :where(.ck-main--universal-student) {
        padding: clamp(12px, 2vw, 18px) !important;
    }

    :where(.enc-title-band, .enc-statusbar) {
        padding-inline: 16px;
    }

    :where(.cv-sidebar) {
        padding: 16px;
    }

    :where(.cv-content) {
        padding: clamp(18px, 2.5vw, 28px) 16px;
    }

    #sqb-question-panel {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    :where(.ck-main--universal-student) {
        padding: 10px !important;
    }

    :where(.ck-main--universal-student, .student-play-card, .enc-gallery-card, .game-shell, .app-card, .cv-content, .cv-sidebar)[style*="100vh"],
    :where(.enc-gallery-card)[style*="calc(100vh"] {
        height: auto !important;
        min-height: 0 !important;
    }

    :where(.enc-gallery-card) {
        width: 100% !important;
        max-width: 100% !important;
    }

    :where(.enc-title-band) {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 14px 12px;
        border-radius: var(--play-radius) var(--play-radius) 0 0;
    }

    :where(.enc-title-band h1) {
        font-size: clamp(1rem, 4.8vw, 1.35rem);
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    :where(.enc-statusbar) {
        flex-wrap: wrap;
        padding: 10px 12px;
        font-size: 12px;
        border-radius: 0 0 var(--play-radius) var(--play-radius);
    }

    :where(.cv-body-wrap) {
        flex-direction: column;
        overflow: visible;
    }

    :where(.cv-sidebar) {
        width: 100%;
        max-width: none;
        border-right: 0 !important;
        border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    }

    :where(.cv-content) {
        width: 100%;
        padding: 14px 12px 16px;
        overflow: visible;
    }

    :where(.ws-layout-split) {
        flex-direction: column;
        align-items: stretch;
    }

    :where(.ws-word-panel, #wsGridPanel) {
        width: 100%;
        max-width: 100%;
        flex: 1 1 auto;
    }

    :where(.ws-word-panel) {
        max-height: none;
    }

    :where(.ws-bottom-actions) {
        flex-direction: column;
    }

    :where(.ws-btn) {
        width: 100%;
        justify-content: center;
    }

    #sqb-game-screen {
        position: relative;
        height: auto;
        min-height: 0;
    }

    #sqb-game-area {
        min-height: min(52svh, 420px);
        max-height: none;
        height: auto;
    }

    #sqb-question-panel {
        max-height: none;
    }

    #sqb-answers-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    :where(.sqb-stats, .sqb-side-stats, .sqb-hud) {
        flex-wrap: wrap;
        gap: 10px;
    }

    :where(.sqb-stat, .sqb-side-stat) {
        flex: 1 1 140px;
        min-width: calc(50% - 5px);
    }

    :where(
        .game-board-container,
        .play-scroll-x,
        .play-board-scroll,
        .board-scroll,
        .responsive-table-shell,
        .table-responsive,
        .overflow-x-auto,
        .ws-canvas-wrap,
        #wsGridPanel
    ) {
        overflow: auto;
    }

    :where(.ck-main--universal-student, .student-play-card, .enc-gallery-card, .game-shell, .app-card, .cv-content) table {
        display: block;
        width: max-content;
        min-width: 100%;
        overflow-x: auto;
    }

    :where(.ck-main--universal-student, .student-play-card, .enc-gallery-card, .game-shell, .app-card, .cv-content) :where(th, td) {
        white-space: nowrap;
    }

    :where([class*="fullscreen-exit-btn"], .btn-fullscreen-standard, .btn-fullscreen-toggle) {
        top: max(12px, env(safe-area-inset-top)) !important;
        right: max(12px, env(safe-area-inset-right)) !important;
        min-height: var(--play-touch-target);
        padding: 10px 14px !important;
        font-size: 12px !important;
    }

    :where(
        .play-modal-card,
        .ws-win-card,
        .ah-overlay-card,
        .bio-modal-content,
        .modal-animate,
        #question-modal > div,
        #victory-modal > div
    ) {
        width: min(92vw, 680px) !important;
        max-height: min(86svh, 860px);
        overflow: auto;
        padding: min(24px, 5vw) !important;
    }
}

@media (max-width: 480px) {
    :where(.ck-main--universal-student) {
        padding: 8px !important;
    }

    :where(.enc-gallery-card) {
        border-radius: 16px;
    }

    :where(.enc-title-band) {
        padding: 12px 10px;
        border-radius: 16px 16px 0 0;
    }

    :where(.enc-title-band-icon) {
        font-size: 20px;
    }

    :where(.enc-statusbar) {
        padding: 9px 10px;
        border-radius: 0 0 16px 16px;
    }

    :where(.cv-sidebar, .cv-content) {
        padding: 12px 10px !important;
    }

    :where(.ws-word-list) {
        flex-direction: column;
    }

    :where(.ws-word-capsule) {
        width: 100%;
        text-align: center;
    }

    :where(.sqb-stat, .sqb-side-stat) {
        min-width: 100%;
    }

    :where(.sqb-title) {
        letter-spacing: 1.5px;
    }
}

@media (hover: none) and (pointer: coarse) {
    :where(
        .ck-main--universal-student,
        .student-play-card,
        .enc-gallery-card,
        .game-shell,
        .app-card,
        .cv-content
    ) :where(
        button,
        .btn,
        [role="button"],
        input[type="button"],
        input[type="submit"],
        input[type="reset"],
        .ws-btn,
        .sqb-game-btn
    ) {
        -webkit-tap-highlight-color: transparent;
    }

    :where([draggable="true"], .draggable-item, .drag-source, .drop-zone, .grid-cell, .answer-card, .option-card) {
        touch-action: manipulation;
    }
}

/* Mobile v2: broad coverage for play modules loaded through student/saas layouts. */
html {
    -webkit-text-size-adjust: 100%;
}

@media (max-width: 820px) {
    .saas-full-content {
        overflow-y: auto !important;
    }

    :where(body.ck-student-play-route, body.ck-student-universal-route) {
        overflow-x: hidden !important;
    }

    :where(body.ck-student-play-route, body.ck-student-universal-route) :where(.ck-main, .ck-main--universal-student) {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        gap: 10px !important;
        padding: 10px !important;
        overflow: visible !important;
    }

    :where(body.ck-student-play-route, body.ck-student-universal-route) :where(.ck-center) {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        padding: 10px !important;
        overflow: visible !important;
        align-self: stretch !important;
    }

    :where(
        .sidebar-gallery-wrapper,
        .enc-gallery-card,
        .student-play-card,
        .game-shell,
        .app-card,
        .teacher-play-wrapper,
        .play-shell,
        .play-card,
        .module-shell,
        .mod-panel,
        .al-play-shell,
        .wb-container,
        .eai-shell,
        .podcast-shell,
        .worksheet-shell,
        .flashcard-shell,
        .presentation-shell,
        .exam-shell,
        .webquest-shell,
        .infografia-shell,
        .mindmap-shell,
        .concept-map-shell
    ) {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        border-radius: 18px !important;
        overflow: visible !important;
    }

    :where(
        .sidebar-gallery-wrapper,
        .enc-gallery-card,
        .student-play-card,
        .game-shell,
        .app-card,
        .teacher-play-wrapper,
        .play-shell,
        .play-card,
        .module-shell,
        .mod-panel
    ) > * {
        min-width: 0 !important;
        max-width: 100%;
    }

    :where(
        .sidebar-gallery-header,
        .enc-title-band,
        .play-hero,
        .play-header,
        .game-header,
        .app-header,
        .module-header,
        .quiz-header
    ) {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        min-height: auto !important;
        padding: 12px !important;
        border-radius: 18px 18px 0 0 !important;
        flex-wrap: wrap !important;
    }

    :where(
        .sidebar-gallery-icon,
        .enc-title-band-icon,
        .play-hero-icon,
        .play-header-icon,
        .game-header-icon,
        .app-header-icon,
        .module-header-icon
    ) {
        flex: 0 0 44px !important;
        width: 44px !important;
        height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 24px !important;
        line-height: 1 !important;
    }

    :where(
        .sidebar-gallery-title,
        .enc-title-band h1,
        .play-hero h1,
        .play-header h1,
        .game-header h1,
        .app-header h1,
        .module-header h1,
        .quiz-header h1
    ) {
        flex: 1 1 180px !important;
        min-width: 0 !important;
        max-width: 100% !important;
        font-size: clamp(1.05rem, 5vw, 1.45rem) !important;
        line-height: 1.12 !important;
        letter-spacing: 0 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        text-overflow: clip !important;
    }

    :where(
        .sidebar-gallery-statusbar,
        .enc-statusbar,
        .statusbar,
        .play-statusbar,
        .game-statusbar,
        .stats-row,
        .score-row
    ) {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        padding: 10px 12px !important;
        min-height: auto !important;
        overflow: visible !important;
    }

    :where(
        .sidebar-gallery-app-area,
        .sidebar-gallery-body,
        .sidebar-gallery-content,
        .app-content,
        .game-main,
        .main-grid,
        .rs-grid,
        .sdk-main,
        .sdk-game-main,
        .pss-game-main,
        .pb-main,
        .game-layout,
        .play-layout,
        .quiz-layout,
        .workspace-layout,
        .workspace-grid,
        .module-layout,
        .content-layout,
        .app-layout,
        .eai-layout,
        .ws-layout,
        .ws-layout-split,
        .worksheet-layout,
        .flashcard-layout,
        .podcast-layout,
        .presentation-layout,
        .atlas-layout,
        .cv-body-wrap
    ) {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        overflow: visible !important;
    }

    :where(
        .game-sidebar,
        .game-sidebar-left,
        .game-sidebar-right,
        .game-info-panel,
        .cv-sidebar,
        .cv-sidebar-left,
        .cv-sidebar-right,
        .sidebar-hud,
        .pss-sidebar-left,
        .pss-sidebar-right,
        .rs-sidebar,
        .rs-info,
        .sdk-sidebar,
        .sdk-s-sidebar,
        .sdk-s-info-panel,
        .pm-panel,
        .pb-sidebar,
        .pb-info,
        .setup-panel,
        .tool-panel,
        .tools-panel,
        .settings-panel,
        .side-panel,
        .left-panel,
        .right-panel,
        .stats-panel,
        .controls-panel,
        .info-panel,
        .student-panel,
        .lesson-sidebar,
        .filters-panel
    ) {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 0 1 auto !important;
        max-height: none !important;
        overflow: visible !important;
        order: 2;
    }

    :where(
        .game-board-container,
        .game-board,
        .board-container,
        .game-stage,
        .play-stage,
        .quiz-stage,
        .canvas-wrap,
        .canvas-container,
        .worksheet-preview,
        .sheet-preview,
        .whiteboard-canvas-wrap,
        .wb-board,
        .slide-stage,
        .presentation-stage,
        .map-canvas,
        .mindmap-canvas,
        .mind-map-canvas,
        .infographic-preview,
        .triptico-preview,
        .webquest-preview,
        .exam-preview,
        .flashcard-stage,
        .podcast-player
    ) {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
        min-height: min(58svh, 520px);
        height: auto !important;
        max-height: none !important;
        padding: 10px !important;
        border-radius: 14px !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch;
        order: 1;
    }

    :where(
        .sidebar-gallery-grid,
        .enc-gallery,
        .gallery-grid,
        .cards-grid,
        .modules-grid,
        .items-grid,
        .lessons-grid,
        .worksheet-grid,
        .flashcard-grid,
        .quiz-options,
        .quiz-options-grid,
        .answers-grid,
        .options-grid,
        .student-quiz-options,
        .atlas-quiz-options,
        .eai-quiz-options
    ) {
        width: 100% !important;
        max-width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)) !important;
        gap: 10px !important;
    }

    :where(
        .sidebar-gallery-wrapper,
        .enc-gallery-card,
        .student-play-card,
        .game-shell,
        .app-card,
        .teacher-play-wrapper,
        .play-shell,
        .play-card,
        .module-shell,
        .mod-panel
    ) :where(
        .toolbar,
        .game-toolbar,
        .play-toolbar,
        .action-bar,
        .actions,
        .controls-row,
        .filters-row,
        .form-row,
        .button-row,
        .topbar,
        .header-actions,
        .tools-row
    ) {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        overflow: visible !important;
    }

    :where(
        .sidebar-gallery-wrapper,
        .enc-gallery-card,
        .student-play-card,
        .game-shell,
        .app-card,
        .teacher-play-wrapper,
        .play-shell,
        .play-card,
        .module-shell,
        .mod-panel
    ) :where(button, .btn, [role="button"], input[type="button"], input[type="submit"], a.btn) {
        min-height: 44px !important;
        max-width: 100%;
        white-space: normal !important;
        overflow-wrap: anywhere;
        touch-action: manipulation;
    }

    :where(
        .sidebar-gallery-wrapper,
        .enc-gallery-card,
        .student-play-card,
        .game-shell,
        .app-card,
        .teacher-play-wrapper,
        .play-shell,
        .play-card,
        .module-shell,
        .mod-panel
    ) :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 44px !important;
    }

    :where(
        .sidebar-gallery-wrapper,
        .enc-gallery-card,
        .student-play-card,
        .game-shell,
        .app-card,
        .teacher-play-wrapper,
        .play-shell,
        .play-card,
        .module-shell,
        .mod-panel
    ) :where(img, video, svg, canvas, iframe) {
        max-width: 100% !important;
    }

    :where(
        .sidebar-gallery-wrapper,
        .enc-gallery-card,
        .student-play-card,
        .game-shell,
        .app-card,
        .teacher-play-wrapper,
        .play-shell,
        .play-card,
        .module-shell,
        .mod-panel
    ) :where(img, video, svg) {
        height: auto;
    }

    :where(
        .sidebar-gallery-wrapper,
        .enc-gallery-card,
        .student-play-card,
        .game-shell,
        .app-card,
        .teacher-play-wrapper,
        .play-shell,
        .play-card,
        .module-shell,
        .mod-panel
    ) :where(table) {
        display: block;
        width: max-content;
        min-width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    :where(
        .modal-content,
        .modal-card,
        .dialog-card,
        .play-modal-card,
        .quiz-modal,
        .result-modal,
        .completion-card
    ) {
        width: min(94svw, 680px) !important;
        max-width: 94svw !important;
        max-height: min(88svh, 780px) !important;
        overflow: auto !important;
    }

    /* Game shells with fixed viewport heights (custom-prefix plays) */
    :where(.rs-game-shell, .sdk-player-container, .pb-wrapper) {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    :where(.main-grid, .rs-grid, .sdk-main, .sdk-game-main, .pss-game-main, .pb-main, .game-main)
        :where(img, canvas, svg, video, iframe) {
        max-width: 100% !important;
    }

    :where(.main-grid, .rs-grid, .sdk-main, .sdk-game-main, .pss-game-main, .pb-main, .game-main)
        :where(img, canvas, svg) {
        height: auto;
    }

    :where(.sdk-board, .sdk-s-board) {
        width: 100% !important;
        max-width: min(94vw, 430px) !important;
    }

    :where(#racer-page, .racer-page-container) {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* Fixed-width overlays/cards from individual games */
    :where(
        .bm-quiz-card,
        .bm-gameover-card,
        .bm-modal-card,
        .dm-modal,
        .win95-window,
        .dialog-window,
        .game-over-modal,
        .bo-card,
        #sqa-feedback-card,
        .vss-answers,
        .ws-win-card
    ) {
        width: min(94vw, 460px) !important;
        max-width: 94vw !important;
    }

    :where(.sqa-attack-btn) {
        width: min(100%, 450px) !important;
    }
}

@media (max-width: 560px) {
    :where(body.ck-student-play-route, body.ck-student-universal-route) :where(.ck-main, .ck-center, .ck-main--universal-student) {
        padding: 8px !important;
    }

    :where(
        .sidebar-gallery-wrapper,
        .enc-gallery-card,
        .student-play-card,
        .game-shell,
        .app-card,
        .teacher-play-wrapper,
        .play-shell,
        .play-card,
        .module-shell,
        .mod-panel
    ) {
        border-radius: 14px !important;
    }

    :where(
        .sidebar-gallery-header,
        .enc-title-band,
        .play-hero,
        .play-header,
        .game-header,
        .app-header,
        .module-header,
        .quiz-header
    ) {
        padding: 10px !important;
        gap: 8px !important;
        border-radius: 14px 14px 0 0 !important;
    }

    :where(
        .sidebar-gallery-icon,
        .enc-title-band-icon,
        .play-hero-icon,
        .play-header-icon,
        .game-header-icon,
        .app-header-icon,
        .module-header-icon
    ) {
        flex-basis: 40px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 22px !important;
    }

    :where(
        .sidebar-gallery-title,
        .enc-title-band h1,
        .play-hero h1,
        .play-header h1,
        .game-header h1,
        .app-header h1,
        .module-header h1,
        .quiz-header h1
    ) {
        flex-basis: calc(100% - 54px) !important;
        font-size: clamp(1rem, 6vw, 1.25rem) !important;
    }

    :where(
        .sidebar-gallery-grid,
        .enc-gallery,
        .gallery-grid,
        .cards-grid,
        .modules-grid,
        .items-grid,
        .lessons-grid,
        .worksheet-grid,
        .flashcard-grid,
        .quiz-options,
        .quiz-options-grid,
        .answers-grid,
        .options-grid,
        .student-quiz-options,
        .atlas-quiz-options,
        .eai-quiz-options
    ) {
        grid-template-columns: 1fr !important;
    }

    :where(
        .game-board-container,
        .game-board,
        .board-container,
        .game-stage,
        .play-stage,
        .quiz-stage,
        .canvas-wrap,
        .canvas-container,
        .worksheet-preview,
        .sheet-preview,
        .whiteboard-canvas-wrap,
        .wb-board,
        .slide-stage,
        .presentation-stage,
        .map-canvas,
        .mindmap-canvas,
        .mind-map-canvas,
        .infographic-preview,
        .triptico-preview,
        .webquest-preview,
        .exam-preview,
        .flashcard-stage,
        .podcast-player
    ) {
        min-height: min(52svh, 440px);
        padding: 8px !important;
    }

    :where(
        .sidebar-gallery-wrapper,
        .enc-gallery-card,
        .student-play-card,
        .game-shell,
        .app-card,
        .teacher-play-wrapper,
        .play-shell,
        .play-card,
        .module-shell,
        .mod-panel
    ) :where(.action-bar, .actions, .button-row) > :where(button, .btn, a.btn, [role="button"]) {
        flex: 1 1 100%;
        justify-content: center;
    }
}

@media (max-width: 920px) and (orientation: landscape) and (max-height: 520px) {
    :where(body.ck-student-play-route, body.ck-student-universal-route) :where(.ck-main, .ck-center, .ck-main--universal-student) {
        padding: 6px !important;
    }

    :where(.sidebar-gallery-header, .enc-title-band, .play-hero, .play-header, .game-header, .app-header, .module-header, .quiz-header) {
        padding: 8px 10px !important;
    }

    :where(.game-board-container, .game-board, .board-container, .game-stage, .play-stage, .quiz-stage, .canvas-wrap, .canvas-container) {
        min-height: calc(100svh - 128px);
    }
}
