/* ==========================================================================
   1. Design System & Global Reset
   ========================================================================== */
:root {
    --ios-bg: #000000;
    --ios-card: #1C1C1E;
    --ios-blue: #0A84FF;
    --ios-text-primary: #FFFFFF;
    --max-width: 1440px;
    --sidebar-width: 350px;
    --safe-top: env(safe-area-inset-top, 20px);
}

* { box-sizing: border-box; }

body {
    font-family: "Inter", "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0; padding: 0; 
    background-color: #000000; 
    color: var(--ios-text-primary);
    overflow: hidden; width: 100%; height: 100vh;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes waveSlideUp { 0% { opacity: 0; transform: translateY(30px); } 100% { opacity: 1; transform: translateY(0); } }

.wave-item { opacity: 0; animation: waveSlideUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }

/* ==========================================================================
   2. List Page
  ========================================================================== */
#list-page {
    background: radial-gradient(circle at 50% 0%, #454550 0%, #1a1a1e 40%, #000000 100%);
    position: relative; padding: 0; overflow: hidden; display: block; height: 100vh; width: 100%;
}
.game-container {
    position: relative; height: 100vh; display: flex; flex-direction: column; 
    justify-content: flex-start; align-items: center; 
    max-width: 1440px; margin: 0 auto; padding: 60px 15px 0 15px; z-index: 10;
}

.logo-area { margin-bottom: 20px; display: flex; justify-content: center; }
.logo-area img { width: 360px; height: auto; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6)); }

.list-grid-viewport {
    width: 100%; 
    max-width: 1920px; 
    flex: 1; 
    height: auto;
    
    /* [수정됨] 스크롤 기능 비활성화 */
    overflow: hidden; 
    /* 기존: overflow-y: auto; overflow-x: hidden; */

    padding: 20px 200px 200px 30px; 
    scrollbar-width: none; 
    -ms-overflow-style: none;  
}
.list-grid-viewport::-webkit-scrollbar { display: none; }

.game-grid-content {
    margin-top: 20px; display: grid; grid-template-columns: repeat(4, 1fr); 
    gap: 40px 20px; width: 100%;
}

.game-card {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    padding: 20px; margin: 0; min-height: 180px; 
    background: #444; color: #fff; text-decoration: none; text-transform: uppercase;
    font-size: 1.5rem; letter-spacing: 0.1rem; transition: 0.5s; cursor: pointer; overflow: hidden;
}
.game-card:hover, .game-card.selected {
    letter-spacing: 0.25rem; background: var(--hover-neon, #0A84FF); color: var(--hover-neon, #0A84FF);
    box-shadow: 0 0 35px var(--hover-neon, #0A84FF); transform: translateY(-5px); z-index: 100;
}
.game-card::before {
    content: ''; position: absolute; inset: 2px; background: #27282c; z-index: 1;
}
.game-card span { position: relative; z-index: 10; font-weight: 800; font-size: 1.5rem; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.game-card i { position: absolute; inset: 0; display: block; z-index: 5; }
.game-card i::before, .game-card i::after {
    content: ''; position: absolute; width: 10px; height: 5px;
    border: 2px solid var(--hover-neon, #0A84FF); background: var(--hover-neon, #0A84FF); 
    box-shadow: 0 0 5px var(--hover-neon, #0A84FF); transform: translateX(-50%); transition: 0.5s;
}
.game-card i::before { top: -3.5px; left: 80%; }
.game-card i::after { bottom: -3.5px; left: 20%; }
.game-card:hover i::before, .game-card.selected i::before { left: 20%; width: 20px; }
.game-card:hover i::after, .game-card.selected i::after { left: 80%; width: 20px; }

/* Black Belt Styles */
.game-card.black-belt-card:hover, .game-card.black-belt-card.selected {
    background: var(--hover-neon, #1C1C1E) !important; color: #fff !important; 
    box-shadow: 0 0 25px rgba(221, 221, 221, 0.5) !important;
}
.game-card.black-belt-card:hover::before, .game-card.black-belt-card.selected::before {
    background: rgba(255, 255, 255, 0.15) !important; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05) !important;
}

/* Mode Popup */
.mode-popup {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 90%; height: 90%; background: radial-gradient(circle, rgba(40, 40, 40, 0.6) 0%, rgba(0, 0, 0, 0) 70%);
    backdrop-filter: blur(3px); border: none; box-shadow: none; 
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    gap: 8px; opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 50; border-radius: 20px;
}
.game-card.selected .mode-popup { opacity: 1; pointer-events: auto; }
.mode-btn {
    width: 80%; background: #e2e2e2 !important; color: #0A84FF !important; border: none;
    padding: 12px; font-weight: 800; font-size: 1rem; cursor: pointer; border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); transition: transform 0.2s;
}
.mode-btn.back { background: #e2e2e2 !important; color: #FF3B30 !important; }
.mode-btn:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(255, 255, 255, 0.4); }

/* Responsive Grid */
@media (min-width: 1025px) {
    .game-card:nth-child(n+5):nth-child(-n+8), .game-card:nth-child(n+13):nth-child(-n+16) { left: 160px; }
}
@media (max-width: 1024px) {
    .game-grid-content { grid-template-columns: repeat(3, 1fr) !important; }
    .game-card { left: 0 !important; }
}
@media (max-width: 768px) {
    .game-grid-content { grid-template-columns: 1fr !important; gap: 15px !important; }
    .game-card { flex-direction: row !important; justify-content: space-between !important; padding: 15px 20px !important; min-height: auto !important; }
    .mode-popup { flex-direction: row !important; }
    .mode-btn { width: auto !important; }
    .list-grid-viewport { padding-right: 10px !important; }
}

.main-footer {
    position: fixed; bottom: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.1);
    /* 블러 효과 유지 (필요 시 유지, 그라디언트가 불투명하면 효과는 미미함) */
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);    
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* 테두리 살짝 더 선명하게(0.05 -> 0.1) */
    padding: 15px 10px;
    display: flex; justify-content: center; align-items: center;
    gap: 30px; z-index: 100; flex-wrap: wrap;
}
.main-footer img {
    height: 30px; width: auto; object-fit: contain;
    transition: all 0.3s ease;
}



/* 모바일 대응 */
@media (max-width: 768px) {
    .main-footer {
        padding: 15px;
        gap: 15px;
    }
    .main-footer img {
        height: 25px; /* 모바일에서는 로고 크기 축소 */
    }
}

/* 모바일 가로 모드 (높이가 부족할 때 숨김) */
@media screen and (orientation: landscape) and (max-width: 950px) {
    .main-footer {
        display: none; 
    }
}
/* ==========================================================================
   3. Video Page Styles
   ========================================================================== */
#video-page { display: none; height: 100vh; width: 100%; position: relative; background: #000; }
.video-layout { display: flex; height: 100vh; width: 100%; flex-direction: row; overflow: hidden; }

.back-btn-floating {
    position: absolute; top: 20px; left: 40px; z-index: 1000;
    display: flex; align-items: center; gap: 8px; padding: 10px 28px;
    background: rgba(20, 20, 20, 0.6) !important; backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 12px; cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6); transition: all 0.3s ease;
}
.back-btn-floating:hover { background: rgba(40, 40, 40, 0.8) !important; transform: scale(1.05); box-shadow: 0 0 15px var(--ios-blue); border-color: var(--ios-blue); }
.back-text { color: var(--ios-blue); font-weight: 700; font-size: 20px; }

.video-main-container { flex: 1; display: flex; flex-direction: column; background: #000; height: 100vh; overflow: hidden; position: relative; min-width: 0; }
.video-content { flex: 1; display: flex; justify-content: center; align-items: center; width: 100%; overflow: hidden; position: relative; min-height: 0; }
.video-player { width: 100%; height: 100%; object-fit: contain; cursor: pointer; }

.video-custom-controls {
    background: rgba(10, 10, 10, 0.95); padding: 10px 20px; border-top: 1px solid rgba(255,255,255,0.1); 
    width: 100%; z-index: 10; flex-shrink: 0; padding-bottom: calc(15px + env(safe-area-inset-bottom));
}
.video-main-container:fullscreen .video-custom-controls { padding-bottom: 30px; }

.custom-progress-container { width: 100%; height: 15px; position: relative; cursor: pointer; margin-bottom: 10px; display: flex; align-items: center; }
.progress-bg { width: 100%; height: 4px; background-color: rgba(255, 255, 255, 0.2); border-radius: 2px; position: absolute; }
.progress-fill { height: 4px; background-color: var(--ios-blue); width: 0%; border-radius: 2px; position: absolute; z-index: 2; pointer-events: none; box-shadow: 0 0 10px var(--ios-blue); }
.loop-highlight { height: 4px; background-color: rgba(255, 213, 0, 0.6); position: absolute; z-index: 1; display: none; pointer-events: none; }
.progress-handle { width: 14px; height: 14px; background-color: #fff; border-radius: 50%; position: absolute; top: 50%; left: 0%; transform: translate(-50%, -50%); z-index: 5; pointer-events: none; box-shadow: 0 0 10px rgba(255,255,255,0.5); transition: left 0.1s linear; }
.marker { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid var(--ios-blue); border-radius: 50%; display: none; z-index: 3; margin-left: -6px; pointer-events: none; }
.marker-b { border-color: #FF3B30; }

.controls-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; }
.controls-left { display: flex; align-items: center; gap: 15px; color: #FFF; }
.controls-right { display: flex; align-items: center; gap: 20px; color: #FFF; }
.v-control-btn { background-color: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.05); color: #FFF; font-size: 0.9rem; font-weight: 600; cursor: pointer; padding: 6px 12px; border-radius: 6px; transition: all 0.2s; }
.v-control-btn:hover { background-color: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.3); }
.icon-btn { font-size: 1.1rem; padding: 0; background: transparent; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: none; }

.volume-container { display: flex; align-items: center; gap: 5px; }
.volume-slider { width: 80px; height: 4px; -webkit-appearance: none; background: rgba(255,255,255,0.3); border-radius: 2px; outline: none; }
.volume-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: #fff; border-radius: 50%; cursor: pointer; }

.control-unit { display: flex; align-items: center; gap: 8px; padding-right: 10px; }
.repeat-buttons { display: flex; gap: 5px; background: rgba(255,255,255,0.05); padding: 2px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); }

.speed-dropdown-container { position: relative; }
.speed-toggle-btn { min-width: 50px; text-align: center; }
.speed-menu { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: rgba(20, 20, 20, 0.95); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 5px; margin-bottom: 8px; display: none; flex-direction: column; gap: 2px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); min-width: 70px; z-index: 100; }
.speed-menu.show { display: flex; }
.speed-item { padding: 8px 12px; font-size: 0.85rem; color: #ccc; cursor: pointer; text-align: center; border-radius: 4px; }
.speed-item.active { color: var(--ios-blue); font-weight: bold; background: rgba(10, 132, 255, 0.1); }

.sidebar {
    width: var(--sidebar-width); background-color: #0A0A0A; padding: 30px 30px;
    display: flex; flex-direction: column; border-left: 1px solid rgba(255, 255, 255, 0.1);
    height: 100vh; overflow-y: auto; flex-shrink: 0; z-index: 20; color: #FFF;
    scrollbar-width: none; -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; padding: 0 5px; width: 100%; }

/* [수정] 사이드바 타이틀 스타일: 줄바꿈 허용 */
.sidebar-main-title { 
    font-size: 1.4rem; 
    font-weight: 800; 
    margin: 0; 
    white-space: normal; /* nowrap -> normal */
    line-height: 1.2;    /* 줄 간격 추가 */
    overflow: hidden; 
    text-overflow: ellipsis; 
    color: #FFF; 
    text-shadow: 0 0 10px rgba(255,255,255,0.1); 
}

.sidebar-footer {
    margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; flex-direction: column; gap: 12px;
}

.time-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 5px; }
.time-card {
    background-color: #1C1C1E; border-radius: 12px; padding: 15px 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05);
}
.time-label { font-size: 0.85rem; color: #ffffff; font-weight: 600; margin-bottom: 5px; white-space: nowrap; }
.time-value { font-size: 1.6rem; font-weight: 800; color: var(--ios-blue); font-family: 'Wanted Sans', sans-serif; letter-spacing: -0.5px; text-shadow: 0 0 15px rgba(10, 132, 255, 0.4); }

.info-unit {
    display: flex; flex-direction: row; justify-content: space-between; align-items: center;
    background: #1C1C1E; padding: 15px 15px; border-radius: 12px; margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}
.info-unit > span { white-space: nowrap; flex-shrink: 0; margin-right: 15px; font-size: 0.95rem; font-weight: 600; color: #FFF; }

.counter-group { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 8px; min-width: 100px; }

/* 숫자 입력창 스크롤바(스피너) 제거 */
.counter-input { 
    width: 40px; 
    text-align: center; 
    background: transparent; 
    border: none; 
    color: #FFF; 
    font-size: 1rem; 
    font-weight: 700; 
    margin: 0; 
    -moz-appearance: textfield;
}
.counter-input::-webkit-outer-spin-button,
.counter-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.counter-group button {
    display: flex; align-items: center; justify-content: center; width: 30px; height: 30px;
    border-radius: 50%; background: #FFFFFF; color: #000; font-weight: bold; border: none; cursor: pointer; padding: 0;
}
.counter-group button:hover { background: #F2F2F7; }

.mode-toggle-btn { background-color: #FF453A; color: white; border: none; border-radius: 20px; padding: 8px 12px; font-size: 0.8rem; cursor: pointer; display: flex; align-items: center; gap: 6px; flex-shrink: 0; transition: background 0.2s, box-shadow 0.2s; box-shadow: 0 0 10px rgba(255, 69, 58, 0.4); }
.mode-toggle-btn.active { background-color: var(--ios-blue); box-shadow: 0 0 10px rgba(10, 132, 255, 0.4); }
.toggle-icon { font-size: 1rem; line-height: 1; }

.tab-group { display: flex; background: rgba(118, 118, 128, 0.24); border-radius: 10px; padding: 2px; margin-bottom: 20px; }
.tab-btn { flex: 1; padding: 8px; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; background: transparent; color: #8E8E93; transition: all 0.2s; }
.tab-btn.active { background: #636366; color: #FFFFFF; box-shadow: 0 2px 4px rgba(0,0,0,0.3); }

.control-group { display: none; flex-direction: column !important; gap: 8px; width: 100%; }
.control-group.active { display: flex !important; }
.control-group::-webkit-scrollbar { display: none; }

.control-item-container {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 12px 15px; margin-bottom: 8px; background: #1C1C1E; 
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; transition: all 0.2s;
}
.control-item-container.playing-item {
    border-color: var(--ios-blue); background: rgba(10, 132, 255, 0.1);
    box-shadow: 0 0 15px rgba(10, 132, 255, 0.2);
}
.control-title-text {
    flex: 1; font-size: 0.95rem; font-weight: 600; color: #FFF; text-align: left; margin-right: 10px;
    cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.play-toggle-btn {
    flex-shrink: 0; min-width: 50px; padding: 6px 12px; font-size: 0.8rem; font-weight: 700;
    border-radius: 20px; border: none; cursor: pointer; transition: all 0.2s;
    background: #E5E5EA; color: #8E8E93;
}
.play-toggle-btn.active {
    background: #FF3B30; color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.4);
}

.lang-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    z-index: 2000; /* 최상위 노출 */
    
    background: transparent;          /* 배경 투명 */
    border: 1.5px solid #FFFFFF;      /* 흰색 테두리 */
    border-radius: 30px;              /* 둥근 모서리 */
    padding: 8px 18px;
    
    font-family: "Inter", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #FFFFFF;
    cursor: pointer;
    
    display: flex;
    align-items: center;
    gap: 6px;
    
    backdrop-filter: blur(5px);       /* 배경 살짝 흐리게 (고급스러움) */
    transition: transform 0.2s, background 0.2s;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1); /* 호버 시 살짝 밝게 */
}

.lang-btn:active {
    transform: scale(0.95); /* 눌리는 효과 */
}

/* 2. 텍스트 스팬 스타일 */
.lang-span {
    color: #FFFFFF;   /* 기본 흰색 */
    opacity: 0.5;     /* 선택 안 된 언어는 흐리게 */
    transition: color 0.3s, opacity 0.3s;
}

.divider {
    color: #FFFFFF;
    opacity: 0.3;
    font-weight: 400;
}

/* 3. 활성화된 언어 (노란색 하이라이트) */
.lang-span.active {
    color: #FFE600 !important; /* 요청하신 노란색 */
    opacity: 1;                /* 불투명(선명하게) */
    text-shadow: 0 0 10px rgba(255, 230, 0, 0.2); /* 네온 느낌 살짝 추가 */
}

/* ==========================================================================
   [수정됨] 4. Mobile Landscape Optimization (Fixed Sidebar)
   ========================================================================== */

@media screen and (orientation: landscape) and (max-width: 950px) {

.mode-toggle-btn, .tab-group, .top-controls {
        position: fixed !important;
        /* 기본 20px + 기기 상단 여백 */
        top: max(20px, calc(env(safe-area-inset-top) + 20px)) !important; 
        right: max(20px, env(safe-area-inset-right)) !important;
        left: auto !important; bottom: auto !important;
        margin: 0 !important; transform: none !important;
        z-index: 9999 !important; width: auto !important;
    }

    .game-container{ padding-top: 30px}
    
    .lang-btn {
        position: fixed !important; /* 스크롤 무시하고 화면에 고정 */
        top: 30px !important;
        right: max(35px, env(safe-area-inset-right)) !important;
        
        font-size: 0.9rem !important; /* 모바일에서 약간 작게 */
        padding: 6px 14px !important;
        border-width: 1.2px !important;
    }

    /* 3열 그리드 및 간격 조정 */
    .game-grid-content {
        grid-template-columns: repeat(3, 1fr) !important; 
        gap: 15px !important;
        padding-top: 20px;
    }

    /* 로고 영역 왼쪽 정렬 */
    .logo-area { 
        margin-bottom: 10px; 
        justify-content: flex-start !important; 
        padding-left: 10px;
    }
    .logo-area img { width: 150px; } 

    /* 뷰포트 패딩: 버튼과 로고가 겹치지 않게 상단 공간 확보 */
    .list-grid-viewport {
        padding: 0px 20px 20px 30px !important; 
    }

    /* [2] 카드 디자인 및 네온 효과 복구 */
    .game-card {
        min-height: 120px !important;
        padding: 10px !important;
        flex-direction: column !important;
        justify-content: center !important;
        /* 웹 버전의 부드러운 전환 효과 유지 */
        transition: transform 0.3s, box-shadow 0.3s, background 0.3s !important;
    }
    .game-card span { font-size: 1.1rem; pointer-events: none; }

    /* 네온 장식(i) 강제 표시 */
    .game-card i { display: block !important; }
    
    /* 모바일 터치(:active) 시 웹의 호버(:hover) 효과 그대로 적용 
       - 배경색, 텍스트색, 그림자, 위치 이동(transform), 글자 간격
    */
    .game-card:active, .game-card.selected {
        letter-spacing: 0.25rem !important;
        background: var(--hover-neon, #0A84FF) !important;
        color: var(--hover-neon, #0A84FF) !important;
        box-shadow: 0 0 10px var(--hover-neon, #0A84FF) !important;
        transform: translateY(-5px) !important;
        z-index: 100;
        border: none !important;
    }

    /* 네온 바 애니메이션 효과 복구 */
    .game-card:active i::before, .game-card.selected i::before {
        left: 20% !important; width: 20px !important;
        transition: 0.3s !important;
    }
    .game-card:active i::after, .game-card.selected i::after {
        left: 80% !important; width: 20px !important;
        transition: 0.3s !important;
    }
    
    /* 검은 배경 오버레이 유지 */
    .game-card::before {
        content: ''; position: absolute; inset: 2px; background: #27282c; z-index: 1;
        pointer-events: none;
    }

    .mode-popup {
        width: 85% !important;        /* 팝업 전체 너비 약간 축소 */
        height: 85% !important;
        gap: 6px !important;          /* 버튼 사이 간격 줄임 */
        border-radius: 12px !important;
    }

    .mode-btn {
        font-size: 0.85rem !important; /* 글자 크기 축소 (기존 1rem -> 0.85rem) */
        padding: 8px 12px !important;  /* 내부 여백 축소 */
        width: auto !important;        /* 꽉 찬 너비 해제 (필요시) */
        min-width: 120px !important;    /* 최소 너비 확보 */
        border-radius: 6px !important; /* 모서리 둥글기 축소 */
    }

/* --- 2. Video Page (UI 개선) --- */
    
    .video-layout { 
        display: flex !important; flex-direction: row !important;
        width: 100%; height: 100vh; overflow: hidden; 
    }
    .video-main-container {
        flex: 1 !important; width: auto !important; min-width: 0; position: relative;
    }

    /* [수정] Home 버튼: 상단 안전 영역 확보 */
    .back-btn-floating {
        position: fixed !important; 
        /* 기본 20px + 기기 상단 여백 */
        top: max(20px, calc(env(safe-area-inset-top) + 20px)) !important; 
        left: max(20px, env(safe-area-inset-left)) !important;
        z-index: 9999 !important; background: rgba(0, 0, 0, 0.6) !important;
        border: 1px solid rgba(255, 255, 255, 0.2); padding: 6px 12px; display: flex !important;
    }
    .back-btn-floating .back-text { font-size: 0.8rem; color: #fff; }
    #sidebar-toggle-btn { display: none !important; }

    /* 재생 바 및 시간 */
    .video-custom-controls { padding: 10px 5px !important; position: relative !important; }
    .custom-progress-container {
        width: calc(100% - 95px) !important; margin-right: auto !important; margin-bottom: 8px !important;
        margin-left: 10px !important;
    }
    .time-text {
        position: absolute !important; top: 8px !important; right: max(5px, env(safe-area-inset-right)) !important;
        width: 80px !important; text-align: right !important; margin: 0 !important; padding: 0 !important;
        font-size: 0.85rem !important; font-family: monospace;
    }

    /* 컨트롤 버튼 간격 및 라벨 숨김 */
    .controls-row { flex-wrap: nowrap !important; gap: 2px !important; justify-content: space-between !important; }
    .controls-left { gap: 2px !important; flex-shrink: 1; }
    .controls-right { gap: 2px !important; flex-shrink: 0; }
    .volume-container { gap: 2px !important; }
    .volume-slider { width: 60px !important; }
    
    .v-control-label { display: none !important; } /* 라벨 숨김 */
    
    .control-unit { gap: 2px !important; margin-right: 0 !important; padding-right: 2px !important; }
    .speed-toggle-btn { min-width: 40px !important; padding: 4px !important; margin-right: 6px !important; }
    .repeat-buttons { display: flex !important; gap: 3px !important; }
    .v-control-btn { white-space: nowrap !important; padding: 4px 8px !important; font-size: 0.75rem !important; }
    .icon-btn { width: 32px; height: 32px; font-size: 1rem; }


    /* --- 3. Sidebar --- */
    
    .sidebar {
        position: relative !important; display: flex !important; flex-direction: column !important;
        width: 260px !important; min-width: 260px !important; height: 100vh;
        background: #0A0A0A; border-left: 1px solid rgba(255,255,255,0.15);
        z-index: 20; overflow: hidden !important; padding: 0 !important;
    }

    /* [수정] 사이드바 헤더: 상단 패딩을 늘려 Title과 Toggle 버튼이 상태 바 아래로 오게 함 */
    .sidebar-header { 
        flex-shrink: 0 !important; 
        height: auto !important; 
        min-height: 50px !important;
        
        /* 기존 50px -> (안전영역 + 50px)로 변경 */
        padding-top: max(0px, calc(env(safe-area-inset-top) + 20px)) !important;
        padding-right: 15px !important;
        padding-bottom: 10px !important;
        padding-left: 15px !important;
        
        background: #0A0A0A; 
        z-index: 5;
        
        display: flex !important; 
        flex-direction: row !important;
        align-items: center !important; 
        justify-content: space-between !important;
        gap: 10px !important;
    }
    
    /* 타이틀 */
    .sidebar-main-title { 
        font-size: 1rem !important; 
        line-height: 1.2 !important; 
        margin: 0 !important; padding: 0 !important;
        flex: 1; display: block !important;
    }
    
    /* Toggle 버튼 위치 초기화 */
    .sidebar-header .mode-toggle-btn { 
        position: static !important; 
        top: auto !important; right: auto !important; transform: none !important;
        margin: 0 !important; flex-shrink: 0;
        height: 32px !important; 
        display: flex !important; align-items: center !important; justify-content: center !important;
    }

    .tab-group {
        position: relative !important; flex-shrink: 0 !important;
        margin: 0 15px 5px 15px !important; z-index: 5;
        top: auto !important; right: auto !important;
    }

    /* 리스트 스크롤 영역 */
    .control-group {
        flex: 1 !important; overflow-y: auto !important;
        padding: 0 15px 80px 15px !important; 
        scrollbar-width: none;
    }

    /* Footer (스와이프) */
    .sidebar-footer {
        position: absolute !important; bottom: 0; left: 0; right: 0;
        background: rgba(10, 10, 10, 0.95) !important;
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        
        padding: 15px 15px 15px 15px !important; 
        
        z-index: 30;
        transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
        transform: translateY(85%); 
    }

    .sidebar-footer.is-open { transform: translateY(0%); }

    /* 핸들바 */
    .sidebar-footer::before {
        content: ''; position: absolute; 
        top: 10px; left: 50%; transform: translateX(-50%);
        width: 30px; height: 4px; 
        background: rgba(255,255,255,0.3); border-radius: 2px;
    }

    /* 내부 요소 사이즈 최적화 */
    .time-info-grid { margin-top: 10px; margin-bottom: 5px; }
    .time-card { padding: 6px; }
    .time-label { font-size: 0.7rem; }
    .time-value { font-size: 1.1rem; }
    .info-unit { padding: 8px; margin-bottom: 5px; font-size: 0.8rem; }
    .control-item-container { padding: 8px 10px; min-height: 40px; }
    .play-toggle-btn { padding: 4px 10px; font-size: 0.75rem; min-width: 40px; }

    /* 설정 텍스트 크기 조절 */
    .info-unit > span { 
        font-size: 0.75rem !important; 
        letter-spacing: -0.5px !important; 
        color: #cccccc !important; 
        white-space: nowrap !important;
    }
    .counter-group button { width: 24px !important; height: 24px !important; font-size: 0.9rem !important; }
    .counter-input { width: 30px !important; font-size: 0.9rem !important; }
}