@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a1a 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.game-title {
    color: #ffcc00;
    font-size: 24px;
    text-shadow: 3px 3px 0 #ff0000, -1px -1px 0 #ff0000;
    letter-spacing: 4px;
}

.battle-area {
    border: 4px solid #444;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

#gameCanvas {
    display: block;
    background: linear-gradient(180deg, #1a1a3a 0%, #0a0a1a 100%);
}

.players-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 800px;
}

.player-section {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.player1-section {
    background: rgba(255, 68, 68, 0.1);
    border: 2px solid rgba(255, 68, 68, 0.3);
}

.player2-section {
    background: rgba(68, 68, 255, 0.1);
    border: 2px solid rgba(68, 68, 255, 0.3);
}

.player1-section.active-turn {
    background: rgba(255, 68, 68, 0.3);
    border-color: #ff4444;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
}

.player2-section.active-turn {
    background: rgba(68, 68, 255, 0.3);
    border-color: #4444ff;
    box-shadow: 0 0 15px rgba(68, 68, 255, 0.5);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.player-label {
    font-size: 12px;
    text-transform: uppercase;
}

.player1-section .player-label {
    color: #ff4444;
}

.player2-section .player-label {
    color: #4444ff;
}

.player-name {
    font-size: 10px;
    color: #fff;
}

.hp-bar-container {
    margin-bottom: 15px;
}

.hp-bar {
    width: 100%;
    height: 20px;
    background: #333;
    border: 2px solid #666;
    border-radius: 4px;
    overflow: hidden;
}

.hp-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.player1-section .hp-fill {
    background: linear-gradient(90deg, #ff0000 0%, #ff6600 50%, #ffcc00 100%);
}

.player2-section .hp-fill {
    background: linear-gradient(90deg, #0066ff 0%, #00ccff 50%, #00ffcc 100%);
}

.hp-text {
    display: block;
    color: #fff;
    font-size: 10px;
    margin-top: 5px;
    text-align: right;
}

.vs-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
}

.vs {
    color: #ffcc00;
    font-size: 28px;
    text-shadow: 2px 2px 0 #ff0000;
}

.action-panel {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.action-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    padding: 12px 20px;
    border: 3px solid;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
}

.action-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.attack-btn {
    background: linear-gradient(180deg, #ff3333 0%, #cc0000 100%);
    border-color: #ff6666;
    color: #fff;
    text-shadow: 1px 1px 0 #990000;
}

.defend-btn {
    background: linear-gradient(180deg, #3366ff 0%, #0033cc 100%);
    border-color: #6699ff;
    color: #fff;
    text-shadow: 1px 1px 0 #001a66;
}

.charge-btn {
    background: linear-gradient(180deg, #aa33ff 0%, #6600cc 100%);
    border-color: #cc66ff;
    color: #fff;
    text-shadow: 1px 1px 0 #330066;
}

.charge-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.charge-label {
    font-size: 8px;
    color: #aa66ff;
    text-transform: uppercase;
}

.charge-bar {
    flex: 1;
    height: 12px;
    background: #222;
    border: 2px solid #555;
    border-radius: 3px;
    overflow: hidden;
}

.charge-fill {
    height: 100%;
    background: linear-gradient(90deg, #6600cc 0%, #aa33ff 50%, #ff66ff 100%);
    transition: width 0.3s ease;
}

.charge-text {
    font-size: 8px;
    color: #ff66ff;
    min-width: 35px;
    text-align: right;
}

.armor-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.armor-label {
    font-size: 8px;
    color: #ffaa00;
    text-transform: uppercase;
}

.armor-bar {
    flex: 1;
    height: 10px;
    background: #222;
    border: 2px solid #555;
    border-radius: 3px;
    overflow: hidden;
}

.armor-fill {
    height: 100%;
    background: linear-gradient(90deg, #886600 0%, #ffaa00 50%, #ffcc66 100%);
    transition: width 0.3s ease;
}

.armor-text {
    font-size: 8px;
    color: #ffcc66;
    min-width: 35px;
    text-align: right;
}

.turn-indicator {
    font-size: 14px;
    padding: 10px 30px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #ffcc00;
    border-radius: 6px;
    text-shadow: 1px 1px 0 #000;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(180deg, #1a1a3a 0%, #0a0a1a 100%);
    border: 4px solid #ffcc00;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.5);
}

.modal-content h2 {
    color: #ffcc00;
    font-size: 20px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0 #ff0000;
}

.modal-content p {
    color: #fff;
    font-size: 12px;
    margin-bottom: 30px;
}

.restart-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    padding: 15px 40px;
    background: linear-gradient(180deg, #ffcc00 0%, #cc9900 100%);
    border: 4px solid #ffdd33;
    border-radius: 8px;
    cursor: pointer;
    color: #333;
    text-shadow: 1px 1px 0 #fff;
    transition: transform 0.1s;
}

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

.restart-btn:active {
    transform: scale(0.95);
}