/* 
 * FloodGame Redesigned Design System
 * Modern Hybrid HUD Interface (6th-12th Grade Friendly)
 */

@font-face {
    font-family: overwatch;
    src: url(fonts/f014015d.woff);
}

@font-face {
    font-family: overwatch-italic;
    src: url(fonts/bignoodletoo.woff);
}

/* CSS Variables — Tactical Navy Palette */
:root {
    --font-primary: 'overwatch', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --bg-hud: rgba(15, 22, 38, 0.92);
    --bg-hud-light: rgba(26, 35, 58, 0.97);
    --border-hud: rgba(160, 174, 192, 0.25);
    --border-hud-hover: rgba(160, 174, 192, 0.55);
    --text-color: #e2e8f0;
    --text-muted: #718096;

    /* Game State Colors */
    --color-budget: #38a169;
    --color-safety: #2b6cb0;
    --color-risk: #c05621;
    --color-danger: #9b2c2c;

    /* Subtle Shadows (no neon bloom) */
    --glow-cyan: 0 2px 12px rgba(0, 0, 0, 0.5);
    --glow-green: 0 2px 12px rgba(0, 0, 0, 0.4);
    --glow-blue:  0 2px 12px rgba(0, 0, 0, 0.4);
    --glow-orange: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* Resets & Main Viewport Layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: #0b0e14;
    font-family: var(--font-primary);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
}

/* Full-Screen WebGL Canvas Background */
#webgl-output,
#webgl-output canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1;
}

/* Three.js Stats & Debug position adjustments */
#webgl-output > div {
    position: absolute !important;
    bottom: 275px !important;
    left: 25px !important;
    top: auto !important;
    z-index: 2;
}

/* ==========================================================================
   Atmospheric Storm Weather Animations
   ========================================================================== */

@keyframes cloudRollLeft {
    0%   { transform: translateX(-450px); }
    100% { transform: translateX(calc(100vw + 450px)); }
}

@keyframes cloudRollRight {
    0%   { transform: translateX(calc(100vw + 450px)); }
    100% { transform: translateX(-450px); }
}

@keyframes windSweepLeft {
    0%   { transform: translateX(-110%); opacity: 0; }
    15%  { opacity: 0.45; }
    85%  { opacity: 0.45; }
    100% { transform: translateX(115vw); opacity: 0; }
}

@keyframes windSweepRight {
    0%   { transform: translateX(115vw); opacity: 0; }
    15%  { opacity: 0.45; }
    85%  { opacity: 0.45; }
    100% { transform: translateX(-110%); opacity: 0; }
}

@keyframes lightning {
    0%, 92%, 94%, 96%, 100% { opacity: 0; }
    93%, 95%                 { opacity: 0.16; }
}

/* ==========================================================================
   Full-Screen Game Menu (id="modal-js-example")
   ========================================================================== */
#modal-js-example {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* Slate blue menu background matching user color swatch (#668aa3) */
    background: linear-gradient(180deg, #53758e 0%, #668aa3 50%, #4f7088 100%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#modal-js-example.is-active:not(.is-hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#modal-js-example.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* === Canvas Rain Overlay (Rains OVER UI and Cards) === */
#menu-rain-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 150;
}

/* === Lightning Flash Overlay === */
@keyframes lightning {
    0%, 91%, 93%, 95%, 100% { opacity: 0; }
    92%, 94%                 { opacity: 0.22; }
}

.menu-lightning {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    background: rgba(210, 235, 255, 1);
    animation: lightning 6.5s ease-in-out infinite;
}

/* === Storm Wind Streaks (Horizontal & Angled Wisps) === */
@keyframes windSweepLeft {
    0%   { transform: translateX(-110%) rotate(-1deg); opacity: 0; }
    15%  { opacity: 0.75; }
    85%  { opacity: 0.75; }
    100% { transform: translateX(115vw) rotate(1deg); opacity: 0; }
}

@keyframes windSweepRight {
    0%   { transform: translateX(115vw) rotate(1deg); opacity: 0; }
    15%  { opacity: 0.75; }
    85%  { opacity: 0.75; }
    100% { transform: translateX(-110%) rotate(-1deg); opacity: 0; }
}

@keyframes windGustSweep {
    0%   { transform: translateX(-120%) translateY(0) scaleY(1); opacity: 0; }
    20%  { opacity: 0.85; }
    80%  { opacity: 0.85; }
    100% { transform: translateX(120vw) translateY(20px) scaleY(1.5); opacity: 0; }
}

.menu-wind {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 150;
    overflow: hidden;
}

.menu-wind-streak {
    position: absolute;
    background: linear-gradient(90deg, transparent 0%, rgba(240, 248, 255, 0.4) 20%, rgba(255, 255, 255, 0.9) 50%, rgba(220, 240, 255, 0.4) 80%, transparent 100%);
    border-radius: 4px;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
}

.menu-wind-streak.wind-left {
    animation: windSweepLeft linear infinite;
}

.menu-wind-streak.wind-right {
    animation: windSweepRight linear infinite;
}

.menu-wind-streak.wind-gust {
    animation: windGustSweep ease-in-out infinite;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 30%, rgba(230, 245, 255, 0.95) 60%, transparent 100%);
}

/* === Fluffy Illustrated Cumulus Clouds (Matching Mockup) === */
.menu-cloud {
    position: absolute;
    pointer-events: none;
    z-index: 2;
}

.menu-cloud.cloud-left {
    animation: cloudRollLeft linear infinite;
}

.menu-cloud.cloud-right {
    animation: cloudRollRight linear infinite;
}

.menu-cloud-shape {
    position: relative;
    width: 480px;
    height: 210px;
    pointer-events: none;
}

/* Content sits above weather layers */
.menu-container {
    position: relative;
    z-index: 200;
    width: 100%;
    max-width: 980px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Modern High-End Title Section */
.menu-title-section {
    margin-bottom: 6px;
}

.menu-title-section h1 {
    font-size: 4.2rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    font-family: var(--font-primary), 'Segoe UI', Roboto, sans-serif;
    font-weight: 900;
    color: #ffffff;
    background: linear-gradient(135deg, #ffffff 0%, #d8ecf8 45%, #9ecdf5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 14px rgba(10, 25, 45, 0.45)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.2));
    margin-bottom: 6px;
    line-height: 1.05;
}

.menu-title-badge {
    display: inline-block;
    padding: 6px 20px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 20px;
    backdrop-filter: blur(8px);
    color: #e2f1fd;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.menu-title-section p {
    display: none;
}

/* Map Selection Grid */
.map-selection-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 16px !important;
    margin: 4px 0 !important;
    width: 100% !important;
}

@media (max-width: 800px) {
    .map-selection-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 500px) {
    .map-selection-grid { grid-template-columns: 1fr !important; }
}

/* Illustrated map card style */
.map-card {
    background: #ffffff;
    border: 3px solid #d8e4ec;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.map-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 0;
    margin-bottom: 0;
    transition: transform 0.3s ease;
    display: block;
    background: #1e2c3a;
}

.map-card:hover {
    transform: translateY(-6px);
    border-color: #f5d060;
    box-shadow: 0 8px 28px rgba(0,0,0,0.25), 0 0 0 2px #f5d060;
}

.map-card:hover img {
    transform: scale(1.04);
}

.map-card strong {
    font-size: 1.05rem;
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
    font-weight: 700;
    color: #1a2a3a;
    padding: 8px 10px 9px;
    background: #f0f5f8;
    border-top: 1px solid #dde8ef;
    text-align: center;
    letter-spacing: 0.3px;
    display: block;
}

.map-card.selected-map {
    border-color: #f5d060 !important;
    border-width: 3px !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2) !important;
}

.map-card.selected-map strong {
    background: #f7e6a1 !important;
    color: #2b1800 !important;
}

/* Settings row */
.menu-settings-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.72);
    padding: 10px 28px;
    border-radius: 30px;
    border: 2px solid rgba(200,220,235,0.9);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(8px);
    align-self: center;
    position: relative !important;
    z-index: 205 !important;
}

@media (max-width: 600px) {
    .menu-settings-row { flex-direction: column; gap: 10px; }
}

.settings-label {
    font-weight: 700;
    color: #1a2a3a;
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 0.95rem;
}

.graphics-radio-group {
    display: flex;
    gap: 20px;
}

.graphics-radio-group label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 0.92rem;
    color: #2a3a4a;
    font-weight: 500;
}

.graphics-radio-group input {
    accent-color: #c8860a;
    width: 16px;
    height: 16px;
}

/* Premium Modern Launch Simulation Button */
.launch-button {
    font-family: var(--font-primary), 'Segoe UI', Roboto, sans-serif !important;
    padding: 16px 52px !important;
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    border-radius: 50px !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    align-self: center !important;
    height: auto !important;
    line-height: 1 !important;
    position: relative !important;
    z-index: 205 !important;
}

/* Pre-Selection / Static State */
.launch-button.is-static,
.launch-button:disabled {
    background: rgba(255, 255, 255, 0.18) !important;
    border: 2px solid rgba(255, 255, 255, 0.35) !important;
    color: rgba(255, 255, 255, 0.65) !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12) !important;
    pointer-events: none !important;
    text-shadow: none !important;
    opacity: 0.7 !important;
}

/* Active State (When map location is selected - Clean Solid Gold) */
.launch-button.is-primary,
.launch-button:not(.is-static) {
    background: linear-gradient(180deg, #f7d770 0%, #e0a316 100%) !important;
    border: 2px solid #fce8a6 !important;
    color: #2b1800 !important;
    font-weight: 900 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22) !important;
    text-shadow: none !important;
    animation: none !important;
    pointer-events: auto !important;
    opacity: 1 !important;
}

.launch-button.is-primary:hover,
.launch-button:not(.is-static):hover {
    background: linear-gradient(180deg, #ffe080 0%, #ebaf20 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28) !important;
}



/* ==========================================================================
   Heads-Up Display (HUD) Overlays
   ========================================================================== */

/* 1. Top HUD Status Bar */
.top-hud-bar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--bg-hud);
    border: 1px solid var(--border-hud);
    border-radius: 12px;
    padding: 8px 20px;
    box-shadow: var(--glow-cyan);
    backdrop-filter: blur(10px);
}

@media (max-width: 900px) {
    .top-hud-bar {
        width: calc(100% - 40px);
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        padding: 10px;
    }
}

.hud-stat-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    font-size: 0.95rem;
}

.hud-stat-pill i {
    font-size: 1.1rem;
}

.hud-stat-pill.budget i { color: var(--color-budget); }
.hud-stat-pill.safety i { color: var(--color-safety); }
.hud-stat-pill.risk i { color: var(--color-risk); }

.hud-stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.hud-stat-value {
    font-weight: bold;
}

/* Simulation Controls inside Top HUD */
.hud-sim-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 15px;
}

@media (max-width: 900px) {
    .hud-sim-controls {
        border-left: none;
        padding-left: 0;
    }
}

.hud-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hud-btn:hover {
    background: rgba(160, 174, 192, 0.15);
    border-color: var(--border-hud-hover);
}

.hud-btn.is-active {
    background: var(--color-safety);
    border-color: var(--color-safety);
    box-shadow: var(--glow-blue);
}

/* 2. Left HUD Panel (Tile Inspector & Mitigation) */
.left-hud-panel {
    position: absolute;
    top: 90px;
    left: 20px;
    width: 350px;
    max-height: calc(100vh - 200px);
    z-index: 10;
    background: var(--bg-hud);
    border: 1px solid var(--border-hud);
    border-radius: 12px;
    box-shadow: var(--glow-cyan);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@media (max-width: 768px) {
    .left-hud-panel {
        width: calc(100% - 40px);
        max-height: 45vh;
        bottom: 90px;
        top: auto;
    }
}

.hud-panel-header {
    background: rgba(160, 174, 192, 0.08);
    border-bottom: 1px solid rgba(160, 174, 192, 0.15);
    padding: 12px 15px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #A0AEC0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hud-panel-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 10px;
    font-size: 0.85rem;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.hud-tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.02);
}

.hud-tab-btn.is-active {
    color: #A0AEC0;
    border-bottom-color: #A0AEC0;
    font-weight: bold;
}

.hud-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.hud-info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hud-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hud-info-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.hud-info-value {
    font-weight: bold;
}

/* Mitigation Items list */
.hud-ability-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hud-ability-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s ease;
}

.hud-ability-card:hover {
    border-color: rgba(160, 174, 192, 0.3);
}

.hud-ability-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.hud-ability-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.hud-ability-cost {
    font-size: 0.85rem;
    color: var(--color-budget);
}

.hud-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: white;
    padding: 4px 8px;
    font-size: 0.85rem;
    outline: none;
    width: 130px;
}

.hud-checkbox {
    accent-color: #A0AEC0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 3. Right HUD Panel (AI Tutor Chat Drawer) */
.right-hud-panel {
    position: absolute;
    top: 90px;
    right: 20px;
    width: 380px;
    max-height: calc(100vh - 200px);
    z-index: 10;
    background: var(--bg-hud);
    border: 1px solid var(--border-hud);
    border-radius: 12px;
    box-shadow: var(--glow-cyan);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s ease;
}

@media (max-width: 768px) {
    .right-hud-panel {
        width: calc(100% - 40px);
        max-height: 50vh;
        bottom: 90px;
        top: auto;
        right: 20px;
    }
}

.right-hud-panel.is-collapsed {
    transform: translateX(450px);
    pointer-events: none;
    opacity: 0;
}

/* Floating Tutor Trigger Button (Enlarged) */
.tutor-trigger-btn {
    position: absolute;
    top: 90px;
    right: 24px;
    z-index: 99;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-hud-light);
    border: 3px solid #A0AEC0;
    box-shadow: 0 0 20px rgba(160, 174, 192, 0.4), inset 0 0 10px rgba(160, 174, 192, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #A0AEC0;
    font-size: 1.85rem;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.tutor-trigger-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 0 28px rgba(160, 174, 192, 0.65), inset 0 0 14px rgba(160, 174, 192, 0.35);
    border-color: #ffffff;
    color: #ffffff;
}

/* SVG Energy Beam connecting Bottom HUD button to Sidebar */
#hud-beam-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
}

@keyframes beamShoot {
    0% {
        stroke-dashoffset: 1000;
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 0;
    }
}

.chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 200px;
    max-height: 350px;
}

/* Chat Messages */
.chat-message {
    display: flex;
    flex-direction: column;
}

.chat-message.tutor {
    align-items: flex-start;
}

.chat-message.player {
    align-items: flex-end;
}

.chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
}

.chat-message.tutor .chat-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border-top-left-radius: 2px;
}

.chat-message.player .chat-bubble {
    background: #2b6cb0;
    color: white;
    border-top-right-radius: 2px;
}

/* Chat Input Area */
.chat-input-bar {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-input-field {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    outline: none;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.chat-input-field:focus {
    border-color: var(--border-hud-hover);
}

.chat-send-btn {
    background: #3182ce;
    border: none;
    border-radius: 6px;
    color: white;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chat-send-btn:hover {
    background: #4299e1;
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Quick prompts grid */
.quick-prompts-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 12px 10px 12px;
    background: rgba(0, 0, 0, 0.2);
}

.quick-prompt-btn {
    font-family: inherit;
    background: rgba(160, 174, 192, 0.05);
    border: 1px solid rgba(160, 174, 192, 0.2);
    border-radius: 20px;
    padding: 4px 12px;
    color: #A0AEC0;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-prompt-btn:hover {
    background: rgba(160, 174, 192, 0.15);
    border-color: #A0AEC0;
}

/* Avatar layout for Chat log header */
.tutor-avatar-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tutor-avatar-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(160, 174, 192, 0.1);
    border: 1px solid #A0AEC0;
    color: #A0AEC0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* 4. Bottom Utility Toolbar */
.bottom-hud-dock {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 15px;
    background: var(--bg-hud);
    border: 1px solid var(--border-hud);
    border-radius: 12px;
    padding: 8px 15px;
    box-shadow: var(--glow-cyan);
    backdrop-filter: blur(10px);
}

@media (max-width: 600px) {
    .bottom-hud-dock {
        width: calc(100% - 40px);
        justify-content: center;
        gap: 8px;
        padding: 8px;
        bottom: 10px;
    }
}

.bottom-dock-btn {
    font-family: inherit;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 16px;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.bottom-dock-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.bottom-dock-btn.risk-btn {
    border-color: var(--color-risk);
    color: var(--color-risk);
}

.bottom-dock-btn.risk-btn:hover {
    background: rgba(221, 107, 32, 0.1);
}

.bottom-dock-btn.risk-btn.active-risks {
    background: var(--color-risk);
    color: white;
    box-shadow: var(--glow-orange);
}

.bottom-dock-btn.report-btn {
    border-color: var(--color-budget);
    color: var(--color-budget);
}

.bottom-dock-btn.report-btn:hover {
    background: rgba(72, 187, 120, 0.1);
}

.bottom-dock-btn.info-btn {
    border-color: #3182ce;
    color: #3182ce;
}

.bottom-dock-btn.info-btn:hover {
    background: rgba(49, 130, 206, 0.1);
}

/* Typing indicator anim */
.typing-indicator span {
    height: 6px;
    width: 6px;
    float: left;
    margin: 0 1.5px;
    background-color: var(--text-muted);
    display: block;
    border-radius: 50%;
    opacity: 0.4;
    animation: typing 1s infinite;
}

.typing-indicator span:nth-of-type(1) { animation-delay: 0s; }
.typing-indicator span:nth-of-type(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-of-type(3) { animation-delay: 0.4s; }

@keyframes typing {
    0% { transform: translateY(0px); opacity: 0.4; }
    50% { transform: translateY(-5px); opacity: 1; }
    100% { transform: translateY(0px); opacity: 0.4; }
}

/* Modals overlays details inside game */
.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 14, 20, 0.85);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
}

.game-modal.is-hidden {
    display: none !important;
}

.game-modal-card {
    background: var(--bg-hud);
    border: 2px solid var(--border-hud);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    box-shadow: var(--glow-cyan);
    overflow: hidden;
    animation: modal-slide 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes modal-slide {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.game-modal-header {
    background: rgba(160, 174, 192, 0.08);
    border-bottom: 1px solid rgba(160, 174, 192, 0.15);
    padding: 15px 20px;
    font-weight: bold;
    color: #A0AEC0;
    font-size: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.5;
}

.game-modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close-btn:hover {
    color: white;
}

/* Legacy box adjustments */
    var ob = scene.getObjectByProperty("externalID", externalID);
    removeObject3D(ob);
};
*/

/* Redesigned HUD Banners (Top Left, Top Center, Top Right, and Bottom Bar) */

/* 1. Top Left Panel (City Badge in Top Left Corner) */
.top-left-hud-panel {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 1045;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(160, 174, 192, 0.45);
    border-radius: 12px;
    padding: 8px 16px;
    color: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 12px rgba(160, 174, 192, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    font-family: var(--font-primary);
    transition: all 0.3s ease;
}

.top-left-hud-panel .hud-large-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .top-left-hud-panel {
        top: 10px;
        left: 10px;
        padding: 5px 12px;
        border-radius: 10px;
    }
    .top-left-hud-panel .hud-large-value {
        font-size: 0.82rem;
    }
}

/* 2. Top Right Panel (Level / XP / Date) */
.top-right-hud-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1040;
    background: rgba(22, 32, 50, 0.9);
    border: 2px solid #2e5b66;
    border-radius: 12px;
    padding: 10px 20px;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
    font-family: var(--font-primary);
}
.top-right-hud-panel .hud-xp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.top-right-hud-panel .hud-xp-label {
    font-size: 0.75rem;
    font-weight: bold;
    color: #4fd1c5;
}
.top-right-hud-panel .hud-xp-bar-container {
    flex-grow: 1;
    height: 8px;
    background: #2d3748;
    border-radius: 4px;
    overflow: hidden;
}
.top-right-hud-panel .hud-xp-bar-fill {
    height: 100%;
    background: #4fd1c5;
    border-radius: 4px;
}
.top-right-hud-panel .hud-date-row {
    font-size: 0.85rem;
    font-weight: bold;
    color: #e2e8f0;
    text-transform: uppercase;
    text-align: center;
}

/* 3. Top Center Bar Layout Adjustments */
.top-hud-bar {
    position: absolute !important;
    top: 18px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 1040 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    background: rgba(15, 23, 42, 0.92) !important;
    border: 1px solid rgba(160, 174, 192, 0.45) !important;
    border-radius: 20px !important;
    padding: 0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(160, 174, 192, 0.15) !important;
    backdrop-filter: blur(12px);
    font-family: var(--font-primary);
    width: max-content !important;
    max-width: 95vw !important;
    overflow: visible !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.top-hud-scroll-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    padding: 10px 28px 10px 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Attached Bottom Edge Toggle Tab */
.top-hud-edge-tab,
.top-hud-toggle-btn {
    position: absolute !important;
    bottom: -18px !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(160, 174, 192, 0.5) !important;
    border-top: none !important;
    border-radius: 0 0 12px 12px !important;
    color: #A0AEC0 !important;
    padding: 2px 16px !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5) !important;
    z-index: 1045 !important;
    transition: all 0.25s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    pointer-events: auto !important;
}

.top-hud-edge-tab:hover,
.top-hud-toggle-btn:hover {
    background: rgba(160, 174, 192, 0.25) !important;
    color: #ffffff !important;
}

/* Collapsed State */
.top-hud-bar.hud-collapsed {
    transform: translate(-50%, -100%) !important;
}

.top-hud-bar.hud-collapsed .top-hud-edge-tab,
.top-hud-bar.hud-collapsed .top-hud-toggle-btn {
    bottom: -28px !important;
    border-top: 1px solid rgba(160, 174, 192, 0.5) !important;
    border-radius: 0 0 14px 14px !important;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%) !important;
    color: #A0AEC0 !important;
    padding: 4px 18px !important;
    font-size: 0.75rem !important;
    box-shadow: 0 4px 15px rgba(160, 174, 192, 0.35) !important;
}

.hud-sim-controls {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-left: 10px !important;
    flex-shrink: 0 !important;
}
.top-hud-bar .hud-card-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.top-hud-bar .hud-circle-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: white;
}
.top-hud-bar .hud-circle-icon.green {
    background: #2ea85c;
}
.top-hud-bar .hud-circle-icon.red {
    background: #e53e3e;
}
.top-hud-bar .hud-card-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.top-hud-bar .hud-card-label {
    font-size: 0.65rem;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.top-hud-bar .hud-card-value {
    font-size: 1.1rem;
    font-weight: bold;
}
.top-hud-bar .hud-card-value.green {
    color: #48bb78;
}
.top-hud-bar .hud-card-value.red {
    color: #f56565;
}
.top-hud-bar .hud-plus-btn {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    transition: all 0.2s ease;
}
.top-hud-bar .hud-plus-btn.green {
    color: #48bb78;
    border-color: rgba(72, 187, 120, 0.4);
}
.top-hud-bar .hud-plus-btn.green:hover {
    background: rgba(72, 187, 120, 0.15);
    border-color: #48bb78;
}
.top-hud-bar .hud-plus-btn.red {
    color: #f56565;
    border-color: rgba(245, 101, 101, 0.4);
}
.top-hud-bar .hud-plus-btn.red:hover {
    background: rgba(245, 101, 101, 0.15);
    border-color: #f56565;
}
.top-hud-bar .hud-progress-container {
    width: 140px;
    height: 14px;
    background: #2d3748;
    border-radius: 7px;
    position: relative;
    overflow: visible;
    margin-top: 2px;
}
.top-hud-bar .hud-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #dd6b20, #ecc94b);
    border-radius: 7px;
    transition: width 0.3s ease;
}
.top-hud-bar .hud-progress-emoji {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
}

/* 4. Bottom Center HUD Ability Bar */
.bottom-hud-bar {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1040;
    background: rgba(22, 32, 50, 0.9);
    border: 2px solid #2e5b66;
    border-radius: 20px;
    padding: 12px 25px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    display: flex;
    gap: 15px;
    align-items: center;
    backdrop-filter: blur(10px);
    font-family: var(--font-primary);
}
.hud-circle-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.hud-circle-btn-container:hover {
    transform: translateY(-3px);
}
.hud-circle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: white;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    transition: box-shadow 0.2s ease;
}
.hud-circle-btn:hover {
    box-shadow: 0 0 12px currentColor;
}
.hud-circle-btn.build { background: #3182ce; color: #90cdf4; }
.hud-circle-btn.roads { background: #dd6b20; color: #fbd38d; }
.hud-circle-btn.zone { background: #38a169; color: #9ae6b4; }
.hud-circle-btn.economy { background: #ecc94b; color: #fefcbf; }
.hud-circle-btn.parks { background: #319795; color: #81e6d9; }
.hud-circle-btn.prevention { background: #e53e3e; color: #feb2b2; }
.hud-circle-btn.info { background: #805ad5; color: #d6bcfa; }
.hud-circle-btn.settings { background: #718096; color: #e2e8f0; }

.hud-circle-btn-label {
    font-size: 0.6rem;
    font-weight: bold;
    color: #cbd5e0;
    letter-spacing: 0.5px;
}

/* Active Tool highlighting feedback */
.hud-circle-btn-container {
    position: relative;
}

.hud-circle-btn-container.active-tool {
    transform: translateY(-5px);
}

.hud-circle-btn-container.active-tool .hud-circle-btn {
    box-shadow: 0 0 18px currentColor !important;
    border: 2px solid white;
}

.hud-circle-btn-container.active-tool .hud-circle-btn-label {
    color: white;
    text-shadow: 0 0 8px currentColor;
}

/* Option A: Expanding Pulse Ring on HUD Button Click */
.hud-btn-pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin-top: -36px;
    margin-left: -25px;
    border-radius: 50%;
    border: 3px solid #A0AEC0;
    pointer-events: none;
    animation: btnPulseRing 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    z-index: 100;
}

@keyframes btnPulseRing {
    0% {
        transform: scale(0.6);
        opacity: 1;
        box-shadow: 0 0 10px #A0AEC0, inset 0 0 10px #A0AEC0;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
        box-shadow: 0 0 25px rgba(160, 174, 192, 0), inset 0 0 20px rgba(160, 174, 192, 0);
    }
}

/* Option A: Sidebar Beacon Edge Glow on Panel Open */
.left-hud-panel.panel-open-glow {
    animation: sidebarBeaconSweep 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes sidebarBeaconSweep {
    0% {
        box-shadow: -10px 0 35px rgba(160, 174, 192, 0.9), 0 0 20px rgba(160, 174, 192, 0.6) inset;
        border-color: #A0AEC0;
    }
    50% {
        box-shadow: 0 0 45px rgba(160, 174, 192, 0.8), 0 0 30px rgba(160, 174, 192, 0.5) inset;
        border-color: #f5d060;
    }
    100% {
        box-shadow: var(--glow-cyan);
        border-color: var(--border-hud);
    }
}

/* ==========================================================================
   Intro Information Modal (#starterInfo)
   ========================================================================== */
#starterInfo {
    z-index: 20000 !important;
}

#starterInfo .modal-background {
    background: linear-gradient(180deg, #53758e 0%, #668aa3 50%, #4f7088 100%) !important;
    opacity: 1 !important;
}

#starterInfo .modal-card {
    position: relative !important;
    top: auto !important;
    max-width: 650px !important;
    width: 90% !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35) !important;
    margin: 0 auto !important;
}

#starterInfo .modal-card-head {
    background-color: #668aa3 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 16px 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

#starterInfo .modal-card-title {
    color: #ffffff !important;
    font-family: var(--font-primary), 'Segoe UI', Roboto, sans-serif !important;
    font-size: 1.6rem !important;
    font-weight: 800 !important;
    letter-spacing: 1px !important;
    margin: 0 !important;
    text-transform: uppercase !important;
    text-align: left !important;
    transform: none !important;
}

#starterInfo .intro-next-btn {
    background: linear-gradient(180deg, #f7d770 0%, #e0a316 100%) !important;
    color: #2b1800 !important;
    font-weight: 800 !important;
    font-size: 1rem !important;
    padding: 8px 24px !important;
    border-radius: 30px !important;
    border: none !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

#starterInfo .intro-next-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28) !important;
}

#starterInfo .modal-card-body {
    background-color: #ffffff !important;
    padding: 24px 28px !important;
    color: #2d3748 !important;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

#starterInfo .intro-desc {
    background: #f0f5f9;
    border-left: 4px solid #668aa3;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
    color: #334155;
    font-size: 0.98rem;
    line-height: 1.5;
}

#starterInfo h2.intro-heading {
    color: #668aa3 !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    margin: 0 0 8px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

#starterInfo hr.intro-divider {
    border: 0 !important;
    height: 2px !important;
    background-color: #668aa3 !important;
    margin: 0 0 16px 0 !important;
    opacity: 0.25 !important;
}

#starterInfo ul.intro-list {
    margin: 0 0 10px 0 !important;
    padding-left: 20px !important;
    list-style-type: disc !important;
}

#starterInfo ul.intro-list li {
    margin-bottom: 8px !important;
    color: #334155 !important;
    font-size: 0.95rem !important;
}

#starterInfo ul.intro-list li a {
    color: #3182ce !important;
    font-weight: 600 !important;
    text-decoration: underline !important;
}

#starterInfo .modal-card-foot {
    background-color: #668aa3 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 14px 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

#starterInfo .footer-logo img {
    height: 36px !important;
    width: auto !important;
    display: block !important;
}

#starterInfo .footer-contact {
    color: #ffffff !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
}

/* ==========================================================================
   Economy & Game Report Modal (#modalDetails) Styling
   ========================================================================== */
#modalDetails {
    z-index: 10005 !important;
}

#modalDetails .modal-card {
    max-width: 720px !important;
    width: 92% !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4) !important;
    margin: 0 auto !important;
}

#modalDetails .modal-card-head {
    background-color: #668aa3 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 18px 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

#modalDetails .modal-card-title {
    color: #ffffff !important;
    font-family: var(--font-primary), 'Segoe UI', Roboto, sans-serif !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    margin: 0 !important;
    text-transform: uppercase !important;
}

#modalDetails .modal-card-body {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    padding: 24px 28px !important;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    max-height: 75vh !important;
    overflow-y: auto !important;
}

#modalDetails .game-reports {
    margin-bottom: 24px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 18px 20px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

#modalDetails .game-reports h2 {
    color: #668aa3 !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin: 0 0 6px 0 !important;
}

#modalDetails .game-reports hr {
    background-color: #668aa3 !important;
    height: 2px !important;
    margin: 0 0 16px 0 !important;
    opacity: 0.25 !important;
}

#modalDetails .game-progress-info,
#modalDetails .game-progress-info-report {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    margin-bottom: 10px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

#modalDetails .game-progress-info .has-text-weight-bold,
#modalDetails .game-progress-info-report .has-text-weight-bold {
    color: #334155 !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
}

#modalDetails .game-progress-info .has-text-right,
#modalDetails .game-progress-info-report .has-text-right {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
}

/* Header & Footer Action Buttons for modalDetails */
.report-close-btn-header {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 20px !important;
    padding: 6px 16px !important;
    font-weight: 800 !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.report-close-btn-header:hover {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    transform: scale(1.05) !important;
}

.report-export-btn {
    background: linear-gradient(180deg, #f7d770 0%, #e0a316 100%) !important;
    color: #2b1800 !important;
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    padding: 10px 22px !important;
    border-radius: 30px !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.report-export-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3) !important;
}

.report-close-btn-footer {
    background: #e2e8f0 !important;
    color: #1e293b !important;
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    padding: 10px 22px !important;
    border-radius: 30px !important;
    border: 1px solid #cbd5e1 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.report-close-btn-footer:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
    border-color: #ef4444 !important;
    transform: scale(1.05) !important;
}

/* Prevention Guide Banner Box inside Left HUD Panel */
.prevention-guide-box {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    border: 2px solid #f5d060 !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    margin-bottom: 14px !important;
    color: #f8fafc !important;
    font-size: 0.85rem !important;
    line-height: 1.45 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

.prevention-guide-box strong {
    color: #f5d060 !important;
}

/* Timer Badge in Top HUD Bar */
.hud-timer-badge {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(160, 174, 192, 0.4) !important;
    border-radius: 20px !important;
    padding: 5px 14px !important;
    color: #A0AEC0 !important;
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    letter-spacing: 0.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    font-family: 'Courier New', Courier, monospace !important;
    box-shadow: 0 2px 10px rgba(160, 174, 192, 0.15) !important;
}

/* Mobile Responsive Bottom HUD Bar & Touch Scroll */
@media (max-width: 768px) {
    .bottom-hud-bar {
        bottom: 10px !important;
        left: 2.5vw !important;
        right: 2.5vw !important;
        transform: none !important;
        width: 95vw !important;
        max-width: 95vw !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: scroll !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-x !important;
        justify-content: flex-start !important;
        padding: 8px 12px !important;
        gap: 14px !important;
        border-radius: 18px !important;
        box-sizing: border-box !important;
        scrollbar-width: none !important;
    }
    .bottom-hud-bar::-webkit-scrollbar {
        display: none !important;
    }
    .hud-circle-btn-container {
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        touch-action: pan-x !important;
    }
    .hud-circle-btn {
        width: 38px !important;
        height: 38px !important;
        font-size: 0.95rem !important;
        touch-action: pan-x !important;
    }
    .hud-circle-btn-label {
        font-size: 0.6rem !important;
        white-space: nowrap !important;
        touch-action: pan-x !important;
    }
}

.hud-sim-controls {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    margin-left: 14px !important;
    flex-shrink: 0 !important;
}

#clockDiv {
    margin-right: 6px !important;
    flex-shrink: 0 !important;
}

/* Top HUD Action Button (Start / Finish / Start Again) */
#sim-play-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    min-width: 115px !important;
    justify-content: center !important;
    margin-left: 8px !important;
    margin-right: 4px !important;
    background: linear-gradient(135deg, rgba(160, 174, 192, 0.25) 0%, rgba(59, 130, 246, 0.35) 100%) !important;
    border: 1px solid rgba(160, 174, 192, 0.5) !important;
    border-radius: 20px !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    font-size: 0.85rem !important;
    padding: 7px 18px !important;
    letter-spacing: 0.5px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    box-shadow: 0 2px 10px rgba(160, 174, 192, 0.2) !important;
    transition: all 0.2s ease !important;
    font-family: var(--font-primary) !important;
    height: auto !important;
    line-height: 1.2 !important;
}

#sim-play-btn:hover {
    background: linear-gradient(135deg, rgba(160, 174, 192, 0.4) 0%, rgba(59, 130, 246, 0.55) 100%) !important;
    box-shadow: 0 4px 15px rgba(160, 174, 192, 0.4) !important;
    transform: translateY(-1px) !important;
}

#sim-play-btn[value="finish"] {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(239, 68, 68, 0.35) 100%) !important;
    border-color: rgba(245, 158, 11, 0.6) !important;
    color: #fbbf24 !important;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25) !important;
}

#sim-play-btn[value="again"] {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(59, 130, 246, 0.35) 100%) !important;
    border-color: rgba(16, 185, 129, 0.6) !important;
    color: #34d399 !important;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25) !important;
}

/* Budget Info Modal Mobile Height & Sticky Footer Fix */
#modalBudgetInfo {
    display: none;
}

#modalBudgetInfo.is-active {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px !important;
}

#modalBudgetInfo .modal-card {
    max-height: 65vh !important;
    height: auto !important;
    width: 90vw !important;
    max-width: 580px !important;
    margin: auto !important;
    border-radius: 18px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

#modalBudgetInfo .modal-card-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
}

#modalBudgetInfo .modal-card-foot {
    flex-shrink: 0 !important;
    position: sticky !important;
    bottom: 0 !important;
    background: #0f172a !important;
    z-index: 20 !important;
    padding: 10px 18px !important;
}

/* Mobile Responsive Menu Container & Launch Simulation Scroll Fix */
#modal-js-example,
#starterInfo {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
}

@media (max-width: 768px) {
    #modal-js-example {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        justify-content: flex-start !important;
        padding-top: 10px !important;
        padding-bottom: 90px !important; /* Generous bottom clearance above mobile browser bars */
    }

    .menu-container {
        margin-top: 0 !important;
        margin-bottom: 40px !important;
        gap: 12px !important;
    }

    .menu-title-section h1 {
        font-size: 2.6rem !important;
        letter-spacing: 3px !important;
    }

    .menu-title-badge {
        font-size: 0.7rem !important;
        padding: 4px 12px !important;
    }

    .map-selection-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .launch-button {
        padding: 14px 28px !important;
        font-size: 1.05rem !important;
        margin-bottom: 40px !important; /* Ensure launch button is 100% reachable */
    }

    /* Top HUD Mobile Width & Horizontal Swipe Containment */
    .top-hud-bar {
        top: 10px !important;
        width: 94vw !important;
        max-width: 94vw !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }
    .top-hud-scroll-wrapper {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-x !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        padding: 8px 16px !important;
        scrollbar-width: none !important;
        width: 100% !important;
    }
    .top-hud-scroll-wrapper::-webkit-scrollbar {
        display: none !important;
    }
    .top-hud-bar .hud-card-item,
    .top-hud-bar .hud-sim-controls {
        flex-shrink: 0 !important;
    }
}

/* ── Mobile Economy Report Modal ───────────────────────────── */
@media (max-width: 768px) {
    /* Make modal fill the screen properly */
    #modalDetails .modal-card {
        width: 96vw !important;
        max-width: 96vw !important;
        max-height: 90vh !important;
        margin: auto !important;
        border-radius: 14px !important;
        overflow: hidden !important;
    }

    /* Scrollable body */
    #modalDetails .modal-card-body {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 14px 12px !important;
        max-height: calc(90vh - 120px) !important;
    }

    /* Stack grid to single column */
    #modalDetails .game-reports > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    /* Readable row text */
    #modalDetails .game-progress-info {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 5px 0 !important;
        border-bottom: 1px solid rgba(0,0,0,0.06) !important;
        font-size: 0.82rem !important;
        gap: 8px !important;
    }

    #modalDetails .game-progress-info .has-text-right {
        text-align: right !important;
        white-space: nowrap !important;
        font-weight: 600 !important;
        flex-shrink: 0 !important;
    }

    /* Section headers */
    #modalDetails .game-reports h2 {
        font-size: 1rem !important;
        margin-top: 14px !important;
        margin-bottom: 4px !important;
    }

    /* Header & footer */
    #modalDetails .modal-card-head,
    #modalDetails .modal-card-foot {
        padding: 12px 16px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    #modalDetails .modal-card-title {
        font-size: 0.95rem !important;
    }

    /* Buttons - easier to tap */
    #modalDetails .report-export-btn,
    #modalDetails .report-close-btn-footer {
        padding: 10px 18px !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
        flex: 1 !important;
        text-align: center !important;
    }
}

/* Google Maps Autocomplete Dropdown Styling */
.pac-container {
    z-index: 99999 !important;
    background-color: #1a233a !important;
    border: 1px solid rgba(160, 174, 192, 0.4) !important;
    border-radius: 8px !important;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
    margin-top: 4px !important;
}
.pac-item {
    border-top: 1px solid rgba(160, 174, 192, 0.1) !important;
    color: #cbd5e1 !important;
    font-size: 0.8rem !important;
    padding: 8px 12px !important;
    cursor: pointer !important;
}
.pac-item:hover {
    background-color: rgba(160, 174, 192, 0.15) !important;
}
.pac-item-query {
    color: #ffffff !important;
    font-size: 0.85rem !important;
}
.pac-matched {
    color: #60a5fa !important;
}
.pac-icon {
    display: none !important;
}

/* Premium Gold/White Map Select Tabs */
.tabs li a {
    cursor: pointer !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: rgba(255, 255, 255, 0.75) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
    font-weight: 700;
    transition: all 0.25s ease;
}
.tabs li:not(.is-active) a:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
}
.tabs li.is-active a {
    background: linear-gradient(180deg, #f7d770 0%, #e0a316 100%) !important;
    color: #2b1800 !important;
    border-color: #fce8a6 !important;
    box-shadow: 0 4px 14px rgba(224, 163, 22, 0.4) !important;
}

/* Premium Gold/White Custom Sandbox Design */
#custom_city_section {
    background: #ffffff !important;
    border: 3px solid #d8e4ec !important;
    border-radius: 14px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
    padding: 24px !important;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}
#custom_city_section:hover {
    border-color: #f5d060 !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2), 0 0 0 2px #f5d060 !important;
    transform: translateY(-2px) !important;
}

/* ==========================================================================
   Real-World Aerial Minimap (Overview Radar) HUD
   ========================================================================== */
.minimap-hud {
    position: fixed;
    bottom: 25px;
    right: 25px;
    left: auto;
    z-index: 1030;
    width: 270px !important;
    min-width: 270px !important;
    max-width: 90vw;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid rgba(56, 189, 248, 0.45);
    border-radius: 15px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.65), 0 0 18px rgba(56, 189, 248, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-transform: translateX(0);
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.38s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.3s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
    font-family: var(--font-primary, system-ui, sans-serif);
}

.minimap-hud:hover {
    border-color: rgba(56, 189, 248, 0.75);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.72), 0 0 22px rgba(56, 189, 248, 0.25);
}

/* Smooth Slide Right Off-Screen when AI Tutor Bubble is Open */
.minimap-hud.is-slid-out {
    transform: translateX(calc(100% + 50px)) !important;
    -webkit-transform: translateX(calc(100% + 50px)) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.minimap-hud.is-collapsed {
    width: 205px !important;
    min-width: 205px !important;
}

.minimap-hud.is-collapsed .minimap-body {
    display: none !important;
}

.minimap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 13px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
    border-bottom: 1px solid rgba(56, 189, 248, 0.25);
    box-sizing: border-box;
}

.minimap-title-group {
    display: flex;
    align-items: center;
    gap: 7.5px;
    overflow: hidden;
    white-space: nowrap;
}

.minimap-pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #38bdf8;
    border-radius: 50%;
    box-shadow: 0 0 7.5px #38bdf8;
    animation: radarPulse 2s infinite;
    flex-shrink: 0;
}

@keyframes radarPulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 10px #38bdf8; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

.minimap-title {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #38bdf8;
    text-transform: uppercase;
}

.minimap-city {
    font-size: 0.7rem;
    font-weight: 600;
    color: #cbd5e1;
    max-width: 115px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.minimap-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.minimap-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    color: #cbd5e1;
    padding: 2.5px 7px;
    font-size: 0.66rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
    transition: all 0.2s ease;
}

.minimap-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
    color: #ffffff;
}

.minimap-body {
    position: relative;
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #090d16;
    box-sizing: border-box;
    width: 100%;
}

#minimap-canvas {
    width: 245px !important;
    height: 245px !important;
    min-width: 245px !important;
    min-height: 245px !important;
    max-width: 245px !important;
    max-height: 245px !important;
    flex-shrink: 0 !important;
    -webkit-flex-shrink: 0 !important;
    aspect-ratio: 1 / 1;
    border-radius: 9px;
    display: block;
    box-shadow: inset 0 0 9px rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
}

.minimap-coords-badge {
    position: absolute;
    bottom: 17px;
    left: 17px;
    font-size: 0.64rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(15, 23, 42, 0.85);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    letter-spacing: 0.4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 550px) {
    .minimap-hud {
        bottom: 95px;
        right: 15px;
        left: auto;
        width: 200px !important;
    }
    #minimap-canvas {
        width: 175px !important;
        height: 175px !important;
    }
}

