/**
 * 後台響應式 - 一鍵編版頁面
 *
 * 由 admin-responsive.css 依原行序拆出；載入順序見 src/lib/assets.ts 的
 * ADMIN_STYLES，順序即 cascade 順序，不可調換。
 */

/* ==================== 一鍵編版頁面 - 手機版響應式優化 ==================== */

/* 中等手機尺寸 (max-width: 48rem / 768px) */
@media (max-width: 48rem) {
    /* 一鍵編版 - 工具列緊湊化 */
    #page-batch-build .batch-build-toolbar {
        padding: 0.75rem;
        gap: 0.5rem;
        flex-direction: column;
        align-items: stretch;
    }

    #page-batch-build .batch-build-toolbar .filter-group {
        padding: 0.375rem 0.5rem;
        gap: 0.375rem;
    }

    #page-batch-build .batch-build-toolbar .filter-group label {
        font-size: 0.75rem;
        gap: 0.25rem;
    }

    #page-batch-build .batch-build-toolbar .filter-group label i {
        font-size: 0.75rem;
    }

    #page-batch-build .batch-build-toolbar .form-input {
        min-width: unset;
        flex: 1;
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
    }

    #page-batch-build .batch-build-toolbar .btn-primary {
        margin-left: 0;
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    /* 一鍵編版 - 控制面板緊湊化 */
    #page-batch-build .batch-build-control-panel {
        padding: 0.75rem;
        margin-bottom: 1rem;
        gap: 0.75rem;
    }

    #page-batch-build .control-section h3 {
        font-size: 0.875rem;
        gap: 0.5rem;
    }

    #page-batch-build .section-header-row {
        margin-bottom: 0.5rem;
    }

    #page-batch-build .select-all-label {
        font-size: 0.75rem;
    }

    #page-batch-build .game-count {
        font-size: 0.6875rem;
    }

    /* 一鍵編版 - 搜索框緊湊化 */
    #page-batch-build .games-search-wrapper {
        margin-bottom: 0.5rem;
    }

    #page-batch-build .games-search-box {
        padding: 0.5rem 0.75rem;
    }

    #page-batch-build .games-search-box input {
        font-size: 0.8125rem;
    }

    /* 一鍵編版 - 遊戲選擇網格：手機版每行三個 */
    #page-batch-build .games-selection {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.375rem;
    }

    /* 一鍵編版 - 遊戲卡片：橫向佈局 (Icon | 版本號) */
    #page-batch-build .game-checkbox {
        position: relative;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        padding: 0.375rem;
        gap: 0.25rem 0.375rem;
        align-items: center;
    }

    /* Checkbox 絕對定位在左上角 */
    #page-batch-build .game-checkbox input[type="checkbox"] {
        position: absolute;
        top: 0.25rem;
        left: 0.25rem;
        width: 0.875rem;
        height: 0.875rem;
        margin: 0;
        z-index: 2;
    }

    /* 圖標放左邊，跨兩行 */
    #page-batch-build .game-checkbox-icon {
        grid-column: 1;
        grid-row: 1 / 3;
        width: 40px;
        height: 40px;
        margin: 0;
        margin-left: 0.75rem;
    }

    /* 遊戲資訊區塊：放右邊 */
    #page-batch-build .game-checkbox-info {
        grid-column: 2;
        grid-row: 1 / 3;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 0.125rem;
        min-width: 0;
    }

    /* 隱藏遊戲代碼 */
    #page-batch-build .game-checkbox-info .game-code-line {
        display: none;
    }

    /* 版本標籤容器：垂直排列 */
    #page-batch-build .game-versions-container {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.125rem;
    }

    /* 版本標籤樣式 */
    #page-batch-build .game-version-display {
        font-size: 0.5rem;
        padding: 0.125rem 0.25rem;
        white-space: nowrap;
    }
}

/* 小型手機尺寸 (max-width: 30rem / 480px) */
@media (max-width: 30rem) {
    /* 一鍵編版 - 工具列更緊湊 */
    #page-batch-build .batch-build-toolbar {
        padding: 0.5rem;
        gap: 0.375rem;
    }

    #page-batch-build .batch-build-toolbar .filter-group {
        padding: 0.25rem 0.375rem;
        flex-direction: row;
        align-items: center;
    }

    #page-batch-build .batch-build-toolbar .filter-group label {
        font-size: 0.6875rem;
        flex-shrink: 0;
    }

    #page-batch-build .batch-build-toolbar .form-input {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }

    #page-batch-build .batch-build-toolbar .btn-primary {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }

    /* 一鍵編版 - 控制面板更緊湊 */
    #page-batch-build .batch-build-control-panel {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
        gap: 0.5rem;
    }

    #page-batch-build .control-section h3 {
        font-size: 0.8125rem;
        flex-wrap: wrap;
    }

    #page-batch-build .select-all-label {
        font-size: 0.6875rem;
    }

    #page-batch-build .game-count {
        font-size: 0.625rem;
    }

    /* 一鍵編版 - 搜索框更緊湊 */
    #page-batch-build .games-search-box {
        padding: 0.375rem 0.5rem;
    }

    #page-batch-build .games-search-box input {
        font-size: 0.75rem;
    }

    #page-batch-build .games-search-box i {
        font-size: 0.75rem;
    }

    /* 一鍵編版 - 遊戲卡片更緊湊 */
    #page-batch-build .game-checkbox {
        padding: 0.25rem;
        gap: 0.1875rem 0.25rem;
        border-radius: 0.375rem;
    }

    #page-batch-build .game-checkbox input[type="checkbox"] {
        top: 0.1875rem;
        left: 0.1875rem;
        width: 0.75rem;
        height: 0.75rem;
    }

    #page-batch-build .game-checkbox-icon {
        width: 36px;
        height: 36px;
        margin-left: 0.625rem;
    }

    #page-batch-build .game-version-display {
        font-size: 0.4375rem;
        padding: 0.0625rem 0.1875rem;
    }
}

/* 超小螢幕 (max-width: 22.5rem / 360px) */
@media (max-width: 22.5rem) {
    /* 一鍵編版 - 遊戲卡片極致緊湊 */
    #page-batch-build .game-checkbox {
        padding: 0.1875rem;
        gap: 0.125rem 0.1875rem;
    }

    #page-batch-build .game-checkbox input[type="checkbox"] {
        top: 0.125rem;
        left: 0.125rem;
        width: 0.625rem;
        height: 0.625rem;
    }

    #page-batch-build .game-checkbox-icon {
        width: 32px;
        height: 32px;
        margin-left: 0.5rem;
    }

    #page-batch-build .game-version-display {
        font-size: 0.375rem;
        padding: 0.0625rem 0.125rem;
    }
}
