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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 1200px;
    width: 100%;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    color: #764ba2;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.player-info {
    flex: 1;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.player1-info {
    border: 3px solid #4CAF50;
}

.player2-info {
    border: 3px solid #f44336;
}

.player-info h3 {
    margin-bottom: 10px;
    color: #333;
}

.health-bar {
    width: 100%;
    height: 25px;
    background: #ddd;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid #333;
}

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

#health1 {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
}

#health2 {
    background: linear-gradient(90deg, #f44336, #FF5722);
}

.turn-indicator {
    flex: 1;
    font-size: 1.5em;
    font-weight: bold;
    color: #764ba2;
    text-align: center;
    padding: 15px;
    background: #fff3cd;
    border-radius: 10px;
    border: 3px solid #ffc107;
}

#gameCanvas {
    width: 100%;
    height: 400px;
    border: 3px solid #764ba2;
    border-radius: 10px;
    display: block;
    background: linear-gradient(180deg, #87CEEB 0%, #98D8C8 100%);
    cursor: crosshair;
}


.difficulty-settings {
    margin-top: 20px;
    padding: 20px;
    background: #fff3e0;
    border-radius: 10px;
    border-left: 5px solid #FF9800;
}

.difficulty-settings h3 {
    color: #E65100;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.setting-row {
    margin-bottom: 15px;
}

.setting-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 1em;
}

.setting-row input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.setting-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #FF9800;
    cursor: pointer;
}

.setting-row input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #FF9800;
    cursor: pointer;
    border: none;
}

.instructions {
    margin-top: 20px;
    padding: 20px;
    background: #e3f2fd;
    border-radius: 10px;
    border-left: 5px solid #2196F3;
}

.instructions h3 {
    color: #1976D2;
    margin-bottom: 10px;
}

.instructions p {
    color: #333;
    margin: 5px 0;
}

.game-over {
    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: 1000;
}

.game-over.hidden {
    display: none;
}

.shop-btn {
    margin-top: 10px;
    padding: 10px 20px;
    font-size: 1em;
    font-weight: bold;
    background: linear-gradient(135deg, #FF9800 0%, #FF5722 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

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

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

.shop.hidden {
    display: none;
}

.shop-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

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

.shop-content h2 {
    color: #764ba2;
    margin: 0;
}

.shop-exit {
    background: #f44336;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-exit:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.shop-hint {
    text-align: center;
    color: #999;
    font-size: 0.9em;
    margin: 5px 0 15px 0;
}

.shop-points {
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    color: #FF9800;
    margin-bottom: 20px;
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.shop-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #ddd;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.shop-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.shop-item h3 {
    margin-bottom: 10px;
    font-size: 1.1em;
}

.shop-item p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9em;
}

.shop-item .cost {
    font-weight: bold;
    color: #FF9800;
    margin-top: 10px;
}

.shop-item button {
    margin-top: 10px;
    padding: 8px 20px;
    font-size: 1em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.shop-item button:hover {
    transform: scale(1.1);
}

.shop-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, #FF9800, transparent);
    margin: 30px 0;
}

.shop-health-section {
    margin: 20px 0;
}

.shop-health-section h2 {
    color: #FF1744;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.health-purchase {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.health-item {
    background: linear-gradient(135deg, #FFE0E6 0%, #FFB3C1 100%);
    border: 3px solid #FF1744;
    border-radius: 15px;
    padding: 20px;
    width: 250px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(255, 23, 68, 0.3);
    transition: transform 0.2s;
}

.health-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(255, 23, 68, 0.4);
}

.health-item h3 {
    margin: 0 0 10px 0;
    font-size: 1.3em;
}

.health-item p {
    margin: 8px 0;
    font-size: 0.95em;
    color: #333;
}

.health-btn {
    margin-top: 10px;
    padding: 10px 30px;
    font-size: 1em;
    font-weight: bold;
    background: linear-gradient(135deg, #FF1744 0%, #C51162 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 3px 6px rgba(255, 23, 68, 0.3);
}

.health-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 12px rgba(255, 23, 68, 0.5);
}

.health-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.health-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.shop-damage-section {
    margin: 20px 0;
}

.shop-damage-section h2 {
    color: #FF6B00;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.damage-item {
    background: linear-gradient(135deg, #FFE4CC 0%, #FFB380 100%) !important;
    border: 3px solid #FF6B00 !important;
    box-shadow: 0 4px 8px rgba(255, 107, 0, 0.3) !important;
}

.damage-item:hover {
    box-shadow: 0 8px 16px rgba(255, 107, 0, 0.4) !important;
}

.damage-btn {
    margin-top: 10px;
    padding: 10px 30px;
    font-size: 1em;
    font-weight: bold;
    background: linear-gradient(135deg, #FF6B00 0%, #CC5500 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 3px 6px rgba(255, 107, 0, 0.3);
}

.damage-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 12px rgba(255, 107, 0, 0.5);
}

.damage-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.damage-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.shop-close {
    display: block;
    margin: 20px auto 0;
    padding: 12px 40px;
    font-size: 1.1em;
    font-weight: bold;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.shop-close:hover {
    transform: scale(1.05);
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

.game-over-content {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.game-over-content h2 {
    font-size: 3em;
    color: #764ba2;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.restart-btn {
    padding: 15px 40px;
    font-size: 1.3em;
    font-weight: bold;
    background: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

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

@media (max-width: 768px) {
    .game-info {
        flex-direction: column;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
}

