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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    background-attachment: fixed;
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(74, 144, 226, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(226, 74, 74, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

#header {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 100%);
    backdrop-filter: blur(15px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
}

#header h1 {
    font-size: 2.8em;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5), 2px 2px 8px rgba(0, 0, 0, 0.8);
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: 2px;
}

#group-info {
    font-size: 1.2em;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#group-id {
    color: #ffd700;
    font-size: 1.4em;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.4);
    font-weight: 800;
    letter-spacing: 3px;
}

#controls-panel {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.15) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 10;
}

#mode-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
}

#mode-switcher label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 1.1em;
}

#mode-switcher input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

#score-display {
    display: flex;
    gap: 30px;
    font-size: 1.3em;
    font-weight: bold;
}

.score {
    padding: 12px 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.score:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.25) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#reset-btn, .menu-button {
    padding: 12px 24px;
    font-size: 1.1em;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff5252 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

#reset-btn:hover, .menu-button:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff4444 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#reset-btn:active, .menu-button:active {
    transform: translateY(0) scale(0.98);
}

#game-container {
    display: flex;
    justify-content: center;
    padding: 20px;
}

#game-canvas {
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(138, 43, 226, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
    background: #1a1a2e;
    max-width: 100%;
    height: auto;
    position: relative;
    z-index: 5;
}

#mobile-controls {
    display: none;
    justify-content: center;
    padding: 20px;
    gap: 10px;
}

.control-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.control-btn {
    width: 65px;
    height: 65px;
    font-size: 1.6em;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    user-select: none;
    touch-action: none;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.control-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.25) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.control-btn:active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.35) 100%);
    transform: scale(0.95) translateY(0);
}

#instructions {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.15) 100%);
    backdrop-filter: blur(10px);
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px 15px 0 0;
}

#instructions h3 {
    margin-bottom: 15px;
    font-size: 1.4em;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

#instructions p {
    margin: 8px 0;
    font-size: 1em;
    opacity: 0.9;
    line-height: 1.6;
}

@media (max-width: 768px) {
    #mobile-controls {
        display: flex;
        flex-direction: column;
    }
    
    #header h1 {
        font-size: 2em;
    }
    
    #controls-panel {
        flex-direction: column;
    }
    
    #score-display {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    #game-canvas {
        width: 100%;
    }
}

/* Menu Styles */
.menu-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1000;
    pointer-events: auto;
}

.menu-content {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.3) 100%);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 50px;
    max-width: 550px;
    width: 100%;
    text-align: center;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(138, 43, 226, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1001;
    pointer-events: auto;
}

.menu-content h1 {
    font-size: 3.5em;
    margin-bottom: 15px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.6), 2px 2px 10px rgba(0, 0, 0, 0.8);
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 50%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: 3px;
}

#group-info-menu {
    font-size: 1.3em;
    margin-bottom: 35px;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.4);
    font-weight: 700;
    letter-spacing: 2px;
}

.menu-section {
    margin: 30px 0;
}

.menu-section h2 {
    font-size: 1.6em;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
    font-weight: 600;
    letter-spacing: 1px;
}

.difficulty-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.difficulty-btn {
    padding: 15px 30px;
    font-size: 1.2em;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.difficulty-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.difficulty-btn.selected {
    background: #4a90e2;
    border-color: #4a90e2;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

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

.mode-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    max-width: 320px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.mode-option:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.15) 100%);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.mode-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.mode-option input[type="radio"]:checked + span {
    color: #4a90e2;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(74, 144, 226, 0.6);
}

.start-btn {
    padding: 15px 40px;
    font-size: 1.3em;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 30px;
    font-weight: bold;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.start-btn:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

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

.hidden {
    display: none !important;
}

.menu-button {
    padding: 10px 20px;
    font-size: 1.1em;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.menu-button:hover {
    background: #357abd;
}

.game-screen {
    display: block;
    position: relative;
}

.game-screen.hidden {
    display: none !important;
    pointer-events: none;
    visibility: hidden;
}

