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

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    overflow: hidden;
    user-select: none;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen.hidden {
    display: none;
}

/* Start Screen */
#startScreen {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

.start-content {
    text-align: center;
    max-width: 600px;
    padding: 2rem;
}

.game-title {
    font-family: 'Orbitron', monospace;
    font-size: 3.5rem;
    font-weight: 900;
    color: #3b82f6;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-subtitle {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 3rem;
    letter-spacing: 0.3em;
}

.controls-info {
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
    backdrop-filter: blur(10px);
}

.controls-info h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    color: #3b82f6;
    margin-bottom: 1.5rem;
}

.control-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.key {
    background: linear-gradient(145deg, #374151, #1f2937);
    color: #fbbf24;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    border: 2px solid rgba(251, 191, 36, 0.3);
    min-width: 80px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.description {
    color: #cbd5e1;
    flex: 1;
    text-align: left;
}

.start-button {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(145deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.4);
    background: linear-gradient(145deg, #2563eb, #1d4ed8);
}

/* Game Screen */
#gameScreen {
    background: #0f172a;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

/* Game UI Overlay */
.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.game-ui > * {
    pointer-events: auto;
}

/* Top UI Bar */
.top-ui {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, transparent 100%);
    backdrop-filter: blur(10px);
}

/* Player Cards */
.player-card {
    background: rgba(30, 41, 59, 0.9);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 1rem;
    min-width: 200px;
    backdrop-filter: blur(10px);
}

.player-card.player1 {
    border-color: rgba(59, 130, 246, 0.5);
}

.player-card.player2 {
    border-color: rgba(239, 68, 68, 0.5);
}

.player-name {
    font-family: 'Orbitron', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

.health-bar-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.health-bar {
    flex: 1;
    height: 20px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 50%, #dc2626 100%);
    width: 100%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.health-text {
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    color: #22c55e;
    min-width: 40px;
    text-align: center;
}

.powerup-status {
    text-align: center;
    min-height: 1.5rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

/* Center Info */
.center-info {
    text-align: center;
    background: rgba(30, 41, 59, 0.9);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    min-width: 250px;
}

.turn-indicator {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat .label {
    font-size: 0.8rem;
    color: #94a3b8;
}

.stat span:last-child {
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    font-size: 1.1rem;
    color: #fbbf24;
}

.wind-info {
    margin-top: 0.5rem;
}

.wind-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.wind-arrow {
    font-size: 1.5rem;
    color: #fbbf24;
    font-weight: bold;
}

.wind-label {
    color: #94a3b8;
    font-size: 0.9rem;
}

#windForceText {
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    color: #fbbf24;
}

/* Power Bar */
.power-bar-container {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.power-bar {
    position: relative;
    width: 30px;
    height: 200px;
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 15px;
    overflow: hidden;
}

.power-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(0deg, #22c55e 0%, #fbbf24 50%, #dc2626 100%);
    width: 100%;
    height: 0%;
    transition: height 0.1s ease;
    border-radius: 0 0 13px 13px;
}

.power-indicator {
    position: absolute;
    left: -5px;
    right: -5px;
    height: 4px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    bottom: 0%;
    transition: bottom 0.1s ease;
}

.power-label {
    font-family: 'Orbitron', monospace;
    font-size: 0.8rem;
    color: #94a3b8;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Controls Help */
.controls-help {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 0.75rem;
    backdrop-filter: blur(10px);
}

.control-hint {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.key-small {
    background: rgba(59, 130, 246, 0.2);
    color: #fbbf24;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Orbitron', monospace;
    font-weight: 600;
    font-size: 0.8rem;
}

/* End Screen */
#endScreen {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #374151 100%);
}

.end-content {
    text-align: center;
    max-width: 500px;
    padding: 2rem;
}

.victory-title {
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    font-weight: 900;
    color: #22c55e;
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #22c55e, #fbbf24);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.victory-subtitle {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 3rem;
}

.restart-button {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(145deg, #22c55e, #16a34a);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(34, 197, 94, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.restart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(34, 197, 94, 0.4);
    background: linear-gradient(145deg, #16a34a, #15803d);
}

/* Floating Damage Text */
.damage-text {
    position: absolute;
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 900;
    color: #dc2626;
    text-shadow: 0 0 10px rgba(220, 38, 38, 0.8);
    pointer-events: none;
    z-index: 20;
    animation: floatUp 2s ease-out forwards;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-30px) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(-60px) scale(0.8);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .top-ui {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .player-card {
        min-width: 150px;
    }
    
    .game-stats {
        gap: 1rem;
    }
    
    .power-bar-container {
        right: 1rem;
    }
    
    .power-bar {
        height: 150px;
        width: 25px;
    }
    
    .controls-info {
        padding: 1.5rem;
    }
    
    .control-item {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-height: 600px) {
    .power-bar {
        height: 120px;
    }
    
    .controls-info {
        padding: 1rem;
    }
    
    .game-title {
        font-size: 2rem;
    }
}