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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: #000;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    z-index: 100;
}

.title {
    color: #ff69b4;
    font-size: 2em;
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.8), 0 0 20px rgba(255, 105, 180, 0.5);
    font-weight: bold;
}

.player-info {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 15px;
    border: 2px solid;
    min-width: 200px;
}

.pink-info {
    border-color: #ff69b4;
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.3);
}

.blue-info {
    border-color: #87ceeb;
    box-shadow: 0 0 20px rgba(135, 206, 235, 0.3);
}

.player-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.pink-info .player-name {
    color: #ff69b4;
    text-shadow: 0 0 10px rgba(255, 105, 180, 0.8);
}

.blue-info .player-name {
    color: #87ceeb;
    text-shadow: 0 0 10px rgba(135, 206, 235, 0.8);
}

.stat {
    color: white;
    font-size: 1.1em;
    margin: 5px 0;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

.stat span {
    font-weight: bold;
    font-size: 1.2em;
}

.pink-info .stat span {
    color: #ff69b4;
}

.blue-info .stat span {
    color: #87ceeb;
}

.lives-stat span {
    font-size: 1.1em;
    color: white !important;
}

.lives-stat.low-lives span {
    animation: pulse-red 1s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
    }
    50% {
        opacity: 0.6;
        text-shadow: 0 0 20px rgba(255, 0, 0, 1);
    }
}

.control-indicator {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
    text-align: center;
    font-style: italic;
}

.powerups-active {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 20px;
}

.powerup-indicator {
    font-size: 0.85em;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid;
    text-align: center;
    font-weight: bold;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.98); }
}

.powerup-shield {
    border-color: #00ffff;
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

.powerup-rapid {
    border-color: #ff6347;
    color: #ff6347;
    text-shadow: 0 0 5px #ff6347;
}

.powerup-triple {
    border-color: #9370db;
    color: #9370db;
    text-shadow: 0 0 5px #9370db;
}

.powerup-speed {
    border-color: #32cd32;
    color: #32cd32;
    text-shadow: 0 0 5px #32cd32;
}

#gameCanvas {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom, #1a1a2e 0%, #0f0f1e 100%);
}

.game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    border: 5px solid #ff69b4;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    z-index: 1000;
}

.game-over h2 {
    color: #ff69b4;
    font-size: 2.5em;
    margin-bottom: 15px;
}

.game-over p {
    color: #87ceeb;
    font-size: 1.5em;
    margin-bottom: 20px;
    font-weight: bold;
}

.game-over button {
    background: linear-gradient(135deg, #ff69b4, #ffb6c1);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    font-family: 'Comic Sans MS', cursive;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.4);
    transition: transform 0.2s;
}

.game-over button:hover {
    transform: scale(1.05);
}

.hidden {
    display: none;
}

/* Settings Button */
.settings-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid #ff69b4;
    color: white;
    font-size: 1.2em;
    padding: 10px 20px;
    border-radius: 15px;
    cursor: pointer;
    font-family: 'Comic Sans MS', cursive;
    font-weight: bold;
    z-index: 200;
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.3);
    transition: all 0.3s;
}

.settings-btn:hover {
    background: rgba(255, 105, 180, 0.3);
    transform: scale(1.05);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: linear-gradient(135deg, #ffc0cb 0%, #ffb6c1 50%, #ffd1dc 100%);
    padding: 40px;
    border-radius: 20px;
    border: 5px solid #ff69b4;
    box-shadow: 0 10px 50px rgba(255, 105, 180, 0.5);
    max-width: 600px;
    width: 90%;
}

.modal-content h2 {
    color: #ff69b4;
    font-size: 2em;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(255, 105, 180, 0.3);
}

.player-controls {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 3px solid #ffb6c1;
}

.player-controls h3 {
    color: #ff69b4;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.control-option {
    margin: 10px 0;
}

.control-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 10px;
    transition: background 0.2s;
}

.control-option label:hover {
    background: rgba(255, 182, 193, 0.2);
}

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

.radio-label {
    font-size: 1.1em;
    color: #333;
    font-weight: bold;
}

.gamepad-status {
    font-size: 0.85em;
    font-style: italic;
    color: #666;
    font-weight: normal;
}

.gamepad-status.connected {
    color: #32cd32;
}

.controller-help {
    background: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #ffb6c1;
}

.controller-help p {
    color: #ff69b4;
    font-weight: bold;
    margin: 5px 0;
}

.modal-btn {
    background: linear-gradient(135deg, #ff69b4, #ffb6c1);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    font-family: 'Comic Sans MS', cursive;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.4);
    transition: transform 0.2s;
    display: block;
    margin: 0 auto;
}

.modal-btn:hover {
    transform: scale(1.05);
}

/* Start Screen */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #ffc0cb 0%, #ffb6c1 25%, #ffd1dc 50%, #ffe4e1 75%, #fff0f5 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    padding: 20px;
}

.start-content {
    text-align: center;
    background: white;
    padding: 40px 50px;
    border-radius: 30px;
    border: 5px solid #ff69b4;
    box-shadow: 0 20px 60px rgba(255, 105, 180, 0.4);
    max-width: min(700px, 90vw);
    max-height: 90vh;
    overflow-y: auto;
}

.game-title {
    color: #ff69b4;
    font-size: clamp(2em, 5vw, 3em);
    margin-bottom: 30px;
    text-shadow: 3px 3px 6px rgba(255, 105, 180, 0.3);
    line-height: 1.2;
}

.start-info {
    display: flex;
    justify-content: space-around;
    gap: 40px;
    margin: 30px 0;
}

.player-instructions {
    background: linear-gradient(135deg, #ffe4e1 0%, #fff0f5 100%);
    padding: 20px 30px;
    border-radius: 20px;
    border: 3px solid #ffb6c1;
    flex: 1;
}

.player-instructions h3 {
    color: #ff69b4;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.player-instructions p {
    color: #ff69b4;
    font-size: 1.1em;
    margin: 8px 0;
    font-weight: bold;
}

.tip {
    color: #87ceeb;
    font-size: 1.1em;
    margin: 20px 0;
    font-weight: bold;
    line-height: 1.6;
}

.start-btn {
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    color: white;
    border: none;
    padding: 20px 60px;
    font-size: 1.8em;
    font-family: 'Comic Sans MS', cursive;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 8px 20px rgba(255, 105, 180, 0.5);
    transition: all 0.3s;
    margin: 20px 0;
    text-transform: uppercase;
}

.start-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 30px rgba(255, 105, 180, 0.6);
}

.start-btn:active {
    transform: scale(1.05);
}

.settings-tip {
    color: #999;
    font-size: 0.9em;
    font-style: italic;
    margin-top: 15px;
}

.control-selection {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin: 30px 0;
}

.player-control-box {
    background: white;
    padding: 25px;
    border-radius: 20px;
    border: 4px solid;
    flex: 1;
    max-width: 300px;
}

.pink-box {
    border-color: #ff69b4;
}

.pink-box h3 {
    color: #ff69b4;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.blue-box {
    border-color: #87ceeb;
}

.blue-box h3 {
    color: #87ceeb;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.control-choice {
    margin: 15px 0;
}

.control-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.control-label input[type="radio"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.control-label span {
    user-select: none;
}

.control-desc {
    color: #666;
    font-size: 0.9em;
    margin: 5px 0 0 30px;
    font-style: italic;
}

/* Mode Selection */
.mode-selection {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: nowrap;
}

.mode-btn {
    background: white;
    border: 3px solid #ff69b4;
    border-radius: 15px;
    padding: 20px 25px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 160px;
    max-width: 180px;
    font-family: 'Comic Sans MS', cursive;
}

.mode-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.4);
    background: linear-gradient(135deg, #fff0f5, #ffe4e1);
}

.mode-emoji {
    font-size: 2.5em;
}

.mode-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #ff69b4;
}

.mode-desc {
    font-size: 0.8em;
    color: #666;
    text-align: center;
    line-height: 1.3;
}

.control-info {
    margin-top: 30px;
}

/* Mobile Touch Controls */
.mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 250px;
    pointer-events: none;
    z-index: 200;
}

.mobile-controls.hidden {
    display: none;
}

.joystick-container {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 150px;
    height: 150px;
    pointer-events: all;
}

.joystick-base {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 105, 180, 0.5);
    backdrop-filter: blur(10px);
}

.joystick-stick {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff69b4, #ffb6c1);
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.6);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.1s;
    touch-action: none;
}

.shoot-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff69b4, #ff1493);
    border: 4px solid white;
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.6);
    font-size: 2.5em;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.2s;
    font-family: 'Comic Sans MS', cursive;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.shoot-btn:active {
    transform: scale(0.9);
    box-shadow: 0 3px 10px rgba(255, 105, 180, 0.8);
}

@media (max-width: 768px) {
    .start-screen {
        padding: 10px;
    }

    .start-content {
        padding: 20px 15px;
        max-width: 95vw;
        max-height: 95vh;
        border-width: 3px;
    }

    .game-title {
        font-size: clamp(1.5em, 6vw, 2.5em);
        margin-bottom: 15px;
    }

    .mode-selection {
        gap: 10px;
        margin: 15px 0;
    }

    .mode-btn {
        min-width: 130px;
        max-width: 150px;
        padding: 12px 15px;
    }

    .mode-emoji {
        font-size: 1.8em;
    }

    .mode-title {
        font-size: 0.95em;
    }

    .mode-desc {
        font-size: 0.7em;
    }

    .control-selection {
        gap: 10px;
    }

    .player-control-box {
        padding: 15px;
    }

    .tip {
        font-size: 0.9em;
        margin: 15px 0;
    }

    .start-btn {
        padding: 15px 40px;
        font-size: 1.4em;
    }

    .hud {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }

    .title {
        font-size: 1.2em;
    }

    .player-info {
        padding: 10px 15px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .start-content {
        padding: 15px 10px;
    }

    .mode-selection {
        gap: 8px;
    }

    .mode-btn {
        min-width: 110px;
        max-width: 130px;
        padding: 10px 12px;
    }

    .mode-emoji {
        font-size: 1.5em;
    }

    .mode-title {
        font-size: 0.85em;
    }

    .mode-desc {
        font-size: 0.65em;
    }
}
