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

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    background: #87CEEB;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

#scene-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
}

#resource-bar {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 8px;
    pointer-events: auto;
}

.resource {
    display: flex;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.resource-icon {
    margin-right: 5px;
    font-size: 16px;
}

#action-panel {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.action-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #4CAF50;
    border-radius: 12px;
    color: white;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover,
.action-btn:active {
    background: rgba(76, 175, 80, 0.3);
    transform: scale(1.05);
}

.action-btn.active {
    background: rgba(76, 175, 80, 0.6);
    border-color: #8BC34A;
}

.btn-icon {
    font-size: 18px;
    margin-bottom: 4px;
}

.btn-label {
    font-size: 12px;
}

#build-menu {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 10px;
    pointer-events: auto;
    max-width: 90vw;
    flex-wrap: wrap;
    justify-content: center;
}

.build-option {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #666;
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.build-option:hover,
.build-option:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.build-icon {
    font-size: 16px;
    margin-bottom: 2px;
}

.build-label {
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 2px;
}

.build-cost {
    font-size: 9px;
    color: #FFD700;
}

#status-panel {
    position: absolute;
    top: 70px;
    left: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 12px;
    text-align: center;
    pointer-events: auto;
}

#selection-info {
    margin-bottom: 4px;
}

#day-counter {
    font-weight: bold;
    color: #FFD700;
}

#tutorial {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    pointer-events: auto;
}

.tutorial-content {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    max-width: 80vw;
    max-width: 300px;
}

.tutorial-content h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.tutorial-content p {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

#tutorial-next {
    background: #4CAF50;
    border: none;
    border-radius: 8px;
    color: white;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

#tutorial-next:hover {
    background: #45a049;
}

#footer {
    position: fixed;
    bottom: 5px;
    right: 10px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: auto;
}

#footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

#footer a:hover {
    color: white;
}

.hidden {
    display: none !important;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .resource {
        font-size: 12px;
    }
    
    .resource-icon {
        font-size: 14px;
    }
    
    .action-btn {
        padding: 10px 12px;
        min-width: 70px;
    }
    
    .btn-icon {
        font-size: 16px;
    }
    
    .btn-label {
        font-size: 11px;
    }
    
    .build-option {
        min-width: 60px;
        padding: 6px 8px;
    }
    
    .build-icon {
        font-size: 14px;
    }
    
    #status-panel {
        font-size: 11px;
    }
}

/* Landscape mode adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    #resource-bar {
        top: 5px;
        padding: 6px;
    }
    
    #status-panel {
        top: 45px;
        padding: 6px 10px;
    }
    
    #action-panel {
        bottom: 10px;
    }
    
    #build-menu {
        bottom: 80px;
    }
}