﻿/* --- [라이브 카지노] 전용 스타일 --- */

.casino_item_card {
    flex: 0 0 25%;
    /*padding-left: 12px;*/
    margin-bottom: 20px;
    box-sizing: border-box;
    cursor: pointer;
}

/* 이미지 박스 및 효과 */
/* BP · 자연 비율 전환 — 구 aspect-ratio 272/145 강제 + absolute/cover 덮기 구조 해체(그리드 경로 한정).
   관리자가 제각각 크기로 업로드하므로 비율 강제 금지: 너비만 4분할(1fr) 고정, 높이 = 이미지 원본 비율
   (s2 홈 스트립과 같은 표시 목표). 한 행 안 높이 차이는 의도된 동작(masonry 신설 금지 — PM).
   ⚠️ 홈 스트립(HomeSection=true · app-home.css .gcard_*)은 무접촉 — 이미 목표 상태. */
.casino_item_card .img_wrap {
    position: relative;
    width: 100%;
    border-radius: 8px 8px 0 0; /* 상단만 둥글게 (정보바와 합쳐짐) */
    overflow: hidden;
    background: #1a2436;
}

.casino_item_card .img_wrap img {
    /* BP · in-flow 자연 높이 — wrap 높이가 이미지를 따라간다(cover 크롭 0). hover scale 은 현행 유지. */
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

/* BP(F-2 재구성) · 폴백 = in-flow 블록(min-height 140px — 기존 카드 톤 유지).
   이미지 정상 로드 = 폴백 미렌더/숨김이라 wrap 높이 = 이미지 자연 높이,
   이미지 없음·onerror = 폴백만 남아 wrap 높이 = 140px(빈 검은 박스 0 유지).
   표시 전환은 마크업 소관(CasinoGameBrowser — onerror 가 형제 폴백을 켠다). */
.casino_item_card .img_ph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 140px;
    font-size: 28px;
    font-weight: 800;
    color: #6b7a90;
    user-select: none;
}

/* BP ③ · 카드 높이가 제각각이므로 행 상단 정렬 — 그리드 경로(grid_container_box 하위)만.
   홈 스트립·타 col_4 소비처는 무접촉. */
.grid_container_box .game_grid.col_4 {
    align-items: start;
}

/* 원본의 border_line 효과 재현 */
.border_line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
    z-index: 1;
}

/* 하단 정보 바 (MuiImageListItemBar-root 스타일) */
.item_info_bar {
    padding: 10px 15px;
    border: 1px solid rgb(30, 43, 61);
    border-radius: 0px 0px 8px 8px;
    background-color: rgb(11, 20, 37);
    border-top: none;
}

.item_title {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    /* 긴 게임명 한 줄 말줄임 — 카드 폭 침범 금지.
       min-width:0 은 카드가 flex/grid 아이템일 때 축소를 허용시켜 ellipsis가 실제로 걸리게 한다
       (없으면 콘텐츠 폭만큼 늘어나 카드가 벌어진다). */
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* 호버 시 효과 */
.casino_item_card:hover .img_wrap img {
    transform: scale(1.05); /* 이미지 살짝 확대 */
}

.casino_item_card:hover .item_info_bar {
    background-color: #1976d2; /* 호버 시 파란색 포인트 (MUI 기본 포인트) */
    transition: background-color 0.3s;
}


/* 모달 배경 오버레이 */
.modal_overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* 모달 본체 컨테이너 */
.slot_modal_container {
    cursor: default;
    width: 90%;
    max-width: 1100px;
    max-height: 85vh;
    background-color: #0f1621;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* 헤더 */
.slot_modal_header {
    padding: 15px 20px;
    background-color: #0b111c;
    display: flex;
    justify-content: center; /* 제목 중앙 */
    align-items: center;
    position: relative;
    border-bottom: 1px solid #1f293d;
}

.modal_title {
    font-size: 16px;
    color: #e1e5eb;
    font-weight: 600;
}

.btn_modal_close {
    position: absolute;
    right: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
}

    .btn_modal_close svg {
        fill: #8a96a3;
        width: 24px;
    }

/* 검색 영역 */
.slot_modal_search_area {
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
}

.input_game_search {
    width: 250px;
    background-color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 2px;
    font-size: 13px;
}

/* 게임 그리드 (6열) */
.slot_game_grid_scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}


.game_unit {
    cursor: pointer;
    transition: transform 0.2s;
}

    .game_unit:hover {
        transform: translateY(-5px);
    }

.game_thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 2px solid #81d8d0; /* 티파니 테두리 포인트 */
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

    .game_thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.game_name {
    font-size: 12px;
    color: #e1e5eb;
    text-align: center;
    line-height: 1.4;
    word-break: keep-all;
}

/* 스크롤바 커스텀 */
.slot_game_grid_scroll::-webkit-scrollbar {
    width: 6px;
}

.slot_game_grid_scroll::-webkit-scrollbar-thumb {
    background: #1f293d;
    border-radius: 10px;
}


모바일 환경에서도 자연스럽게 보이도록 **미디어 쿼리(@media)**를 사용하여 레이아웃을 조정해 드리겠습니다.

모바일일 때는 모달창이 상단에 딱 붙고(top: 0), 게임 리스트는 한 줄에 2개씩(repeat(2, 1fr)) 나오도록 CSS를 보완했습니다.

1. 수정된 CSS (모바일 대응 추가)
기존 CSS 하단에 아래의 미디어 쿼리 내용을 추가해 주세요.

CSS
/* 기본 PC 스타일 (기존 유지) */
.slot_modal_container {
    width: 90%;
    max-width: 1100px;
    max-height: 85vh;
    background-color: #0f1621;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.slot_game_grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* PC는 6개 */
    gap: 15px;
}

/* --- 모바일 대응 (화면 너비 768px 이하) --- */
@media screen and (max-width: 768px) {
    /* 1. 모달 배경에서 중앙 정렬 해제 및 상단 배치 */
    .modal_overlay {
        align-items: flex-start;
        padding: 20px 15px;
    }

    /* 2. 모달 컨테이너를 상단에 밀착 */
    .slot_modal_container {
        width: 100%; /* 모바일은 가로 꽉 차게 */
        max-width: none;
        height: 100%; /* 전체 높이 사용 */
        max-height: 100vh;
        border-radius: 0; /* 모바일은 둥근 모서리 제거 (선택 사항) */
    }

    /* 3. 검색 영역 조정 */
    .slot_modal_search_area {
        padding: 10px;
    }

    .input_game_search {
        width: 100%; /* 검색창도 가로 꽉 차게 */
    }

    /* 4. 게임 그리드를 2열로 변경 */
    .slot_game_grid {
        grid-template-columns: repeat(2, 1fr); /* 모바일은 2개씩 */
        gap: 10px; /* 간격은 조금 좁게 */
    }

    /* 5. 게임 썸네일 크기 보정 */
    .game_name {
        font-size: 13px; /* 모바일에서 글자가 너무 작으면 키우기 */
    }
}
/* BR §E · 벤더 점검(IS_LOCK) 오버레이 — BP 자연 비율 구조 위(wrap 기준 absolute).
   폴백(머릿글자) 카드에도 동일 적용(이미지 유무 무관 일관 — wrap 이 공통 부모).
   구 badge bg-danger 표식은 교체 제거(규약 위반 별건 자연 해소). z-index 2 = .border_line(1) 위. */
.casino_item_card .vendor_lock_overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(0, 0, 0, .55);   /* dim */
    color: #fff;
    pointer-events: none;             /* 클릭 처리(점검 안내)는 카드 onclick 현행 가드 유지 */
}

.casino_item_card .vendor_lock_overlay .vlo_ico { font-size: 22px; line-height: 1; }
.casino_item_card .vendor_lock_overlay .vlo_txt { font-size: 12px; font-weight: 700; }


/* (지시로 폐기) 구 gflex/--gcols 가변 그리드 축 — 정적 col_4/col_6 클래스(layout.css 정본)로 회귀. */

/* ==========================================================================
   지시 · `/game/slot/games` 카드 그리드 정규화 + 모바일 헤더 (s3·treebet 한정)
   전 규칙이 `.slot_games_page` 스코프 — 🔴 벤더 목록 `/game/slot` 은 같은
   `.game_grid.col_6` + `.casino_item_card` 를 쓰므로 스코프 없이는 같이 변한다.
   ⚠️ 열 수는 손대지 않는다: PC 6열(layout.css `.game_grid.col_6`)·모바일 2열
      (layout.css + mobile.css `@media(max-width:1248px)`)이 이미 정상 — 실측 확인.
      카드가 제각각이던 진범은 열 수가 아니라 아래 이미지 높이 축이다.
   ========================================================================== */

/* ── 카드 크기 통일 ──────────────────────────────────────────────────────
   위 `.casino_item_card .img_wrap img { height:auto }`(BP 회차 "자연 비율")가
   이미지 원본 비율로 카드 높이를 정하고 있어 세로 긴 원본 하나가 행 전체를 밀었다.
   이 화면에서만 비율을 고정해 "이미지가 카드에 맞춰지는" 방향으로 되돌린다.
   ⚠️ BP 주석의 "비율 강제 금지"는 이 두 미러의 이 화면에 한해 해제되는 것이며,
      홈 스트립·라이브카지노·타 미러는 스코프 밖이라 종전 그대로다.
   1/1 근거 = 같은 파일 `.game_thumb` 의 기존 슬롯 썸네일 관용구(신규 비율 발명 0).
   비율이 크게 다른 원본은 중앙 크롭되지만 게임명은 item_info_bar 에 따로 있어 식별 가능.
   크롭이 과하면 `cover` → `contain` + 배경으로 전환(카드 크기는 그대로 유지된다). */
/* 🔴 폭 불균등(실측 201/212/324px)의 진범 — 트랙 최소폭.
   `repeat(6, 1fr)` 의 1fr 은 `minmax(auto, 1fr)` 이고, 그리드 아이템(.casino_item_card)의
   `min-width` 가 auto 라 **트랙의 최소치 = 카드의 min-content 기여값**이 된다. 그 기여값은
     ① <img> 고유 폭 200px — width:100% 는 고유 크기 계산에 반영되지 않아 원본 200px 이 바닥이 된다
     ② .item_title 의 white-space:nowrap — 긴 게임명은 텍스트 전체 폭이 바닥이 된다(324px 카드의 정체)
   6트랙 × 200px+ + gap 60px > 컨테이너 폭 → 트랙이 1fr 균등 배분을 못 하고 제각각 부푼다.
   ⚠️ 원본이 전부 200×200 이어도 발생한다 — 원본 크기 문제가 아니라 최소폭 규칙 문제.
   min-width:0 이 `min-width:auto` 를 덮어 트랙 최소치를 0 으로 만들면 1fr 이 진짜 균등해진다.
   (.item_title 의 min-width:0 은 텍스트 말줄임용이라 트랙 밀림을 막지 못한다 — 축이 다르다.)
   ※ .img_wrap 에는 불필요 — 자동 최소 크기 규칙은 **그리드/플렉스 아이템에만** 적용되고
     .img_wrap 은 카드의 일반 블록 자식이다. 죽은 선언을 남기지 않기 위해 넣지 않았다. */
.slot_games_page .casino_item_card {
    min-width: 0;
}

.slot_games_page .casino_item_card .img_wrap {
    aspect-ratio: 1 / 1;
    overflow: hidden;   /* 상단 라운드 유지 + 크롭 경계 */
}

/* onerror 로 img 가 display:none 이 돼도 wrap 이 aspect-ratio 로 자리를 지켜 카드가 무너지지 않는다. */
.slot_games_page .casino_item_card .img_wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── 검색 input 폭 — 구 인라인 style(max-width:220px; width:220px) 이관.
      PC 결과 동일. 인라인이 아니어야 아래 모바일 분기가 이길 수 있다. */
.slot_games_page .support_header.page_header .action_buttons .sch_key {
    width: 220px;
    max-width: 220px;
}

/* ── 모바일 헤더 2행 재배치 ───────────────────────────────────────────────
   분기 640px = 이 프로젝트의 실제 모바일 플래그(mobile.css `.pc`/`.mo` 토글 축) 재사용.
   신규 브레이크포인트 도입 0. 641px 이상에서는 아래가 전혀 적용되지 않아 PC 무회귀.
   겹침 진범 = `.support_header.page_header .action_buttons { position:absolute }`
   (layout.css S1 "헤더 높이 고정" 관용구) — 좁은 폭에서 제목·버튼 위를 덮었다.
   이 화면에서만 static 으로 풀고 아래 행으로 내린다. */
@media (max-width: 640px) {
    .slot_games_page .support_header.page_header {
        display: block;   /* space-between 해제 — 2행 구성 */
    }

    /* 1행: 벤더명 ······ [게임사 목록] */
    .slot_games_page .support_header.page_header .title_group {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;     /* 자식 말줄임 허용(없으면 축소되지 않아 버튼을 민다) */
    }

    .slot_games_page .support_header.page_header .main_title {
        font-size: 14px;  /* PC 20px 대비 70% */
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    /* 「게임사 목록」 버튼 — 우측 밀착 + 축소·줄바꿈 금지(긴 벤더명에도 온전). */
    .slot_games_page .support_header.page_header .sub_text {
        margin-left: auto;
        flex: 0 0 auto;
    }

    /* 2행: 검색 풀폭 */
    .slot_games_page .support_header.page_header .action_buttons {
        position: static;
        transform: none;
        margin-top: 8px;
        width: 100%;
    }

    .slot_games_page .support_header.page_header .action_buttons .sch_key {
        width: 100%;
        max-width: none;
    }
}
