/* ==============================================================================
   CAPYBILL LANDLORD TYCOON — COZY CARTOON UI STYLESHEET
   Adheres strictly to Visual Asset Bible & Android WebView Dropdown Safety Rules:
   - Zero vh/dvh or width: max-content inside fixed/absolute containers
   - 1-tap zero-latency touch via pointer-events: none on decorative child spans
   ============================================================================== */

@font-face {
    font-family: 'Fredoka';
    src: url('../assets/fonts/Fredoka-Bold.ttf') format('truetype');
    font-weight: bold;
    font-display: swap;
}

@font-face {
    font-family: 'Coiny';
    src: url('../assets/fonts/Coiny.ttf') format('truetype');
    font-weight: normal;
    font-display: swap;
}

:root {
    --color-gold: #F59E0B;
    --color-gold-light: #FEF3C7;
    --color-wood: #B45309;
    --color-wood-dark: #5C2D0C;
    --color-parchment: #FFFBEB;
    --color-mint: #10B981;
    --color-mint-dark: #047857;
    --color-coral: #EF4444;
    --color-sky: #BAE6FD;
    --color-text: #3E2723;
    --font-primary: 'Fredoka', 'Coiny', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: 'Coiny', 'Fredoka', cursive;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #0F172A;
    font-family: var(--font-primary);
    color: var(--color-text);
    touch-action: manipulation;
}

.desktop-viewport-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #090D16;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #BAE6FD;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    cursor: pointer;
}

/* ==============================================================================
   MADE WITH UNITY SPLASH SCREEN & WELCOME SPLASH OVERLAY
   ============================================================================== */
.unity-splash-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    background: radial-gradient(circle at center, #262628 0%, #1F1F20 55%, #161618 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.42s ease;
}

.unity-splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.unity-splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: unitySplashDolly 1.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    pointer-events: none;
}

.unity-splash-logo {
    width: 82px;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5));
}

.unity-splash-wordmark {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    pointer-events: none;
}

.unity-splash-made-with {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.28em;
    color: #A1A1AA;
    text-transform: uppercase;
}

.unity-splash-brand {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: #FFFFFF;
    line-height: 1.05;
}

.unity-splash-progress-track {
    width: 146px;
    height: 5px;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.unity-splash-progress-fill {
    width: 0%;
    height: 100%;
    background: #FFFFFF;
    border-radius: 999px;
    transition: width 0.28s ease-out;
}

@keyframes unitySplashDolly {
    0% { opacity: 0; transform: scale(0.91); }
    25% { opacity: 1; transform: scale(0.97); }
    100% { opacity: 1; transform: scale(1.03); }
}

#welcome-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: radial-gradient(circle at center, #1E293B 0%, #090D16 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.35s ease;
    overflow: hidden;
}

.welcome-stage-16x9 {
    position: relative;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 0 20px 3.5% 20px;
    overflow: hidden;
    background: linear-gradient(180deg, #38BDF8 0%, #FEF3C7 100%);
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.72);
}

.welcome-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center;
    pointer-events: none;
    z-index: 0;
}

.welcome-start-btn {
    position: relative;
    z-index: 2;
    background: none;
    border: none;
    cursor: pointer;
    width: 28%;
    min-width: 165px;
    max-width: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin-bottom: 2px;
    animation: pulseScale 1.6s infinite ease-in-out;
}

.welcome-start-btn img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
    filter: drop-shadow(0 6px 12px rgba(45, 20, 8, 0.55));
}

@keyframes pulseScale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

/* ==============================================================================
   TOP BAR HUD
   ============================================================================== */
#hud-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 15;
    padding: env(safe-area-inset-top, 8px) 16px 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: linear-gradient(180deg, rgba(30, 15, 5, 0.68) 0%, rgba(30, 15, 5, 0) 100%);
    pointer-events: none;
}

.hud-row-top, .hud-row-sub {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
    pointer-events: none;
}

.hud-left-cluster {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    pointer-events: auto;
}

.hud-profile-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(45, 20, 8, 0.82);
    border: 2.5px solid #F59E0B;
    border-radius: 26px;
    padding: 3px 12px 3px 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: transform 0.12s ease;
}

.hud-avatar-wrapper {
    position: relative;
    width: 38px;
    height: 38px;
}

.hud-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #FDE68A;
    pointer-events: none;
}

.hud-avatar-frame {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 46px;
    height: 46px;
    pointer-events: none;
    object-fit: contain;
}

.hud-profile-info {
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.hud-level-badge {
    font-family: var(--font-display);
    font-size: 13px;
    color: #FDE68A;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
    line-height: 1.1;
}

.hud-exp-bar {
    width: 68px;
    height: 7px;
    background: #2D1408;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #78350F;
    margin-top: 2px;
}

#hud-exp-fill {
    width: 25%;
    height: 100%;
    background: linear-gradient(90deg, #F59E0B, #10B981);
    transition: width 0.25s ease;
}

.hud-currencies {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hud-pill {
    background: rgba(45, 20, 8, 0.85);
    border: 2px solid #F59E0B;
    border-radius: 20px;
    padding: 3px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    font-family: var(--font-display);
    font-size: 14px;
    color: #FEF3C7;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: transform 0.12s ease;
}

.hud-pill:active { transform: scale(0.94); }

.hud-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
    pointer-events: none;
}

.hud-icon-emoji {
    font-size: 15px;
    line-height: 1;
    pointer-events: none;
}

.hud-plus-btn {
    background: #10B981;
    color: #FFF;
    border: 1.5px solid #FFF;
    border-radius: 50%;
    width: 17px;
    height: 17px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    pointer-events: none;
}

.hud-plus-btn.gold {
    background: #F59E0B;
}

.hud-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    pointer-events: auto;
}

.hud-btn {
    background: rgba(255, 251, 235, 0.95);
    border: 2px solid var(--color-wood-dark);
    border-radius: 14px;
    min-width: 32px;
    height: 32px;
    padding: 0 7px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    color: var(--color-wood-dark);
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.18);
}

.hud-btn:active, .hud-pill:active, .hud-profile-box:active {
    transform: scale(0.93);
}

/* ==============================================================================
   HUB RIGHT QUICK ACTIONS & QUICK COLLECT BUTTON (3D GRAPHIC SPRITES)
   ============================================================================== */
#hub-quick-actions {
    position: absolute;
    right: 16px;
    top: 66px;
    z-index: 12;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    pointer-events: none;
}

.side-sprite-btn {
    pointer-events: auto;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 66px;
    height: 66px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.14s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.side-sprite-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 5px 12px rgba(0,0,0,0.4));
}

.side-sprite-btn:active {
    transform: scale(0.92);
}

#quick-collect-wrap {
    position: absolute;
    right: 16px;
    bottom: 14px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#btn-quick-collect {
    position: relative;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 74px;
    height: 74px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.14s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#qc-sprite {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.45));
}

#btn-quick-collect.pulse-active {
    animation: qcPulse 1.4s infinite ease-in-out;
}

@keyframes qcPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.09); filter: drop-shadow(0 8px 22px rgba(245, 158, 11, 0.75)); }
}

#btn-quick-collect:active {
    transform: scale(0.92);
}

#qc-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #EF4444;
    color: #FFF;
    border: 2px solid #FFF;
    border-radius: 12px;
    padding: 1px 7px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(0,0,0,0.35);
    pointer-events: none;
}

/* ==============================================================================
   INTERIOR & JUICE KIOSK CONTEXT BARS (LANDSCAPE DOCKED BOTTOM BAR)
   ============================================================================== */
.context-action-bar {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    min-width: 0;
    max-width: calc(100% - 20px);
    z-index: 22;
    background: rgba(255, 251, 235, 0.96);
    border: 3px solid var(--color-wood-dark);
    border-radius: 18px;
    padding: 6px 10px;
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

.ctx-btn {
    flex: 0 1 auto;
    min-width: 0;
    background: #FEF3C7;
    border: 2px solid #B45309;
    border-radius: 11px;
    padding: 7px 10px;
    font-family: var(--font-primary);
    font-size: clamp(11px, 1.4vw, 12px);
    font-weight: bold;
    line-height: 1.15;
    color: var(--color-wood-dark);
    text-align: center;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
}

.ctx-btn.ctx-back {
    background: #FDE68A;
    border-color: var(--color-wood-dark);
}

.ctx-btn:active {
    transform: scale(0.94);
}

/* ==============================================================================
   BOTTOM NAVIGATION BAR & MORE DRAWER (COZY 3D GRAPHIC SPRITE DOCK)
   ============================================================================== */
#bottom-nav {
    position: absolute;
    bottom: 12px;
    left: 16px;
    right: auto;
    width: auto;
    height: 68px;
    z-index: 20;
    background: rgba(45, 20, 8, 0.82);
    border: 3px solid #F59E0B;
    border-radius: 26px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 4px 10px;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
}

.nav-sprite-btn {
    position: relative;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 58px;
    height: 58px;
    display: flex;
    justify-content: center;
    align-items: center;
    outline: none;
    transition: transform 0.16s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.16s ease;
}

.nav-sprite-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35));
}

.nav-sprite-btn:not(.active) img {
    filter: brightness(0.90) drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

.nav-sprite-btn.active {
    transform: scale(1.15) translateY(-5px);
}

.nav-sprite-btn.active img {
    filter: brightness(1.05) drop-shadow(0 6px 14px rgba(245, 158, 11, 0.6));
}

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

.red-dot-sprite {
    position: absolute !important;
    top: -3px;
    right: -3px;
    width: 20px !important;
    height: 20px !important;
    object-fit: contain;
    pointer-events: none;
    display: none;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4)) !important;
    animation: badgePulse 1.8s infinite ease-in-out;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18); }
}

#more-drawer {
    position: absolute;
    left: 16px;
    bottom: 86px;
    z-index: 25;
    background: rgba(255, 251, 235, 0.98);
    border: 3.5px solid var(--color-wood-dark);
    border-radius: 26px;
    padding: 8px 12px;
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    box-shadow: 0 16px 36px rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    animation: drawerPop 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#more-drawer.open {
    display: flex;
}

@keyframes drawerPop {
    0% { opacity: 0; transform: translateY(16px) scale(0.92); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.drawer-sprite-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 54px;
    height: 54px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.drawer-sprite-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.3));
}

.drawer-sprite-btn:active {
    transform: scale(0.92);
}

/* ==============================================================================
   FLOATING FX LAYER
   ============================================================================== */
#fx-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 35;
    pointer-events: none;
    overflow: hidden;
}

.fx-item {
    position: absolute;
    font-weight: bold;
    font-size: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.55);
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    animation: floatUpFade 1.1s ease-out forwards;
}

#toast-container {
    position: absolute;
    top: 52px;
    right: 14px;
    z-index: 96;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    max-width: min(370px, 68%);
    pointer-events: none;
}

.fx-receipt-banner {
    position: relative;
    background: rgba(255, 251, 235, 0.98);
    border: 2.5px solid var(--color-wood-dark);
    border-radius: 14px;
    padding: 8px 14px;
    text-align: right;
    font-size: 13px;
    font-weight: 800;
    color: var(--color-wood-dark);
    box-shadow: 0 6px 18px rgba(0,0,0,0.38);
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    animation: toastSlideInRight 2.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes floatUpFade {
    0% { opacity: 1; transform: translate(-50%, 0) scale(0.85); }
    30% { opacity: 1; transform: translate(-50%, -18px) scale(1.08); }
    100% { opacity: 0; transform: translate(-50%, -55px) scale(0.95); }
}

@keyframes toastSlideInRight {
    0% { opacity: 0; transform: translateX(48px) scale(0.92); }
    10% { opacity: 1; transform: translateX(0) scale(1.01); }
    16% { opacity: 1; transform: translateX(0) scale(1); }
    85% { opacity: 1; transform: translateX(0) scale(1); }
    100% { opacity: 0; transform: translateX(34px) scale(0.95); }
}

.currency-coin {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    vertical-align: middle;
    font-weight: 800;
}

.inline-coin {
    width: 15px;
    height: 15px;
    object-fit: contain;
    vertical-align: -2.5px;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.fx-coin-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

/* ==============================================================================
   COZY MODALS SYSTEM
   ============================================================================== */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.72);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

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

.modal-dialog {
    width: 100%;
    max-width: 680px;
    max-height: 88%;
    background: var(--color-parchment);
    border: 4px solid var(--color-wood-dark);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0,0,0,0.55);
}

.modal-header {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    border-bottom: 3px solid var(--color-wood-dark);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #FFF;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: bold;
    color: #FFF;
    text-shadow: 0 2px 4px rgba(0,0,0,0.45);
    letter-spacing: 0.5px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}

.modal-close {
    background: #EF4444;
    border: 2px solid #FFF;
    color: #FFF;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 12px 0 12px;
    background: #FEF3C7;
    border-bottom: 2px solid #FDE68A;
}

.modal-tab-btn {
    flex: 1;
    min-width: 0;
    padding: 7px 6px;
    background: rgba(255,255,255,0.65);
    border: 2px solid #D97706;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: bold;
    color: var(--color-wood-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.modal-tab-btn.active {
    background: var(--color-parchment);
    color: #D97706;
}

.modal-body {
    padding: 12px;
    overflow-y: auto;
     -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cozy-card {
    background: #FFFBEB url('../assets/sprites/UI_Card_Parchment.png') center/100% 100% no-repeat;
    border: 2.5px solid #F59E0B;
    border-radius: 18px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.cozy-card-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 12px;
    background: #FEF3C7;
    padding: 4px;
    border: 1.5px solid #FDE68A;
    flex-shrink: 0;
}

.cozy-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.cozy-card-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: bold;
    color: var(--color-wood-dark);
    text-shadow: 0 1px 1px rgba(255,255,255,0.8);
}

.cozy-card-desc {
    font-size: 11px;
    color: #64748B;
    line-height: 1.35;
}

.cozy-btn {
    background: linear-gradient(180deg, #34D399 0%, #10B981 40%, #059669 100%);
    color: #FFF;
    border: 2px solid #047857;
    border-radius: 14px;
    padding: 8px 14px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    box-shadow: 0 4px 0 #064E3B, 0 6px 12px rgba(0,0,0,0.22);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.cozy-btn.gold {
    background: linear-gradient(180deg, #FDE68A 0%, #F59E0B 40%, #D97706 100%);
    border-color: #B45309;
    color: #451A03;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
    box-shadow: 0 4px 0 #78350F, 0 6px 12px rgba(0,0,0,0.22);
}

.cozy-btn.secondary {
    background: #94A3B8;
    border-color: #475569;
    box-shadow: 0 4px 0 #334155;
}

.cozy-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.cozy-btn:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #064E3B;
}

.cozy-btn.gold:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #78350F;
}

.progress-track {
    width: 100%;
    height: 100%;
    background: #E2E8F0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #CBD5E1;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #F59E0B, #10B981);
    transition: width 0.25s ease;
}

/* ==========================================================================
   TENANT CODEX (SỔ SƯU TẬP KHÁCH TRỌ — 2-PAGE LEATHER BOOK MODAL)
   ========================================================================== */
#modal-tenants {
    background: rgba(0, 0, 0, 0.72);
}

.codex-book-wrapper {
    position: relative;
    width: min(840px, 94vw);
    aspect-ratio: 1500 / 837;
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: codexBookPopIn 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes codexBookPopIn {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.codex-book {
    position: relative;
    width: 100%;
    height: 100%;
    background-image: url('../assets/sprites/UI_Codex_Book.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    box-sizing: border-box;
    padding: 3% 4.2% 3.2% 4.8%;
    gap: 3.5%;
    user-select: none;
    -webkit-user-select: none;
}

.codex-close-btn {
    position: absolute;
    top: 2.8%;
    right: 3.2%;
    width: 32px;
    height: 32px;
    background: #DC2626;
    border: 2px solid #FFFFFF;
    border-radius: 6px;
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    z-index: 10;
    transition: transform 0.12s ease, background 0.12s ease;
}

.codex-close-btn:hover {
    transform: scale(1.1);
    background: #B91C1C;
}

.codex-close-btn:active {
    transform: scale(0.95);
}

/* Left Page: Collection Grid & Progress */
.codex-page-left {
    display: flex;
    flex-direction: column;
    padding: 2% 3% 1% 1%;
    box-sizing: border-box;
    overflow: hidden;
}

.codex-header-banner {
    width: 100%;
    height: 38px;
    background-image: url('../assets/sprites/UI_Name_Banner.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.codex-title {
    font-family: 'Coiny', sans-serif;
    font-size: clamp(12px, 1.5vw, 16px);
    color: #3D2412;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

.codex-progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    font-size: clamp(10px, 1.1vw, 12px);
    color: #5D432C;
    font-weight: 600;
}

.codex-progress-track {
    flex: 1;
    max-width: 130px;
    height: 12px;
    background-image: url('../assets/sprites/UI_EXP_Track.png');
    background-size: 100% 100%;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    padding: 2px;
    box-sizing: border-box;
}

.codex-progress-fill {
    height: 100%;
    background-image: url('../assets/sprites/UI_EXP_Fill.png');
    background-size: cover;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.codex-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 6px;
    flex: 1;
}

.codex-card {
    position: relative;
    background-image: url('../assets/sprites/UI_Card_Parchment.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 5px 3px 5px 3px;
    box-sizing: border-box;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 2px solid transparent;
}

.codex-card:hover {
    transform: translateY(-2px);
}

.codex-card.selected {
    border-color: #F59E0B;
    background-color: #FEF3C7;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.45), 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.03);
}

.codex-card-portrait {
    width: clamp(34px, 4.2vw, 50px);
    height: clamp(34px, 4.2vw, 50px);
    object-fit: contain;
    transition: filter 0.2s ease;
}

.codex-card-portrait.silhouette {
    filter: brightness(0.2) sepia(1) hue-rotate(330deg) saturate(2);
}

.codex-card-name {
    font-size: clamp(9px, 1.05vw, 11px);
    font-weight: 700;
    color: #3D2B1F;
    text-align: center;
    line-height: 1.1;
    margin-top: 1px;
}

.codex-card-rarity {
    font-size: clamp(8px, 0.85vw, 9.5px);
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.codex-card-rarity.common { color: #785E48; }
.codex-card-rarity.rare { color: #0284C7; }
.codex-card-rarity.epic { color: #9333EA; }

.codex-card-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 20px;
    height: 20px;
    background-image: url('../assets/sprites/UI_RedDot_Badge.png');
    background-size: 100% 100%;
    color: #FFFFFF;
    font-size: 8px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Right Page: Selected Tenant Profile */
.codex-page-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2% 1% 1% 3%;
    box-sizing: border-box;
    text-align: center;
    overflow: hidden;
}

.codex-profile-backdrop {
    width: clamp(75px, 9.5vw, 108px);
    height: clamp(75px, 9.5vw, 108px);
    background-image: url('../assets/sprites/UI_Card_Parchment.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.codex-profile-portrait {
    width: 82%;
    height: 82%;
    object-fit: contain;
    animation: codexBob 2.4s ease-in-out infinite;
}

@keyframes codexBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.codex-profile-portrait.silhouette {
    filter: brightness(0.2) sepia(1) hue-rotate(330deg) saturate(2);
    animation: none;
}

.codex-profile-name {
    font-family: 'Coiny', sans-serif;
    font-size: clamp(14px, 1.8vw, 19px);
    color: #3E2415;
    margin: 1px 0 0 0;
    line-height: 1.15;
}

.codex-profile-rarity {
    font-size: clamp(9px, 1vw, 11px);
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.codex-profile-bio {
    font-size: clamp(9px, 1.05vw, 11px);
    font-style: italic;
    color: #5D432C;
    line-height: 1.3;
    margin: 0 0 4px 0;
    padding: 0 4px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.codex-profile-details {
    width: 100%;
    border-top: 1px solid rgba(120, 94, 72, 0.25);
    padding-top: 4px;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 2.5px;
    text-align: left;
    font-size: clamp(9px, 0.95vw, 11px);
    color: #3D2B1F;
}

.codex-profile-details strong {
    color: #1E120A;
}

.codex-avatar-btn {
    width: 82%;
    max-width: 220px;
    height: 34px;
    border-radius: 999px;
    border: 2px solid #D97706;
    background: linear-gradient(180deg, #FDE68A 0%, #F59E0B 100%);
    color: #4A2E16;
    font-family: 'Coiny', sans-serif;
    font-size: clamp(11px, 1.2vw, 13px);
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(217, 119, 6, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: transform 0.12s ease, filter 0.12s ease;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.codex-avatar-btn:hover {
    transform: scale(1.03);
    filter: brightness(1.05);
}

.codex-avatar-btn:active {
    transform: scale(0.97);
}

.codex-avatar-btn:disabled,
.codex-avatar-btn.equipped {
    background: #E2E8F0;
    border-color: #94A3B8;
    color: #64748B;
    cursor: default;
    box-shadow: none;
    transform: none;
}

/* ==============================================================================
   LANDSCAPE ENFORCEMENT & ROTATE PROMPT (MOBILE PORTRAIT ONLY)
   ============================================================================== */
.rotate-device-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1E293B 0%, #0F172A 100%);
    z-index: 99999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    text-align: center;
    color: #FFFBEB;
}

.rotate-phone-icon {
    font-size: 56px;
    margin-bottom: 16px;
    animation: rotatePhone 2s ease-in-out infinite alternate;
}

@keyframes rotatePhone {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(90deg) scale(1.15); }
    100% { transform: rotate(90deg) scale(1.15); }
}

.rotate-device-overlay h3 {
    font-family: var(--font-display);
    font-size: 20px;
    color: var(--color-gold);
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.rotate-device-overlay p {
    font-size: 14px;
    line-height: 1.5;
    max-width: 320px;
    color: #E2E8F0;
}

@media screen and (orientation: portrait) and (max-width: 820px) {
    .rotate-device-overlay {
        display: flex;
    }
}


/* ==============================================================================
   INTERACTIVE ONBOARDING / FTUE TUTORIAL OVERLAY (PHASE 7)
   ============================================================================== */
.tutorial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 85;
    pointer-events: none;
    display: none;
    overflow: hidden;
}

.tutorial-overlay.active {
    display: block;
}

.tut-mask-panel {
    position: absolute;
    background: rgba(15, 10, 5, 0.72);
    pointer-events: auto;
    transition: all 0.18s ease-out;
}

.tut-spotlight-hole {
    position: absolute;
    background: rgba(254, 243, 199, 0.08);
    border: 3.5px solid #FBBF24;
    border-radius: 18px;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.35), inset 0 0 18px rgba(251, 191, 36, 0.35);
    pointer-events: auto;
    cursor: pointer;
    padding: 0;
    transition: left 0.18s ease-out, top 0.18s ease-out, width 0.18s ease-out, height 0.18s ease-out;
    animation: tutSpotlightGlow 1.6s ease-in-out infinite alternate;
}

@keyframes tutSpotlightGlow {
    0% { transform: scale(0.98); border-color: #FBBF24; }
    100% { transform: scale(1.03); border-color: #FEF08A; }
}

.tut-pulse-attention {
    animation: tutAttentionShake 0.36s ease-in-out !important;
}

@keyframes tutAttentionShake {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.12); border-color: #EF4444; }
    75% { transform: scale(0.95); border-color: #FBBF24; }
}

.tut-hand-pointer {
    position: absolute;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 88;
    animation: tutHandBounce 0.9s ease-in-out infinite alternate;
    transition: left 0.18s ease-out, top 0.18s ease-out;
}

@keyframes tutHandBounce {
    0% { transform: translate(-50%, 0px) scale(0.96); }
    100% { transform: translate(-50%, -8px) scale(1.05); }
}

.tut-hand-label {
    display: inline-block;
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: #FFFBEB;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 999px;
    border: 2px solid #FFFBEB;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
    white-space: nowrap;
}

.tut-btn-skip {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 90;
    pointer-events: auto;
    background: rgba(30, 20, 12, 0.85);
    color: #FEF3C7;
    border: 2px solid #F59E0B;
    border-radius: 999px;
    padding: 5px 14px;
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.tut-btn-skip:active {
    transform: scale(0.95);
}

.tut-dialogue-card {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    width: min(94%, 640px);
    background: #FFFBEB url('../assets/sprites/UI_Card_Parchment.png') center/100% 100% no-repeat;
    border: 3.5px solid #451A03;
    border-radius: 20px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 89;
    pointer-events: auto;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
    transition: top 0.22s ease, bottom 0.22s ease;
}

.tut-dialogue-card.tut-card-top {
    bottom: auto;
    top: 46px;
}

.tut-avatar-box {
    position: relative;
    width: 58px;
    height: 58px;
    flex-shrink: 0;
}

.tut-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
}

.tut-avatar-frame {
    position: absolute;
    inset: -3px;
    width: calc(100% + 6px);
    height: calc(100% + 6px);
    object-fit: contain;
    pointer-events: none;
}

.tut-dialogue-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tut-dialogue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.tut-speaker-name {
    font-family: var(--font-display);
    font-size: 13px;
    color: #92400E;
    font-weight: bold;
}

.tut-step-badge {
    background: #FEF3C7;
    border: 1.5px solid #F59E0B;
    color: #B45309;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 999px;
}

.tut-dialogue-text {
    font-size: 12.5px;
    line-height: 1.38;
    color: #3E2723;
    margin: 0;
}

.tut-btn-next {
    flex-shrink: 0;
    padding: 10px 14px !important;
    font-size: 12.5px !important;
    white-space: nowrap;
}
/* ==============================================================================
   INTERIOR PEEK SPLIT-VIEW MODE (NON-OBSCURING ROOM ACTIVITY DRAWER)
   ============================================================================== */
#interior-action-bar {
    z-index: 56;
}

.modal-overlay.interior-peek-mode {
    background: rgba(15, 23, 42, 0.08);
    justify-content: flex-end;
    align-items: center;
    padding: 44px 10px 64px 10px;
}

.modal-overlay.interior-peek-mode .modal-dialog {
    width: clamp(320px, 48%, 430px);
    max-width: calc(100% - 16px);
    max-height: 100%;
    border-width: 3.5px;
    border-radius: 20px;
    box-shadow: -8px 14px 34px rgba(0, 0, 0, 0.52);
    animation: peekDrawerSlideIn 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.modal-overlay.interior-peek-mode .modal-header {
    padding: 8px 12px;
}

.modal-overlay.interior-peek-mode .modal-title {
    font-size: clamp(13px, 1.65vw, 15px);
}

.modal-overlay.interior-peek-mode .modal-tabs {
    gap: 4px;
    padding: 6px 8px 0 8px;
}

.modal-overlay.interior-peek-mode .modal-tab-btn {
    padding: 5px 4px;
    font-size: 11px;
}

.modal-overlay.interior-peek-mode .modal-body {
    padding: 8px 10px;
    gap: 7px;
    overflow-x: hidden;
}

.modal-overlay.interior-peek-mode .cozy-card {
    padding: 8px 10px;
    gap: 8px;
    border-radius: 14px;
}

.modal-overlay.interior-peek-mode .cozy-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.modal-overlay.interior-peek-mode .cozy-card-title {
    font-size: 13px;
    line-height: 1.25;
}

.modal-overlay.interior-peek-mode .cozy-card-desc {
    font-size: 10.5px;
    line-height: 1.3;
}

.modal-overlay.interior-peek-mode .cozy-btn {
    padding: 6px 10px;
    font-size: 11.5px;
    border-radius: 11px;
    max-width: 100%;
    box-sizing: border-box;
}

.modal-overlay.interior-peek-mode .cozy-card > .cozy-btn {
    flex-shrink: 0;
    padding: 6px 9px;
    font-size: 11px;
}

.modal-overlay.interior-peek-mode .wardrobe-slot-tab {
    min-width: 0;
    padding: 5px 4px;
    font-size: 10.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-overlay.interior-peek-mode .repair-minigame-canvas {
    height: clamp(120px, 34vh, 175px);
}

@media screen and (max-width: 760px), screen and (max-height: 430px) {
    .context-action-bar {
        bottom: 8px;
        padding: 5px 8px;
        gap: 5px;
        border-radius: 15px;
    }
    .ctx-btn {
        padding: 5px 8px;
        font-size: 10.5px;
        border-radius: 9px;
    }
}

@keyframes peekDrawerSlideIn {
    0% { opacity: 0; transform: translateX(26px) scale(0.95); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

/* ==============================================================================
   v1.2 HUD AVATAR 3-SLOT COSTUME OVERLAYS, AD BREAK TOAST & REPAIR MINIGAME
   ============================================================================== */
.hud-avatar-equip {
    position: absolute;
    pointer-events: none;
    object-fit: contain;
    z-index: 2;
}

.hud-equip-hat {
    top: -11px;
    left: 5px;
    width: 28px;
    height: 28px;
}

.hud-equip-body {
    bottom: -3px;
    left: 7px;
    width: 24px;
    height: 24px;
}

.hud-equip-hand {
    bottom: -2px;
    right: -4px;
    width: 20px;
    height: 20px;
}

.ad-break-toast {
    position: absolute;
    top: 52px;
    right: 14px;
    left: auto;
    transform: none;
    z-index: 98;
    background: rgba(45, 20, 8, 0.96);
    border: 2.5px solid #F59E0B;
    border-radius: 14px;
    padding: 9px 16px;
    color: #FEF3C7;
    font-family: var(--font-display);
    font-size: 13.5px;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.52);
    pointer-events: none;
    text-align: right;
    animation: toastSlideInRight 2.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.repair-minigame-canvas {
    width: 100%;
    max-width: 340px;
    height: 185px;
    border-radius: 16px;
    border: 3px solid #D97706;
    background: linear-gradient(180deg, #FEF3C7 0%, #FDE68A 100%);
    touch-action: none;
    user-select: none;
    cursor: grab;
    box-shadow: inset 0 3px 10px rgba(120, 53, 15, 0.2);
}

.repair-minigame-canvas:active {
    cursor: grabbing;
}

.wardrobe-preview-stage {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 2.5px solid #D97706;
    border-radius: 16px;
    padding: 10px 14px;
}

.wardrobe-slot-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.wardrobe-slot-tab {
    flex: 1;
    min-width: 68px;
    padding: 6px 8px;
    border-radius: 10px;
    border: 2px solid #B45309;
    background: #FFFBEB;
    color: #78350F;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.wardrobe-slot-tab.active {
    background: #F59E0B;
    color: #FFFBEB;
    border-color: #78350F;
}

/* ==============================================================================
   CONFIRM EXIT GAME MODAL (DOUBLE SWIPE-BACK AT MENU/HOME)
   ============================================================================== */
.exit-confirm-overlay {
    z-index: 120;
}

.exit-confirm-dialog {
    max-width: 400px;
    text-align: center;
}

.exit-confirm-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 20px 20px;
}

.exit-confirm-mascot-wrap {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: radial-gradient(circle, #FEF3C7 0%, #FDE68A 100%);
    border: 3px solid #D97706;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 14px rgba(120, 53, 15, 0.25);
}

.exit-confirm-mascot {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.28));
}

.exit-confirm-desc {
    font-size: 14px;
    font-weight: 700;
    color: #451A03;
    line-height: 1.45;
    margin: 2px 0 6px;
}

.exit-confirm-actions {
    display: flex;
    width: 100%;
    gap: 10px;
    justify-content: center;
}

.exit-btn-stay {
    flex: 1.25;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 800;
    border-radius: 14px;
    background: linear-gradient(180deg, #22C55E 0%, #16A34A 100%);
    border: 2.5px solid #14532D;
    color: #FFFFFF;
    cursor: pointer;
    box-shadow: 0 4px 0 #14532D;
}

.exit-btn-quit {
    flex: 1;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 800;
    border-radius: 14px;
    background: linear-gradient(180deg, #EF4444 0%, #DC2626 100%);
    border: 2.5px solid #7F1D1D;
    color: #FFFFFF;
    cursor: pointer;
    box-shadow: 0 4px 0 #7F1D1D;
}

.exit-btn-stay:active,
.exit-btn-quit:active {
    transform: translateY(2px);
}

/* ==============================================================================
   SETTINGS VERSION FOOTER & CREDIT ROLL OVERLAY (V1.3 TASK 5)
   ============================================================================== */
.settings-version-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-top: 2px;
    background: rgba(254, 243, 199, 0.72);
    border: 2px dashed #D97706;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 800;
    color: #78350F;
}

.credit-roll-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 125;
    background: radial-gradient(circle at 50% 25%, rgba(36, 20, 9, 0.96) 0%, rgba(10, 12, 20, 0.985) 100%);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 12px;
}

.credit-roll-overlay.active {
    display: flex;
}

.credit-roll-stage {
    position: relative;
    width: min(820px, 95vw);
    height: min(500px, 92vh);
    background: linear-gradient(180deg, rgba(36, 18, 9, 0.98) 0%, rgba(16, 10, 8, 0.99) 100%);
    border: 3px solid #F59E0B;
    border-radius: 20px;
    box-shadow: 0 0 0 3px #1C1008, 6px 6px 0 #B45309, 0 24px 60px rgba(0, 0, 0, 0.88);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.credit-roll-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    background: linear-gradient(90deg, #271308 0%, #3B1B0B 55%, #271308 100%);
    border-bottom: 2px solid rgba(245, 158, 11, 0.55);
    flex-shrink: 0;
}

.credit-roll-topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.credit-roll-version-pill {
    background: linear-gradient(135deg, #FDE047 0%, #F59E0B 100%);
    color: #271308;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.7px;
    padding: 3px 10px;
    border-radius: 999px;
    box-shadow: 2px 2px 0 #78350F;
    white-space: nowrap;
}

.credit-roll-reason-badge {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #FDE68A;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.credit-roll-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.credit-roll-speed-btn {
    background: rgba(45, 22, 10, 0.92);
    color: #FDE68A;
    border: 2px solid #F59E0B;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 11.5px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.credit-roll-speed-btn:hover,
.credit-roll-speed-btn.active {
    background: linear-gradient(135deg, #FDE047 0%, #F59E0B 100%);
    color: #1C1008;
    border-color: #FFFBEB;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.55);
}

.credit-roll-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #FFFBEB;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
}

.credit-roll-close:active {
    transform: scale(0.92);
}

.credit-roll-viewport {
    flex: 1 1 0%;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 20px 22px 40px 22px;
    text-align: center;
    color: #FEF3C7;
    background:
        radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.14) 0%, transparent 55%),
        radial-gradient(circle at 50% 100%, rgba(56, 189, 248, 0.08) 0%, transparent 55%);
}

.credit-roll-viewport::-webkit-scrollbar {
    width: 6px;
}

.credit-roll-viewport::-webkit-scrollbar-track {
    background: rgba(20, 10, 5, 0.75);
}

.credit-roll-viewport::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #FDE047, #D97706);
    border-radius: 3px;
}

.credit-roll-track,
.credits-roll-track {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    padding-top: 8px;
    padding-bottom: 120px;
}

.credit-roll-hint {
    padding: 7px 14px;
    background: #1C0E06;
    border-top: 1.5px solid rgba(245, 158, 11, 0.35);
    font-size: 11px;
    font-weight: 800;
    color: #FDE68A;
    text-align: center;
    flex-shrink: 0;
}

/* Hero Block */
.credits-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 16px 16px;
    width: 100%;
    border-bottom: 1.5px dashed rgba(251, 191, 36, 0.4);
}

.credit-mascot-badge {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: radial-gradient(circle, #FEF3C7 0%, #F59E0B 100%);
    border: 3px solid #FDE047;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    margin-bottom: 4px;
}

.credit-mascot-badge img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.credits-hero-kicker {
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 1.8px;
    color: #38BDF8;
    text-transform: uppercase;
}

.credits-hero-title {
    font-family: var(--font-display);
    font-size: clamp(22px, 3.4vw, 32px);
    font-weight: 900;
    letter-spacing: 1.5px;
    color: #FDE047;
    text-shadow: 2px 2px 0 #92400E, 0 0 18px rgba(251, 191, 36, 0.45);
    margin: 0;
    line-height: 1.15;
}

.credits-hero-sub {
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.9px;
    color: #FEF3C7;
}

.credits-stamp-seal {
    margin-top: 4px;
    display: inline-block;
    padding: 4px 14px;
    border: 2px solid #F59E0B;
    color: #FDE047;
    background: rgba(217, 119, 6, 0.22);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.3px;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}

/* Player Dossier Stats */
.credits-player-dossier {
    width: 100%;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(56, 189, 248, 0.1) 100%);
    border: 1.5px solid rgba(251, 191, 36, 0.55);
    border-radius: 12px;
    padding: 12px 14px;
}

.credits-dossier-title {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.2px;
    color: #FDE047;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.credits-dossier-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.credits-stat-box {
    background: rgba(20, 12, 8, 0.85);
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-radius: 8px;
    padding: 6px 8px;
}

.credits-stat-val {
    display: block;
    font-size: 14px;
    font-weight: 900;
    color: #38BDF8;
}

.credits-stat-lbl {
    display: block;
    font-size: 9.5px;
    font-weight: 800;
    color: #FDE68A;
    margin-top: 2px;
}

/* BSMB Shared Game Credits & Sections (Synced with design-system/css/bsmb-game.css + NinjaBill) */
.bsmb-g-credits,
.credits-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.bsmb-g-credits-head,
.credits-sec-header {
    font-size: 11.5px;
    font-weight: 900;
    letter-spacing: 1.4px;
    color: #FDE047;
    background: rgba(217, 119, 6, 0.26);
    border-left: 3.5px solid #F59E0B;
    border-right: 3.5px solid #F59E0B;
    padding: 5px 16px;
    border-radius: 6px;
    text-transform: uppercase;
}

.bsmb-g-credits-grid,
.credits-role-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.bsmb-g-credits-card,
.credits-role-card {
    background: rgba(28, 16, 10, 0.9);
    border: 1px solid rgba(251, 191, 36, 0.32);
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
}

.bsmb-g-credits-card.bsmb-g-credits-founder,
.credits-role-card.credits-card-founder {
    border-color: rgba(56, 189, 248, 0.65);
    background: linear-gradient(135deg, rgba(12, 30, 46, 0.94), rgba(28, 18, 12, 0.92));
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.16);
}

.bsmb-g-credits-card.bsmb-g-credits-wide,
.credits-role-card.credits-card-wide {
    grid-column: 1 / -1;
    border-color: rgba(251, 191, 36, 0.72);
    background: linear-gradient(135deg, rgba(52, 32, 10, 0.95), rgba(28, 16, 10, 0.95));
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.2);
}

.bsmb-g-credits-role,
.credits-role-title {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.8px;
    color: #38BDF8;
    text-transform: uppercase;
}

.bsmb-g-credits-card.bsmb-g-credits-wide .bsmb-g-credits-role,
.credits-role-card.credits-card-wide .credits-role-title {
    color: #FDE047;
}

.bsmb-g-credits-name,
.credits-role-name {
    font-size: 13.5px;
    font-weight: 900;
    color: #FFFFFF;
    margin-top: 3px;
}

.bsmb-g-credits-card.bsmb-g-credits-wide .bsmb-g-credits-name,
.credits-role-card.credits-card-wide .credits-role-name {
    color: #FEF9C3;
    font-size: 14px;
}

.bsmb-g-credits-desc,
.credits-role-desc {
    font-size: 11px;
    color: #FDE68A;
    opacity: 0.9;
    margin-top: 3px;
    line-height: 1.4;
}

/* OST Tracklist */
.credits-ost-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    text-align: left;
}

.credits-ost-item {
    background: rgba(24, 14, 8, 0.9);
    border-left: 3.5px solid #F59E0B;
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 10.5px;
    color: #FEF3C7;
    line-height: 1.35;
}

.credits-ost-item.subscene {
    border-left-color: #38BDF8;
}

.credits-ost-item b {
    color: #FDE047;
    display: block;
    font-size: 11px;
    margin-bottom: 2px;
}

/* Bill Universe Ecosystem Strip */
.credits-universe-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    width: 100%;
}

.credits-uni-pill {
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(28, 16, 10, 0.92);
    border: 1.5px solid rgba(251, 191, 36, 0.45);
    color: #FEF3C7;
    font-size: 11px;
    font-weight: 800;
}

.credits-uni-pill.active-game {
    background: linear-gradient(135deg, #FDE047 0%, #F59E0B 100%);
    color: #1C1008;
    border-color: #FFFBEB;
    font-weight: 900;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

/* Finale Quote Card */
.credits-finale-card {
    margin-top: 4px;
    padding: 14px 18px;
    border: 2px solid #FDE047;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.25) 0%, rgba(24, 12, 6, 0.95) 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    width: 100%;
}

.credits-finale-quote {
    font-size: 13px;
    font-weight: 800;
    color: #FFFBEB;
    line-height: 1.48;
    margin: 0 0 6px;
}

.credits-finale-ver {
    font-size: 10.5px;
    font-weight: 900;
    color: #FDE047;
    letter-spacing: 0.9px;
}

@media screen and (max-width: 640px) {
    .bsmb-g-credits-grid,
    .credits-role-grid,
    .credits-ost-list {
        grid-template-columns: 1fr;
    }
    .credits-dossier-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}


