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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 900px;
    width: 100%;
}

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

.game-title {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
    gap: 20px;
}

.info-section {
    flex: 1;
    text-align: center;
}

.info-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #aaa;
}

.health-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-bar-small {
    flex: 1;
    height: 20px;
    background: #333;
    border: 2px solid #ff6b6b;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.health-bar-small::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ff9999);
    transition: width 0.3s ease;
}

#playerHealthBar::after {
    width: 100%;
}

#botHealthBar::after {
    width: 100%;
}

.health-display > span {
    font-size: 0.85rem;
    color: #fff;
    min-width: 40px;
}

canvas {
    display: block;
    margin: 0 auto 20px;
    background: linear-gradient(180deg, #2a5298 0%, #1a1a2a 100%);
    border: 3px solid #ff6b6b;
    border-radius: 10px;
    width: 100%;
    height: auto;
    max-width: 800px;
}

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

.controls-section h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #ffd93d;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.control-item:last-child {
    border-bottom: none;
}

.key {
    background: #ff6b6b;
    color: white;
    padding: 4px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.85rem;
    min-width: 60px;
    text-align: center;
}

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

.modal-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border: 2px solid #ff6b6b;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
    max-width: 500px;
}

.modal-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #ffd93d;
}

.modal-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: #ddd;
}

.modal-content button {
    background: linear-gradient(45deg, #ff6b6b, #ff9999);
    color: white;
    border: none;
    padding: 12px 40px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.modal-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
}

.status-info {
    text-align: center;
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }

    .game-title {
        font-size: 1.8rem;
    }

    .game-info {
        flex-direction: column;
        gap: 10px;
    }

    canvas {
        margin-bottom: 15px;
    }

    .controls-guide {
        padding: 10px;
    }

    .modal-content {
        padding: 30px 20px;
        margin: 20px;
    }
}

/* ヘルスバーのカスタムプロパティ対応 */
:root {
    --health: 100%;
}

#playerHealthBar,
#botHealthBar {
    --health: 100%;
}

#playerHealthBar::after,
#botHealthBar::after {
    width: var(--health) !important;
}
