/* Purple Dragon - Main Styles */

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

body {
    background: #000;
    overflow: hidden;
    font-family: Arial, sans-serif;
    cursor: none;
}

#canvas {
    display: block;
    background: #000;
}

#ui-container {
    position: absolute;
    top: 70%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    width: 90%;
    max-width: 450px;
    transition: opacity 0.5s ease;
}

.mouse-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(117, 64, 160, 0.7);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
    transform: translate(-50%, -50%);
}

#dragonModeBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(45deg, #7540a0, #9c6bc7);
    border: 2px solid #c59afa;
    border-radius: 50%;
    color: white;
    width: 70px;
    height: 70px;
    font-size: 12px;
    font-weight: bold;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8" fill="%23c59afa" opacity="0.8"/><circle cx="12" cy="12" r="4" fill="%23ffffff"/></svg>') 12 12, pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 15px rgba(117, 64, 160, 0.3);
    pointer-events: auto;
    display: none;
    opacity: 0;
    z-index: 2000;
}

#dragonModeBtn.visible {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

#dragonModeBtn:hover {
    background: linear-gradient(45deg, #8a4fb5, #b285d4);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 20px rgba(117, 64, 160, 0.5);
    border-color: #e6d9f0;
}

#gameUI {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #c59afa;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#gameUI.visible {
    opacity: 1;
}

#timeLeft {
    color: #ff6b6b;
    margin-top: 5px;
}

#fireBar {
    margin-top: 8px;
}

#fireBarContainer {
    width: 150px;
    height: 8px;
    background: rgba(50, 50, 50, 0.8);
    border: 1px solid #7540a0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 3px;
}

#fireBarFill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff8800, #ffcc00);
    border-radius: 3px;
    transition: width 0.1s ease;
    box-shadow: 0 0 8px rgba(255, 100, 0, 0.6);
}

#gameControls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: #b19fc9;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#gameControls.visible {
    opacity: 1;
}

.mobile-controls {
    display: none;
}

#gameOver {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(20, 5, 30, 0.95);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #7540a0;
    box-shadow: 0 0 30px rgba(117, 64, 160, 0.4);
    backdrop-filter: blur(15px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    max-width: 90vw;
    z-index: 200;
}

#gameOver.visible {
    opacity: 1;
    pointer-events: auto;
}

#gameOver h2 {
    color: #c9a9dd;
    font-size: 24px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#gameOver p {
    color: #b19fc9;
    font-size: 16px;
    margin-bottom: 10px;
}

#backButton {
    background: linear-gradient(45deg, #7540a0, #9c6bc7) !important;
    border: 2px solid #c59afa !important;
    border-radius: 15px !important;
    color: white !important;
    padding: 15px 30px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8" fill="%23c59afa" opacity="0.8"/><circle cx="12" cy="12" r="4" fill="%23ffffff"/></svg>') 12 12, pointer !important;
    margin-top: 20px !important;
    transition: all 0.3s ease !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
    box-shadow: 0 4px 15px rgba(117, 64, 160, 0.3) !important;
    backdrop-filter: blur(10px) !important;
}

#backButton:hover {
    background: linear-gradient(45deg, #8a4fb5, #b285d4) !important;
    border-color: #e6d9f0 !important;
    transform: translateY(-2px) scale(1.05) !important;
    box-shadow: 0 6px 20px rgba(117, 64, 160, 0.5) !important;
}

#backButton:active {
    transform: translateY(0px) scale(0.98) !important;
}

/* Floating Menu */
.floating-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 200px;
    height: 100vh;
    pointer-events: none;
    z-index: 1500;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.floating-menu.visible {
    opacity: 1;
    pointer-events: auto;
}

.menu-particle {
    position: absolute;
    width: auto;
    height: auto;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.3) rotate(15deg);
    animation: particleFloat 8s infinite ease-in-out;
}

.floating-menu.visible .menu-particle {
    pointer-events: auto;
}

.menu-particle.animate-in {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition: all 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.menu-link {
    display: block;
    padding: 10px 16px;
    background: rgba(30, 10, 40, 0.8);
    border: 1px solid rgba(117, 64, 160, 0.4);
    border-radius: 20px;
    color: rgba(197, 154, 250, 0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(117, 64, 160, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8" fill="%23c59afa" opacity="0.8"/><circle cx="12" cy="12" r="4" fill="%23ffffff"/></svg>') 12 12, pointer;
    text-align: center;
    white-space: nowrap;
}

.menu-link:hover {
    background: rgba(117, 64, 160, 0.6);
    border-color: rgba(117, 64, 160, 0.8);
    color: rgba(255, 255, 255, 1);
    transform: scale(1.1) rotate(-2deg);
    box-shadow: 0 8px 25px rgba(117, 64, 160, 0.4);
}

.menu-link:active {
    transform: scale(0.95) rotate(1deg);
}

.menu-particle:nth-child(1) {
    top: 15%;
    right: 20px;
    animation-delay: 0s;
}

.menu-particle:nth-child(2) {
    top: 35%;
    right: 40px;
    animation-delay: 1.5s;
}

.menu-particle:nth-child(3) {
    top: 55%;
    right: 15px;
    animation-delay: 3s;
}

.menu-particle:nth-child(4) {
    top: 75%;
    right: 35px;
    animation-delay: 4.5s;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(1deg);
    }
    50% {
        transform: translateY(-5px) rotate(-1deg);
    }
    75% {
        transform: translateY(-15px) rotate(0.5deg);
    }
}

.menu-particle::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: rgba(117, 64, 160, 0.1);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s ease;
    z-index: -1;
}

.menu-particle:hover::before {
    opacity: 1;
    transform: scale(1);
}

.menu-link::after {
    content: '*';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    transform: scale(0) rotate(0deg);
    transition: all 0.3s ease;
    text-shadow: 0 0 8px rgba(197, 154, 250, 0.8);
}

.menu-link:hover::after {
    opacity: 1;
    transform: scale(1) rotate(180deg);
}

/* Newsletter Form Styles */
.ml-form-embedContainer {
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
}

.ml-form-embedContainer.visible {
    opacity: 1;
    pointer-events: auto;
}

.ml-form-embedWrapper {
    background: rgba(30, 10, 40, 0.9) !important;
    border: 2px solid #7540a0 !important;
    border-radius: 15px !important;
    padding: 25px !important;
    box-shadow: 0 0 30px rgba(117, 64, 160, 0.3) !important;
    backdrop-filter: blur(10px);
    max-width: 400px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.ml-form-embedContent h4 {
    color: #c9a9dd !important;
    font-size: 22px !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
    margin-bottom: 12px !important;
}

.ml-form-embedContent p {
    color: #b19fc9 !important;
    font-size: 16px !important;
    margin-bottom: 18px !important;
}

.ml-form-fieldRow input[type="email"] {
    background: rgba(20, 5, 30, 0.8) !important;
    border: 2px solid #7540a0 !important;
    border-radius: 8px !important;
    color: #e6d9f0 !important;
    padding: 12px 15px !important;
    font-size: 16px !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.ml-form-fieldRow {
    margin: 0 0 15px 0 !important;
}

.ml-form-fieldRow input[type="email"]:focus {
    border-color: #a567c7 !important;
    box-shadow: 0 0 15px rgba(117, 64, 160, 0.5) !important;
    outline: none !important;
}

.ml-form-fieldRow input[type="email"]::placeholder {
    color: #8a7a95 !important;
}

.ml-form-embedSubmit button {
    background: linear-gradient(45deg, #7540a0, #9c6bc7) !important;
    border: none !important;
    border-radius: 8px !important;
    color: white !important;
    padding: 12px 25px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8" fill="%23c59afa" opacity="0.8"/><circle cx="12" cy="12" r="4" fill="%23ffffff"/></svg>') 12 12, pointer !important;
    transition: all 0.3s ease !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
    width: 100% !important;
}

.ml-form-embedSubmit {
    margin: 0 0 15px 0 !important;
}

.ml-form-embedSubmit button:hover {
    background: linear-gradient(45deg, #8a4fb5, #b285d4) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(117, 64, 160, 0.4) !important;
}

.ml-form-successContent h4 {
    color: #d4c4e8 !important;
    font-size: 22px !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
}

.ml-form-successContent p {
    color: #c9a9dd !important;
    font-size: 16px !important;
}

/* Mobile Touch Controls */
#mobileControls {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#mobileControls.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Virtual Joystick */
#virtualJoystick {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 100px;
    height: 100px;
    pointer-events: auto;
}

#joystickOuter {
    width: 100%;
    height: 100%;
    border: 3px solid rgba(117, 64, 160, 0.8);
    border-radius: 50%;
    background: rgba(30, 10, 40, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    box-shadow: 0 0 20px rgba(117, 64, 160, 0.4);
}

#joystickHandle {
    width: 35px;
    height: 35px;
    background: linear-gradient(45deg, #7540a0, #9c6bc7);
    border: 2px solid #c59afa;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.1s ease;
    box-shadow: 0 0 15px rgba(117, 64, 160, 0.6);
}

#joystickHandle.active {
    background: linear-gradient(45deg, #8a4fb5, #b285d4);
    border-color: #e6d9f0;
    box-shadow: 0 0 25px rgba(117, 64, 160, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Fire Button */
#fireButton {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(45deg, #ff4444, #ff6600);
    border: 3px solid #ff8888;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.4);
    pointer-events: auto;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

#fireButton.active {
    background: linear-gradient(45deg, #ff6666, #ff8800);
    border-color: #ffaaaa;
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 68, 68, 0.8);
}

#fireButton.cooldown {
    background: linear-gradient(45deg, #666666, #888888);
    border-color: #aaaaaa;
    color: #cccccc;
    box-shadow: 0 0 10px rgba(170, 170, 170, 0.3);
}

#fireButton::before {
    content: '🔥';
    font-size: 28px;
}

#fireButton.cooldown::before {
    content: '❄️';
    font-size: 24px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        cursor: default;
    }

    .mouse-cursor {
        display: none;
    }

    #ui-container {
        top: 65%;
        width: 95%;
    }
    
    .floating-menu {
        width: 100vw !important;
        height: 100vh !important;
    }
    
    .menu-particle:nth-child(1) {
        top: 8% !important;
        right: 15% !important;
    }
    
    .menu-particle:nth-child(2) {
        top: 18% !important;
        left: 12% !important;
        right: auto !important;
    }
    
    .menu-particle:nth-child(3) {
        top: 28% !important;
        right: 8% !important;
    }
    
    .menu-particle:nth-child(4) {
        top: 38% !important;
        left: 20% !important;
        right: auto !important;
    }
    
    .menu-link {
        font-size: 16px !important;
        padding: 14px 20px !important;
        background: rgba(5, 0, 15, 0.95) !important;
        border: 3px solid rgba(117, 64, 160, 0.9) !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8), 0 0 20px rgba(117, 64, 160, 0.6) !important;
        backdrop-filter: blur(20px) !important;
        font-weight: 600 !important;
        border-radius: 25px !important;
        cursor: pointer !important;
    }

    #gameUI {
        font-size: 16px;
        top: 15px;
        left: 15px;
    }

    #gameControls {
        font-size: 12px;
        bottom: 15px;
        left: 15px;
    }

    .desktop-controls {
        display: none;
    }
    
    .mobile-controls {
        display: block;
    }

    #dragonModeBtn {
        width: 60px !important;
        height: 60px !important;
        font-size: 10px !important;
        bottom: 20px !important;
        right: 20px !important;
    }

    #virtualJoystick {
        bottom: 80px;
        right: 20px;
        width: 90px;
        height: 90px;
    }

    #joystickHandle {
        width: 30px;
        height: 30px;
    }

    #fireButton {
        bottom: 80px;
        left: 20px;
        width: 60px;
        height: 60px;
        font-size: 20px;
    }

    #fireButton::before {
        font-size: 24px;
    }

    #fireButton.cooldown::before {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    #gameUI {
        font-size: 14px;
    }

    #gameControls {
        font-size: 11px;
    }

    #dragonModeBtn {
        width: 50px !important;
        height: 50px !important;
        font-size: 8px !important;
        bottom: 12px !important;
        right: 12px !important;
    }

    #virtualJoystick {
        bottom: 70px;
        right: 15px;
        width: 80px;
        height: 80px;
    }

    #joystickHandle {
        width: 28px;
        height: 28px;
    }

    #fireButton {
        bottom: 70px;
        left: 15px;
        width: 55px;
        height: 55px;
        font-size: 18px;
    }

    #fireButton::before {
        font-size: 22px;
    }

    #fireButton.cooldown::before {
        font-size: 18px;
    }
}

/* Hide mobile controls on desktop */
@media (min-width: 769px) {
    #mobileControls {
        display: none;
    }
}