/* 3D Outdoor Map Explorer & POV Walker Stylesheet */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    background-color: #090d12;
    color: #e6edf3;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Reticle / Crosshair for POV Mode */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 50;
    display: none;
}
#crosshair::before, #crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}
#crosshair::before {
    top: 4px;
    left: 0;
    width: 10px;
    height: 2px;
}
#crosshair::after {
    top: 0;
    left: 4px;
    width: 2px;
    height: 10px;
}

/* Glassmorphism Panels */
.glass-panel {
    background: rgba(13, 17, 23, 0.82);
    border: 1px solid rgba(48, 54, 61, 0.8);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    color: #c9d1d9;
    z-index: 20;
}

/* Top HUD Bar */
#top-hud {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    pointer-events: auto;
    z-index: 60;
}

.hud-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.map-badge {
    background: #1f6feb;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hud-map-name {
    font-size: 15px;
    font-weight: 600;
    color: #f0f6fc;
}

.hud-actions {
    display: flex;
    gap: 8px;
}

.btn {
    background: #21262d;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn:hover {
    background: #30363d;
    border-color: #58a6ff;
    color: #58a6ff;
}

.btn-primary {
    background: #238636;
    border-color: #2ea043;
    color: #fff;
}

.btn-primary:hover {
    background: #2ea043;
    border-color: #3fb950;
    color: #fff;
}

/* Bottom Left: Player Telemetry */
#player-telemetry {
    position: absolute;
    bottom: 16px;
    left: 16px;
    padding: 10px 14px;
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
}

.telemetry-row {
    display: flex;
    justify-content: space-between;
}

.telemetry-label { color: #8b949e; }
.telemetry-val { color: #58a6ff; font-weight: 600; }

/* Bottom Right: Minimap */
#minimap-container {
    position: absolute;
    bottom: 16px;
    right: 16px;
    width: 170px;
    height: 170px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#minimap-canvas {
    width: 156px;
    height: 136px;
    background: #090d12;
    border-radius: 4px;
    border: 1px solid #30363d;
}

.minimap-label {
    font-size: 10px;
    color: #8b949e;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Center Pointer Lock Instruction Overlay */
#click-to-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 13, 18, 0.7);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 40;
    cursor: pointer;
}

.overlay-box {
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 28px 36px;
    text-align: center;
    box-shadow: 0 12px 36px rgba(0,0,0,0.8);
}

.overlay-box h1 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #58a6ff;
}

.overlay-box p {
    font-size: 13px;
    color: #8b949e;
    margin-bottom: 18px;
}

.keybinds-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    text-align: left;
    font-size: 12px;
    margin-bottom: 20px;
    background: #161b22;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #21262d;
}

.key-badge {
    background: #30363d;
    color: #f0f6fc;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
    margin-right: 4px;
}

/* Developer Mode Panel (Collapsible via Tab) */
#dev-panel {
    position: absolute;
    top: 70px;
    left: 14px;
    width: 290px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding: 14px;
    display: none;
    z-index: 60;
}

.dev-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #58a6ff;
    border-bottom: 1px solid #30363d;
    padding-bottom: 4px;
    margin: 10px 0 8px 0;
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 4px 0;
}

.toggle-item span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Map Selection Modal */
#map-catalog-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 13, 18, 0.85);
    backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    width: 860px;
    max-width: 92vw;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #30363d;
}

.modal-header h2 {
    font-size: 16px;
    color: #58a6ff;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.map-card {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s ease;
}

.map-card:hover {
    border-color: #58a6ff;
    transform: translateY(-2px);
}

.map-card.active-map {
    border-color: #238636;
    background: rgba(35, 134, 54, 0.08);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #f0f6fc;
}

.card-stats {
    font-size: 11px;
    color: #8b949e;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #161b22;
    padding: 8px;
    border-radius: 6px;
}

/* Loading Overlay */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #090d12;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
    transition: opacity 0.3s ease;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(88, 166, 255, 0.15);
    border-left-color: #58a6ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

#loading-msg {
    font-size: 14px;
    font-weight: 500;
    color: #58a6ff;
}
