/* =========================================================================
   1. GLOBAL SYSTEM SETTINGS
   ========================================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; 
}

body {
    background-color: #0c0c0c; 
    color: #E5E5E5;
    font-family: 'Courier New', 'Noto Sans Bengali', Courier, monospace;
    height: 100vh;
    height: 100dvh; 
    width: 100vw;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: manipulation;
    position: fixed;
}

/* PREMIUM AUTOMATIC TYPOGRAPHY OPTIMIZATION CONTROLLER FOR BENGALI */
:lang(bn), .bangla-font-active {
    font-family: 'Noto Sans Bengali', sans-serif !important;
}

:lang(bn) .brand-main, .bangla-font-active .brand-main,
:lang(bn) .boot-logo, .bangla-font-active .boot-logo {
    letter-spacing: normal !important; 
    font-weight: 700;
}

/* Explicit text elements text-spacing resets to avoid touching block layouts or moving grids */
.bangla-font-active .text-button,
.bangla-font-active .choice-btn,
.bangla-font-active .toggle-btn,
.bangla-font-active .warning-btn,
.bangla-font-active p,
.bangla-font-active span,
.bangla-font-active div:not(.screen):not(.menu-container):not(.settings-box),
.bangla-font-active .highlight-text,
.bangla-font-active .card-label {
    letter-spacing: normal !important; 
    word-spacing: normal !important;
    line-height: 1.5 !important;      
}

/* =========================================================================
   2. SCREEN STATE CONTROLLER
   ========================================================================= */
.screen {
    width: 100%;
    max-width: 600px;
    height: 100%;
    padding: clamp(15px, 5vw, 30px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: screen-fade 0.4s ease-out forwards;
}

@keyframes screen-fade {
    from { opacity: 0; transform: scale(0.99); }
    to { opacity: 1; transform: scale(1); }
}

.hidden {
    display: none !important;
}

/* =========================================================================
   3. STAGE 0: REBOOT HARDWARE OVERLAY SCREEN
   ========================================================================= */
.boot-container {
    width: 100%;
    text-align: center;
    padding: 20px;
}

.boot-logo {
    font-size: clamp(32px, 7vw, 56px);
    letter-spacing: 12px;
    margin-bottom: 5px;
    color: #E5E5E5;
    text-shadow: 0 0 15px rgba(212,175,55,0.2);
}

.boot-version {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 4px;
    color: #555;
    margin-bottom: 40px;
}

.progress-wrapper {
    width: 100%;
    height: 2px;
    background-color: #1a1a1a;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #D4AF37;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px #D4AF37;
}

.boot-status-box {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    letter-spacing: 2px;
    color: #666;
    height: 20px;
}

/* =========================================================================
   4. STAGE 1: BRUTALIST MAIN VIEWPORT NAVIGATION LAYOUT
   ========================================================================= */
.menu-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.game-branding {
    text-align: center;
    margin-bottom: clamp(40px, 10vw, 80px);
}

.brand-main {
    font-size: clamp(40px, 9vw, 68px);
    font-weight: bold;
    letter-spacing: 14px;
    color: #E5E5E5;
    margin: 0 0 15px 0;
    text-shadow: 0 0 18px rgba(212, 175, 55, 0.35);
}

.brand-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(212,175,55,0) 0%, rgba(212,175,55,0.6) 50%, rgba(212,175,55,0) 100%);
    width: 80%;
    margin: 0 auto 15px auto;
}

.brand-sub-container {
    font-family: 'Courier New', monospace;
    font-size: clamp(12px, 3.5vw, 14px);
    letter-spacing: 3px;
    color: #888888;
    min-height: 24px;
}

.highlight-text {
    color: #E5E5E5;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 3.5vw, 22px);
    align-items: center;
}

.text-button {
    background: none;
    border: none;
    color: #888888;
    font-family: 'Courier New', monospace;
    font-size: clamp(14px, 4vw, 17px);
    letter-spacing: 5px;
    cursor: pointer;
    padding: 5px 10px;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.text-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background-color: #D4AF37;
    transition: all 0.3s ease;
}

.text-button:hover {
    color: #D4AF37;
    transform: translateY(-1px);
    text-shadow: 0 0 8px rgba(212,175,55,0.4);
}

.text-button:hover::after {
    width: 100%;
    left: 0;
}

/* =========================================================================
   5. UTILITY VIEWPORTS: STRUCTURE SETTINGS & CHANGELOG INTERFACES
   ========================================================================= */
.top-navigation-bar {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    margin-bottom: 30px;
}

.back-button {
    background: none;
    border: 1px solid #222;
    color: #666;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 2px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    border-color: #D4AF37;
    color: #D4AF37;
}

h2 {
    font-size: 24px;
    letter-spacing: 6px;
    color: #E5E5E5;
    margin-bottom: 40px;
    text-align: center;
    width: 100%;
}

.settings-box {
    width: 100%;
    background-color: #111111;
    border: 1px solid #1a1a1a;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.setting-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-label {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    letter-spacing: 3px;
    color: #888;
}

.brutalist-toggle {
    display: flex;
    border: 1px solid #333;
    background-color: #0c0c0c;
    padding: 2px;
}

.toggle-btn {
    background: none;
    border: none;
    color: #555;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 2px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background-color: #D4AF37;
    color: #0c0c0c;
    font-weight: bold;
}

.changelog-container {
    max-height: 60vh;                 
    overflow-y: auto;                 
    padding-right: 12px;
    margin-top: 20px;
    scrollbar-width: thin;
    scrollbar-color: #D4AF37 #121212;
    -webkit-overflow-scrolling: touch; 
}

.changelog-container::-webkit-scrollbar {
    width: 6px;
}

.changelog-container::-webkit-scrollbar-track {
    background: #121212;
    border-radius: 2px;
}

.changelog-container::-webkit-scrollbar-thumb {
    background-color: #D4AF37;
    border-radius: 2px;
}

.changelog-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 18px; 
}

.changelog-list li {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #A5A5A5;
    border-left: 2px solid #222;
    padding-left: 15px;
    transition: border-color 0.3s ease;
}

.changelog-list li:hover {
    border-left-color: #D4AF37; 
}

.version-tag {
    color: #D4AF37;
    font-weight: bold;
    display: inline-block;
    width: 55px; 
}

.changelog-list li.latest-version {
    border-left-color: #D4AF37 !important; 
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.04) 0%, rgba(0, 0, 0, 0) 100%);
}

.tutorial-container {
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    scrollbar-width: thin;
    scrollbar-color: #444 #111;
}

.tutorial-container::-webkit-scrollbar { width: 4px; }
.tutorial-container::-webkit-scrollbar-track { background: #111; }
.tutorial-container::-webkit-scrollbar-thumb { background: #444; }

.tutorial-section {
    border-left: 1px solid #222;
    padding-left: 20px;
}

.tutorial-tag {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 3px;
    color: #D4AF37;
    display: block;
    margin-bottom: 8px;
}

.tutorial-container p {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #999;
}

/* =========================================================================
   6. PRE-BIRTH FLOW CHARACTER SELECTION OVERHAUL (RESTORED HOVERS & SPACING)
   ========================================================================= */
.intro-narrative-box {
    text-align: center;
    color: #E5E5E5;
    font-size: clamp(13px, 4.2vw, 15px);
    line-height: 1.8;
    max-width: 480px;
    margin: 0 auto;
    white-space: pre-line; 
}

.choice-buttons-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;              
    width: 100%;
    max-width: 340px;       
    margin: 30px auto 0 auto;
}

.choice-btn {
    background-color: #0c0c0c;
    border: 1px solid #252525;
    padding: 18px 20px;     
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.choice-btn:not(.active):hover {
    border-color: #D4AF37;
    background-color: #121212;
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.choice-btn.active {
    border-color: #D4AF37 !important;
    background-color: #1c180e !important;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3) !important;
    transform: none !important;
    cursor: default;
}

.card-label {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    letter-spacing: 3px;
    color: #A5A5A5;
    font-weight: bold;
    transition: color 0.2s ease;
}

.choice-btn:hover .card-label,
.choice-btn.active .card-label {
    color: #D4AF37;
}

.action-confirmation-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 35px;
}

.confirm-action-btn {
    background-color: #D4AF37;
    border: 1px solid #D4AF37;
    color: #0c0c0c;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 4px;
    padding: 16px 48px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(212,175,55,0.15);
    transition: all 0.3s ease;
}

.confirm-action-btn:hover {
    background-color: #e5be43;
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(212,175,55,0.25);
}

/* =========================================================================
   7. STAGE 3: EXPERIMENTAL RUNTIME GAMEPLAY MONITOR VIEWPORT
   ========================================================================= */
.sandbox-gameplay-viewport {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.sandbox-header {
    font-size: 14px;
    letter-spacing: 4px;
    color: #555;
    margin-bottom: 20px;
    text-align: left;
}

.sandbox-log-box {
    flex-grow: 1;
    background-color: #050505;
    border: 1px solid #111;
    border-radius: 4px;
    padding: 25px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.8;
    color: #666;
    overflow-y: auto;
}

/* =========================================================================
   8. CINEMATIC SCROLLER ANIMATION LAYER
   ========================================================================= */
.transition-viewport-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #0c0c0c;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.25, 1, 0.3, 1);
}

.birth-card-scroller {
    position: absolute;
    font-family: 'Courier New', monospace;
    font-size: clamp(48px, 12vw, 96px);
    font-weight: bold;
    letter-spacing: 16px;
    color: #161616;
    text-transform: uppercase;
    opacity: 0;
    width: 100%;
    text-align: center;
}

.animate-born-exit {
    animation: born-exit-trigger 2.6s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

.animate-age-enter {
    animation: age-enter-trigger 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes born-exit-trigger {
    0% { transform: scale(0.7) translateY(60px); color: #161616; opacity: 0; }
    15% { transform: scale(1.0) translateY(0px); color: #E5E5E5; opacity: 1; }
    80% { transform: scale(1.0) translateY(0px); color: #E5E5E5; opacity: 1; filter: blur(0px); }
    100% { transform: scale(1.3) translateY(-120px); color: #D4AF37; opacity: 0; filter: blur(8px); }
}

@keyframes age-enter-trigger {
    0% { transform: scale(0.8) translateY(80px); color: #161616; opacity: 0; filter: blur(4px); }
    25% { transform: scale(1.0) translateY(0px); color: #D4AF37; opacity: 1; filter: blur(0px); text-shadow: 0 0 25px rgba(212,175,55,0.4); }
    80% { transform: scale(1.0) translateY(0px); color: #D4AF37; opacity: 1; filter: blur(0px); }
    100% { transform: scale(1.05); color: #E5E5E5; opacity: 0; }
}

/* =========================================================================
   9. MEMORY SYSTEM ALERT WARNING MODAL OVERLAYS
   ========================================================================= */
.warning-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(6, 6, 6, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.warning-modal-box {
    background-color: #0f0f0f;
    border: 1px solid #ea4335;
    width: 100%;
    max-width: 460px;
    padding: clamp(20px, 6vw, 35px);
    box-shadow: 0 10px 40px rgba(234,67,53,0.12);
    animation: modal-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modal-slide-up {
    from { opacity: 0; transform: translateY(15px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.warning-title {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    letter-spacing: 4px;
    color: #ea4335;
    margin-bottom: 20px;
    font-weight: bold;
}

.warning-text {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #999999;
    margin-bottom: 30px;
}

.warning-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.warning-btn {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 2px;
    padding: 12px 24px;
    cursor: pointer;
    background: none;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.warning-btn-cancel {
    border: 1px solid #333;
    color: #666;
}

.warning-btn-cancel:hover {
    border-color: #555;
    color: #a5a5a5;
}

.warning-btn-confirm {
    border: 1px solid #ea4335;
    color: #ea4335;
    background-color: rgba(234,67,53,0.03);
}

.warning-btn-confirm:hover {
    background-color: #ea4335;
    color: #0c0c0c;
    box-shadow: 0 0 15px rgba(234,67,53,0.3);
}