/* --- [폰트 및 변수 설정] --- */
@font-face {
    font-family: 'DosMyungjo';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-5@1.0/HakgyoansimByeolbichhaneulTTF-L.woff2') format('woff2');
    font-weight: normal;
    font-display: swap;
}

i.fa-solid,
i.fa-regular {
    font-family: "Font Awesome 6 Free" !important;
    /* 아이콘 글리프 조건이라 굵기 통일 대상에서 제외 (900이 아니면 아이콘이 깨짐) */
    font-weight: 900 !important;
}

:root {
    --bg-body: #0f172a;
    --bg-solid: #1e293b;
    --bg-solid-hover: #334155;
    --border-glass: rgba(255, 255, 255, 0.08);
    --primary-accent: #38bdf8;
    --secondary-accent: #a855f7;
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --bg-card: #1e293b;

    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 32px;

    /* 사이트 기본 폰트: 나눔스퀘어 네오 (index.php에서 네이버 CDN으로 로드)
       나눔스퀘어 네오는 굵기별로 패밀리명이 나뉘어 있다(Light/Bold/ExtraBold/Heavy).
       'NanumSquareNeo'는 Regular 한 종이며, 굵게 쓰려면 font-weight가 아니라
       font-family를 'NanumSquareNeoBold' 등으로 바꿔야 한다. */
    --font-main: 'NanumSquareNeo', 'Noto Sans KR', "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
    /* 굵게 쓸 곳 전용. font-weight가 아니라 이 변수를 font-family에 지정할 것 */
    --font-bold: 'NanumSquareNeoBold', 'Noto Sans KR', "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}

/* --- [기본 레이아웃 Reset] --- */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* body에만 걸면 iOS 사파리에서 가로 넘침이 막히지 않아
   레이아웃 뷰포트가 넓어지고, position:fixed 요소(언어 버튼)가 화면 밖으로 밀린다 */
html {
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background-image:
        radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.08) 0%, transparent 25%);
    background-attachment: fixed;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

/* 폼 요소는 font-family를 상속하지 않으므로 명시적으로 지정
   (검색창 placeholder, 번호 뽑기 입력칸 등도 기본 폰트로) */
input,
textarea,
select {
    font-family: inherit;
}

/* --- [굵기 통일: 전체 500] ---
   h1~h6 / strong / b / th 는 브라우저 기본값이 bold(700)라
   CSS에서 굵기를 지정하지 않아도 굵게 나온다. 여기서 함께 500으로 맞춘다.
   (되돌리려면 이 블록만 지우면 됨) */
h1, h2, h3, h4, h5, h6,
strong, b, th, optgroup {
    font-weight: 500;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 24px 60px 24px;
}

.thumbnails-off .container {
    padding-top: 70px;
}

/* --- [상단 플로팅 바] --- */
.floating-bar-style {
    position: fixed;
    top: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    height: 50px;
    background: var(--bg-solid);
    border: 1px solid var(--border-glass);
    border-radius: 50px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
}

.floating-bar-style:hover {
    background: var(--bg-solid-hover);
    transform: translateY(2px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* --- [헤더 레이아웃] --- */
header {
    margin-bottom: 20px;
    position: relative;
    z-index: 10;
}

.header-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 75px;
    position: relative;
}

/* --- [사이드 위젯] --- */
.info-widget {
    width: 250px;
    height: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.info-widget:hover {
    transform: translateY(-5px);
    background: var(--bg-solid-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.widget-thumbnail-zone {
    width: 100%;
    height: 130px;
    background: #000;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-text-zone {
    flex: 1;
    background: var(--bg-solid);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8px 12px;
    text-align: center;
}

.widget-main-text {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 2px;
    color: #fff;
}

.widget-sub-text {
    font-size: 0.8rem;
    color: var(--text-sub);
}

.widget-video-iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) scale(1.1);
    pointer-events: none;
}

.video-overlay-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    background: transparent;
    cursor: pointer;
}

.safety-display-area {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.safety-text {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    word-break: keep-all;
    animation: fadeInText 0.5s ease;
}

.clock-display-area {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 500;
    color: #fff;
    font-family: 'DosMyungjo', serif;
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 중앙 타이틀 및 검색 */
.header-center {
    flex: 1;
    min-width: 0;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    margin: 0 0 13px 0;
    text-align: center;
}

.title-brand {
    display: block;
    line-height: 1;
    margin-bottom: 0px;
}

/* 새로 추가할 로고 이미지 스타일 */
.main-logo {
    height: 110px;
    width: auto;
    padding-right: 19px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* (선택 사항) 로고에 마우스를 올렸을 때 살짝 커지는 효과 */
.main-logo:hover {
    transform: scale(1.02);
}


.title-sub {
    font-size: 1rem;
    color: var(--text-sub);
    font-weight: 500;
    display: block;
    line-height: 2;
    letter-spacing: 0px;
}

.search-container {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    position: relative;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    color: #94a3b8;
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 1;
}

#searchInput {
    flex: 1 1 0;
    /* input은 기본 min-width:auto(약 20글자) 때문에 줄어들지 않아
       좁은 화면에서 옆의 뽑기 버튼을 화면 밖으로 밀어낸다 */
    min-width: 0;
    height: 56px;
    padding: 0 24px 0 52px;
    border-radius: var(--radius-md);
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-solid);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

#searchInput:focus {
    background: #0f172a;
    border-color: var(--primary-accent);
    outline: 2px solid var(--primary-accent);
    outline-offset: 1px;
}

.random-btn {
    flex: 0 0 auto;
    max-width: 45%;
    height: 56px;
    padding: 0 18px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    font-size: 1.05rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.random-btn-emoji {
    flex-shrink: 0;
    font-size: 1.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-top: -1px;
}

/* 긴 번역어(예: Ngẫu nhiên, Случайно)도 버튼 밖으로 삐져나가지 않게 */
.random-btn-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.random-btn:hover {
    transform: rotate(5deg) scale(1.05);
}

/* --- [카테고리] --- */
.category-scroll-mask {
    margin-top: 20px;
    position: relative;
    overflow: visible;
}

.category-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    padding: 4px 0;
    overflow-x: visible;
}

.category-container::-webkit-scrollbar {
    display: none;
}

.cat-btn {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px 12px;
    border-radius: 50px;
    background: var(--bg-solid);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-sub);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.cat-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-2px);
}

.cat-btn.active {
    background: var(--btn-color);
    color: white;
    font-weight: 500;
    border-color: transparent;
}

.cat-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    20% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

.cat-icon {
    filter: grayscale(1);
    transition: filter 0.3s;
}

.cat-btn.active .cat-icon,
.cat-btn:hover .cat-icon {
    filter: grayscale(0);
}

/* --- [교과 단원 선택 스타일 추가] --- */
.curriculum-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    animation: fadeIn 0.3s ease;
    background: var(--bg-solid);
    border-radius: var(--radius-md);
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.making-desc-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.making-desc {
    font-size: 0.85rem;
    color: var(--text-sub);
    text-align: center;
    padding: 0 10px;
}

.making-apply-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(90deg, var(--secondary-accent), var(--primary-accent));
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.making-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.45);
}

.curr-selector {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-width: 100%;
    padding: 5px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: center;
}

.curr-selector::-webkit-scrollbar {
    display: none;
}

.curr-btn {
    padding: 8px 10px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-sub);
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.curr-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.curr-btn.active {
    background: var(--primary-accent);
    color: #1e293b;
    font-weight: 500;
    border-color: transparent;
}

.unit-list .curr-btn.active {
    background: #f472b6;
}

/* --- [게임 그리드] --- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-bottom: 20px;
}

/* ========================================
   썸네일 OFF → 심플 리스트 뷰
   ======================================== */

/* 그리드 → 단일 컬럼 리스트 */
.thumbnails-off .game-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 카드 → 가로형 리스트 행 (제목 + 메타 2줄) */
.thumbnails-off .game-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    min-height: 60px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--bg-card);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    transform: none;
    position: relative;
}

.thumbnails-off .game-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateX(3px);
}

/* 썸네일 이미지 영역 숨김 */
.thumbnails-off .card-img-wrapper {
    display: none;
}

/* 좌측 컬러 인디케이터 바 */
.thumbnails-off .game-card::before {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 4px;
    align-self: stretch;
    background: var(--card-color, #64748b);
    border-radius: 0 2px 2px 0;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.thumbnails-off .game-card:hover::before {
    opacity: 1;
}

/* card-info: 제목(상단 줄) + 메타(하단 줄) 2줄 스택, 좌측 정렬 */
.thumbnails-off .card-info {
    border-top: none;
    border-bottom: none !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 8px 14px;
    gap: 3px;
    min-width: 0;
    background: transparent;
}

/* 제목 + 뱃지를 묶는 좌측 그룹 */
.thumbnails-off .card-info-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

/* 게임 제목 스타일: 말줄임표 없이 1줄에서 하드 컷 (넘치는 부분은 호버 시 흐르며 노출) */
.thumbnails-off .card-title {
    font-size: 1rem;
    color: #e2e8f0;
    margin: 0;
    line-height: 1.3;
    max-height: calc(1.3em * 1);
    overflow: hidden;
    white-space: normal;
    word-break: keep-all;
    display: block;
    min-width: 0;
    text-align: left;
    transition: color 0.2s;
}

.thumbnails-off .game-card:hover .card-title {
    color: #fff;
}

/* 카드 메타(기기 아이콘·카테고리·인원수) 제목 아래 2번째 줄로 노출 */
.thumbnails-off .card-meta {
    display: block;
    font-size: 0.78rem;
}

/* creator 배지 숨김 (card-img-wrapper 자체가 숨겨지므로 이중 안전장치) */
.thumbnails-off .card-creator-badge {
    display: none !important;
}

.thumbnails-off .card-vs-fullpanel {
    display: none !important;
}

/* BEST / NEW 뱃지: 절대 위치 → 인라인으로 전환 */
.thumbnails-off .badge {
    position: static;
    flex-shrink: 0;
    padding: 2px 7px;
    font-size: 0.65rem;
    border-radius: 5px;
    line-height: 1.4;
}

/* 리스트용 뱃지: thumbnails-off 시에만 표시 */
.thumbnails-off .badge-in-list {
    display: inline-block;
}

/* 리스트 뷰 NEW 뱃지: 'NEW' → 'N' 으로 축약 */
.thumbnails-off .badge-in-list.badge-new {
    font-size: 0;
    padding: 2px 5px;
}
.thumbnails-off .badge-in-list.badge-new::before {
    content: 'N';
    font-size: 0.65rem;
}

/* 우측 화살표 아이콘 */
.thumbnails-off .game-card::after {
    content: '›';
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    font-size: 1.3rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.25);
    transition: color 0.2s, transform 0.2s;
    padding-right: 6px;
}

.thumbnails-off .game-card:hover::after {
    color: rgba(255, 255, 255, 0.7);
    transform: translateX(2px);
}

/* 모바일 섹션 헤더는 유지 */
.thumbnails-off .mobile-section-header {
    grid-column: unset;
}

.game-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    transform: translateZ(0);
}

.game-card:hover {
    transform: translateY(-12px) scale(1.02);
    z-index: 5;
    border-color: rgba(255, 255, 255, 0.2);
}

.card-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #1e293b;
    position: relative;
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, opacity 0.5s ease;
}

.game-card img.lazy-thumb:not(.loaded) {
    opacity: 0;
}

.game-card img.lazy-thumb.loaded {
    opacity: 1;
}

.game-card:hover img {
    transform: scale(1.1);
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    z-index: 2;
}

/* 리스트용 뱃지: 기본 숨김 (썸네일 OFF 시만 노출) */
.badge-in-list {
    display: none;
}

/* 이미지 위 뱃지: 기본 표시 (썸네일 OFF 시 숨김) */
.thumbnails-off .badge-on-img {
    display: none;
}

/* 학급대항전(king_vs) 카드의 금색 순위 패널(.card-vs-fullpanel, z-index: 3)이
   이미지 영역 전체를 덮으므로, NEW/BEST 뱃지가 그 뒤에 가려지지 않도록 더 위로 올린다 */
.badge-on-img {
    z-index: 4;
}

.badge-best {
    background: #fbbf24;
    color: #1e293b;
}

.badge-new {
    background: #34d399;
    color: #064e3b;
}

/* 제작자 배지: 썸네일 하단에 오버레이로 표시.
   card-info(카테고리+제목) 영역은 제작자 유무와 상관없이 항상 동일한 2줄 구조를 유지하기 위해
   썸네일 이미지 위 배지로 분리했다. */
.card-creator-badge {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: calc(100% - 20px);
    padding: 5px 12px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(2px);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-creator-badge .creator-label {
    color: #cbd5e1;
    font-weight: 500;
    margin-right: 5px;
    flex-shrink: 0;
}

.card-creator-badge a,
.card-creator-badge span:not(.creator-label) {
    color: #eab308;
    font-weight: 500;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-creator-badge a:hover {
    text-decoration: underline;
}

/* 학급대항전(king_vs) 게임: 썸네일을 아예 불러오지 않고 1~3위만 중앙 정렬로 채우는 패널
   (사이트 전반의 다크 카드 톤과 통일 + 1/2/3위를 금/은/동 텍스트로 구분) */
.card-vs-fullpanel {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 14px;
    background: linear-gradient(160deg, #1e293b, #0f172a);
}

.vs-panel-ranks {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 100%;
}

.vs-panel-rank-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 100%;
    font-size: 0.85rem;
    font-weight: 500;
    color: #f1f5f9;
}

.vs-panel-rank-row:first-child {
    font-size: 1rem;
}

.vs-panel-rank-label {
    flex-shrink: 0;
    font-weight: 500;
}

.vs-panel-rank-row:nth-child(1) .vs-panel-rank-label {
    color: #fbbf24;
}

.vs-panel-rank-row:nth-child(2) .vs-panel-rank-label {
    color: #94a3b8;
}

.vs-panel-rank-row:nth-child(3) .vs-panel-rank-label {
    color: #b45309;
}

.vs-panel-rank-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-info {
    padding: 16px 20px;
    background: var(--bg-solid);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* 말줄임표 없이 1줄에서 하드 컷 (넘치는 부분은 호버 시 흐르며 노출) */
.card-title {
    font-size: 1rem;
    font-weight: 500;
    color: #f1f5f9;
    margin: 0 0 8px 0;
    line-height: 1.3;
    max-height: calc(1.3em * 1);
    overflow: hidden;
    display: block;
    white-space: normal;
    word-break: keep-all;
    text-align: left;
}

/* 실제로 흐르며 스크롤되는 대상. transitionDuration은 JS에서 넘치는 길이에 비례해 지정 */
.card-title-inner {
    display: block;
    transform: translateY(0);
}

.card-meta {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta .meta-dot {
    margin: 0 2px;
    color: rgba(148, 163, 184, 0.55);
}

/* 썸네일 ON: card-info-left는 투명 래퍼로 레이아웃 영향 없음 */
.card-info-left {
    display: contents;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-sub);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
}

/* sm 카드(스마트폰용)는 일반 카드와 동일한 배경 사용 (썸네일 ON/OFF 모두) */
.game-card.card-type-sm {
    background: var(--bg-card);
}

.game-card.card-type-sm .card-info {
    background: var(--bg-solid);
}

/* --- [로딩 스피너] --- */
#loadingSpinner {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.5s;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-sub);
}

.loading-hidden {
    opacity: 0;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.mobile-section-header {
    grid-column: 1 / -1;
    margin-top: 0px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.mobile-section-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: white;
}

/* ========================================= */
/* [반응형 미디어 쿼리] */
/* ========================================= */

@media (max-width: 1024px) {
    .info-widget {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding-top: 80px;
        padding-left: 20px;
        padding-right: 20px;
    }



    .header-row {
        flex-direction: column;
        gap: 20px;
    }

    .header-center {
        width: 100%;
    }


    .title-sub {
        display: none;
    }

    #currentFlag {
        margin-right: 6px;
    }

    .search-icon {
        left: 16px;
        font-size: 0.95rem;
    }

    #searchInput {
        height: 50px;
        font-size: 16px;
        padding-left: 44px;
    }

    .random-btn {
        height: 50px;
        padding: 0 12px;
        font-size: 0.9rem;
        gap: 4px;
    }

    .random-btn-emoji {
        font-size: 1.25rem;
        margin-top: -1px;
    }

    .floating-bar-style {
        top: 10px;
        height: 40px;
        padding: 0 12px !important;
        background: #0f172a !important;
    }

    .curr-selector {
        justify-content: flex-start;
        padding: 5px 20px;
    }

    #langTriggerBtn {
        right: 16px !important;
        left: auto !important;
        /* 어떤 경우에도 화면 오른쪽을 넘지 않도록 (fixed 요소의 %는 뷰포트 기준) */
        max-width: calc(100% - 32px);
        overflow: hidden;
    }

    .top-left-floating-group {
        left: 16px !important;
        top: 10px !important;
        right: auto !important;
        /* 언어 버튼(약 100px) 자리를 남겨두고, 넘치면 라벨을 줄임표 처리 */
        max-width: calc(100% - 132px);
    }

    .top-left-floating-group .floating-bar-style {
        min-width: 0;
        overflow: hidden;
    }

    #infoBtnTextSpan,
    #thumbToggleTextSpan {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #currentLangName {
        display: none;
    }

    .category-container {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 4px 20px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }

    .category-scroll-mask {
        margin-top: 16px;
        mask-image: none;
        -webkit-mask-image: none;
        overflow: visible;
    }

    header {
        margin-bottom: 16px;
    }

    .game-grid {
        grid-template-columns: repeat(1, 1fr);
        gap: 16px;
        padding-bottom: 60px;
    }

    .card-info {
        padding: 12px;
    }

    .card-title {
        font-size: 0.95rem;
    }

    .card-meta {
        font-size: 0.75rem;
    }

    /* 기존 모바일 미디어 쿼리 안쪽 어딘가에 추가 */
    .title-brand {
        font-size: 2.4rem;
    }

    /* <-- 기존에 있던 코드는 삭제하셔도 됩니다 */

    /* 모바일용 로고 크기 조정 */
    .main-logo {
        height: 75px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================= */
/* [독립된 다국어 모달 및 UI 전용 CSS] */
/* ========================================= */
#langModal,
#langModal * {
    box-sizing: border-box !important;
    font-family: var(--font-main);
}

#langModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#langModal.active {
    opacity: 1;
    visibility: visible;
}

.lang-modal-content {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

#langModal.active .lang-modal-content {
    transform: scale(1) translateY(0);
}

.lang-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #1f2937;
    background: #111827;
}

.lang-modal-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-modal-close {
    background: #1f2937;
    color: #9ca3af;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    font-size: 1.2rem;
}

.lang-modal-close:hover {
    background: #374151;
    color: white;
}

.lang-modal-search {
    padding: 16px 20px 8px 20px;
    position: relative;
    background: #111827;
}

.lang-modal-search input {
    width: 100%;
    background: #1f2937;
    border: 1px solid #374151;
    color: white;
    padding: 14px 14px 14px 44px;
    border-radius: 12px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.lang-modal-search input:focus {
    border-color: #eab308;
    outline: 1px solid #eab308;
}

.lang-modal-search i {
    position: absolute;
    left: 36px;
    top: 50%;
    color: #9ca3af;
    transform: translateY(-3px);
    font-size: 1rem;
}

.lang-modal-body {
    padding: 16px 20px 20px 20px;
    overflow-y: auto;
    flex: 1;
    background: #111827;
}

.lang-modal-body::-webkit-scrollbar {
    width: 8px;
}

.lang-modal-body::-webkit-scrollbar-track {
    background: #1f2937;
    border-radius: 4px;
}

.lang-modal-body::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

.lang-modal-body::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #1f2937;
    border: 1px solid #374151;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.lang-item:hover {
    background: #374151;
    border-color: #6b7280;
}

.lang-item.selected {
    background: #1f2937;
    border-color: #eab308;
}

.lang-flag {
    width: 36px;
    height: 26px;
    border-radius: 4px;
    object-fit: cover;
    transition: transform 0.3s;
}

.lang-item:hover .lang-flag {
    transform: scale(1.1);
}

.lang-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.lang-name {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.lang-item.selected .lang-name {
    color: #facc15;
}

.lang-en-name {
    color: #9ca3af;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.lang-check {
    color: #eab308;
    font-size: 1.1rem;
    display: none;
    margin-left: auto;
}

.lang-item.selected .lang-check {
    display: block;
}

.lang-no-result {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: #6b7280;
    text-align: center;
}

.lang-no-result.active {
    display: flex;
}

/* 토스트 메시지 CSS */
#langToast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 99999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    box-sizing: border-box !important;
}

#langToast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.toast-text {
    display: flex;
    flex-direction: column;
}

.toast-msg {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

.toast-lang {
    color: #9ca3af;
    font-size: 0.75rem;
    margin: 0;
}

/* 배너 디자인 및 애니메이션 */
.flashy-banner {
    display: block;
    width: 100%;
    margin: 0 0 10px 0;
    padding: 11px;
    background: linear-gradient(90deg, #38bdf8, #a855f7, #f472b6, #38bdf8);
    background-size: 300% 100%;
    border-radius: 50px;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
    animation: banner-scroll 4s linear infinite;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    word-break: keep-all;
    text-decoration: none;
}

.flashy-banner:hover {
    transform: scale(1.02);
    color: #fff;
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
}

@keyframes banner-scroll {
    0% {
        background-position: 0% 0;
    }

    100% {
        background-position: 300% 0;
    }
}

@media (max-width: 768px) {
    .flashy-banner {
        display: none;
    }
}

/* ========================================= */
/* [랜덤 번호 뽑기 모달 전용 스타일] */
/* ========================================= */
.raffle-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    font-family: var(--font-main);
}

.raffle-modal * {
    box-sizing: border-box;
}

.raffle-modal.active {
    opacity: 1;
    visibility: visible;
}

.raffle-modal-content {
    background: #1e293b;
    border: 1px solid #374151;
    border-radius: 20px;
    width: 90%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    transform: scale(0.9) translateY(-20px);
    transform-origin: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.raffle-modal.active .raffle-modal-content {
    transform: scale(1) translateY(0);
}

@media (max-width: 768px) {
    .raffle-modal {
        padding: 16px;
        align-items: center;
    }

    .raffle-modal-content {
        width: 100%;
        max-width: none;
        max-height: 90vh;
        overflow-y: auto;
    }
}

.raffle-modal-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
    border-bottom: 1px solid #334155;
    background: rgba(0, 0, 0, 0.15);
}

.raffle-modal-title {
    color: white;
    font-size: 1.6rem;
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.raffle-modal-close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.raffle-modal-close:hover {
    background: #ef4444;
    color: white;
    border-color: transparent;
    transform: translateY(-50%) rotate(90deg);
}

.raffle-modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.raffle-controls-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    background: rgba(15, 23, 42, 0.3);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 600px) {
    .raffle-controls-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-label {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stepper-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.step-btn {
    background: #334155;
    color: #cbd5e1;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.step-btn:hover {
    background: #475569;
    color: white;
}

.raffle-controls-row input {
    width: 60px;
    padding: 8px 4px;
    border-radius: 8px;
    border: 1px solid #475569;
    background: #0f172a;
    color: white;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    outline: none;
    transition: all 0.2s;
}

.raffle-controls-row input::-webkit-outer-spin-button,
.raffle-controls-row input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.raffle-controls-row input[type="number"] {
    -moz-appearance: textfield;
}

.raffle-controls-row input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.action-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex-grow: 1;
    justify-content: flex-end;
}

@media (max-width: 600px) {
    .action-buttons {
        justify-content: stretch;
        margin-top: 8px;
    }

    .draw-btn,
    .reset-btn,
    .close-btn-bottom {
        flex: 1;
    }
}

.draw-btn {
    padding: 8px 24px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f472b6, #a855f7);
    color: white;
    font-weight: 500;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(244, 114, 182, 0.3);
    transition: all 0.2s;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.draw-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 114, 182, 0.5);
}

.reset-btn {
    padding: 8px 16px;
    border-radius: 8px;
    background: #334155;
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.reset-btn:hover {
    background: #475569;
    color: white;
}

.close-btn-bottom {
    padding: 8px 16px;
    border-radius: 8px;
    background: #475569;
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.close-btn-bottom:hover {
    background: #64748b;
    color: white;
}

.raffle-message {
    color: #fb7185;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    min-height: 20px;
    margin-top: -8px;
    margin-bottom: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.raffle-message.show {
    opacity: 1;
}

.raffle-result {
    min-height: 160px;
    background: #0f172a;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    padding: 24px;
    text-align: center;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.5);
}

.raffle-result .placeholder {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 500;
    line-height: 1.6;
    max-width: 80%;
}

.raffle-num-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 85px;
    height: 85px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.15);
    font-size: 3.2rem;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.1);
    transform: scale(0);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    70% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.raffle-history {
    margin-top: 10px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.raffle-history h3 {
    font-size: 0.95rem;
    color: #94a3b8;
    margin: 0 0 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 24px;
}

.history-item {
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.05);
}



/* ========================================= */
/* [랜덤 번호 뽑기 하단 플로팅 버튼 강조] */
/* ========================================= */
#raffleTriggerBtn {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #f472b6, #a855f7);
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    transition: opacity 0.2s, transform 0.2s;
    white-space: nowrap;
    border: none;
    border-radius: 0;
    cursor: pointer;
    width: 100%;
}

#raffleTriggerBtn:hover {
    opacity: 0.9;
    color: white;
}

#raffleTriggerBtn i {
    color: #fff;
    font-size: 1.1rem;
    margin-right: 6px;
}

#raffleTriggerBtn span {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

/* --- [index.php에서 이관된 스타일] --- */
@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }
}

/* 플로팅 바 & 버튼 인라인 스타일 이관 */
#langTriggerBtn {
    right: 24px;
    left: auto;
    max-width: calc(100% - 48px);
    z-index: 99999;
    padding: 0 16px;
    cursor: pointer;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 국기·아이콘은 눌리지 않게, 언어명만 줄어들도록 */
#langTriggerBtn i,
#langTriggerBtn img {
    flex-shrink: 0;
}

#currentLangName {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-left-floating-group {
    position: fixed;
    top: 20px;
    left: 24px;
    z-index: 99999;
    display: flex;
    gap: 0;
    /* 알약이 결합된 느낌을 위해 gap을 0으로 설정 */
}

.top-left-floating-group .floating-bar-style {
    position: static;
    padding: 0 12px;
    /* 가로폭 축소를 위해 16px -> 12px로 패딩 수정 */
    cursor: pointer;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    color: var(--text-main);
}

#infoTriggerBtn {
    border-radius: 50px 0 0 50px;
    border-right: none;
    /* 중간 경계선 중복 제거 */
}

#thumbToggleBtn {
    border-radius: 0 50px 50px 0;
    display: inline-flex;
    align-items: center;
}

/* 아이폰 스타일 스위치 스타일링 */
.ios-switch {
    display: inline-block;
    flex-shrink: 0;
    width: 32px;
    height: 18px;
    background: #475569;
    /* OFF 상태: 약간 밝은 회색(슬레이트) */
    border-radius: 100px;
    position: relative;
    margin-left: 6px;
    transition: background 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.ios-switch-knob {
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ON 상태: 스위치 배경이 우리반 참가하기 그라디언트로 밝아짐 */
#thumbToggleBtn.state-on .ios-switch {
    background: linear-gradient(90deg, #38bdf8, #a855f7);
}

/* ON 상태: 스위치 손잡이가 우측으로 이동 */
#thumbToggleBtn.state-on .ios-switch-knob {
    transform: translateX(14px);
}

#currentLangName {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    margin: 0 6px 0 8px;
}

#infoBtnTextSpan,
#thumbToggleTextSpan {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    /* 소개와 썸네일 온오프 폰트 사이즈 통일 */
    margin: 0;
    /* 내부 여백 제거하여 더 짧고 단단한 알약 형태 유도 */
}

#leftWidget {
    cursor: default;
}

#padletContainer {
    display: none;
    padding-bottom: 60px;
}

#infiniteScrollSentinel {
    height: 1px;
    width: 100%;
}

#klkRankingContent {
    max-height: 500px;
    overflow: hidden;
}

/* 1600px 화면 너비 응답형 제어 및 뿅! 팝업 애니메이션 */
@keyframes sidePanelPopIn {
    0% {
        opacity: 0;
        transform: scale(0.6) translateY(50px);
    }
    70% {
        opacity: 1;
        transform: scale(1.05) translateY(-6px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (max-width: 1599px) {
    .klk-ranking-side-panel,
    .main-region-side-panel {
        display: none !important;
    }
}

/* KLK 왼쪽 하단 랭킹 위젯 스타일 */
.klk-ranking-side-panel {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

@media (min-width: 1600px) {
    .klk-ranking-side-panel,
    .main-region-side-panel {
        display: flex !important;
        animation: sidePanelPopIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }
}

.klk-ranking-widget {
    width: 280px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(8px);
    transition: width 0.3s ease;
}

.klk-ranking-widget.is-collapsed {
    width: 200px;
}

.klk-widget-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    cursor: pointer;
}

.klk-toggle-btn {
    margin-left: auto;
    cursor: pointer;
    padding: 4px;
    color: #cbd5e1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.klk-toggle-btn:hover {
    color: #fff;
}


.klk-content-hidden {
    display: none !important;
}

.klk-widget-content {
    padding: 16px;
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.6;
}

.klk-rank-item {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.klk-rank-item:last-child {
    margin-bottom: 0;
}

.klk-week-range {
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.35;
}

.klk-week-title {
    font-size: 0.82rem;
    font-weight: 500;
    color: #fbbf24;
}

.klk-week-sub {
    font-size: 0.71rem;
    font-weight: 500;
    color: #94a3b8;
    margin-top: 2px;
}

.klk-vs-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0px;
    padding: 1px 2px;
    line-height: 1.3;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.klk-vs-item:last-child {
    margin-bottom: 0;
}

.klk-vs-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
}

/* 네이티브 title 툴팁의 표시 지연을 없애기 위한 즉시 표시 커스텀 툴팁 */
.klk-vs-item::after {
    content: attr(data-game-title);
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%) translateY(-6px);
    background: #ef4444;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 1.125rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 30;
}

.klk-vs-item:hover::after {
    opacity: 1;
    visibility: visible;
}

.klk-vs-item-icon {
    font-size: 1rem;
    flex-shrink: 0;
    min-width: 20px;
    text-align: center;
}

.klk-vs-item-text {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.klk-map-btn {
    display: block;
    text-align: center;
    padding: 10px;
    background: #334155;
    color: #f8fafc;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.klk-map-btn:hover {
    background: #475569;
    color: #fff;
}

.klk-widget-btn {
    display: block;
    text-align: center;
    padding: 12px;
    background: linear-gradient(90deg, #38bdf8, #a855f7);
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: opacity 0.2s, transform 0.2s;
    white-space: nowrap;
}

.klk-widget-btn:hover {
    opacity: 0.9;
    color: white;
}

/* 명예의 전당 / 인증서 배너 스타일 (둥둥 떠 있는 투명 서클) */
.klk-honor-box {
    order: -1;
    /* 위젯의 위쪽으로 배치 */
    position: relative;
    width: 196px;
    /* 280px의 70% */
    height: 196px;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
    animation: floatBob 3s ease-in-out infinite;
    transition: width 0.3s ease, height 0.3s ease;
}

/* 위젯이 접혔을 때 이미지 크기를 200px의 70%인 140px로 축소 */
.klk-ranking-widget.is-collapsed+.klk-honor-box {
    width: 140px;
    height: 140px;
}

.honor-bg-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* 투명 배경 골드 배지 비율 유지 */
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.klk-honor-box:hover .honor-bg-img {
    transform: scale(1.08);
    filter: brightness(0.5) blur(1px);
}

.honor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 50%;
}

.klk-honor-box:hover .honor-overlay {
    opacity: 1;
    pointer-events: auto;
}

.honor-overlay-bg-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    border-radius: 50%;
}

.honor-overlay-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    /* 세로 줄바꿈 배치 */
    align-items: center;
    gap: 8px;
    /* 텍스트 링크 사이의 간격 */
}

.honor-text-link {
    color: #fbbf24;
    /* 골드 색깔 */
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease, text-shadow 0.2s ease;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
    border: 1px solid rgba(251, 191, 36, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

/* 140px로 작아졌을 때 텍스트 크기 조정 */
.klk-ranking-widget.is-collapsed+.klk-honor-box .honor-text-link {
    font-size: 0.8rem;
    padding: 4px 8px;
}

.honor-text-link:hover {
    color: #ffffff;
    border-color: #ffffff;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
    background: rgba(251, 191, 36, 0.1);
    transform: scale(1.05);
}

/* 둥둥 떠 있는 위아래 흔들림 애니메이션 */
@keyframes floatBob {
    100% {
        transform: translateY(0px);
    }
}

/* ========================================= */
/* [지역별 100위 이내 학급수 랭킹 위젯 스타일] */
/* ========================================= */

.main-region-side-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* 메인화면 index.php용 플로팅 위젯 */
.main-region-widget {
    width: 280px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0;
    font-family: var(--font-main);
    transition: width 0.3s ease;
}

.main-region-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* 좌우 하단 타이틀 폰트 크기 및 굵기 동기화 */
#klkTitleText,
#mainRegionTitleText {
    font-size: 0.95rem;
    font-weight: 500;
}

.klk-ranking-widget.is-collapsed #klkTitleText,
.main-region-widget.is-collapsed #mainRegionTitleText {
    font-size: 0.85rem;
}

.main-region-toggle-btn {
    margin-left: auto;
    cursor: pointer;
    padding: 4px;
    color: #cbd5e1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.main-region-toggle-btn:hover {
    color: #fff;
}



.main-region-title-sub {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.main-region-title-main {
    font-size: 1.05rem;
    color: #fbbf24;
    /* 🏆 골드 강조 */
    font-weight: 500;
    margin-top: 2px;
}

.main-region-content {
    padding: 10px 12px;
    display: block;
    overflow: hidden;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.vs-carousel-track {
    display: flex;
    width: 100%;
    min-width: 100%;
    transition: transform 0.5s ease-in-out;
}

.vs-carousel-page {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.main-region-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 3px;
    font-weight: 500;
}

.main-region-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.main-region-rank-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-region-medal {
    font-size: 0.95rem;
    min-width: 20px;
}

.main-region-name {
    color: #e2e8f0;
}

.main-region-count {
    color: #00f3ff;
    /* 네온 시안 색상 */
    font-weight: 500;
}

/* 학급대항전 챔피언 랭킹 스타일 */
.vs-champion-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px;
    border-bottom: none;
    transition: background 0.2s ease;
    cursor: pointer;
}

.vs-champion-item:last-child {
    border-bottom: none;
}

.vs-champion-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.vs-champion-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 1px;
}

.vs-champion-game-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    transition: color 0.2s ease;
}

.vs-champion-game-name:hover {
    color: #e2e8f0;
    text-decoration: underline;
}

.vs-challenge-link {
    font-size: 0.78rem;
    font-weight: 500;
    color: #f59e0b;
    text-decoration: none;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.vs-challenge-link:hover {
    color: #fbbf24;
    text-decoration: underline;
}

.vs-champion-school {
    font-size: 0.85rem;
    font-weight: 400;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    line-height: 1.4;
}


/* 스마트폰 브라우저에서는 메인화면/게임화면 모두 지역 랭킹 및 모바일 미지원 요소 숨김 */
@media (max-width: 768px) {
    .main-region-widget {
        display: none !important;
    }

    #game-region-ranking-widget {
        display: none !important;
    }

    .hide-on-mobile {
        display: none !important;
    }
}

/* 게임화면 index.html용 플로팅 위젯 */
#game-region-ranking-widget {
    background: #1e293b;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 0;
    width: 250px;
    position: absolute;
    bottom: 120px;
    /* 학급 입력창 위에 뜨도록 배치 */
    right: 20px;
    z-index: 40;
    transition: opacity 0.5s, transform 0.5s;
    font-family: var(--font-main);
}

#game-region-ranking-widget.hidden {
    display: none !important;
}

.game-region-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.game-region-toggle-btn {
    margin-left: auto;
    cursor: pointer;
    padding: 4px;
    color: #cbd5e1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.game-region-toggle-btn:hover {
    color: #fff;
}


.game-region-content {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.game-region-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 3px;
    font-weight: 500;
}

.game-region-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.game-region-name-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.game-region-count {
    color: #00f3ff;
    /* 네온 시안 */
    font-weight: 500;
}

/* 지역 랭킹 접힘 상태 스타일 */
.main-region-widget.is-collapsed {
    width: 200px;
}

.main-region-widget.is-collapsed .main-region-content {
    display: none !important;
}

#game-region-ranking-widget.is-collapsed {
    width: 200px !important;
}

#game-region-ranking-widget.is-collapsed .game-region-content {
    display: none !important;
}


/* ========================================
   베스트 게임 캐러셀 (24시간 인기 게임)
   데스크톱 전용
======================================== */

#bestGameStrip {
    width: 100%;
    display: grid;
    grid-template-columns: 0.6fr repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* stripTrack 자체는 레이아웃을 갖지 않고, 자식 4개(.strip-tile)가
   #bestGameStrip 그리드의 2~5번째 칸에 바로 놓이게 함 */
.strip-tiles {
    display: contents;
}

/* 로딩 스켈레톤: 타일 4칸 자리에 쉬머 박스 표시 */
.strip-tile.skeleton {
    aspect-ratio: 16 / 13;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 0%,
            rgba(255, 255, 255, 0.07) 50%,
            rgba(255, 255, 255, 0.03) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    border-color: transparent;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* 왼쪽 첫 번째 카드: 타이틀 + 좌우 이동 버튼 */
.strip-nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 16px 8px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.strip-nav-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border-color: rgba(56, 189, 248, 0.35);
}

.strip-nav-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-main);
    text-decoration: none;
}

.strip-nav-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.strip-nav-label {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.3;
    color: var(--text-main);
}

.strip-nav-page {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-sub);
    letter-spacing: 0.02em;
}

.strip-nav-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 좌/우 내비 버튼 */
.strip-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    color: var(--text-main);
    font-size: 1.05rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 2px;
    /* 이모지 수직 미세 보정 */
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease,
        transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.2s ease, box-shadow 0.2s ease;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.strip-nav:hover {
    background: var(--primary-accent);
    border-color: var(--primary-accent);
    color: #0f172a;
    transform: scale(1.14);
    box-shadow: 0 5px 18px rgba(56, 189, 248, 0.4);
}

.strip-nav:active {
    transform: scale(0.92);
}

.strip-nav:disabled {
    opacity: 0.28;
    cursor: default;
    pointer-events: none;
}

/* 인기 게임 타일 (썸네일 크게 + 제목만) */
.strip-tile {
    display: flex;
    flex-direction: column;
    background: var(--bg-solid);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s ease, border-color 0.2s ease;
}

.strip-tile:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 10px 26px rgba(56, 189, 248, 0.25);
    border-color: var(--primary-accent);
}

.tile-thumb-wrap {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #000;
}

.tile-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.strip-tile:hover .tile-thumb {
    transform: scale(1.08);
}

/* 순위 뱃지 (썸네일 좌측 상단) */
.tile-rank {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    border: 2px solid rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.tile-rank-1 {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    color: #78350f;
    box-shadow: 0 4px 14px rgba(245, 158, 11, .75);
}

.tile-rank-2 {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    color: #1e293b;
    box-shadow: 0 3px 12px rgba(148, 163, 184, .55);
}

.tile-rank-3 {
    background: linear-gradient(135deg, #fed7aa, #fb923c);
    color: #7c2d12;
    box-shadow: 0 3px 12px rgba(251, 146, 60, .55);
}

.tile-rank-other {
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: #fff;
    box-shadow: 0 3px 12px rgba(56, 189, 248, .45);
}

/* 게임 제목만 표시 */
.tile-title {
    padding: 12px 12px;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* 데스크톱 전용 */
@media (max-width: 768px) {
    #bestGameStrip {
        display: none !important;
    }
}

/* ========================================
   모바일 게임 BEST 10 위젯
======================================== */
.mobile-best-widget {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.85) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.mobile-best-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
}

.mobile-best-title-icon {
    font-size: 1.3rem;
}

.mobile-best-title-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #ff8a00, #e60067);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-best-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-best-item {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #f1f5f9;
}

.mobile-best-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mobile-best-rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 14px;
    flex-shrink: 0;
}

.mobile-best-rank.rank-1 {
    background: linear-gradient(135deg, #fde68a, #f59e0b);
    color: #78350f;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.mobile-best-rank.rank-2 {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(148, 163, 184, 0.35);
}

.mobile-best-rank.rank-3 {
    background: linear-gradient(135deg, #fed7aa, #fb923c);
    color: #7c2d12;
    box-shadow: 0 2px 8px rgba(251, 146, 60, 0.35);
}

.mobile-best-rank.rank-other {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-best-name {
    font-size: 0.95rem;
    font-weight: 500;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 12px;
}

.mobile-best-clicks {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.mobile-best-item:hover .mobile-best-clicks {
    color: #f43f5e;
}

/* 스켈레톤 로딩 스타일 */
.skeleton-list {
    pointer-events: none;
}

.skeleton-item {
    background: rgba(255, 255, 255, 0.02);
    border-color: transparent;
}

.skeleton-rank {
    background: rgba(255, 255, 255, 0.05) !important;
    color: transparent !important;
    box-shadow: none !important;
}

.skeleton-text {
    height: 14px;
    width: 60%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton-text::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    animation: shimmer 1.5s infinite;
}

/* ========================================
   킹수학 후원하기 버튼 빛나는 애니메이션 효과
======================================== */
.sponsor-btn {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #d4af37, #f3e5ab, #aa771c, #f3e5ab, #d4af37);
    background-size: 200% 200%;
    color: #3b2314 !important;
    /* 가독성을 위한 어두운 브론즈색 텍스트 */
    /* 나눔스퀘어 네오는 굵기가 별도 패밀리라 font-weight로는 굵어지지 않는다 */
    font-family: var(--font-bold);
    font-weight: 500 !important;
    border: 1px solid #aa771c !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(170, 119, 28, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    animation: goldGlow 3.5s infinite ease-in-out, goldBgShift 8s infinite linear;
}

.sponsor-btn:hover {
    background: linear-gradient(135deg, #f3e5ab, #d4af37, #f3e5ab, #d4af37);
    color: #3b2314 !important;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.7), inset 0 1px 2px rgba(255, 255, 255, 0.5);
    border-color: #d4af37 !important;
}

.sponsor-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.5) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    animation: shineSweep 3.5s infinite ease-in-out;
}

@keyframes shineSweep {
    0% {
        left: -150%;
    }

    15% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

@keyframes goldBgShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes goldGlow {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(170, 119, 28, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3);
        border-color: #aa771c;
    }

    50% {
        box-shadow: 0 6px 20px rgba(212, 175, 55, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.4);
        border-color: #f3e5ab;
    }
}

/* 썸네일 오프 시 좌우 광고(비디오)의 유튜브/영상 영역 제거 및 텍스트화 */
.thumbnails-off .info-widget.mode-video {
    height: 50px;
    border-radius: 50px;
}

.thumbnails-off .info-widget.mode-video:hover {
    transform: translateY(-2px);
}

.thumbnails-off .info-widget.mode-video .widget-thumbnail-zone {
    display: none;
}

.thumbnails-off .info-widget.mode-video .widget-text-zone {
    border-top: none;
    padding: 4px 16px;
}

.thumbnails-off .info-widget.mode-video .widget-main-text {
    font-size: 0.85rem;
}

.thumbnails-off .info-widget.mode-video .widget-sub-text {
    font-size: 0.72rem;
}

/* 썸네일 오프 시 인기게임 카러셀 축소 스타일 */
.thumbnails-off #bestGameStrip {
    grid-template-columns: 0.8fr repeat(4, 1fr);
    /* 네비 카드가 가로 배치되므로 폭을 약간 넓힘 */
    gap: 12px;
}

.thumbnails-off .strip-nav-card {
    height: 50px;
    flex-direction: row;
    justify-content: space-between;
    /* 양 끝 정렬 (인기 게임은 왼쪽, 버튼은 오른쪽) */
    align-items: center;
    padding: 0 20px;
    border-radius: 50px;
    gap: 12px;
}

.thumbnails-off .strip-nav-card:hover {
    transform: translateY(-2px);
    /* 호버 시 흔들림 방지 */
}

.thumbnails-off .strip-nav-icon,
.thumbnails-off .strip-nav-page,
.thumbnails-off .strip-nav-sub-label,
.thumbnails-off .strip-nav-label br {
    display: none;
}

.thumbnails-off .strip-nav-label {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.thumbnails-off .strip-nav-buttons {
    gap: 4px;
}

.thumbnails-off .strip-nav {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
    border-width: 1px;
    box-shadow: none;
}

/* 인기게임 타일 가로 알약형 변형 */
.thumbnails-off .strip-tile {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    /* 왼쪽 정렬 */
    padding: 0 16px;
    height: 50px;
    border-radius: 50px;
    gap: 10px;
}

.thumbnails-off .strip-tile:hover {
    transform: translateY(-2px) scale(1.01);
}

.thumbnails-off .tile-thumb-wrap {
    width: auto;
    height: auto;
    aspect-ratio: auto;
    background: transparent;
    overflow: visible;
    position: static;
    flex-shrink: 0;
}

.thumbnails-off .tile-thumb {
    display: none;
}

.thumbnails-off .tile-rank {
    position: static;
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnails-off .tile-rank-1 {
    box-shadow: none;
}

.thumbnails-off .tile-rank-2 {
    box-shadow: none;
}

.thumbnails-off .tile-rank-3 {
    box-shadow: none;
}

.thumbnails-off .tile-rank-other {
    box-shadow: none;
}

.thumbnails-off .tile-title {
    flex-grow: 1;
    min-width: 0;
    /* flex container 안에서 텍스트 말줄임(...)이 올바르게 작동하도록 설정 */
    padding: 0;
    text-align: left;
    /* 왼쪽 정렬 */
    border-top: none;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 로딩 스켈레톤의 썸네일 해제 시 레이아웃 변형 */
.thumbnails-off .strip-tile.skeleton {
    aspect-ratio: auto;
    height: 50px;
    border-radius: 50px;
}
/* --- [썸네일 오프: 게임 제목 호버 시 썸네일 미리보기] --- */
#thumbHoverPreview {
    position: fixed;
    width: 300px;
    height: 188px;
    z-index: 1500;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: var(--bg-solid);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px) scale(0.97);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
    pointer-events: none;
}

/* 아래쪽에 뜰 때는 반대 방향에서 등장 */
#thumbHoverPreview.below {
    transform: translateY(-6px) scale(0.97);
}

#thumbHoverPreview.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#thumbHoverPreview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
