@charset "UTF-8";

/* --- 共通レイアウト --- */
.cl-layout-centerer {
    display: flex !important; justify-content: center !important;
    align-items: flex-start !important; width: 100% !important;
    margin: 0 !important; padding: 10px 0 !important;
    background: transparent !important; border: none !important;
}
div[id^="manga_"] {
    display: flex; gap: 15px;
    width: 720px !important; max-width: 95% !important;
    height: 90vh !important; max-height: 1200px !important; min-height: 600px !important;
    box-sizing: border-box !important; margin: 0 !important;
    font-family: "Helvetica Neue", Arial, sans-serif;
}

/* --- メイン画面 --- */
.cl-col-main {
    flex: 2; display: flex; flex-direction: column;
    background: #222; border-radius: 12px; overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3); position: relative; min-width: 0;
}
.cl-viewport {
    flex: 1; position: relative; width: 100%;
    background: #333; overflow-y: auto; cursor: default;
    -webkit-tap-highlight-color: transparent;
    scrollbar-width: thin; scrollbar-color: #666 #333;
}
.cl-image {
    width: 100% !important; display: block !important; height: auto !important;
    margin: 0 !important; padding: 0 !important; border: none !important;
    max-width: none !important; transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

/* --- 字幕 --- */
.cl-subtitle {
    position: absolute; bottom: 55px; left: 5%; right: 5%;
    background-color: rgba(0, 0, 0, 0.7); color: #fff;
    padding: 10px 15px; border-radius: 8px; font-size: 1rem;
    line-height: 1.5; text-align: center; z-index: 25;
    pointer-events: none; transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}
.cl-subtitle.hidden { opacity: 0; }

/* --- サイドバー (PC) --- */
.cl-col-sidebar {
    flex: 1; background: #f0f0f0; border-radius: 12px; overflow: hidden;
    border: 4px solid #fff; box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center;
    min-width: 0; cursor: pointer; position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}
.cl-col-sidebar:hover { transform: scale(1.02); box-shadow: 0 8px 20px rgba(0,0,0,0.15); border-color: #FF4081; }
.cl-sidebar-inner { width: 100%; height: 100%; padding: 10px; box-sizing: border-box; }
.cl-full-image { width: 100%; height: 100%; object-fit: contain; display: block; opacity: 0.9; }
.cl-swap-hint {
    position: absolute; bottom: 10px; right: 10px;
    background: rgba(0,0,0,0.6); color: #fff; padding: 4px 8px;
    font-size: 0.75rem; border-radius: 4px; pointer-events: none;
}

/* --- コントロールバー --- */
.cl-controls {
    height: 40px; background: #222; padding: 0 15px;
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid #333; flex-shrink: 0;
}
.cl-control-buttons-group { display: flex; gap: 8px; align-items: center; }
.cl-status { color: #aaa; font-size: 0.8rem; display: flex; align-items: center; gap: 6px; }
.cl-eq-icon { font-size: 0.7rem; color: #FF4081; animation: eq 1s infinite; }
@keyframes eq { 0%,100%{opacity:0.5;} 50%{opacity:1;} }

/* --- ボタン --- */
.cl-replay-btn, .cl-mobile-swap-btn {
    background: transparent; border: 1px solid #555; color: #ddd;
    padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; cursor: pointer;
    transition: all 0.2s; white-space: nowrap;
}
.cl-replay-btn:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.1); }

/* 緑色の切替ボタン (PC非表示) */
.cl-mobile-swap-btn {
    display: none; background: #4CAF50; border-color: #4CAF50; color: #fff; font-weight: bold;
}
.cl-mobile-swap-btn:hover { background: #45a049; border-color: #45a049; }

/* --- オーバーレイ & マスク --- */
.cl-mask {
    position: absolute; left: 0; right: 0;
    background: rgba(0, 0, 0, 0.75); z-index: 5; pointer-events: none;
    opacity: 0; height: 0; transition: height 0.3s ease, opacity 0.3s ease;
}
.cl-mask-top { top: 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.cl-mask-bottom { bottom: 0; border-top: 1px solid rgba(255,255,255,0.1); }

.cl-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(2px);
    z-index: 20; display: flex; align-items: center; justify-content: center;
    transition: opacity 0.2s; cursor: pointer;
}
.cl-overlay.hidden { opacity: 0; pointer-events: none; }
.cl-overlay-btn {
    background: transparent; border: 2px solid #fff; color: #fff;
    padding: 10px 24px; border-radius: 30px; font-weight: bold;
    cursor: pointer; pointer-events: none;
}

/* --- 自動再生ボタン (FAB) --- */
.cl-4koma-start-trigger {
    position: absolute; bottom: 60px; right: 20px;
    background-color: #FF4081; color: white; border: none; border-radius: 50px;
    padding: 12px 24px; font-size: 0.95rem; font-weight: bold;
    cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    opacity: 1; display: flex; align-items: center; gap: 8px;
    z-index: 99; transition: transform 0.2s, opacity 0.2s; margin: 0;
}
.cl-4koma-start-trigger:hover { transform: scale(1.05); background-color: #ff5c93; }
.cl-4koma-start-trigger:active { transform: scale(0.95); }
.cl-4koma-start-trigger:disabled { background-color: #666; opacity: 0.8; cursor: wait; }
.cl-4koma-start-trigger.hidden { opacity: 0; pointer-events: none; transform: translateY(20px); }

/* --- スマホ対応 (Max 768px) --- */
@media (max-width: 768px) {
    div[id^="manga_"] { 
        height: auto !important; width: 100% !important; 
        max-width: 100% !important; max-height: none !important; 
        display: block !important; 
    }
    .cl-col-main { width: 100%; height: 75vh; max-height: 800px; }
    .cl-col-sidebar { display: none !important; }
    .cl-mobile-swap-btn { display: inline-block; }
    .cl-4koma-start-trigger { padding: 10px 20px; font-size: 0.85rem; bottom: 55px; right: 15px; }
    .cl-status-text { display: none; } 
}