/* ======================================================== */
/* Five Hearts Under One Roof (한 지붕 다섯 심장)            */
/* 1:1 Commercial Game Style System                         */
/* ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

:root {
    --bg-dark: #06070a;
    --panel-bg: rgba(14, 16, 26, 0.92);
    --panel-border: rgba(255, 255, 255, 0.12);
    --panel-glow: rgba(255, 51, 119, 0.35);
    
    --accent-pink: #ff3377;
    --accent-pink-light: #ff75a5;
    --accent-purple: #9c27b0;
    --accent-gold: #f59e0b;
    --accent-cyan: #00d4ff;
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.78);
    --text-muted: #8b92a8;
    
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --font-game: 'Plus Jakarta Sans', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Segoe UI', sans-serif;
    --font-title: 'Outfit', 'Plus Jakarta Sans', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-game);
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    color: var(--text-primary);
}

/* ======================================================== */
/* SCREEN SWITCHER                                          */
/* ======================================================== */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    z-index: 10;
}

.screen.active {
    display: flex;
}

/* ======================================================== */
/* 1. TITLE SCREEN / LOBBY (UILobby)                        */
/* ======================================================== */
#titleScreen {
    background: url('photos/bg_main.png') center/cover no-repeat #000;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px 80px;
    position: relative;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.8);
}

#titleScreen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(6, 7, 10, 0.88) 0%, rgba(6, 7, 10, 0.45) 50%, rgba(6, 7, 10, 0.75) 100%);
    pointer-events: none;
}

.title-top-bar {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-pink-light);
    letter-spacing: 0.5px;
}

.title-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn-round {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn-round:hover {
    background: var(--accent-pink);
    border-color: var(--accent-pink-light);
    transform: scale(1.08);
    box-shadow: 0 0 15px var(--panel-glow);
}

.icon-btn-round svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.title-main-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 650px;
}

.title-branding {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.title-main-logo {
    font-size: 3.2rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1.15;
    background: linear-gradient(135deg, #ffffff 40%, #ff85ad 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 18px rgba(255, 51, 119, 0.45));
}

.title-edition-badge {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent-pink-light);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.title-subline {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Authentic Lobby Menu Buttons (2-column compact grid to ensure all 6 buttons are visible on all screen sizes) */
.title-menu-container {
    display: grid;
    grid-template-columns: repeat(2, 230px);
    gap: 10px;
    width: fit-content;
}

.title-nav-card {
    background: rgba(18, 20, 32, 0.78);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 3px solid transparent;
    color: #fff;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.title-nav-card:hover {
    background: linear-gradient(90deg, rgba(255, 51, 119, 0.35) 0%, rgba(20, 22, 38, 0.9) 100%);
    border-color: rgba(255, 51, 119, 0.6);
    border-left: 4px solid var(--accent-pink);
    transform: translateX(10px);
    box-shadow: 0 6px 28px var(--panel-glow);
}

.title-nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.title-nav-icon {
    width: 22px;
    height: 22px;
    fill: var(--accent-pink-light);
    opacity: 0.85;
    transition: transform 0.2s ease, fill 0.2s ease;
}

.title-nav-card:hover .title-nav-icon {
    fill: #fff;
    transform: scale(1.15);
}

.title-nav-label {
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
}

.title-nav-arrow {
    width: 14px;
    height: 14px;
    fill: var(--text-muted);
    transition: transform 0.2s ease, fill 0.2s ease;
}

.title-nav-card:hover .title-nav-arrow {
    fill: #fff;
    transform: translateX(4px);
}

.title-footer {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
}

/* ======================================================== */
/* 2. GAME SCREEN (CINEMATIC FMV VIEWPORT)                  */
/* ======================================================== */
#gameScreen {
    background: #000;
    flex-direction: column;
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* Viewport Container */
.game-viewport {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#gameVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

/* Auto-Hiding In-Game HUD Elements */
.hud-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 30;
    transition: opacity 0.3s ease;
}

.hud-layer.hud-hidden {
    opacity: 0;
}

/* Top HUD Bar */
.game-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    pointer-events: auto;
}

.hud-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hud-btn {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.hud-btn:hover {
    background: rgba(255, 51, 119, 0.3);
    border-color: var(--accent-pink);
    transform: translateY(-1px);
    box-shadow: 0 0 15px var(--panel-glow);
}

.hud-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

#btnHudQuality {
    border-color: rgba(105, 240, 174, 0.4);
    background: rgba(105, 240, 174, 0.08);
}

#btnHudQuality:hover {
    background: rgba(105, 240, 174, 0.2);
    border-color: #69f0ae;
    box-shadow: 0 0 15px rgba(105, 240, 174, 0.3);
}

.hud-chapter-badge {
    background: rgba(14, 16, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    padding: 8px 18px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hud-chapter-icon {
    width: 16px;
    height: 16px;
    fill: var(--accent-pink-light);
}

.hud-chapter-title {
    font-weight: 700;
    color: #fff;
}

.hud-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* In-Game Subtitle Banner (Visual Novel 1:1) */
.dialogue-box {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 82%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    z-index: 25;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.dialogue-box.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
}

.dialogue-speaker {
    display: none;
}

.dialogue-text {
    font-size: 1.02rem;
    line-height: 1.35;
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.95), 0 0 6px rgba(0,0,0,0.8), -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    letter-spacing: -0.1px;
}

/* ======================================================== */
/* CHOICE DECISION OVERLAY (1:1 from 04_스토리_선택지.png)   */
/* ======================================================== */
.choice-overlay {
    position: absolute;
    bottom: 35px;
    left: 0;
    width: 100%;
    height: auto;
    background: transparent;
    backdrop-filter: none;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 0 20px;
    pointer-events: none;
}

.choice-overlay.active {
    display: flex !important;
}

.choice-overlay.active ~ #hudLayer .game-bottom-bar {
    display: none !important;
}

.choice-box {
    width: auto;
    max-width: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    animation: choicePopUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes choicePopUp {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Choice Cards Horizontal Row */
.choice-options-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 960px;
}

.choice-card {
    flex: 1 1 200px;
    min-width: 180px;
    max-width: 380px;
    min-height: 48px;
    height: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    color: #1a1a1a;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: normal;
    overflow-wrap: break-word;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
    user-select: none;
}

.choice-card:hover {
    background: linear-gradient(135deg, #38bdf8 0%, #ec4899 100%);
    border: 2px solid #ffffff;
    color: #ffffff;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.65), 0 6px 18px rgba(0, 0, 0, 0.35);
}

.choice-card:active {
    transform: translateY(0) scale(0.98);
}

.choice-label {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.15px;
}

/* Timer Bar (Below Cards, exactly like authentic game) */
.choice-timer-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto;
}

.choice-timer-icon-wrap {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #ec4899;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.choice-timer-icon-wrap svg {
    width: 16px;
    height: 16px;
    fill: #ec4899;
}

.timer-bar-wrap {
    width: 380px;
    max-width: 70vw;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 9999px;
    overflow: hidden;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
}

.timer-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #38bdf8, #0ea5e9);
    box-shadow: 0 0 10px #38bdf8;
    transition: width 0.05s linear;
}

/* ======================================================== */
/* FLOATING AFFECTION TOAST (UIStoryFavor - Top Right)       */
/* ======================================================== */
.affection-toast {
    position: absolute;
    top: 75px;
    right: 32px;
    background: rgba(18, 20, 32, 0.88);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 8px 18px;
    border-radius: 9999px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 60;
    animation: toastFloat 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-heart-icon {
    width: 18px;
    height: 18px;
    fill: #ec4899;
}

.toast-text {
    color: #fff;
    font-weight: 700;
}

/* Bottom Bar - Minimal cinema transport (NO Seeker Bar) */
.game-bottom-bar {
    position: absolute;
    bottom: 20px;
    right: 28px;
    width: auto;
    background: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.ctrl-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    color: #fff;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.18s ease;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--accent-pink-light);
    color: var(--accent-pink-light);
}

.ctrl-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ======================================================== */
/* IN-GAME PAUSE MENU (UIStoryMenuPopup)                    */
/* ======================================================== */
.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 8, 14, 0.78);
    backdrop-filter: blur(14px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 120;
}

.modal-backdrop.active {
    display: flex;
}

.pause-menu-card {
    background: rgba(18, 20, 32, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.85);
    padding: 36px 42px;
    width: 440px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: choiceModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pause-title {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff 40%, #ff85ad 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pause-menu-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pause-menu-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.pause-menu-btn:hover {
    background: linear-gradient(90deg, rgba(255, 51, 119, 0.4) 0%, rgba(28, 30, 48, 0.95) 100%);
    border-color: var(--accent-pink);
    transform: translateX(6px);
    box-shadow: 0 4px 20px var(--panel-glow);
}

/* ======================================================== */
/* DRAWERS (Flowchart, Relationship, Chat, Settings)        */
/* ======================================================== */
/* ======================================================== */
/* FULL-SCREEN GAME VIEWS (Authentic 1:1 Game UI)           */
/* ======================================================== */
.drawer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 150;
    display: none;
    flex-direction: column;
    overflow: hidden;
    background-color: #06080e;
}

.drawer.open {
    display: flex;
    animation: fullScreenFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fullScreenFadeIn {
    0% { opacity: 0; transform: scale(1.01); }
    100% { opacity: 1; transform: scale(1); }
}

#flowchartDrawer {
    background: url('photos/bg_chapter.png') center / cover no-repeat;
}

#relationshipDrawer {
    background: url('photos/bg_relationship.png') center / cover no-repeat;
}

#galleryDrawer {
    background: url('photos/bg_album.png') center / cover no-repeat;
}

#settingsDrawer {
    background: url('photos/bg_settings.png') center / cover no-repeat;
}

#chatDrawer {
    background: rgba(6, 8, 14, 0.92);
    backdrop-filter: blur(20px);
}

.drawer-header {
    padding: 16px 36px;
    background: rgba(12, 14, 24, 0.72);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 10;
}

.drawer-title {
    font-size: 1.35rem;
    font-weight: 800;
    font-family: var(--font-title);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.drawer-title svg {
    width: 24px;
    height: 24px;
    fill: var(--accent-pink-light);
}

.drawer-back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.drawer-back-btn:hover {
    background: var(--accent-pink);
    border-color: var(--accent-pink);
    box-shadow: 0 0 16px var(--panel-glow);
}

.drawer-back-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.drawer-view-tabs {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9999px;
    padding: 3px;
    gap: 4px;
}

.view-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 9999px;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.view-tab-btn.active {
    background: var(--accent-pink);
    color: #fff;
    box-shadow: 0 2px 10px var(--panel-glow);
}

.view-tab-btn:hover:not(.active) {
    color: #fff;
}

.close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 51, 119, 0.3);
    color: #fff;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 48px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Chapter Select 1:1 Authentic Grid Layout */
.chapter-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 22px;
    width: 100%;
}

.chapter-select-card {
    background: rgba(14, 16, 26, 0.78);
    backdrop-filter: blur(14px);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    position: relative;
}

.chapter-select-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-pink);
    box-shadow: 0 12px 35px var(--panel-glow), 0 0 20px rgba(255, 51, 119, 0.3);
}

.chapter-thumb-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    background: #000;
}

.chapter-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.chapter-select-card:hover .chapter-thumb-img {
    transform: scale(1.05);
}

.chapter-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 9999px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.chapter-card-badge.unlocked {
    background: rgba(76, 175, 80, 0.85);
    color: #fff;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.5);
}

.chapter-card-badge.active {
    background: var(--accent-pink);
    color: #fff;
    box-shadow: 0 2px 12px var(--panel-glow);
}

.chapter-card-badge.locked {
    background: rgba(0, 0, 0, 0.75);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chapter-lock-veil {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 10, 18, 0.72);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
}

.chapter-lock-veil svg {
    width: 32px;
    height: 32px;
    fill: rgba(255, 255, 255, 0.75);
}

.chapter-card-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.chapter-num-label {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--accent-pink-light);
    text-transform: uppercase;
}

.chapter-title-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--font-title);
    line-height: 1.25;
}

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

.chapter-actions-row {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    gap: 8px;
}

/* Character Map / Housemates Cards (1:1 from UIRanking) */
.heroine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    width: 100%;
}

.heroine-card {
    background: rgba(18, 20, 32, 0.82);
    backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.heroine-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-pink);
    box-shadow: 0 12px 35px var(--panel-glow);
}

.heroine-portrait-wrap {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    position: relative;
    background: #000;
}

.heroine-portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.heroine-card:hover .heroine-portrait-img {
    transform: scale(1.05);
}

.heroine-rank-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 9999px;
    background: rgba(18, 20, 32, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 4px;
}

.heroine-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.heroine-name-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.heroine-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    font-family: var(--font-title);
    white-space: nowrap;
}

.heroine-korean-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.heroine-role-badge {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-pink-light);
}

.heroine-favor-box {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.heroine-favor-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 700;
}

.heroine-favor-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    overflow: hidden;
}

.heroine-favor-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff3377, #ff75a5);
    box-shadow: 0 0 10px rgba(255, 51, 119, 0.6);
    transition: width 0.3s ease;
}

/* Settings View Modal Box */
.settings-container-box {
    max-width: 620px;
    width: 100%;
    margin: 20px auto;
    background: rgba(14, 16, 26, 0.88);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-lg);
    padding: 34px 40px;
    box-shadow: 0 14px 50px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* Smartphone HeartTalk Messenger (UIStoryChat) */
.phone-mockup {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #0d0f18;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(255, 255, 255, 0.14);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.phone-top-notch {
    height: 28px;
    background: #08090f;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: monospace;
}

.chat-tabs-bar {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    background: #121422;
    border-bottom: 1px solid var(--panel-border);
    overflow-x: auto;
}

.chat-tab-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--panel-border);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.chat-tab-btn.active {
    background: var(--accent-pink);
    border-color: var(--accent-pink-light);
    color: #fff;
}

.chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    max-width: 82%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
}

.chat-msg.them {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-bottom-left-radius: 4px;
}

.chat-msg.me {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent-pink), #c2185b);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(255, 51, 119, 0.35);
}

/* Settings Controls */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.settings-slider {
    width: 100%;
    accent-color: var(--accent-pink);
}

.settings-btn-row {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.chap-lock-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    max-width: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Chapter Episodes Flowchart Sublist */
.chapter-episodes-sublist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    background: rgba(10, 12, 20, 0.75);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.chapter-ep-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.chapter-ep-row.current {
    background: rgba(255, 51, 119, 0.15);
    border-color: var(--accent-pink);
    box-shadow: 0 0 12px rgba(255, 51, 119, 0.25);
}

.chapter-ep-row.visited {
    cursor: pointer;
}

.chapter-ep-row.visited:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}

.chapter-ep-row.unvisited {
    opacity: 0.55;
    cursor: not-allowed;
}

.ep-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ep-badge.current {
    background: var(--accent-pink);
    color: #fff;
    box-shadow: 0 0 8px var(--accent-pink);
}

.ep-badge.completed {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
}

.ep-badge.unreached {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Enhanced HeartTalk Smartphone UI (UIStoryChat) */
.phone-mockup {
    width: 100%;
    max-width: 440px;
    height: 640px;
    display: flex;
    flex-direction: column;
    background: #0f111a;
    border-radius: 36px;
    border: 3px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), inset 0 0 0 2px rgba(0,0,0,0.5);
    overflow: hidden;
    position: relative;
}

.phone-top-notch {
    height: 38px;
    background: #090a10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.phone-speaker-cutout {
    width: 60px;
    height: 5px;
    background: #1c1d29;
    border-radius: 4px;
}

.chat-header-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: rgba(20, 23, 36, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-pink);
}

.chat-header-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-title);
}

.chat-header-status {
    font-size: 0.74rem;
    color: #4caf50;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-header-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4caf50;
}

.chat-tabs-bar {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    background: #131522;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    scrollbar-width: none;
}

.chat-tabs-bar::-webkit-scrollbar {
    display: none;
}

.chat-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.chat-tab-btn.active {
    background: var(--accent-pink);
    border-color: var(--accent-pink-light);
    color: #fff;
    box-shadow: 0 2px 10px rgba(255, 51, 119, 0.4);
}

.chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #0d0e17;
}

.chat-msg-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-msg-row.me {
    justify-content: flex-end;
}

.chat-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.chat-msg {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.88rem;
    line-height: 1.45;
    word-break: break-word;
}

.chat-msg.them {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-msg.me {
    background: linear-gradient(135deg, var(--accent-pink), #c2185b);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(255, 51, 119, 0.35);
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #141724;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-input-field {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 8px 14px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
}

.chat-input-field:focus {
    border-color: var(--accent-pink);
    box-shadow: 0 0 8px rgba(255, 51, 119, 0.3);
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-pink);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 10px var(--accent-pink);
}

/* Settings Tabs and Enhanced Controls (UISetting) */
.settings-tabs-row {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.settings-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-title);
    font-size: 0.92rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.settings-tab-btn.active {
    color: #fff;
    background: rgba(255, 51, 119, 0.18);
    border: 1px solid var(--accent-pink);
}

.settings-section-pane {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shortcut-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.shortcut-table th {
    text-align: left;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-pink-light);
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shortcut-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.key-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    font-family: monospace;
    font-weight: 700;
}

/* Video Buffering & Loading Indicator */
.video-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 40;
    pointer-events: none;
}

.video-loader.active {
    display: flex;
}

.video-loader-spinner {
    width: 44px;
    height: 44px;
    border: 3.5px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--accent-pink);
    border-radius: 50%;
    animation: spinLoader 0.75s linear infinite;
}

@keyframes spinLoader {
    to { transform: rotate(360deg); }
}

.video-loader-text {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* ======================================================== */
/* MOBILE PORTRAIT ORIENTATION ADVISORY                     */
/* ======================================================== */
.portrait-notice {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #181b29 0%, #06070a 100%);
    z-index: 99999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    box-sizing: border-box;
}

@media screen and (orientation: portrait) and (max-width: 768px) {
    .portrait-notice {
        display: flex;
    }
}

.portrait-notice-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rotate-phone-anim {
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 51, 119, 0.12);
    border: 1.5px solid rgba(255, 51, 119, 0.4);
    animation: rotatePhone 2.2s infinite ease-in-out;
}

.phone-svg {
    width: 36px;
    height: 36px;
    fill: var(--accent-pink-light);
}

@keyframes rotatePhone {
    0%, 20% { transform: rotate(0deg); }
    50%, 70% { transform: rotate(-90deg); }
    90%, 100% { transform: rotate(0deg); }
}

.rotate-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
    font-family: var(--font-title);
    letter-spacing: 0.5px;
}

.rotate-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 280px;
    line-height: 1.4;
}

/* ======================================================== */
/* MOBILE LANDSCAPE RESPONSIVE SYSTEM                       */
/* Optimized for phone landscape viewports (height <= 560px) */
/* ======================================================== */
@media screen and (orientation: landscape) and (max-height: 560px), screen and (max-height: 500px) {
    /* Title Screen / Lobby */
    #titleScreen {
        padding: 12px 24px;
        justify-content: space-between;
    }

    .title-top-bar {
        margin-bottom: 2px;
    }

    .title-badge {
        padding: 3px 10px;
        font-size: 0.72rem;
    }

    .title-actions {
        gap: 8px;
    }

    .icon-btn-round {
        width: 30px;
        height: 30px;
    }

    .icon-btn-round svg {
        width: 14px;
        height: 14px;
    }

    .title-main-content {
        gap: 6px;
        max-width: 620px;
    }

    .title-branding {
        gap: 2px;
    }

    .title-main-logo {
        font-size: 1.6rem;
        line-height: 1.1;
    }

    .title-edition-badge {
        font-size: 0.68rem;
        letter-spacing: 2px;
    }

    .title-subline {
        display: none;
    }

    .title-menu-container {
        grid-template-columns: repeat(3, minmax(120px, 150px));
        gap: 6px;
    }

    .title-nav-card {
        padding: 5px 10px;
        border-radius: var(--radius-sm);
        backdrop-filter: none;
    }

    .title-nav-left {
        gap: 8px;
    }

    .title-nav-icon {
        width: 15px;
        height: 15px;
    }

    .title-nav-label {
        font-size: 0.76rem;
        letter-spacing: 0.5px;
    }

    .title-nav-arrow {
        width: 10px;
        height: 10px;
    }

    .title-footer {
        padding-top: 4px;
        font-size: 0.65rem;
    }

    /* In-Game Cinematic HUD */
    .game-top-bar {
        height: 40px;
        padding: 0 14px;
    }

    .hud-left {
        gap: 6px;
    }

    .hud-btn {
        padding: 4px 8px;
        font-size: 0.72rem;
        gap: 4px;
        border-radius: 4px;
        backdrop-filter: none;
    }

    .hud-btn svg {
        width: 13px;
        height: 13px;
    }

    .hud-chapter-badge {
        padding: 3px 10px;
        font-size: 0.72rem;
        gap: 6px;
        border-radius: 16px;
        max-width: 220px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        backdrop-filter: none;
        background: rgba(14, 16, 26, 0.95);
    }

    .hud-chapter-icon {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }

    .hud-right {
        gap: 6px;
    }

    .affection-toast {
        top: 46px;
        right: 14px;
        padding: 4px 10px;
        font-size: 0.78rem;
        gap: 6px;
    }

    .toast-heart-icon {
        width: 14px;
        height: 14px;
    }

    .game-bottom-bar {
        bottom: 6px;
        right: 12px;
        gap: 6px;
    }

    .ctrl-btn {
        padding: 4px 8px;
        font-size: 0.72rem;
        gap: 4px;
        border-radius: 4px;
        backdrop-filter: none;
    }

    .ctrl-btn svg {
        width: 12px;
        height: 12px;
    }

    /* Subtitles Dialogue Box */
    .dialogue-box {
        bottom: 10px;
        padding: 4px 14px;
        max-width: 88%;
        border-radius: 6px;
        backdrop-filter: none;
        background: rgba(0, 0, 0, 0.7);
    }

    .dialogue-text {
        font-size: 0.84rem;
        line-height: 1.25;
    }

    /* Choice Decision Overlay & Cards */
    .choice-overlay {
        bottom: 6px;
        padding: 0 10px;
    }

    .choice-box {
        gap: 4px;
        max-width: 98%;
    }

    .choice-options-list {
        gap: 6px;
        max-width: 860px;
    }

    .choice-card {
        flex: 1 1 120px;
        min-width: 100px;
        max-width: 240px;
        min-height: 32px;
        padding: 4px 8px;
        border-radius: 6px;
    }

    .choice-label {
        font-size: 0.74rem;
        line-height: 1.2;
    }

    .choice-timer-container {
        gap: 6px;
    }

    .choice-timer-icon-wrap {
        width: 18px;
        height: 18px;
        border-width: 1.5px;
    }

    .choice-timer-icon-wrap svg {
        width: 10px;
        height: 10px;
    }

    .timer-bar-wrap {
        width: 200px;
        max-width: 60vw;
        height: 5px;
    }

    /* In-Game Pause Menu */
    .pause-menu-card {
        width: 320px;
        max-width: 90vw;
        padding: 16px 20px;
        gap: 10px;
        max-height: 92vh;
        overflow-y: auto;
    }

    .pause-title {
        font-size: 1.15rem;
    }

    .pause-menu-list {
        gap: 6px;
    }

    .pause-menu-btn {
        padding: 8px 12px;
        font-size: 0.82rem;
    }

    /* Full-Screen Drawers */
    .drawer-header {
        padding: 6px 14px;
    }

    .drawer-title {
        font-size: 0.95rem;
        gap: 6px;
    }

    .drawer-title svg {
        width: 16px;
        height: 16px;
    }

    .drawer-back-btn {
        padding: 4px 10px;
        font-size: 0.72rem;
    }

    .drawer-view-tabs {
        padding: 2px;
        gap: 2px;
    }

    .view-tab-btn {
        padding: 3px 8px;
        font-size: 0.7rem;
    }

    .close-btn {
        width: 26px;
        height: 26px;
        font-size: 1rem;
    }

    .drawer-content {
        padding: 8px 14px;
        gap: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .chapter-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 8px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }

    .settings-group {
        padding-bottom: 8px;
    }
}
