body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #000;
    color: #fff;
    overflow: hidden; /* Prevent body scrolling */
}

#map2d, .leaflet-container {
    width: 100vw;
    height: 100vh;
    z-index: 1;
    background-color: #000 !important; /* Kills the blinding white void */
}

/* --- HUD & Layout Classes --- */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.text-center { text-align: center; }

/* --- Sleek, Translucent HUD Styling --- */
#hud-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 15, 15, 0.55) !important; 
    backdrop-filter: blur(6px); /* Frosted glass effect */
    -webkit-backdrop-filter: blur(6px); /* For Safari */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 12px !important;
    max-width: 650px;
    width: 90%;
    margin: 10px auto 0 auto !important; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 2000 !important;
}

/* --- HUD Safe Zone (Portrait) --- */
.hud-safe-zone {
    padding: 0 45px;
}

/* --- Buttons & UI States --- */
.hud-btn {
    background-color: #333;
    color: white;
    border: 1px solid #555;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}
.hud-btn:hover {
    background-color: #444;
}
button:disabled, .disabled-btn {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #555 !important;
}

#gear-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2000;
    font-size: 24px;
    cursor: pointer;
    background: rgba(0,0,0,0.6);
    padding: 6px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    background: transparent;
    border-top: 2px solid white;
    border-bottom: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000 !important;
    filter: drop-shadow(0px 0px 3px rgba(0,0,0,1));
}
#crosshair::before, #crosshair::after {
    content: '';
    position: absolute;
    background: white;
}
#crosshair::before { top: -10px; bottom: -10px; left: 18px; width: 2px; }
#crosshair::after { left: -10px; right: -10px; top: 18px; height: 2px; }

/* --- Modals (Now with Frosted Glass!) --- */
.modal {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 15, 15, 0.65); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.8);
    z-index: 2500;
    width: 85%;
    max-width: 400px;
    color: white;
}

.modal a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: bold;
}
.modal a:hover {
    text-decoration: underline;
}

.modal h2 { margin-top: 0; color: #4CAF50; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }
.setting-row { margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; }
.setting-row select { background: rgba(0,0,0,0.5); color: white; border: 1px solid #444; padding: 5px; border-radius: 4px; }
.close-btn { width: 100%; margin-top: 15px; background: #4CAF50; border-color: #4CAF50; font-size: 1.1rem; font-weight: bold; }

/* --- Error Screen --- */
#error-screen {
    text-align: center;
    color: white;
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3000;
    width: 80%;
    max-width: 400px;
    background: rgba(0,0,0,0.8);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #444;
}

/* --- Stats Grid --- */
.stats-grid {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-top: 20px;
    background: rgba(0,0,0,0.4); 
    padding: 15px 5px;
    border-radius: 8px;
}
.stat-box { display: flex; flex-direction: column; align-items: center; }
.stat-value { font-size: 1.5rem; color: #fff; font-weight: bold; }
.stat-label { font-size: 0.7rem; color: #aaa; text-transform: uppercase; margin-top: 4px; }

/* --- Calendar Archive Styles --- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 10px;
}
.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    font-size: 0.9rem;
}
.active-day { background: rgba(0,0,0,0.5); color: #fff; cursor: pointer; border: 1px solid rgba(255,255,255,0.1); }
.active-day:hover { background: rgba(255,255,255,0.1); }
.today-day { background: #4CAF50; color: #fff; border-color: #4CAF50; }
.today-day:hover { background: #45a049; }
.disabled-day { background: transparent; color: #555; cursor: default; }
.calendar-header { color: #888; font-size: 0.8rem; text-align: center; padding-bottom: 5px; }

/* --- Mobile Landscape Layout (Horizontal Phones) --- */
@media (max-height: 600px) and (orientation: landscape) {
    #hud-top {
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        left: auto !important;
        transform: none !important;
        width: 45vw !important;
        max-width: 320px !important;
        max-height: calc(100vh - 20px) !important;
        margin: 0 !important;
    }
    .hud-safe-zone { padding: 0 !important; }
    #aim-submit-row {
        flex-direction: column !important;
        gap: 6px !important;
    }
}
