:root {
    --color-1: #D50000;
    --color-2: #F2F2F2;
    --color-3: #000851;
    --color-4: #00B7FE;
    --color-1-light: #FF1744;
    --color-3-light: #1A237E;
    --color-4-light: #40C4FF;
}

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

*::-webkit-scrollbar {
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

body {
    font-family: 'VT323', monospace;
    color: var(--color-2);
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: linear-gradient(to right, #0f144a, #000638);
    position: relative;
}

/* Fixed Background Stars */
.fixed-stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.fixed-star {
    position: absolute;
    background: white;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.fixed-star.twinkle {
    animation: twinkle 3s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.8;
    }
}

/* Animated Particles Background */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Particle groups - each group forms a 5-square pattern */
.particle-group {
    position: absolute;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.particle-square {
    position: absolute;
    background: white;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Particle square positions are now calculated dynamically in JavaScript */

/* Particle groups - styles will be applied dynamically via JavaScript */

@keyframes fall {
    0% {
        top: -20px;
    }
    100% {
        top: calc(100vh + 20px);
    }
}

/* Player Ship Container */
.ship-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Player Ship */
.player-ship {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    display: block;
    position: relative;
    z-index: 2;
}

/* Player Fire Animation (4-frame spritesheet - horizontal, driven by JS) */
.player-fire {
    background-image: url('assets/game_sources/player_fire.png');
    background-repeat: no-repeat;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    position: absolute;
    bottom: -101%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    background-position: 0 0; /* Will be updated via JS */
}

/* Landing Page Styles */
.main-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    position: relative;
    transition: all 0.3s ease;
    z-index: 10;
}

.main-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
    transition: transform 0.3s ease;
}

.main-menu.shifted-left {
    transform: translateX(-200px);
}

.logo {
    width: 300px;
    height: auto;
    margin-bottom: 20px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(4px 0px 0px black) drop-shadow(-4px 0px 0px black) drop-shadow(0px 4px 0px black) drop-shadow(0px -4px 0px black);
}

.menu-button {
    width: 250px;
    padding: 15px 20px;
    background-color: #6abc3a;
    border: 3px solid white;
    color: #fff;
    font-family: "VT323", monospace;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 0px 5px black, 0px -5px black, 5px 0px black, -5px 0px black, 0px 10px #00000038, 5px 5px #00000038, -5px 5px #00000038, inset 0px 5px #ffffff36;
    transition: all 0.1s ease;
    margin: 5px;
}

.menu-button:hover {
    background-color: #5aa32f;
    transform: translateY(-2px);
}

.menu-button:active {
    transform: translateY(5px);
    box-shadow: 0px 5px black, 0px -5px black, 5px 0px black, -5px 0px black, inset 0px 5px #00000038;
}

.button-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.play-button {
    background-color: #D50000 !important;
    transition: all 0.1s ease !important;
}

.play-button:hover {
    background-color: #b30000 !important;
}

.config-button {
    background-color: #000851 !important;
}

.config-button:hover {
    background-color: #000640 !important;
}

.info-button {
    background-color: #000851 !important;
}

.info-button:hover {
    background-color: #000640 !important;
}

.developer-signature {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    color: var(--color-2);
    opacity: 0.8;
    z-index: 10;
    transition: transform 0.3s ease;
}

.developer-signature.shifted-left {
    transform: translateX(calc(-50% - 200px));
}

.developer-link {
    color: var(--color-4);
    text-decoration: none;
    transition: color 0.2s ease;
}

.developer-link:hover {
    color: var(--color-1);
    text-decoration: none;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: transparent;
    backdrop-filter: blur(2px);
    border-left: 4px solid white;
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.modal.active {
    right: 0;
}

.modal-content {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 4px solid white;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

.modal-header h3 {
    color: white;
    font-family: 'VT323', monospace;
    font-size: 24px;
    text-transform: uppercase;
    margin: 0;
    font-weight: bold;
    letter-spacing: 2px;
}

.close-button {
    background: rgba(213, 0, 0, 0.3);
    border: 3px solid #D50000;
    border-radius: 0;
    width: 40px;
    height: 40px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    box-shadow: 0px 3px black, 0px -3px black, 3px 0px black, -3px 0px black, inset 0px 3px #ffffff36;
    margin: 5px;
}

.close-button:hover {
    background: rgba(0, 8, 81, 0.5);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0px 5px black, 0px -5px black, 5px 0px black, -5px 0px black, inset 0px 5px #ffffff36;
}

.close-button:active {
    transform: translateY(3px);
    box-shadow: 0px 3px black, 0px -3px black, 3px 0px black, -3px 0px black, inset 0px 3px #00000038;
}

.modal-body {
    padding: 20px;
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

/* Configuration Modal Styles */
.config-option {
    margin-bottom: 30px;
}

.config-option label {
    display: block;
    margin-bottom: 15px;
    color: white;
    font-family: 'VT323', monospace;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 18px;
    letter-spacing: 1px;
}

.option-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.option-btn {
    padding: 12px 20px;
    background: rgba(0, 8, 81, 0.2);
    border: 3px solid #000851;
    border-radius: 0;
    color: #ffffff;
    font-family: 'VT323', monospace;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    backdrop-filter: blur(5px);
    box-shadow: 0px 3px black, 0px -3px black, 3px 0px black, -3px 0px black, inset 0px 3px #ffffff36;
    margin: 3px;
}

.option-btn:hover {
    background: rgba(0, 8, 81, 0.4);
    border-color: #ffffff;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0px 5px black, 0px -5px black, 5px 0px black, -5px 0px black, inset 0px 5px #ffffff36;
}

.option-btn:active {
    transform: translateY(3px);
    box-shadow: 0px 3px black, 0px -3px black, 3px 0px black, -3px 0px black, inset 0px 3px #00000038;
}

.option-btn.active {
    background: rgba(213, 0, 0, 0.3);
    border-color: #D50000;
    color: #ffffff;
    box-shadow: 0px 3px black, 0px -3px black, 3px 0px black, -3px 0px black, inset 0px 3px #ffffff36;
}

.option-btn .material-icons {
    font-size: 16px;
}

/* Information Modal Styles */
.info-section {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 8, 81, 0.1);
    border-left: 4px solid #000851;
    border-radius: 0;
    backdrop-filter: blur(5px);
}

.info-section h4 {
    color: white;
    font-family: 'VT323', monospace;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-section p {
    color: #ffffff;
    font-family: 'VT323', monospace;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.info-section ul {
    margin-left: 20px;
}

.info-section li {
    color: #ffffff;
    font-family: 'VT323', monospace;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 5px;
}

/* Página de juego */
.game-container {
    display: flex;
    height: 100vh;
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
}

.game-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#game {
    border: 2px solid #4ecdc4;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(78, 205, 196, 0.3);
}

.ui-panel {
    width: 300px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    overflow-y: auto;
}

.ui-section {
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ui-section h3 {
    color: #4ecdc4;
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-align: center;
    border-bottom: 1px solid rgba(78, 205, 196, 0.3);
    padding-bottom: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.stat-label {
    font-weight: bold;
    color: #b8b8b8;
    min-width: 60px;
}

.stat-value {
    color: #ffffff;
    font-weight: bold;
}

.health-bar {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 0 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.health-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.control-button {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.control-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.control-button:active {
    transform: translateY(0);
}

.current-word {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    color: #4ecdc4;
    margin-bottom: 10px;
    border: 2px solid rgba(78, 205, 196, 0.3);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typed-text {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    font-size: 1.2rem;
    text-align: center;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
    }
    
    .ui-panel {
        width: 100%;
        height: 200px;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .logo {
        width: 250px;
    }
    
    .menu-button {
        width: 200px;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .main-menu.shifted-left {
        transform: translateX(-100px);
    }
    
    .modal {
        width: 100%;
        right: -100%;
    }
    
    .developer-signature {
        font-size: 12px;
        bottom: 10px;
    }
}

@media (max-width: 480px) {
    .logo {
        width: 200px;
    }
    
    .menu-button {
        width: 180px;
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .main-menu.shifted-left {
        transform: translateX(-50px);
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .option-buttons {
        flex-direction: column;
    }
    
    .option-btn {
        width: 100%;
        justify-content: center;
    }
}
