* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    background: #F4ECD8;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

#canvas {
    display: block;
    touch-action: none;
}

#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(180deg, rgba(244,236,216,0.95) 0%, rgba(244,236,216,0.8) 100%);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-bottom: 1px solid rgba(139,115,85,0.3);
}

.header-content {
    display: flex;
    align-items: baseline;
    gap: 20px;
}

#header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 700;
    color: #4A4A4A;
    letter-spacing: 2px;
}

.tagline {
    font-style: italic;
    color: #8B7355;
    font-size: 14px;
}

.stats {
    font-size: 12px;
    color: #999;
}

#controls {
    position: fixed;
    bottom: 80px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

#controls button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 22px;
    background: rgba(255,255,255,0.9);
    font-size: 24px;
    color: #4A4A4A;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

#controls button:hover {
    background: white;
    transform: scale(1.05);
}

#controls button:active {
    transform: scale(0.95);
}

.panel {
    background: rgba(255,252,245,0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    border: 1px solid rgba(139,115,85,0.2);
}

#legend {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 100;
    padding: 12px;
}

.legend-toggle {
    cursor: pointer;
    font-size: 18px;
    margin-bottom: 8px;
}

.legend-content {
    transition: all 0.3s ease;
}

.legend-content.collapsed {
    display: none;
}

.legend-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 14px;
    margin-bottom: 10px;
    color: #4A4A4A;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}

.color-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

.color-box.residential { background: #F5E6D3; }
.color-box.commercial { background: #D4A5A5; }
.color-box.parks { background: #8FBC8F; }
.color-box.industrial { background: #708090; }
.color-box.water { background: #5B9AA0; }
.color-box.freeway { background: #505050; }
.color-box.mountain { background: #9B8B7B; }

#minimap {
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 180px;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    border: 2px solid rgba(139,115,85,0.3);
    z-index: 100;
    background: #F4ECD8;
}

#minimapCanvas {
    width: 100%;
    height: 100%;
}

#infoPanel {
    position: fixed;
    left: 20px;
    top: 70px;
    width: 280px;
    max-height: calc(100vh - 280px);
    padding: 20px;
    z-index: 100;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#infoPanel.hidden {
    transform: translateX(-320px);
    opacity: 0;
    pointer-events: none;
}

#closePanel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
}

#closePanel:hover {
    background: rgba(0,0,0,0.1);
}

#neighborhoodName {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: #4A4A4A;
    margin-bottom: 12px;
    padding-right: 30px;
}

#neighborhoodDesc {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 16px;
}

#landmarks {
    font-size: 13px;
    color: #8B7355;
    padding-top: 12px;
    border-top: 1px dashed rgba(139,115,85,0.3);
}

#tooltip {
    position: fixed;
    background: rgba(74,74,74,0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: 200;
    white-space: nowrap;
}

#tooltip.hidden {
    display: none;
}

#progress {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.9);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

#footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(0deg, rgba(244,236,216,0.95) 0%, rgba(244,236,216,0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 12px;
    color: #8B7355;
    z-index: 100;
    border-top: 1px solid rgba(139,115,85,0.2);
}

#footer a {
    color: #5B9AA0;
    text-decoration: none;
}

#footer a:hover {
    text-decoration: underline;
}

.compass {
    font-size: 16px;
}

/* Mobile styles */
@media (max-width: 768px) {
    #header h1 {
        font-size: 18px;
    }
    
    .tagline, .stats {
        display: none;
    }
    
    #infoPanel {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 50px;
        width: auto;
        max-height: 40vh;
        border-radius: 16px 16px 0 0;
    }
    
    #infoPanel.hidden {
        transform: translateY(100%);
    }
    
    #legend {
        top: 60px;
        right: 10px;
        padding: 8px;
    }
    
    .legend-content {
        display: none;
    }
    
    #minimap {
        width: 120px;
        height: 120px;
        bottom: 60px;
        left: 10px;
    }
    
    #controls {
        bottom: 60px;
        right: 10px;
    }
    
    #controls button {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    #progress {
        bottom: 50px;
        font-size: 11px;
    }
}