/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%; height: 100%; overflow: hidden;
    font-family: 'Rajdhani', sans-serif;
    background: #0b1221;
    color: #c8d6e5;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ===== SCANLINE OVERLAY ===== */
#scanlines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(93, 173, 226, 0.015) 3px,
        rgba(93, 173, 226, 0.015) 4px
    );
}

/* ===== SCREENS ===== */
.screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; flex-direction: column; }
.screen.active { display: flex; }

/* ===== MAIN SCREEN ===== */
#screen-main { position: relative; }
#stars-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.home-page { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }

.home-nav { display: flex; justify-content: space-between; align-items: center; padding: 16px 28px; }
.home-nav-logo { font-family: 'Orbitron', sans-serif; font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.8); letter-spacing: 3px; }
.home-nav-right { display: flex; align-items: center; gap: 20px; }
.home-nav-link { font-family: 'Orbitron', sans-serif; font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.7); letter-spacing: 2px; cursor: pointer; text-decoration: none; transition: color 0.2s; }
.home-nav-link:hover { color: #fff; }

.home-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 24px; text-align: center; }

.home-titles { margin-bottom: 20px; transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.home-main.expanded .home-titles { transform: translateY(-50px); }
.home-title { font-family: 'Orbitron', sans-serif; font-size: 58px; font-weight: 800; color: #fff; letter-spacing: 4px; line-height: 1.1; margin-bottom: 6px; text-shadow: 0 0 20px rgba(93, 173, 226, 0.4), 0 0 60px rgba(93, 173, 226, 0.15); }
.home-title-thin { font-family: 'Orbitron', sans-serif; font-size: 58px; font-weight: 400; color: rgba(200, 220, 240, 0.6); letter-spacing: 4px; line-height: 1.1; text-shadow: 0 0 20px rgba(93, 173, 226, 0.3), 0 0 60px rgba(93, 173, 226, 0.1); }

.home-btn-enter { font-family: 'Orbitron', sans-serif; background: transparent; color: rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.25); padding: 12px 48px; font-size: 11px; font-weight: 600; cursor: pointer; letter-spacing: 4px; transition: all 0.3s; margin-top: 24px; }
.home-btn-enter:hover { color: #fff; border-color: #fff; }
.home-btn-enter.hidden { display: none; }
.home-expanded { display: flex; flex-direction: column; align-items: center; margin-top: -30px; }
.home-expanded.hidden { display: none; }
.home-expanded { animation: fadeSlideIn 0.7s ease-out 0.2s both; }
@keyframes fadeSlideIn { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }
.home-sep { width: 40px; height: 2px; background: #5dade2; margin-bottom: 20px; box-shadow: 0 0 10px rgba(93, 173, 226, 0.4); }

.home-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.home-briefing { font-family: 'Rajdhani', sans-serif; font-size: 18px; color: rgba(255,255,255,0.6); line-height: 1.85; font-weight: 500; max-width: 460px; margin-bottom: 40px; }
.home-bold { display: block; margin-top: 12px; color: rgba(255,255,255,0.7); font-weight: 700; font-size: 20px; }

.home-btn-launch { font-family: 'Orbitron', sans-serif; background: transparent; color: #fff; border: 2px solid #fff; padding: 18px 64px; font-size: 14px; font-weight: 700; cursor: pointer; letter-spacing: 4px; transition: all 0.2s; }
.home-btn-launch:hover { background: #fff; color: #000; }
.home-btn-continue { font-family: 'Orbitron', sans-serif; background: transparent; color: rgba(255,255,255,0.5); border: 1px solid rgba(255,255,255,0.3); padding: 12px 48px; font-size: 11px; font-weight: 600; cursor: pointer; letter-spacing: 3px; transition: all 0.2s; margin-top: 12px; }
.home-btn-continue:hover { color: #fff; border-color: #fff; }
.home-btn-continue.hidden { display: none; }

.home-bottom { padding: 20px 24px; text-align: center; }
.home-chevron { display: block; margin: 0 auto; width: 10px; height: 10px; border-right: 1px solid rgba(255,255,255,0.15); border-bottom: 1px solid rgba(255,255,255,0.15); transform: rotate(45deg); animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(45deg); } 50% { transform: translateY(4px) rotate(45deg); } }

/* ===== BUTTONS ===== */
.btn-primary {
    font-family: 'Orbitron', sans-serif;
    background: transparent; color: #5dade2;
    border: 2px solid #5dade2; padding: 14px 40px;
    font-size: 13px; font-weight: 700;
    cursor: pointer; transition: all 0.2s; letter-spacing: 3px;
    text-shadow: 0 0 8px rgba(93, 173, 226, 0.5);
    box-shadow: 0 0 20px rgba(93, 173, 226, 0.15), inset 0 0 20px rgba(93, 173, 226, 0.05);
}
.btn-primary:hover { background: rgba(93, 173, 226, 0.1); box-shadow: 0 0 30px rgba(93, 173, 226, 0.25), inset 0 0 20px rgba(93, 173, 226, 0.08); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
    font-family: 'Rajdhani', sans-serif;
    background: transparent; color: #3a5a7a; border: 1px solid #1a2a40;
    padding: 12px 36px; font-size: 15px; font-weight: 600;
    cursor: pointer; letter-spacing: 2px;
}
.btn-secondary:hover { border-color: #3a5a7a; color: #5dade2; }

.btn-danger {
    color: #e74c3c; border-color: #e74c3c;
    text-shadow: 0 0 8px rgba(231, 76, 60, 0.5);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.15);
}
.btn-danger:hover { background: rgba(231, 76, 60, 0.1); }

/* ===== TUTORIAL ===== */
#tutorial-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.tutorial-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 2rem; position: relative; z-index: 1; }
.tutorial-progress { display: flex; gap: 14px; margin-bottom: 1.5rem; }
.tutorial-progress .dot { width: 12px; height: 12px; background: #1a2a40; border: 1px solid #2a3a50; }
.tutorial-progress .dot.active { background: #5dade2; border-color: #5dade2; box-shadow: 0 0 8px rgba(93, 173, 226, 0.5); }

.tutorial-cards { position: relative; width: 100%; max-width: 540px; height: 200px; }
.tutorial-card {
    position: absolute; top: 0; left: 0; width: 100%; text-align: center;
    opacity: 0; transform: translateX(40px); transition: opacity 0.4s, transform 0.4s; pointer-events: none;
}
.tutorial-card.active { opacity: 1; transform: translateX(0); pointer-events: auto; }
.tutorial-card.exit-left { opacity: 0; transform: translateX(-40px); }

.tutorial-icon { font-family: 'Orbitron', sans-serif; font-size: 18px; color: #5dade2; margin-bottom: 1rem; text-shadow: 0 0 10px rgba(93, 173, 226, 0.3); letter-spacing: 3px; }
.tutorial-card h2 { font-family: 'Orbitron', sans-serif; font-size: 24px; margin-bottom: 0.8rem; color: #ffffff; letter-spacing: 3px; }
.tutorial-card p { font-size: 20px; color: #6a8aaa; line-height: 1.8; padding: 0 0.5rem; }
.tutorial-buttons { display: flex; gap: 1.5rem; margin-top: 0; }

/* ===== ERA 1 INTRO MODAL ===== */
.modal-era1-intro { max-width: 480px; text-align: center; }
.modal-era1-intro h2 { font-size: 22px; letter-spacing: 4px; margin-bottom: 1rem; text-shadow: 0 0 20px rgba(93, 173, 226, 0.4); }
.modal-era1-intro h3 { font-size: 11px; color: #5dade2; letter-spacing: 4px; margin-bottom: 0.25rem; }
.era1-intro-text { margin-bottom: 1.5rem; }
.era1-intro-text p { font-size: 15px; color: #6a8aaa; line-height: 1.8; margin-bottom: 0.8rem; }
.era1-intro-text p:last-child { color: #8ab4d4; font-weight: 600; }

.era1-intro-naming { width: 100%; text-align: center; margin-bottom: 1.5rem; }
.era1-intro-naming label { display: block; font-family: 'Orbitron', sans-serif; font-size: 10px; color: #5dade2; margin-bottom: 0.75rem; letter-spacing: 2px; }
.era1-intro-naming input {
    width: 100%; max-width: 320px; padding: 12px 16px;
    font-family: 'Orbitron', sans-serif; font-size: 13px;
    background: #0a1020; border: 2px solid #1a2a40; color: #ffffff;
    text-align: center; outline: none; text-transform: uppercase; letter-spacing: 2px;
}
.era1-intro-naming input:focus { border-color: #5dade2; box-shadow: 0 0 15px rgba(93, 173, 226, 0.2); }
.era1-intro-naming input::placeholder { color: #1a2a40; }

/* ===== GAMEPLAY SCREEN ===== */
#screen-gameplay { flex-direction: column; }

#gameplay-header {
    display: flex; align-items: center; justify-content: center;
    padding: 8px 16px; background: #0a1020; border-bottom: 1px solid #1a2a40; position: relative;
}
#company-display { font-family: 'Orbitron', sans-serif; font-size: 12px; font-weight: 700; color: #ffffff; letter-spacing: 2px; }
.header-label { font-size: 13px; color: #3a5a7a; margin-left: 10px; letter-spacing: 1px; }
.header-buttons {
    position: absolute; right: 12px; display: flex; gap: 6px; align-items: center;
}
#btn-fullscreen, #btn-pause {
    background: none; border: 1px solid #1a2a40;
    color: #3a5a7a; font-family: 'Orbitron', sans-serif; font-size: 12px;
    cursor: pointer; padding: 3px 8px;
}
#btn-fullscreen:hover, #btn-pause:hover { color: #5dade2; border-color: #5dade2; }
#btn-fullscreen.hidden { display: none; }

/* Stats Bar */
#stats-bar {
    display: flex; justify-content: space-around; padding: 10px 8px;
    background: #080e1a; border-bottom: 1px solid #1a2a40;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-label { font-size: 11px; color: #3a5a7a; text-transform: uppercase; letter-spacing: 2px; font-weight: 600; }
.stat-value { font-family: 'Orbitron', sans-serif; font-size: 16px; font-weight: 700; color: #5dade2; text-shadow: 0 0 6px rgba(93, 173, 226, 0.3); }
.stat-primary .stat-value { font-size: 20px; color: #fff; text-shadow: 0 0 8px rgba(93, 173, 226, 0.5); }

/* Gameplay Body - Side Panel Layout */
#gameplay-body { flex: 1; display: flex; min-height: 0; overflow: hidden; }

#gameplay-left {
    flex: 1; display: flex; flex-direction: column; min-width: 0;
    border-right: 1px solid #1a2a40;
}

/* Finance Bar */
#finance-bar {
    display: flex; justify-content: space-around; padding: 6px 10px;
    background: #080e1a; border-bottom: 1px solid #12202e;
}
.finance-item { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.finance-label { font-size: 11px; color: #3a5a7a; text-transform: uppercase; letter-spacing: 1px; }
.finance-pos { font-family: 'Orbitron', sans-serif; font-size: 13px; font-weight: 600; color: #2ecc71; }
.finance-neg { font-family: 'Orbitron', sans-serif; font-size: 13px; font-weight: 600; color: #e74c3c; }

/* Earth Container */
#earth-container { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; min-height: 0; overflow: hidden; }
#earth-canvas { width: 100%; height: 100%; }
#shell-labels { position: absolute; bottom: 6px; left: 0; width: 100%; display: flex; justify-content: center; gap: 6px; }
.shell-label { font-family: 'Orbitron', sans-serif; font-size: 8px; font-weight: 600; color: #5dade2; background: rgba(6, 10, 18, 0.9); padding: 2px 6px; border: 1px solid #1a2a40; letter-spacing: 1px; }
.shell-label.locked { color: #1a2a40; border-color: #0e1525; }

/* Action Buttons */
#action-buttons { display: flex; gap: 8px; padding: 8px 10px; background: #080e1a; }
.btn-action {
    flex: 1; background: #0c1525; border: 1px solid #1a2a40;
    padding: 12px 8px; cursor: pointer; text-align: center;
    transition: all 0.15s; position: relative; overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.btn-action:hover:not(:disabled) { border-color: #5dade2; box-shadow: 0 0 12px rgba(93, 173, 226, 0.15); }
.btn-action:active:not(:disabled) { transform: scale(0.97); }
.btn-action:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-action-label { display: block; font-family: 'Orbitron', sans-serif; font-size: 11px; font-weight: 700; color: #c8d6e5; letter-spacing: 1px; }
.btn-action-cost, .btn-action-info { display: block; font-size: 13px; color: #3a5a7a; margin-top: 4px; }

.flight-proven { font-family: 'Orbitron', sans-serif; font-size: 9px; font-weight: 600; color: #f39c12; margin-top: 3px; display: block; text-shadow: 0 0 6px rgba(243, 156, 18, 0.3); letter-spacing: 1px; }
.flight-proven.hidden { display: none; }

.progress-bar { position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: #0a1020; display: none; }
.progress-bar.active { display: block; }
.progress-fill { height: 100%; width: 0%; background: #5dade2; box-shadow: 0 0 6px rgba(93, 173, 226, 0.5); transition: width 0.1s linear; }

/* Building state — subtle amber pulse */
.btn-action.building { border-color: #f39c12; animation: build-pulse 1.2s ease-in-out infinite; }
@keyframes build-pulse { 0%, 100% { box-shadow: 0 0 6px rgba(243, 156, 18, 0.1); } 50% { box-shadow: 0 0 14px rgba(243, 156, 18, 0.25); } }
/* Launch ready — urgent pulse */
.btn-action.launch-ready { border-color: #5dade2; animation: launch-ready-pulse 1s ease-in-out infinite; }
.btn-action.launch-ready .btn-action-label { color: #5dade2; text-shadow: 0 0 8px rgba(93, 173, 226, 0.5); }
@keyframes launch-ready-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(93, 173, 226, 0.15); border-color: rgba(93, 173, 226, 0.5); transform: scale(1); }
    50% { box-shadow: 0 0 28px rgba(93, 173, 226, 0.6), inset 0 0 12px rgba(93, 173, 226, 0.1); border-color: #7ec8e3; transform: scale(1.02); }
}
/* Launch countdown flash */
.btn-action.countdown { border-color: #f39c12; box-shadow: 0 0 16px rgba(243, 156, 18, 0.3); animation: none; }

/* Auto-launch */
.auto-launch-log { background: #060c16; border: 1px solid #1a2a40; margin: 4px 10px 8px; padding: 6px 8px; font-family: 'Courier New', monospace; font-size: 11px; max-height: 120px; overflow: hidden; }
.auto-launch-log.hidden { display: none; }
.auto-launch-header { display: flex; justify-content: space-between; margin-bottom: 4px; border-bottom: 1px solid #1a2a40; padding-bottom: 3px; }
.auto-launch-title { color: #5dade2; font-family: 'Orbitron', sans-serif; font-size: 9px; letter-spacing: 1px; }
#auto-launch-stats { color: #3a5a7a; font-size: 10px; }
.auto-log-entry { color: #3a5a7a; line-height: 1.4; font-size: 10px; }
.auto-log-entry.success { color: #4a7a4a; }
.auto-log-entry.failure { color: #7a4a4a; }
.btn-action.auto-active { border-color: #5dade2; box-shadow: 0 0 12px rgba(93, 173, 226, 0.2), inset 0 0 20px rgba(93, 173, 226, 0.05); animation: auto-pulse 2s ease-in-out infinite; }
@keyframes auto-pulse { 0%, 100% { box-shadow: 0 0 12px rgba(93, 173, 226, 0.2); } 50% { box-shadow: 0 0 20px rgba(93, 173, 226, 0.35); } }

/* Minigame Full-Screen Overlay */
#minigame-overlay .modal-overlay { background: rgba(0, 0, 0, 0.92); }
#mg-panel {
    position: relative; z-index: 1; width: 95%; max-width: 520px;
    height: 90vh; max-height: 600px;
    display: flex; flex-direction: column;
    background: #060a12; border: 1px solid #1a2a40;
}
#mg-panel::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, #f39c12, transparent);
}
#mg-top {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; background: #0a1020; border-bottom: 1px solid #1a2a40;
}
#mg-title {
    font-family: 'Orbitron', sans-serif; font-size: 12px; font-weight: 700;
    color: #5dade2; letter-spacing: 2px;
}
#mg-reward { font-size: 13px; color: #3a5a7a; }
#mg-reward span { color: #f39c12; }
#mg-prompt {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 2rem; text-align: center;
}
#mg-prompt p {
    font-size: 16px; color: #6a8aaa; line-height: 1.8; margin-bottom: 1.5rem;
}
#mg-mastery-info {
    font-family: 'Orbitron', sans-serif; font-size: 10px;
    color: #f39c12; letter-spacing: 2px; margin-bottom: 1.5rem; min-height: 16px;
}
.mg-buttons { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.mg-buttons .btn-primary { min-width: 240px; }
.mg-buttons .btn-secondary { min-width: 240px; }
#mg-game {
    flex: 1; display: flex; flex-direction: column;
    min-height: 0; overflow: hidden;
}
#mg-canvas {
    flex: 1; width: 100%; min-height: 0;
    background: #050510; display: block; touch-action: none;
}
#mg-instructions {
    font-size: 13px; color: #3a5a7a; text-align: center;
    padding: 8px 12px; background: #0a1020; border-top: 1px solid #1a2a40;
    letter-spacing: 0.5px;
}
#mg-result {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 2rem; text-align: center;
}
#mg-result-text {
    font-family: 'Orbitron', sans-serif; font-size: 18px; font-weight: 700;
    letter-spacing: 2px; margin-bottom: 1rem;
}
.mg-result-success { color: #2ecc71; text-shadow: 0 0 12px rgba(46, 204, 113, 0.4); }
.mg-result-partial { color: #f39c12; text-shadow: 0 0 12px rgba(243, 156, 18, 0.4); }
.mg-result-fail { color: #e74c3c; text-shadow: 0 0 12px rgba(231, 76, 60, 0.4); }
#mg-result-bonus {
    font-size: 15px; color: #5dade2; margin-bottom: 1.5rem; line-height: 1.6;
}

/* Right Panel */
#gameplay-right {
    width: 280px; display: flex; flex-direction: column;
    background: #080e1a; overflow: hidden;
}

/* Progression Tracker */
#progression-tracker { padding: 10px 12px; border-bottom: 1px solid #1a2a40; }
.progression-header { display: flex; align-items: center; justify-content: space-between; cursor: pointer; margin-bottom: 8px; }
.progression-title { font-family: 'Orbitron', sans-serif; font-size: 10px; font-weight: 700; color: #f39c12; letter-spacing: 2px; text-shadow: 0 0 6px rgba(243, 156, 18, 0.3); }
.progression-summary { font-family: 'Orbitron', sans-serif; font-size: 9px; font-weight: 600; color: #3a5a7a; letter-spacing: 1px; }
#progression-tracker.collapsed .prog-item { display: none; }
#progression-tracker.collapsed .progression-header { margin-bottom: 0; }
#progression-tracker.collapsed .progression-summary { color: #5dade2; }
.prog-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 14px; flex-wrap: wrap; }
.prog-check { font-family: 'Orbitron', sans-serif; font-size: 11px; color: #1a2a40; font-weight: 700; }
.prog-check.done { color: #2ecc71; }
.prog-text { color: #6a8aaa; font-size: 11px; }
.prog-text.done { color: #2ecc71; }
.prog-locked .prog-check { color: #0e1a2a; }
.prog-locked .prog-text { color: #1e3048; font-style: italic; }
.prog-val { font-family: 'Orbitron', sans-serif; color: #5dade2; font-weight: 600; margin-left: auto; font-size: 9px; }
.prog-bar-track { width: 100%; height: 3px; background: #0a1628; border-radius: 2px; overflow: hidden; margin-top: -2px; }
.prog-bar-fill { height: 100%; width: 0%; background: #5dade2; border-radius: 2px; transition: width 0.4s ease; }
.prog-bar-fill.done { background: #2ecc71; }

/* Drawer Tabs */
#drawer-tabs { display: flex; background: #060a12; border-bottom: 1px solid #1a2a40; }
.drawer-tab {
    flex: 1; background: none; border: none;
    color: #3a5a7a; font-family: 'Orbitron', sans-serif;
    font-size: 9px; font-weight: 600; padding: 10px 4px; cursor: pointer;
    border-bottom: 2px solid transparent; transition: all 0.2s; letter-spacing: 1px;
}
.drawer-tab.active { color: #5dade2; border-bottom-color: #5dade2; text-shadow: 0 0 6px rgba(93, 173, 226, 0.3); }
.drawer-tab:hover { color: #6a8aaa; }

/* Drawer */
#drawer { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #1a2a40 transparent; }
.drawer-panel { display: none; padding: 8px 10px; }
.drawer-panel.active { display: block; }

/* Tech Summary Panel */
.tech-summary { padding: 8px 10px; }
.tech-summary-header { font-family: 'Orbitron', sans-serif; font-size: 10px; font-weight: 700; color: #5dade2; letter-spacing: 2px; margin-bottom: 8px; }
.tech-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: 1px solid #0e1525; }
.tech-stat-label { font-size: 12px; color: #3a5a7a; letter-spacing: 1px; }
.tech-stat-val { font-family: 'Orbitron', sans-serif; font-size: 12px; font-weight: 600; color: #5dade2; }

.btn-tech-tree {
    display: block; width: calc(100% - 20px); margin: 8px 10px;
    font-family: 'Orbitron', sans-serif; font-size: 11px; font-weight: 700;
    background: transparent; border: 2px solid #5dade2; color: #5dade2;
    padding: 12px; cursor: pointer; letter-spacing: 3px;
    text-shadow: 0 0 8px rgba(93, 173, 226, 0.5);
    box-shadow: 0 0 20px rgba(93, 173, 226, 0.15);
    transition: all 0.2s;
}
.btn-tech-tree:hover { background: rgba(93, 173, 226, 0.1); box-shadow: 0 0 30px rgba(93, 173, 226, 0.25); }

/* Mission Control Log */
.mission-control-log { padding: 0 10px 8px; }
.mission-control-log:empty { display: none; }
.mc-header { font-family: 'Orbitron', sans-serif; font-size: 9px; font-weight: 700; color: #3a5a7a; letter-spacing: 2px; margin-bottom: 6px; padding-top: 8px; border-top: 1px solid #0e1525; }
.mc-entry { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 11px; color: #5a7a5a; }
.mc-icon { font-size: 12px; width: 18px; text-align: center; flex-shrink: 0; }
.mc-name { font-family: 'Orbitron', sans-serif; font-size: 9px; font-weight: 600; color: #4a8a4a; letter-spacing: 0.5px; }
.mc-effect { color: #3a6a3a; font-size: 10px; margin-left: auto; flex-shrink: 0; }
.mc-telemetry-header { color: #2a4a5a; }
.mc-telemetry { display: flex; justify-content: space-between; padding: 2px 0; font-size: 10px; }
.mc-telem-label { color: #1e3a4a; letter-spacing: 0.5px; font-family: 'Courier New', monospace; }
.mc-telem-val { color: #2a5a5a; font-family: 'Courier New', monospace; }

/* Tech Tree Overlay */
#modal-tech-tree { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; align-items: center; justify-content: center; }
#modal-tech-tree.active { display: flex; }
#modal-tech-tree .modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.92); }
#tech-tree-panel {
    position: relative; z-index: 1; width: 95%; max-width: 860px;
    height: 90vh; max-height: 640px;
    display: flex; flex-direction: column;
    background: #060a12; border: 1px solid #1a2a40;
}
#tech-tree-panel::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, #5dade2, transparent); }
#tech-tree-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: #0a1020; border-bottom: 1px solid #1a2a40; }
.tt-title { font-family: 'Orbitron', sans-serif; font-size: 14px; font-weight: 700; color: #5dade2; letter-spacing: 3px; }
.tt-cash { font-family: 'Orbitron', sans-serif; font-size: 14px; color: #2ecc71; }
.tt-close { font-family: 'Orbitron', sans-serif; font-size: 9px; font-weight: 600; background: transparent; border: 1px solid #1a2a40; color: #3a5a7a; padding: 6px 14px; cursor: pointer; letter-spacing: 1px; }
.tt-close:hover { border-color: #5dade2; color: #5dade2; }
.tt-tree-container { flex: 1; overflow: auto; position: relative; padding: 30px 20px 40px; display: flex; justify-content: center; }
.tt-tree { position: relative; min-width: 800px; min-height: 520px; }

/* Tier labels */
.tt-tier-label { position: absolute; left: 0; width: 100%; font-family: 'Orbitron', sans-serif; font-size: 10px; font-weight: 700; color: #1a2a40; letter-spacing: 3px; text-align: center; pointer-events: none; }
.tt-tier-label.unlocked { color: #3a5a7a; }
.tt-tier-req { display: block; font-size: 9px; font-weight: 600; color: #1a2a40; letter-spacing: 2px; margin-top: 2px; }
.tt-tier-label.unlocked .tt-tier-req { color: #5dade2; }

/* Nodes */
.tt-node { position: absolute; width: 100px; text-align: center; cursor: pointer; transition: all 0.3s; z-index: 1; transform: translateX(-50%); }
.tt-node-box {
    background: #0a1525; border: 2px solid #1a2a40; padding: 10px 6px 8px;
    position: relative; overflow: hidden; transition: all 0.3s;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}
.tt-node-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: transparent; transition: background 0.3s; }
.tt-node .tt-node-icon { font-size: 20px; margin-bottom: 4px; display: block; }
.tt-node .tt-node-name { font-family: 'Orbitron', sans-serif; font-size: 8px; font-weight: 700; color: #3a5a7a; letter-spacing: 0.5px; line-height: 1.3; display: block; }
.tt-node .tt-node-cost { font-family: 'Orbitron', sans-serif; font-size: 9px; font-weight: 600; color: #1a2a40; margin-top: 4px; display: block; }

.tt-node.locked { opacity: 0.3; cursor: not-allowed; }
.tt-node.locked .tt-node-box { border-color: #0e1525; }
.tt-node.available .tt-node-box { border-color: #5dade2; box-shadow: 0 0 12px rgba(93, 173, 226, 0.15); }
.tt-node.available .tt-node-box::before { background: linear-gradient(90deg, transparent, #5dade2, transparent); }
.tt-node.available .tt-node-name { color: #c8d6e5; }
.tt-node.available .tt-node-cost { color: #5dade2; }
.tt-node.available:hover .tt-node-box { border-color: #8cc5e8; box-shadow: 0 0 20px rgba(93, 173, 226, 0.3); transform: scale(1.05); }
.tt-node.purchased .tt-node-box { border-color: #2ecc71; background: rgba(46, 204, 113, 0.08); box-shadow: 0 0 12px rgba(46, 204, 113, 0.15); }
.tt-node.purchased .tt-node-box::before { background: linear-gradient(90deg, transparent, #2ecc71, transparent); }
.tt-node.purchased .tt-node-name { color: #2ecc71; }
.tt-node.purchased .tt-node-cost { color: #1a5a3a; }

/* Tech Detail Panel */
.tt-detail-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 1100; align-items: center; justify-content: center; }
.tt-detail-overlay.active { display: flex; }
.tt-detail-panel { background: #0a1220; border: 2px solid #1a2a40; max-width: 420px; width: 90%; position: relative; overflow: hidden; animation: popIn 0.3s ease-out; max-height: 90vh; overflow-y: auto; }
.tt-detail-panel::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, transparent, #5dade2, transparent); }
.tt-detail-header { padding: 20px 20px 0; text-align: center; }
.tt-detail-icon { font-size: 36px; margin-bottom: 8px; }
.tt-detail-tier { font-family: 'Orbitron', sans-serif; font-size: 9px; color: #3a5a7a; letter-spacing: 3px; margin-bottom: 4px; }
.tt-detail-name { font-family: 'Orbitron', sans-serif; font-size: 16px; font-weight: 700; color: #fff; letter-spacing: 2px; }
.tt-detail-effect { font-family: 'Orbitron', sans-serif; font-size: 11px; color: #5dade2; text-align: center; padding: 10px 20px; letter-spacing: 1px; text-shadow: 0 0 8px rgba(93, 173, 226, 0.3); }
.tt-detail-desc { font-size: 15px; color: #6a8aaa; line-height: 1.7; padding: 0 20px 16px; text-align: center; }
.tt-detail-tech { font-size: 13px; color: #3a6a8a; font-style: italic; line-height: 1.6; padding: 12px 20px; margin: 0 12px 16px; text-align: center; background: rgba(93, 173, 226, 0.03); border: 1px solid #12202e; }
.tt-detail-cost { font-family: 'Orbitron', sans-serif; font-size: 13px; color: #f39c12; text-align: center; padding: 8px 20px; letter-spacing: 2px; }
.tt-detail-btn { display: block; width: 100%; font-family: 'Orbitron', sans-serif; background: transparent; color: #5dade2; border: none; border-top: 1px solid #1a2a40; padding: 16px; font-size: 11px; font-weight: 700; letter-spacing: 3px; cursor: pointer; transition: background 0.2s; }
.tt-detail-btn:hover { background: rgba(93, 173, 226, 0.05); }
.tt-detail-btn.buy { color: #2ecc71; }
.tt-detail-btn.buy:hover { background: rgba(46, 204, 113, 0.05); }
.tt-detail-btn:disabled { color: #1a2a40; cursor: not-allowed; }

/* Contracts */
.contract-item {
    padding: 10px; background: #0c1525; border: 1px solid #1a2a40;
    margin-bottom: 5px; border-left: 3px solid #1a2a40; cursor: pointer;
    transition: border-color 0.2s;
}
.contract-item:hover { border-color: #2a3a50; }
.contract-item.available { border-left-color: #5dade2; }
.contract-item.completed { border-left-color: #2ecc71; opacity: 0.6; }
.contract-item.hidden { display: none; }

.contract-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.contract-name { font-family: 'Orbitron', sans-serif; font-size: 10px; font-weight: 600; color: #c8d6e5; letter-spacing: 0.5px; }
.contract-status { font-size: 11px; padding: 2px 8px; background: #0a1525; color: #3a5a7a; border: 1px solid #1a2a40; font-weight: 600; letter-spacing: 1px; }
.contract-status.ready { color: #2ecc71; border-color: #1a3a2a; }
.contract-status.done { color: #2ecc71; border-color: #1a3a2a; }
.contract-desc { font-size: 13px; color: #5a7a9a; line-height: 1.6; margin-bottom: 4px; }
.contract-detail { font-size: 13px; color: #5dade2; line-height: 1.6; margin-bottom: 4px; }
.contract-detail.hidden { display: none; }
.contract-req, .contract-reward { font-size: 12px; color: #3a5a7a; margin-bottom: 2px; }
.contract-reward { color: #f39c12; font-weight: 600; }

.btn-contract {
    margin-top: 6px; background: transparent; border: 1px solid #5dade2;
    color: #5dade2; padding: 6px 16px; font-family: 'Orbitron', sans-serif;
    font-size: 9px; font-weight: 600; cursor: pointer; width: 100%; letter-spacing: 2px;
}
.btn-contract:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-contract:hover:not(:disabled) { background: rgba(93, 173, 226, 0.1); }

/* Achievements */
.achievements-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 2px; }
.achievement-badge {
    background: #0c1525; border: 1px solid #1a2a40; padding: 14px 10px;
    text-align: center; transition: all 0.3s; position: relative; overflow: hidden;
}
.achievement-badge::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: transparent; transition: background 0.3s; }
.achievement-badge.earned { border-color: #f39c12; box-shadow: 0 0 12px rgba(243, 156, 18, 0.1); }
.achievement-badge.earned::before { background: linear-gradient(90deg, transparent, #f39c12, transparent); }
.achievement-badge.locked { opacity: 0.25; }
.achievement-badge .badge-icon { font-size: 26px; margin-bottom: 6px; display: block; }
.achievement-badge .badge-name { display: block; font-family: 'Orbitron', sans-serif; font-size: 9px; font-weight: 700; color: #e8d5b0; margin-bottom: 4px; letter-spacing: 0.5px; line-height: 1.4; }
.achievement-badge.locked .badge-name { color: #2a3a50; }
.achievement-badge .badge-desc { display: block; font-size: 12px; color: #6a8aaa; line-height: 1.4; }
.achievement-badge.locked .badge-desc { color: #1a2a40; }

/* ===== MODALS ===== */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal.active { display: flex; }
.modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); }

.modal-content {
    position: relative; z-index: 1; background: #0a1020;
    border: 1px solid #1a2a40; padding: 2rem; text-align: center;
    max-width: 380px; width: 90%;
}
.modal-content::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, #5dade2, transparent);
}
.modal-content h2 { font-family: 'Orbitron', sans-serif; font-size: 16px; font-weight: 700; margin-bottom: 0.75rem; color: #ffffff; letter-spacing: 2px; }
.modal-content h3 { font-family: 'Orbitron', sans-serif; font-size: 9px; color: #3a5a7a; letter-spacing: 3px; margin-bottom: 0.5rem; font-weight: 600; }
.modal-content p { font-size: 15px; color: #6a8aaa; line-height: 1.7; margin-bottom: 1rem; }
.modal-content button { margin-top: 0.5rem; }
.modal-content button + button { margin-left: 0.5rem; }

.modal-achievement { border: 2px solid #f39c12; padding: 0; overflow: hidden; animation: badgePopIn 0.4s ease-out; }
@keyframes badgePopIn { 0% { transform: scale(0.8); opacity: 0; } 50% { transform: scale(1.02); } 100% { transform: scale(1); opacity: 1; } }
.modal-achievement::before { background: linear-gradient(90deg, transparent, #f39c12, transparent); height: 3px; }
.modal-achievement h3 { font-size: 9px; color: #8b7340; letter-spacing: 4px; margin-bottom: 8px; padding-top: 24px; }
.modal-achievement h2 { font-size: 16px; color: #f39c12; text-shadow: 0 0 12px rgba(243, 156, 18, 0.3); letter-spacing: 2px; margin-bottom: 8px; }
.modal-achievement p { padding: 0 24px; }
.achievement-glow { position: absolute; top: -50px; left: 50%; transform: translateX(-50%); width: 200px; height: 200px; background: radial-gradient(circle, rgba(243, 156, 18, 0.15), transparent 70%); pointer-events: none; }
.achievement-icon-lg { font-size: 40px; margin-bottom: 10px; }
.achievement-context { font-size: 13px !important; color: #3a6a8a !important; font-style: italic; line-height: 1.6 !important; margin-bottom: 16px !important; }
.achievement-context:empty { display: none; }
.achievement-progress { background: #0c1525; padding: 12px 24px; display: flex; justify-content: center; gap: 6px; }
.achievement-pip { width: 14px; height: 14px; border: 1px solid #1a2a40; background: #0a1220; }
.achievement-pip.earned { background: #f39c12; border-color: #f39c12; box-shadow: 0 0 6px rgba(243, 156, 18, 0.4); }
.btn-achievement-ok { display: block; width: 100%; font-family: 'Orbitron', sans-serif; background: transparent; color: #f39c12; border: none; border-top: 1px solid #1a2a40; padding: 16px; font-size: 11px; font-weight: 700; letter-spacing: 3px; cursor: pointer; transition: background 0.2s; margin: 0; }
.btn-achievement-ok:hover { background: rgba(243, 156, 18, 0.05); }

.modal-crisis { border-color: #e74c3c; }
.modal-crisis::before { background: linear-gradient(90deg, transparent, #e74c3c, transparent); }
.modal-crisis h2 { color: #e74c3c; text-shadow: 0 0 8px rgba(231, 76, 60, 0.3); }
.crisis-icon { font-family: 'Orbitron', sans-serif; font-size: 24px; color: #e74c3c; margin-bottom: 0.5rem; font-weight: 800; text-shadow: 0 0 20px rgba(231, 76, 60, 0.4); }

.modal-contract { border-color: #5dade2; }
.modal-contract::before { background: linear-gradient(90deg, transparent, #5dade2, transparent); }
.contract-icon { font-family: 'Orbitron', sans-serif; font-size: 24px; color: #5dade2; margin-bottom: 0.5rem; text-shadow: 0 0 20px rgba(93, 173, 226, 0.4); }
.contract-notify-background { color: #8a9ab5; font-size: 12px; line-height: 1.5; margin: 8px 0; font-style: italic; }
.contract-notify-requirements { color: #5dade2; font-weight: 600; font-size: 13px; margin: 8px 0; letter-spacing: 1px; }
.contract-notify-reward { color: #f39c12; font-weight: 600; font-size: 14px; margin: 8px 0; }
/* Incoming contract preview — prominent heading + payout */
.preview .modal-contract { border-color: #f39c12; }
.preview .modal-contract::before { background: linear-gradient(90deg, transparent, #f39c12, transparent); }
.preview #contract-notify-heading { font-size: 12px; color: #f39c12; letter-spacing: 4px; text-shadow: 0 0 10px rgba(243, 156, 18, 0.4); animation: incoming-pulse 2s ease-in-out infinite; }
.preview .contract-icon { color: #f39c12; text-shadow: 0 0 20px rgba(243, 156, 18, 0.4); }
.preview .contract-notify-reward { font-size: 18px; color: #f39c12; letter-spacing: 2px; text-shadow: 0 0 12px rgba(243, 156, 18, 0.3); padding: 8px 0; border-top: 1px solid rgba(243, 156, 18, 0.15); border-bottom: 1px solid rgba(243, 156, 18, 0.15); }
@keyframes incoming-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.btn-secondary { display: inline-block; padding: 14px 20px; font-family: 'Orbitron', sans-serif; font-size: 10px; font-weight: 700; letter-spacing: 2px; border: 1px solid #3a4a5a; color: #5a6a7a; background: transparent; cursor: pointer; transition: all 0.2s; }
.btn-secondary:hover { background: rgba(90, 106, 122, 0.1); border-color: #5a6a7a; }

.modal-bailout { border-color: #f39c12; }
.modal-bailout::before { background: linear-gradient(90deg, transparent, #f39c12, transparent); }

.modal-kessler { border-color: #ff0000; }
.modal-kessler::before { background: linear-gradient(90deg, transparent, #ff0000, transparent); }
.modal-kessler h2 { color: #ff0000; text-shadow: 0 0 12px rgba(255, 0, 0, 0.4); }
.kessler-stage { font-family: 'Orbitron', sans-serif; font-size: 9px; font-weight: 600; color: #e74c3c; margin: 8px 0; opacity: 0; transition: opacity 0.5s; text-align: left; letter-spacing: 1px; }
.kessler-stage.visible { opacity: 1; }

.modal-era-complete { border-color: #2ecc71; }
.modal-era-complete::before { background: linear-gradient(90deg, transparent, #2ecc71, transparent); }
.era-outro { font-size: 14px !important; color: #5a7a9a !important; font-style: italic; }

#era-summary, #gameover-summary { text-align: left; margin: 0.75rem 0; padding: 0.75rem; background: #060a12; border: 1px solid #1a2a40; }
.summary-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; border-bottom: 1px solid #0e1525; }
.summary-row:last-child { border-bottom: none; }
.summary-label { color: #3a5a7a; }
.summary-value { font-family: 'Orbitron', sans-serif; font-size: 11px; font-weight: 600; color: #5dade2; }

#launch-result-content.success { border-color: #2ecc71; }
#launch-result-content.success::before { background: linear-gradient(90deg, transparent, #2ecc71, transparent); }
#launch-result-content.success h2 { color: #2ecc71; text-shadow: 0 0 8px rgba(46, 204, 113, 0.3); }
#launch-result-content.failure { border-color: #e74c3c; }
#launch-result-content.failure::before { background: linear-gradient(90deg, transparent, #e74c3c, transparent); }
#launch-result-content.failure h2 { color: #e74c3c; text-shadow: 0 0 8px rgba(231, 76, 60, 0.3); }
#launch-result-icon { font-family: 'Orbitron', sans-serif; font-size: 28px; font-weight: 800; margin-bottom: 0.5rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    .home-title, .home-title-thin { font-size: 34px; }
    #gameplay-body { flex-direction: column; }
    #gameplay-left { border-right: none; border-bottom: 1px solid #1a2a40; }
    #gameplay-right { width: 100%; flex: 1; min-height: 0; }
    #progression-tracker { padding: 6px 8px; }
    .progression-title { width: 100%; }
    .prog-item { font-size: 12px; }
    .prog-bar-track { height: 2px; }
}

@media (min-width: 1024px) {
    #gameplay-right { width: 340px; }
    .stat-value { font-size: 18px; }
}

/* ===== ROTATE PROMPT (portrait mobile gate) ===== */
#rotate-prompt {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #060a12; z-index: 10000;
    flex-direction: column; align-items: center; justify-content: center;
    color: #5dade2; font-family: 'Orbitron', sans-serif; font-size: 14px; letter-spacing: 2px;
}
.rotate-icon { font-size: 48px; margin-bottom: 20px; animation: spin 2s ease-in-out infinite; }
@keyframes spin { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(90deg); } }

@media (orientation: portrait) and (max-width: 600px) {
    #rotate-prompt { display: flex; }
}

/* ===== LANDSCAPE MOBILE PANEL TOGGLE ===== */
.panel-toggle { display: none; }
.panel-backdrop { display: none; }

/* ===== LANDSCAPE MOBILE LAYOUT ===== */
@media (orientation: landscape) and (max-height: 500px) {
    /* Compact header */
    #gameplay-header { padding: 2px 8px; min-height: 0; }
    #company-display { font-size: 9px; letter-spacing: 1px; }
    .header-label { display: none; }
    #btn-pause, #btn-fullscreen { padding: 2px 6px; font-size: 10px; }
    .header-buttons { right: 6px; gap: 4px; }

    /* Compact stats bar */
    #stats-bar { padding: 2px 4px; }
    .stat { flex-direction: row; gap: 4px; }
    .stat-label { font-size: 8px; letter-spacing: 1px; }
    .stat-value { font-size: 11px; }
    .stat-primary .stat-value { font-size: 12px; }

    /* Finance bar: hidden in main layout, shown inside slide-out panel */
    #gameplay-left > #finance-bar { display: none; }
    #gameplay-right > #finance-bar { display: flex; border-bottom: 1px solid #1a2a40; }

    /* Force side-by-side layout even on narrow landscape phones */
    #gameplay-body { flex-direction: row !important; }
    #gameplay-left {
        flex: 1; position: relative;
        border-right: none !important; border-bottom: none !important;
    }

    /* Earth fills all vertical space */
    #earth-container { flex: 1; min-height: 0; }

    /* Overlay action buttons on earth canvas */
    #action-buttons {
        position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
        padding: 6px 8px;
        background: linear-gradient(transparent, rgba(6, 10, 18, 0.92) 30%);
        pointer-events: none;
    }
    #action-buttons .btn-action {
        pointer-events: auto;
        padding: 8px 6px;
        min-height: 44px;
        background: rgba(12, 21, 37, 0.95);
    }
    .btn-action-label { font-size: 10px; }
    .btn-action-cost, .btn-action-info { font-size: 11px; margin-top: 2px; }

    /* Shell labels above action buttons */
    #shell-labels { bottom: 70px; }

    /* Right panel becomes slide-out overlay */
    #gameplay-right {
        position: fixed !important; top: 0; right: 0;
        width: 300px !important; height: 100% !important;
        z-index: 100;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        background: #080e1a;
        border-left: 1px solid #1a2a40;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
        flex: none !important;
    }
    #gameplay-right.panel-open { transform: translateX(0); }

    /* Panel toggle tab */
    .panel-toggle {
        display: flex; align-items: center; justify-content: center;
        position: fixed; right: 0; top: 50%; transform: translateY(-50%);
        z-index: 99; writing-mode: vertical-rl;
        background: #0c1525; border: 1px solid #1a2a40; border-right: none;
        color: #5dade2; font-family: 'Orbitron', sans-serif;
        font-size: 9px; font-weight: 600; letter-spacing: 2px;
        padding: 12px 6px; cursor: pointer;
        transition: right 0.3s ease;
    }
    .panel-toggle.shifted { right: 300px; }

    /* Backdrop when panel is open */
    .panel-backdrop {
        display: none; position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0, 0, 0, 0.5); z-index: 98;
    }
    .panel-backdrop.active { display: block; }

    /* Compact progression tracker in overlay */
    #progression-tracker { padding: 8px 10px; }
    .prog-item { font-size: 12px; padding: 2px 0; }

    /* Tutorial: fit in landscape */
    .tutorial-container { padding: 0.5rem 1rem; }
    .tutorial-progress { margin-bottom: 0.5rem; }
    .tutorial-progress .dot { width: 8px; height: 8px; }
    .tutorial-cards { height: 140px; }
    .tutorial-card h2 { font-size: 16px; margin-bottom: 0.4rem; }
    .tutorial-card p { font-size: 14px; line-height: 1.5; }
    .tutorial-icon { font-size: 14px; margin-bottom: 0.4rem; }
    .tutorial-buttons { margin-top: 0; }
    .tutorial-buttons .btn-primary,
    .tutorial-buttons .btn-secondary { padding: 10px 24px; font-size: 11px; }

    /* Main menu: fit in landscape */
    .home-titles { margin-bottom: 8px; padding-top: 20px; }
    .home-main.expanded .home-titles { transform: translateY(-15px); }
    .home-title, .home-title-thin { font-size: 28px; }
    .home-briefing { font-size: 14px; line-height: 1.5; margin-bottom: 12px; max-width: 400px; }
    .home-bold { font-size: 15px; margin-top: 6px; }
    .home-btn-launch { padding: 10px 40px; font-size: 12px; }
    .home-btn-continue { padding: 8px 36px; font-size: 10px; margin-top: 6px; }
    .home-btn-enter { padding: 10px 36px; font-size: 10px; }
    .home-expanded { margin-top: -15px; }
    .home-sep { margin-bottom: 8px; }
    .home-nav { padding: 8px 16px; }

    /* Era 1 intro modal: compact */
    .modal-era1-intro { max-width: 400px; padding: 1rem 1.5rem; }
    .era1-intro-text p { font-size: 13px; line-height: 1.5; margin-bottom: 0.5rem; }
    .era1-intro-naming { margin-bottom: 1rem; }

    /* Modals: compact for landscape */
    .modal-content {
        max-width: 340px; padding: 1rem 1.5rem;
        max-height: 85vh; overflow-y: auto;
    }
    .modal-content h2 { font-size: 14px; margin-bottom: 0.5rem; }
    .modal-content p { font-size: 13px; margin-bottom: 0.5rem; }

    /* Minigame: full screen in landscape */
    #mg-panel {
        width: 100%; max-width: 100%;
        height: 100%; max-height: 100%;
        border: none;
    }
    #mg-top { padding: 6px 12px; }

    /* Tech tree: full screen in landscape */
    #tech-tree-panel { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border: none; }
    #tech-tree-header { padding: 6px 12px; }
    .tt-tree-container { padding: 15px 10px 20px; }
    .tt-detail-panel { max-width: 340px; }
    .tt-detail-desc { font-size: 13px; padding: 0 16px 12px; }
    .tt-detail-tech { font-size: 11px; padding: 8px 12px; margin: 0 8px 8px; }
}

.hidden { display: none !important; }
