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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow: hidden;
    background: linear-gradient(135deg, #6a5acd 0%, #4d3f6d 100%);
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#title {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 900;
    color: white;
    text-shadow: 
        3px 3px 0 #FF6347,
        -1px -1px 0 #FFD700,
        0 4px 10px rgba(0,0,0,0.3);
    letter-spacing: 2px;
    text-align: center;
    pointer-events: none;
    z-index: 100;
}

#counter {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #FFA500;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    backdrop-filter: blur(5px);
    z-index: 100;
}

#counter span {
    font-size: 1.5rem;
    color: #FF6347;
}

#instructions {
    position: fixed;
    top: 80px;
    left: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.8;
    backdrop-filter: blur(5px);
    z-index: 100;
}

#instructions div {
    opacity: 0.9;
}

#layout-controls {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.layout-btn {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    text-align: left;
}

.layout-btn:hover:not(.disabled) {
    background: rgba(255, 99, 71, 0.6);
    border-color: #FF6347;
    transform: translateX(-5px);
}

.layout-btn.active {
    background: rgba(255, 99, 71, 0.8);
    border-color: #FF6347;
    box-shadow: 0 0 15px rgba(255, 99, 71, 0.5);
}

.layout-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.layout-btn small {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 2px;
}

#main-controls {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 100;
}

#push-btn, #reset-btn {
    padding: 15px 35px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#push-btn {
    background: linear-gradient(135deg, #FF6347, #FF4500);
    color: white;
}

#push-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 99, 71, 0.5);
}

#push-btn:active {
    transform: scale(0.98);
}

#reset-btn {
    background: linear-gradient(135deg, #4169E1, #3454D1);
    color: white;
}

#reset-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(65, 105, 225, 0.5);
}

#reset-btn:active {
    transform: scale(0.98);
}

#footer {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    z-index: 100;
}

#footer a {
    color: #FF69B4;
    text-decoration: none;
    font-weight: 600;
}

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

/* Mobile responsiveness */
@media (max-width: 768px) {
    #title {
        top: 10px;
        font-size: 1.3rem;
    }
    
    #counter {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    #counter span {
        font-size: 1.1rem;
    }
    
    #instructions {
        top: auto;
        bottom: 130px;
        left: 10px;
        padding: 10px 15px;
        font-size: 0.75rem;
    }
    
    #layout-controls {
        right: 10px;
        top: 60px;
        transform: none;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        max-width: calc(100% - 20px);
    }
    
    .layout-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .layout-btn small {
        display: none;
    }
    
    #main-controls {
        bottom: 70px;
        gap: 10px;
    }
    
    #push-btn, #reset-btn {
        padding: 12px 25px;
        font-size: 0.95rem;
    }
    
    #footer {
        bottom: 10px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    #layout-controls {
        position: fixed;
        top: 50px;
        left: 10px;
        right: 10px;
        flex-direction: row;
        justify-content: center;
        gap: 5px;
    }
    
    .layout-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
        flex: 1;
        text-align: center;
    }
    
    #instructions {
        display: none;
    }
}