/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #000;
    color: #00ffff;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Twinkling Stars Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, #fff, transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, #fff, transparent),
        radial-gradient(2px 2px at 160px 30px, #fff, transparent),
        radial-gradient(1px 1px at 200px 90px, #fff, transparent),
        radial-gradient(2px 2px at 240px 50px, #fff, transparent),
        radial-gradient(1px 1px at 280px 10px, #fff, transparent),
        radial-gradient(1px 1px at 320px 70px, #fff, transparent),
        radial-gradient(2px 2px at 360px 40px, #fff, transparent);
    background-repeat: repeat;
    background-size: 400px 200px;
    animation: twinkle 4s ease-in-out infinite alternate;
    z-index: -1;
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-right: 2px solid #00ffff;
    padding: 20px;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #00ffff;
    padding-bottom: 15px;
}

.sidebar-header h2 {
    color: #ff00ff;
    font-size: 1.5rem;
    text-shadow: 0 0 10px #ff00ff;
}

.sidebar-toggle {
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    border: none;
    color: #000;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px #00ffff;
}

.sidebar-nav h3 {
    color: #00ffff;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 10px;
}

.sidebar-nav a {
    color: #fff;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    border-radius: 5px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.sidebar-nav a:hover {
    background: linear-gradient(45deg, #00ffff20, #ff00ff20);
    border-color: #00ffff;
    transform: translateX(5px);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    padding: 20px;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

.main-sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    border: none;
    color: #000;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    z-index: 999;
    transition: all 0.3s ease;
}

.main-sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px #00ffff;
}

/* Game Header */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 60px;
}

.game-header h1 {
    font-size: 3rem;
    color: #ff00ff;
    text-shadow: 0 0 20px #ff00ff;
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px #ff00ff; }
    to { text-shadow: 0 0 30px #ff00ff, 0 0 40px #ff00ff; }
}

.subtitle {
    font-size: 1.2rem;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

/* Game Container */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

#gameCanvas {
    border: 3px solid #00ffff;
    border-radius: 15px;
    background: #111;
    box-shadow: 0 0 30px #00ffff50;
    cursor: crosshair;
    width: 100%;
    max-width: 800px;
    height: auto;
    max-height: 600px;
}

/* Controls Panel */
.controls-panel {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #00ffff;
    border-radius: 15px;
    padding: 20px;
    width: 100%;
    max-width: 800px;
}

.control-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 10px;
}

.control-group label {
    color: #00ffff;
    font-weight: bold;
    min-width: 120px;
}

.dial {
    flex: 1;
    height: 8px;
    background: #333;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}

.dial::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px #00ffff;
}

.dial::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #00ffff, #ff00ff);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px #00ffff;
}

.color-selector {
    background: #333;
    color: #fff;
    border: 1px solid #00ffff;
    border-radius: 5px;
    padding: 5px 10px;
    outline: none;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.control-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.reset-btn {
    background: linear-gradient(45deg, #ff4444, #ff6666);
    color: #fff;
}

.shake-btn {
    background: linear-gradient(45deg, #ffaa00, #ffcc44);
    color: #000;
}

.save-btn {
    background: linear-gradient(45deg, #44ff44, #66ff66);
    color: #000;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.3);
}

/* Character Selector */
.character-selector {
    text-align: center;
    margin-bottom: 30px;
}

.character-selector h3 {
    color: #00ffff;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.character-options {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.character-btn {
    padding: 10px 15px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #333;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.character-btn.active,
.character-btn:hover {
    border-color: #00ffff;
    box-shadow: 0 0 15px #00ffff50;
    transform: translateY(-2px);
}

/* Footer */
.game-footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #00ffff;
    margin-top: 40px;
}

.footer-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.footer-links a {
    color: #00ffff;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.footer-links a:hover {
    background: #00ffff20;
    transform: translateY(-1px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
    }
    
    .sidebar.visible {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 10px;
    }
    
    .game-header {
        padding-top: 80px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 90vw;
        height: auto;
        max-height: 60vh;
    }
    
    .controls-panel {
        width: 100%;
        max-width: 90vw;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .control-group label {
        min-width: auto;
        text-align: center;
    }
    
    .button-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .character-options {
        flex-direction: column;
        align-items: center;
    }
    
    .character-btn {
        width: 200px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    #gameCanvas {
        max-width: 95vw;
        max-height: 50vh;
    }
    
    .controls-panel {
        max-width: 95vw;
        padding: 15px;
    }
}

