/* ================================
   Mobile Adjustments (MAX-WIDTH: 768px)
   기준: iPhone 14/15 Pro (393px), Galaxy S24 (360px), 태블릿 세로
================================ */

body {
    padding: 1rem 0.6rem;
    /* 패딩을 더 줄여 콘텐츠 영역 확보 */
}

.container {
    padding: 0 10px;
    /* 컨테이너 좌우 패딩 감소 */
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* 헤더 전체를 세로 스택으로 전환 */
.main-header-layout {
    padding: 1.2rem 1rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
}

/* 왼쪽 쏠림 방지: 3단 그리드 → 세로형 중앙 정렬 Flex */
.header-top-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
}

.header-side-left,
.header-side-right,
.header-center-zone {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-side-left {
    flex-direction: column;
}

.nav-title {
    font-size: 1.4rem;
    letter-spacing: -1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.nav-subtitle {
    font-size: 0.75rem;
    margin-top: 4px;
    text-align: center;
}

/* 사이드 위젯 모바일에서 영역 확보 및 간격 조정 */
.dashboard-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 사이드패널 껍데기를 해제하여 직계 자식 위젯들이 flex 아이템으로 동작하게 함 */
.side-widget-container.left,
.side-widget-container.right {
    display: contents;
}

/* 사용자 요청 순서 재배치 (order 속성 활용) */
#side-upcoming-releases {
    order: 1;
}

#side-pickup {
    order: 2;
}

.center-column {
    order: 3;
}

/* 메인 타임라인 + 페이지네이션 */
#side-broadcast {
    order: 4;
}

#side-redeem {
    order: 5;
}

#side-recent {
    order: 6;
}

#side-links {
    order: 7;
}

.side-widget {
    position: static;
    margin-bottom: 0;
    padding: 1.2rem;
    min-width: 0;
    /* Override 300px min-width from desktop */
    width: 100%;
}

/* 시계 영역을 중앙 정렬 */
.header-side-right {
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    margin-top: -0.3rem;
    margin-bottom: 0.3rem;
}

.main-clock {
    font-size: 1.1rem;
    text-align: center;
}

.main-clock-label {
    font-size: 0.65rem;
    text-align: center;
}

.header-center-zone {
    width: 100%;
    min-width: 0;
}

.mega-tabs {
    width: 100%;
    justify-content: center;
    padding: 5px;
    gap: 6px;
    overflow-x: auto;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.mega-tabs::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera*/
}

.mega-tab-btn {
    padding: 6px 4px; /* 모바일에서 텍스트 잘림 방지 (stretch 되므로 패딩 감소) */
    min-width: 0;
    flex: 1; /* 빈 공간 양옆으로 남지 않도록 버튼들이 균등하게 영역을 꽉 채움 */
    font-size: 0.85rem;
    border-radius: 8px;
    text-align: center;
    white-space: nowrap;
    word-break: keep-all;
}

.mega-tab-btn.theme-btn {
    flex: 0 0 36px;
    font-size: 0.95rem;
    padding: 6px 0;
}

/* 모바일 접속 시 캘린더(일정표) 진입 버튼 숨김 요소 */
a[href="calendar-bar.html"] {
    display: none !important;
}

/* 메가 메뉴 패널 */
.mega-menu-content {
    gap: 8px;
    padding: 8px 0;
}

.filter-btn {
    padding: 7px 14px;
    font-size: 0.85rem;
    border-radius: 12px;
}

/* 국기 버튼 모바일 조정 */
.flag-btn {
    padding-right: 38px;
}

.flag-btn::before {
    width: 36px;
}

/* 모바일 전용 카드 디자인 분리 (강력한 Overflow 방어) */
.timeline-grid {
    grid-template-columns: minmax(0, 100%) !important;
    grid-auto-rows: auto;
    gap: 16px;
}

.game-card {
    height: auto !important;
    min-height: 180px;
    max-height: none !important;
    width: 100%;
    overflow: hidden !important;
    /* 모바일에서 툴팁 무시하고 카드 밖 삐져나옴 완벽 차단 */
}

.card-content {
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.game-title {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 0.6rem;
    word-break: break-all;
    width: 100%;
    /* 가독성 픽스: 두 줄 이상 넘어갈 시 말줄임(Ellipsis) 처리 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.update-desc {
    font-size: 0.85rem;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1rem;
    width: 100%;
}

.card-header {
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.card-tags {
    flex: 1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.countdown-badge {
    min-width: 0;
    flex-shrink: 0;
    font-size: 0.72rem;
    padding: 4px 10px;
    white-space: nowrap;
}

/* 모바일에서는 hover 불가능, 툴팁이 잘리므로 완전 제거 */
.countdown-badge::after {
    display: none !important;
}

/* 즐겨찾기 버튼 */
.card-footer {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: auto;
}

.fav-btn {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    margin-left: 0;
    flex-shrink: 0;
}

.source-link {
    padding: 8px 14px;
    font-size: 0.75rem;
}

/* Pagination Mobile Adjustments */
.pagination-container {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    margin-bottom: 30px;
}

button.page-btn {
    padding: 8px 12px;
    min-width: 36px;
    font-size: 0.85rem;
}

/* -------------------------------------
   실적 / 모바일 전담 (from style.css bottom area)
-------------------------------------- */
.upcoming-grid {
    grid-template-columns: 1fr !important;
}

.upcoming-item {
    padding: 1rem !important;
}

/* 극소형 폰 대응 (Galaxy A 시리즈 등 380px 이하) */
@media (max-width: 380px) {
    body {
        padding: 0.8rem 0.6rem;
    }

    .nav-title {
        font-size: 1.2rem;
    }

    .mega-tab-btn {
        font-size: 0.8rem;
    }

    .card-content {
        padding: 1rem 1.1rem;
    }
}