
    @import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
    @import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
    @import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;700&display=swap');
    @import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

    body.welcome-active .site-footer {
        display: none;
    }

    :root {
        font-family: 'VT323', Consolas, 'Courier New', monospace;

    /* All dark theme variables are now the default */
    --theme-bg-primary: #000000;
    --theme-bg-container: #131722;
    --theme-bg-section: #1e222d;
    --theme-bg-priceinfo: #2a2e39;
    --theme-bg-table-header: #2a2e39;
    --theme-bg-table-row-even: #1e222d;
    --theme-bg-table-footer: #2a2e39;

    --theme-text-primary: #d1d4dc;
    --theme-text-secondary: #8c98a9;
    --theme-text-header: #FDB000; /* Use your preferred orange */
    --theme-text-header-alt: #ffc107; /* Lighter orange */
    --theme-text-button: #000000;
    --theme-text-table-header: #FDB000;
    --theme-text-table-footer: #d1d4dc;
    --theme-text-priceinfo: #d1d4dc;
    --theme-text-status: #ffc107;

    --theme-border-header: #FDB000;
    --theme-border-section: #434651;
    --theme-border-input: #434651;
    --theme-border-input-focus: #FDB000;
    --theme-box-shadow-input-focus: rgba(253, 176, 0, 0.4);
    --theme-accent-priceinfo: #FDB000;

    --theme-button-primary-bg: #FDB000;
    --theme-button-primary-hover-bg: #ffc107;
    --theme-button-results-bg: #563d7c;
    --theme-button-results-hover-bg: #463064;
    --theme-button-results-text: #ffffff;
    --weight-warning-color: #ff5252;
    }

    /* --- Ticker Tape Styles --- */
    #scrolling-ticker-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background-color: #000000; /* Classic black background */
        border-bottom: 2px solid #333;
        z-index: 1100; /* Ensure it's above other content */
        overflow: hidden;
        white-space: nowrap;
    }

    #scrolling-ticker-content {
        display: inline-block;
        /* The animation will be applied here by JavaScript */
    }

    /* Keyframes for the scrolling animation */
    @keyframes scroll-left {
        0% {
            transform: translateX(0%);
        }
        100% {
            transform: translateX(-50%); /* Moves left by the width of the first set of content */
        }
    }

    /* Styling for each individual stock item in the ticker */
    .ticker-item {
        font-family: 'Press Start 2P', 'Courier New', monospace; /* Use the new blocky font */
        font-size: 1rem; /* This font looks better at a slightly smaller base size */
        padding: 10px 15px;
        display: inline-block;
        border-right: 1px solid #333;
        letter-spacing: 2px; /* Increase spacing for a more authentic ticker feel */
        text-transform: uppercase; /* Tickers are almost always uppercase */
    
        /* --- CSS for the "LED Bulb" effect --- */
        image-rendering: pixelated; /* Forces the browser to render sharp pixels, not smooth blurs */
        -webkit-font-smoothing: none; /* Disables font smoothing in WebKit browsers (Chrome, Safari) */
        -moz-osx-font-smoothing: grayscale; /* Disables font smoothing in Firefox */
    }

    /* Colors and glow effects based on stock performance */
    .ticker-up {
        color: #00ff41; /* Bright green */
        text-shadow: 0 0 5px rgba(0, 255, 65, 0.7);
    }

    .ticker-down {
        color: #ff3b30; /* Bright red */
        text-shadow: 0 0 5px rgba(255, 59, 48, 0.7);
    }

    .ticker-neutral {
        color: #ff9500; /* Amber/orange */
        text-shadow: 0 0 5px rgba(255, 149, 0, 0.7);
    }

    body.theme-brand {
        --theme-bg-primary: #eef1f5; 
        --theme-bg-container: #ffffff; 
        --theme-bg-section: #ffffff;
        --theme-bg-priceinfo: #fff9f0; 
        --theme-bg-table-header: #000000; 
        --theme-bg-table-row-even: #f0f2f5; 
        --theme-bg-table-footer: #e9ecef; 
        --theme-page-bg-modal-active: #fea400;
        
        --theme-text-primary: #212529; 
        --theme-text-secondary: #495057;
        --theme-text-header: #fea400; 
        --theme-text-header-alt: #fb9a00; 
        --theme-text-button: #FFFFFF; 
        --theme-text-table-header: #fea400; 
        --theme-text-table-footer: #000000; 
        --theme-text-priceinfo: #c77c00; 
        --theme-text-status: #fb9a00; 
        
        --theme-border-header: #fb9a00; 
        --theme-border-section: #dee2e6;
        --theme-border-input: #ced4da; 
        --theme-border-input-focus: #fea400; 
        --theme-box-shadow-input-focus: rgba(254, 164, 0, .25);
        --theme-accent-priceinfo: #fb9a00; 
        
        --theme-button-primary-bg: #fea400; 
        --theme-button-primary-hover-bg: #e09300; 
        --theme-button-results-bg: #563d7c; 
        --theme-button-results-hover-bg: #463064; 
        --theme-button-results-text: #ffffff;
        --weight-warning-color: #dc3545; 
        }

    body.theme-light-cyan {
        --theme-page-bg-modal-active: #00D4F8;
        --theme-bg-primary: #F9FAFB; 
        --theme-bg-container: #FFFFFF; 
        --theme-bg-section: #FFFFFF;
        --theme-bg-priceinfo: #e0f7fa; 
        --theme-bg-table-header: #00D4F8;    
        --theme-bg-table-row-even: #f1f9fc;  
        --theme-bg-table-footer: #d6f0f5;    
        --theme-text-primary: #333333;       
        --theme-text-secondary: #555e68;     
        --theme-text-header: #00B3D4; 
        --theme-text-header-alt: #00C4E6;    
        --theme-text-button: #FFFFFF;        
        --theme-text-table-header: #FFFFFF;  
        --theme-text-table-footer: #007A8C; 
        --theme-text-priceinfo: #007A8C;     
        --theme-text-status: #00D4F8;
        --theme-border-header: #00D4F8; 
        --theme-border-section: #e0f0f2;     
        --theme-border-input: #a0e0eb; 
        --theme-border-input-focus: #00D4F8; 
        --theme-box-shadow-input-focus: rgba(0, 212, 248, .25); 
        --theme-accent-priceinfo: #00D4F8;   
        --theme-button-primary-bg: #00D4F8;         
        --theme-button-primary-hover-bg: #00b3d4; 
    }
    
    /* --- New Designer Theme --- */
    body.theme-designer {
        font-family: "Poppins", sans-serif;
        
        --theme-bg-primary: #eef1f5;
        --theme-bg-container: #ffffff;
        --theme-bg-section: #ffffff;
        --theme-bg-priceinfo: #e4e6f7;
        --theme-bg-table-header: #000000;
        --theme-bg-table-row-even: #f0f2f5;
        --theme-bg-table-footer: #e9ecef;
        
        --theme-text-primary: #212529;
        --theme-text-secondary: #495057;
        --theme-text-header: #131313;
        --theme-text-header-alt: #131313;
        --theme-text-button: #FFFFFF;
        --theme-text-table-header: #ffffff;
        --theme-text-table-footer: #000000;
        --theme-text-priceinfo: #2D3ECE;
        --theme-text-status: #2D3ECE;
        
        --theme-border-header: #131313;
        --theme-border-section: #dee2e6;
        --theme-border-input: #ced4da;
        --theme-border-input-focus: #2D3ECE;
        --theme-box-shadow-input-focus: rgba(45, 62, 206, 0.25);
        --theme-accent-priceinfo: #2D3ECE;
        
        --theme-button-primary-bg: #2D3ECE;
        --theme-button-primary-hover-bg: #2534a3;
    }

    body { 
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
        margin: 0; padding: 0; 
        line-height: 1.6; 
        background-color: var(--theme-bg-primary); 
        color: var(--theme-text-primary); 
        transition: background-color 0.3s, color 0.3s; 
        -webkit-font-smoothing: antialiased; 
        -moz-osx-font-smoothing: grayscale;
    }

    

    #mainAppContainer {
        display: none;
        margin-top: 50px;
    }

    .container { 
        max-width: 1200px; 
        margin: 20px auto; 
        padding: 20px; 
        background-color: var(--theme-bg-container); 
        border-radius: 10px; 
        box-shadow: 0 5px 20px rgba(0,0,0,0.07); 
    }

    .logo-container { text-align: center; margin-bottom: 20px; }
    #gameLogo, #mainGameLogo { width: 240px; max-width: 100%; height: auto; display: block; margin: auto; }

    h2 { color: var(--theme-text-header); border-bottom: 2px solid var(--theme-border-header); padding-bottom: 10px; margin-top: 25px; margin-bottom: 20px; font-weight: 600; font-size: 1.75rem; }
    h3 { color: var(--theme-text-header-alt); margin-top: 0; margin-bottom: 18px; font-weight: 600; font-size: 1.3rem; }
    h4 { color: var(--theme-text-header-alt); margin-top: 0; margin-bottom: 18px; font-weight: 600; font-size: 1.1rem; }
    label { display: block; margin-bottom: 5px; font-weight: 500; color: var(--theme-text-secondary); font-size: 0.9rem; }
    select, input[type="text"], input[type="number"], input[type="date"] { margin-bottom: 15px; padding: 10px; border-radius: 6px; border: 1px solid var(--theme-border-input); font-size: 0.95rem; width: 100%; box-sizing: border-box; color: var(--theme-text-primary); background-color: var(--theme-bg-container); transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; }
    select:focus, input:focus { border-color: var(--theme-border-input-focus); outline: 0; box-shadow: 0 0 0 0.2rem var(--theme-box-shadow-input-focus); }
    button { padding: 10px 18px; background-color: var(--theme-button-primary-bg); color: var(--theme-text-button); cursor: pointer; border: none; border-radius: 6px; transition: background-color 0.2s ease, transform 0.1s ease; font-size: 0.95rem; font-weight: 500; margin-right:8px; margin-top: 5px; }
    button:hover { background-color: var(--theme-button-primary-hover-bg); transform: translateY(-1px); }
    button:disabled { background-color: #adb5bd; cursor: not-allowed; color: #e9ecef; transform: translateY(0); }
    button#viewPerformanceButton { background-color: var(--theme-button-results-bg) !important; color: var(--theme-button-results-text) !important; }
    button#viewPerformanceButton:hover { background-color: var(--theme-button-results-hover-bg) !important; }

    .theme-switcher { text-align: right; margin-bottom: 15px; padding-right: 10px; }
    .theme-switcher button { font-size: 0.75rem; padding: 4px 8px; margin-top: 5px; margin-right: 0; margin-left: 5px; }

    .admin-controls { text-align: center; margin-bottom: 20px; padding: 10px; background-color: #fff3cd; border: 1px solid #ffeeba; border-radius: 5px; }
    .admin-controls button { background-color: #dc3545; color: white; border-color: #dc3545; }
    .admin-controls button:hover { background-color: #c82333; }
    .admin-controls p { font-size: 0.8em; color: #721c24; margin-top: 5px; }
    
    #scrolling-ticker-container { position: fixed; top: 0; left: 0; width: 100%; background-color: #000000; border-bottom: 2px solid #333; z-index: 1100; overflow: hidden; white-space: nowrap; }
    #scrolling-ticker-content { display: inline-block; }
    @keyframes scroll-left { 0% { transform: translateX(0%); } 100% { transform: translateX(-50%); } }
    .ticker-item { font-family: 'VT323', Consolas, 'Courier New', monospace; font-size: 1.2rem; padding: 8px 15px; display: inline-block; border-right: 1px solid #333; letter-spacing: 1px; }
    .ticker-up { color: #00ff41; } .ticker-down { color: #ff3b30; } .ticker-neutral { color: #ff9500; }
    
    .section { margin-bottom: 20px; padding: 15px; background-color: var(--theme-bg-section); border: 1px solid var(--theme-border-section); border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
    .input-group div { margin-bottom: 10px; } 

    .top-info-columns { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; align-items: stretch; }
    .budget-column, .stock-select-column { flex: 1; min-width: 280px; display: flex; flex-direction: column; }
    .budget-column .section, .stock-select-column .section { width: 100%; box-sizing: border-box; flex-grow: 1; }
    
    #priceInfo { margin-top: 8px; margin-bottom:12px; padding: 8px 10px; background-color: var(--theme-bg-priceinfo); border-left: 4px solid var(--theme-accent-priceinfo); min-height: auto; border-radius: 4px; color: var(--theme-text-priceinfo); font-size: 0.8rem; }
    .budget-info div { margin-bottom: 6px; font-size: 1rem; } 
    .budget-info span { font-weight: 600; color: var(--theme-text-header-alt); } 
    #stockCountDisplayContainer { margin-top:10px; font-size:0.9em; color: var(--theme-text-secondary); } 
    .stock-count-valid { color: var(--positive-text, green); font-weight: bold; }
    .stock-count-invalid { color: var(--negative-text, red); font-weight: bold; }
    
    .suggestions-list { position: absolute; z-index: 100; width: 100%; max-height: 200px; overflow-y: auto; border: 1px solid var(--theme-border-input); border-top: none; background-color: var(--theme-bg-container); box-shadow: 0 4px 8px rgba(0,0,0,0.1); text-align: left; }
    .suggestions-list div.suggestion-item { padding: 8px 12px; cursor: pointer; font-size: 0.85rem; }
    .suggestions-list div.suggestion-item:hover { background-color: var(--theme-bg-table-row-even); }
    .suggestions-list div.suggestion-item.no-match { cursor: default; color: var(--theme-text-secondary); }

    .table-container { width: 100%; overflow-x: auto; margin-top: 10px; border: 1px solid var(--theme-border-section); border-radius: 6px; }
    table { border-collapse: collapse; width: 100%; }
    th, td { border: 1px solid var(--theme-border-section); padding: 8px 10px; text-align: left; font-size: 0.8rem; vertical-align: middle; } 
    th { background-color: var(--theme-bg-table-header); color: var(--theme-text-table-header); font-weight: 600; white-space: nowrap; }
    tbody tr:nth-child(even) { background-color: var(--theme-bg-table-row-even); }
    .text-right { text-align: right !important; } .text-center { text-align: center !important; }
    .positive-return { background-color: #d1e7dd !important; } .positive-return td { color: #0f5132 !important; }
    .negative-return { background-color: #f8d7da !important; } .negative-return td { color: #721c24 !important; }
    .positive-text { color: #198754 !important; } .negative-text { color: #dc3545 !important; } 
    .weight-warning { color: var(--weight-warning-color) !important; font-weight: bold !important; } 
    tfoot tr.totals-row { background-color: var(--theme-bg-table-footer); font-weight: bold; }
    
    #submissionControls { margin-top: 25px; border-top: 1px solid var(--theme-border-medium); padding-top: 25px; text-align: center; }
    #submissionStatus { margin-top:15px; font-weight: 500; color: var(--theme-text-status); font-size: 1.05em; }
    
    .action-btn { font-size: 0.7rem; padding: 2px 5px; margin: 0 1px; } 
    .update-btn { background-color: var(--theme-button-primary-bg); border: 1px solid transparent; color: var(--theme-text-button);} 
    .update-btn:hover { background-color: var(--theme-button-primary-hover-bg); }
    .remove-btn { background-color: #e74c3c; border-color: #e74c3c; color: white; } 
    .remove-btn:hover { background-color: #c0392b; }
    .qty-input { font-size: 0.8rem; padding: 2px 4px !important; text-align: right; border: 1px solid var(--theme-border-input) !important; width: 50px !important; } 

    .modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); }
    .modal-content { background-color: var(--theme-bg-container); margin: 10vh auto; padding: 25px; border: 1px solid var(--theme-border-section); width: 90%; border-radius: 8px; }
    .close-button { color: var(--theme-text-secondary); float: right; font-size: 28px; font-weight: bold; line-height: 0.7; cursor: pointer; }
    
    #startupModal { background-color: transparent; backdrop-filter: none; display: flex; align-items: center; justify-content: center; }
    
    .admin-controls button, .theme-switcher button {
    font-size: 0.7rem;
    padding: 3px 7px;
    }

    #stockDetailModal .modal-content { max-height: 85vh; overflow-y: auto; }
    .stock-detail-header { display: flex; align-items: center; margin-bottom: 10px; }
    #stockDetailLogo { width: 50px; height: 50px; margin-right: 15px; border: 1px solid var(--theme-border-input); border-radius: 4px; background-color: white; object-fit: contain; display: none; }
    #stockDetailModal hr { border: 0; height: 1px; background-color: var(--theme-border-section); margin: 10px 0; }
    .price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 15px; margin-top: 5px; }
    .price-grid div { background-color: var(--theme-bg-table-row-even); padding: 4px 8px; border-radius: 4px; font-size: 0.9em; }
    .chart-container { position: relative; height: 250px; width: 100%; margin-top: 15px; }
    #stockDetailDescription { font-size: 0.8em; max-height: 90px; overflow-y: auto; background-color: var(--theme-bg-table-row-even); padding: 8px; border-radius: 4px; margin-top: 5px; }
    .stock-detail-actions { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--theme-border-section); display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap; }
    .action-price-info { display: flex; align-items: center; gap: 8px; }
    .action-buttons { display: flex; align-items: center; gap: 10px; }
    .stock-detail-actions input[type="number"]#modalStockQuantity { width: 70px; margin: 0; }
    button.cancel-btn { background-color: var(--theme-text-secondary) !important; }
    button.cancel-btn:hover { background-color: #5a6268 !important; }

    @media (max-width: 860px) { 
        .top-info-columns, .results-area-columns { flex-direction: column; }
        .budget-column, .stock-select-column, .results-column-left, .results-column-right { flex: 1 1 100%; min-width: auto; width: 100%; }
        select, input[type="text"], input[type="number"], input[type="date"] { max-width: none; }
        .theme-switcher { text-align: center; margin-top: 10px; }
        th, td { font-size: 0.75rem; padding: 4px 6px;}
        #portfolioTable th,
        #portfolioTable td {
            text-align: center;
        } 
        .action-btn { font-size: 0.65rem; padding: 2px 3px; }
        .qty-input { width: 40px !important; font-size: 0.75rem; }
        .modal-content { width: 95%; margin: 5vh auto; max-height: 90vh;} 
        #stockBrowserModal #modalStockList, #stockDetailModal #stockDetailDescription { max-height: 50vh; }
    }

    #joinGameSection {
    border-top: 1px solid var(--theme-border-section);
    margin-top: 25px;
    padding-top: 20px;
    }

    #joinGameSection h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--theme-text-secondary);
    }

    #activeGamesList {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--theme-border-input);
    border-radius: 6px;
    }

    .joinable-game-item {
    padding: 8px 12px;
    cursor: pointer;
    text-align: left;
    border-bottom: 1px solid var(--theme-border-section);
    font-size: 0.9rem;
    }

    .joinable-game-item:hover {
    background-color: var(--theme-bg-table-row-even);
    }

    .joinable-game-item:last-child {
    border-bottom: none;
    }

    .joinable-game-item-none {
    padding: 8px 12px;
    text-align: left;
    color: var(--theme-text-secondary);
    font-style: italic;
    }


.input-group {
    margin-bottom: 15px;
}
.input-group:last-child {
    margin-bottom: 0;
}


    /* --- Footer Styles --- */
    .site-footer {
        background-color: var(--theme-bg-container);
        color: var(--theme-text-secondary);
        padding: 20px 0;
        margin-top: 40px;
        border-top: 1px solid var(--theme-border-section);
        font-size: 0.9rem;
    }
    .footer-content {
        max-width: 1200px;
        margin: auto;
        padding: 0 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 15px;
    }
    .footer-nav a {
        color: var(--theme-text-secondary);
        text-decoration: none;
        margin-left: 20px;
        transition: color 0.2s;
    }
    .footer-nav a:hover {
        color: var(--theme-text-header);
    }

    /* --- Policy Modal Styles --- */
    #policyModal .policy-modal-content {
        max-width: 800px;
    }
    .policy-text-container {
        max-height: 60vh;
        overflow-y: auto;
        margin-top: 15px;
        padding-right: 15px; /* space for the scrollbar */
        line-height: 1.7;
        white-space: pre-wrap; /* Respects newlines from the text file */
    }

    /* --- Policy Document Formatting --- */
    .policy-document h3 {
        font-size: 1.1rem;
        color: var(--theme-text-primary);
        margin-top: 25px;
        margin-bottom: 10px;
        border-bottom: 1px solid var(--theme-border-section);
        padding-bottom: 5px;
    }
    .policy-document p {
        margin-bottom: 15px;
    }
    .policy-document ul {
        margin-left: 20px;
        margin-bottom: 15px;
    }
    .policy-document li {
        margin-bottom: 8px;
    }
    .policy-document .policy-subtitle,
    .policy-document .policy-meta {
        text-align: center;
        color: var(--theme-text-secondary);
        font-size: 0.9rem;
    }
    .policy-document .policy-meta {
        margin-top: -10px;
    }
    .policy-document .notice {
        background-color: var(--theme-bg-priceinfo);
        border-left: 4px solid var(--theme-accent-priceinfo);
        padding: 10px 15px;
        border-radius: 4px;
    }
    .policy-document hr {
        border: 0;
        height: 1px;
        background-color: var(--theme-border-section);
        margin: 20px 0;
    }

    /* --- Policy Document Spacing & Formatting --- */
    .policy-document {
        /* Tightens the spacing between lines *within* a paragraph */
        line-height: 1.45; 
    }

    .policy-document h2 {
        /* Ensures the main title is centered and spaced correctly */
        text-align: center;
        margin-bottom: 5px;
    }

    .policy-document h3 {
        /* Reduces the space *before* a new section heading */
        font-size: 1.1rem;
        color: var(--theme-text-primary);
        margin-top: 20px;
        margin-bottom: 8px; /* Reduced space after the heading */
        border-bottom: 1px solid var(--theme-border-section);
        padding-bottom: 5px;
    }

    .policy-document p,
    .policy-document ul {
        /* Reduces the space *between* paragraphs and entire bulleted lists */
        margin-top: 0;
        margin-bottom: 10px; /* Reduced from 12px */
    }

    .policy-document ul {
        /* Removes extra padding on the side of lists */
        padding-left: 20px;
    }

    .policy-document li {
        /* Reduces the space *between individual bullet points* */
        margin-bottom: 5px; /* Reduced from 8px */
        padding-left: 5px;
    }

    /* --- Styles from the previous response, kept for completeness --- */
    .policy-document .policy-subtitle,
    .policy-document .policy-meta {
        text-align: center;
        color: var(--theme-text-secondary);
        font-size: 0.9rem;
        line-height: 1.4; /* Specific line-height for this meta block */
    }
    .policy-document .policy-meta {
        margin-top: -10px;
        margin-bottom: 15px;
    }
    .policy-document .notice {
        background-color: var(--theme-bg-priceinfo);
        border-left: 4px solid var(--theme-accent-priceinfo);
        padding: 10px 15px;
        border-radius: 4px;
    }
    .policy-document hr {
        border: 0;
        height: 1px;
        background-color: var(--theme-border-section);
        margin: 20px 0;
    }

    /* --- Footer Style (Two-Line Centered Layout) --- */
    .site-footer {
        padding: 15px 0;
        margin-top: 30px;
        background-color: var(--theme-bg-container);
        border-top: 1px solid var(--theme-border-section);
    }

    .footer-content {
        /* This is the key part. It is NOT a flex container. */
        max-width: 1200px;
        margin: auto;
        padding: 0 20px;
        text-align: center; /* This will now work as intended. */
    }

    /* Formatting for Line 1: Copyright Text */
    .copyright-text {
        font-size: 0.85rem;
        color: var(--theme-text-secondary);
        font-weight: 500;
        margin: 0; /* Important: remove default paragraph margins */
    }

    /* Formatting for Line 2: Policy Links */
    .footer-nav {
        margin-top: 8px; /* Creates the space after the <br> would have */
    }

    .footer-nav a {
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--theme-text-header-alt);
        text-decoration: none;
        margin: 0 10px;
        padding-bottom: 2px;
        border-bottom: 1px solid transparent;
        transition: color 0.2s, border-color 0.2s;
    }

    .footer-nav a:hover {
        color: var(--theme-text-header);
        border-bottom-color: var(--theme-text-header);
    }

    /* --- Welcome Page "Trading Terminal" Styles --- */

#welcomePage {
    /* Define theme colors here for easy customization */
    --terminal-accent-color: #FDB000; /* Your new orange/gold color */
    --terminal-glow-color: rgba(253, 176, 0, 0.4); /* Glow derived from accent */
    --terminal-glow-hover-color: rgba(253, 176, 0, 0.7);

    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    box-sizing: border-box;
    background-color: #000000; 
    font-family: 'VT323', Consolas, 'Courier New', monospace;
    display: none; 
}

.welcome-container {
    max-width: 900px;
    width: 100%;
    border: 2px solid var(--terminal-accent-color);
    padding: 2rem 2.5rem;
    box-shadow: 0 0 15px var(--terminal-glow-color), inset 0 0 10px var(--terminal-glow-color);
    background: rgba(10, 10, 10, 0.5);
    text-align: center;
}

/* All text inside will use the accent color with a glow */
#welcomePage h3,
#welcomePage h4,
#welcomePage p,
#welcomePage li,
#welcomePage label,
#welcomePage a {
    color: var(--terminal-accent-color);
    text-shadow: 0 0 5px var(--terminal-glow-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#welcomeLogo {
    max-width: 250px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px var(--terminal-glow-color));
}

.welcome-separator {
    display: none;
}

/* Rules list styling */
.welcome-box ul {
    text-align: left;
    padding-left: 0;
    margin: 15px auto;
    list-style: none;
    min-height: 250px;
}

.welcome-box li {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.welcome-box li::before {
    content: '>';
    margin-right: 10px;
}

/* Consent section styling */
.consent-box {
    text-align: left;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid var(--terminal-accent-color);
}
.consent-item {
    font-size: 1.1rem;
}
.consent-checkbox {
    appearance: none;
    -webkit-appearance: none;
    background-color: transparent;
    width: 1em;
    height: 1em;
    border: 2px solid var(--terminal-accent-color);
    vertical-align: middle;
    margin-right: 10px;
    position: relative;
    cursor: pointer;
}
.consent-checkbox:checked {
    background-color: var(--terminal-accent-color);
    box-shadow: 0 0 8px var(--terminal-glow-hover-color);
}
.policy-link {
    text-decoration: underline;
}

/* "Agree and Continue" button styling */
#agreeAndContinueButton {
    background-color: var(--terminal-accent-color);
    border: 2px solid var(--terminal-accent-color);
    color: #000000; /* Black text for high contrast */
    text-shadow: none; 
    box-shadow: 0 0 10px var(--terminal-glow-color);
    transition: all 0.2s ease-in-out;
}
#agreeAndContinueButton:not(:disabled):hover {
    background-color: #ffc107; /* A brighter version of your color for hover */
    border-color: #ffc107;
    box-shadow: 0 0 20px var(--terminal-glow-hover-color);
    color: #000000;
}
#agreeAndContinueButton:disabled {
    background-color: transparent;
    border-color: #555;
    color: #555;
    text-shadow: none;
    box-shadow: none;
    cursor: not-allowed;
}

/* CSS for the blinking cursor in the typewriter animation */
.typing-cursor {
    display: inline-block;
    width: 10px;
    height: 1.2rem;
    background-color: var(--terminal-accent-color);
    animation: blink 1s step-end infinite;
    box-shadow: 0 0 5px var(--terminal-glow-color);
    vertical-align: bottom;
}

@keyframes blink {
    from, to { background-color: transparent; }
    50% { background-color: var(--terminal-accent-color); }
}

    /* --- Welcome Page: Two-Column Layout --- */

    .welcome-row-1 {
        display: flex;
        gap: 30px; /* Adjust the space between the two columns */
        align-items: stretch; /* Makes both column boxes the same height */
        margin-bottom: 2rem;
    }

    .welcome-column {
        flex: 1; /* Each column takes up equal space */
        display: flex; /* This helps the .welcome-box inside fill the height */
    }

    /* Adjustments for the content inside each column box */
    .welcome-box {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center; /* This vertically centers the content in each box */
    }

    .welcome-box ul {
        text-align: left; /* Ensure the rules list text is left-aligned */
    }

    /* Responsive stacking for smaller screens */
    @media (max-width: 768px) {
        .welcome-row-1 {
            flex-direction: column;
        }
    }

    /* --- Welcome Page UI Refinements --- */

    /* 2. Center consent section text and align checkboxes with labels */
    .consent-box {
        /* The container for the consent items */
        text-align: left; /* Keep the overall block left-aligned */
    }

    .consent-box h4 {
        text-align: center; /* Center just the "Confirm Your Agreement" heading */
        margin-bottom: 20px;
    }

    .consent-item {
        display: flex;       /* This is the key to putting items on the same row */
        align-items: center; /* This vertically aligns the checkbox and the text */
        margin-bottom: 15px; /* Adds nice spacing between each consent line */
    }

    .consent-item label {
        /* Remove any bottom margin from the label that might push it to a new line */
        margin-bottom: 0;
    }

    .consent-checkbox {
        /* Give the checkbox a little space from the text */
        margin-right: 12px; 
        flex-shrink: 0; /* Prevents the checkbox from being squished on small screens */
    }


    /* 3. Style the "Agree and Continue" button for a terminal theme */
    #agreeAndContinueButton {
        display: block; /* Allows margin auto to center the button */
        margin: 2rem auto 0 auto;
        width: 100%;
        max-width: 450px;
        padding: 12px 30px;
        font-family: 'VT323', Consolas, 'Courier New', monospace; /* Use the terminal font */
        font-size: 1.3rem;
        font-weight: bold;
        letter-spacing: 2px;
        color: #000000; /* Black text for high contrast on orange */
        background-color: #ff9500; /* Solid orange background */
        border: 2px solid #ff9500;
        text-shadow: none; /* No glow on the text for readability */
        box-shadow: 0 0 10px rgba(255, 149, 0, 0.5); /* Add the glow to the button itself */
        transition: all 0.2s ease-in-out;
    }

    #agreeAndContinueButton:not(:disabled):hover {
        background-color: #ffad33; /* A brighter orange for hover */
        box-shadow: 0 0 20px rgba(255, 149, 0, 0.8);
        color: #000000;
    }

    #agreeAndContinueButton:disabled {
        background-color: #333;
        border-color: #555;
        color: #555;
        text-shadow: none;
        box-shadow: none;
        cursor: not-allowed;
    }

    /* --- Game Initialization Page Layout (Definitive) --- */
    #initializationPage {
        /* This rule makes the page a full-screen flex container */
        display: none; /* Initially hidden */
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        padding: 20px;
        box-sizing: border-box;
    }

    #initializationPage .modal-startup-content {
        /* This rule makes the main content block a vertical flex container */
        display: flex;
        flex-direction: column; /* This stacks the rows vertically */
        width: 100%;
        max-width: 800px;
        margin: auto;
    }

    #initializationPage .modal-top-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 10px 0;
        margin-bottom: 20px;
        border-top: 1px solid var(--theme-border-section);
        border-bottom: 1px solid var(--theme-border-section);
    }

    #initializationPage .modal-main-columns {
        display: flex;
        gap: 20px;
        width: 100%;
        margin-bottom: 20px;
    }

    #initializationPage .modal-column {
        flex: 1;
    }

    #initializationPage .column-box {
        border: 1px solid var(--theme-border-section);
        padding: 20px;
        border-radius: 8px;
        height: 100%; /* Ensures columns are equal height */
        text-align: left;
        background-color: var(--theme-bg-section);
    }

    #initializationPage .column-box h4 {
        text-align: center;
        margin-top: 0;
        margin-bottom: 20px;
    }

    body.theme-designer .phone-container {
        background: #ffffff;
        overflow: hidden;
        position: relative;
    }

    body.theme-designer .header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        background: white;
    }

    body.theme-designer .logo {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    body.theme-designer .logo-icon {
        width: 32px;
        height: 32px;
        background: #2D3ECE;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 14px;
    }

    body.theme-designer .logo-text {
        font-size: 18px;
        font-weight: 600;
        color: #1F2937;
    }

    body.theme-designer .header-icons {
        display: flex;
        gap: 16px;
    }

    body.theme-designer .icon {
        height: 24px;
        width: 24px; /* Ensure width is also set */
        background: #f5f5f5;
        border-radius: 50%;
        padding: 8px; /* Adjusted padding */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    body.theme-designer .main-content {
        padding: 0 20px;
        background: white;
    }

    body.theme-designer .portfolio-header {
        text-align: center;
        margin-bottom: 8px;
    }

    body.theme-designer .portfolio-title {
        font-size: 16px;
        color: #6B7280;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    body.theme-designer .portfolio-value {
        font-size: 36px;
        font-weight: 700;
        color: #1F2937;
        margin-bottom: 8px;
    }

    body.theme-designer .portfolio-change {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        color: #10B981;
        font-size: 14px;
        margin-bottom: 32px;
    }

    body.theme-designer .balance-section {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 32px;
        background-color: #f5f5f5;
        padding: 10px;
        border-radius: 10px;
    }

    body.theme-designer .balance-info h3 {
        font-size: 14px;
        color: #6B7280;
        margin-bottom: 4px;
    }

    body.theme-designer .balance-amount {
        font-size: 18px;
        font-weight: 600;
        color: #1F2937;
    }

    body.theme-designer .deposit-btn {
        background: var(--theme-button-primary-bg);
        color: white;
        border: none;
        padding: 12px 24px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
    }

    body.theme-designer .dots-btn {
        background: none;
        border: none;
        font-size: 20px;
        color: #6B7280;
        cursor: pointer;
        margin-left: 8px;
    }

    body.theme-designer .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
    }

    body.theme-designer .section-title {
        font-size: 18px;
        font-weight: 600;
        color: #1F2937;
    }

    body.theme-designer .see-more {
        color: var(--theme-button-primary-bg);
        font-size: 14px;
        text-decoration: none;
    }

    body.theme-designer .stock-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 32px;
    }

    body.theme-designer .stock-card {
        background: #F9FAFB;
        border-radius: 12px;
        padding: 16px;
    }

    body.theme-designer .stock-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 12px;
    }

    body.theme-designer .stock-info {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    body.theme-designer .stock-icon {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 12px;
        font-weight: 600;
    }

    body.theme-designer .stock-details h4 {
        font-size: 14px;
        font-weight: 600;
        color: #1F2937;
        margin-bottom: 2px;
    }

    body.theme-designer .stock-details p {
        font-size: 12px;
        color: #6B7280;
    }

    body.theme-designer .more-btn {
        background: none;
        border: none;
        font-size: 16px;
        color: #6B7280;
        cursor: pointer;
    }

    body.theme-designer .stock-value {
        font-size: 18px;
        font-weight: 600;
        color: #1F2937;
        margin-bottom: 4px;
    }

    body.theme-designer .stock-change {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 12px;
    }

    body.theme-designer .positive {
        color: #10B981;
    }

    body.theme-designer .negative {
        color: #EF4444;
    }

    body.theme-designer .recommendation-list {
        margin-bottom: 100px;
    }

    body.theme-designer .recommendation-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 0;
        border-bottom: 1px solid #F3F4F6;
    }

    body.theme-designer .recommendation-item:last-child {
        border-bottom: none;
    }

    body.theme-designer .recommendation-left {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    body.theme-designer .recommendation-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 14px;
        font-weight: 600;
    }

    body.theme-designer .recommendation-details h4 {
        font-size: 14px;
        font-weight: 600;
        color: #1F2937;
        margin-bottom: 2px;
    }

    body.theme-designer .recommendation-details p {
        font-size: 12px;
        color: #6B7280;
    }

    body.theme-designer .recommendation-right {
        text-align: right;
    }

    body.theme-designer .recommendation-price {
        font-size: 16px;
        font-weight: 600;
        color: #1F2937;
        margin-bottom: 4px;
    }

    body.theme-designer .recommendation-change {
        font-size: 12px;
    }

    body.theme-designer .bottom-nav {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 16px 0 32px 0;
        border-top: 1px solid #F3F4F6;
    }

    body.theme-designer .nav-items {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    body.theme-designer .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        text-decoration: none;
        color: #6B7280;
    }

    body.theme-designer .nav-item.active {
        color: #2D3ECE;
    }

    body.theme-designer .nav-icon {
        width: 24px;
        height: 24px;
        border-radius: 4px;
    }

    body.theme-designer .nav-text {
        font-size: 10px;
    }

    body.theme-designer .main-mid {
        background-color: #f5f5f5;
        margin-left: -20px;
        margin-right: -20px;
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
        padding: 20px;
    }

    @media (max-width: 480px) {
        body.theme-designer #mainAppContainer {
            max-width: 100%;
            border-radius: 0;
            border: none;
            box-shadow: none;
        }

        body.theme-designer .stock-grid {
            grid-template-columns: 1fr;
        }

        body.theme-designer .main-content,
        body.theme-designer .main-mid {
            padding-left: 15px;
            padding-right: 15px;
        }

        body.theme-designer .portfolio-value {
            font-size: 30px;
        }

        body.theme-designer .section-title,
        body.theme-designer .balance-amount {
            font-size: 16px;
        }
    }