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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
    position: relative;
}

.title-text {
    color: #00d4ff;
    position: relative;
    z-index: 2;
    display: inline-block;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 10px rgba(0, 212, 255, 0.5); }
    50% { text-shadow: 0 0 20px rgba(0, 212, 255, 0.8), 0 0 30px rgba(0, 212, 255, 0.6); }
}

.status-section {
    background: linear-gradient(135deg, #2a2a2a 0%, #252525 100%);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-message {
    font-size: 1.5em;
    color: #ff6b6b;
    margin-bottom: 10px;
}

.status-message.connected {
    color: #51cf66;
}

.controller-count {
    font-size: 1.2em;
    color: #a0a0a0;
}

.controllers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.controller {
    background: linear-gradient(135deg, #2a2a2a 0%, #252525 100%);
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #3a3a3a;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.controller:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.2);
}

.controller h3 {
    color: #00d4ff;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.buttons-section, .axes-section {
    margin-bottom: 20px;
}

.buttons-section h4, .axes-section h4 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
}

.button {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    border: 2px solid #4a4a4a;
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    transition: all 0.1s ease;
    position: relative;
    overflow: hidden;
}

.button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.8) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.button.pressed {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #1a1a1a;
    border-color: #00d4ff;
    transform: scale(0.95);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.button.pressed::before {
    width: 100px;
    height: 100px;
}

.axes-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stick-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stick-label {
    color: #a0a0a0;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.stick-visualizer {
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at center, #3a3a3a 0%, #2a2a2a 100%);
    border: 2px solid #4a4a4a;
    border-radius: 50%;
    position: relative;
    margin-bottom: 10px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.stick-dot {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #00d4ff 0%, #0066aa 100%);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.05s ease;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

.stick-values {
    font-size: 0.8em;
    color: #a0a0a0;
    font-family: monospace;
}

.instructions {
    background-color: #2a2a2a;
    border-radius: 10px;
    padding: 20px;
}

.instructions h3 {
    color: #00d4ff;
    margin-bottom: 15px;
}

.instructions ol {
    margin-left: 20px;
    line-height: 1.8;
}

.instructions li {
    color: #d0d0d0;
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.vibration-section {
    background: linear-gradient(135deg, #2a2a2a 0%, #252525 100%);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.vibration-section h2 {
    color: #00d4ff;
    margin-bottom: 20px;
    text-align: center;
}

.vibration-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vibration-presets {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.vibration-btn {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.vibration-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

.vibration-btn:active {
    transform: translateY(0);
}

.custom-vibration {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.custom-vibration label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 400px;
}

.custom-vibration input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #3a3a3a;
    outline: none;
    -webkit-appearance: none;
}

.custom-vibration input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.custom-vibration input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    border: none;
}

.custom-vibrate-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.custom-vibrate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

@media (max-width: 768px) {
    .controllers-container {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .axes-container {
        justify-content: center;
    }
    
    .vibration-presets {
        flex-direction: column;
    }
    
    .vibration-btn {
        width: 100%;
    }
}