* {
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 10px;
    background-color: #f0f0f0;
    min-height: 100vh;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
}

h1 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    text-align: center;
}

#game-canvas {
    border: 3px solid #333;
    cursor: pointer;
    margin-bottom: 15px;
    width: 100%;
    max-width: 400px;
    height: auto;
    touch-action: manipulation;
}

#game-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.player-info {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.stone {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 6px;
    border: 2px solid #333;
    flex-shrink: 0;
}

.black-stone {
    background-color: #000;
}

.white-stone {
    background-color: #fff;
}

.current-player {
    color: #ff6b6b;
}

#game-controls {
    margin-bottom: 10px;
    width: 100%;
    text-align: center;
}

button {
    padding: 12px 24px;
    margin: 0 5px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    touch-action: manipulation;
    margin-bottom: 5px;
}

button:hover {
    background-color: #45a049;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#ai-difficulty-section {
    margin-top: 10px;
    text-align: center;
}

#ai-difficulty-section label {
    display: inline-block;
    margin-right: 8px;
    font-weight: bold;
    color: #333;
}

#ai-difficulty {
    padding: 6px 10px;
    border: 2px solid #4CAF50;
    border-radius: 5px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    min-width: 200px;
}

#ai-difficulty:hover {
    border-color: #45a049;
}

#ai-difficulty:focus {
    outline: none;
    border-color: #45a049;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

#instructions {
    text-align: center;
    color: #666;
    line-height: 1.5;
    font-size: 14px;
}

/* スマホ用の調整 */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    #game-container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    #game-canvas {
        margin-bottom: 10px;
    }
    
    .player-info {
        font-size: 14px;
        min-width: 100px;
    }
    
    .stone {
        width: 14px;
        height: 14px;
    }
    
    button {
        padding: 10px 16px;
        font-size: 13px;
        margin: 2px;
        display: block;
        width: 100%;
        max-width: 200px;
        margin: 2px auto;
    }
    
    #instructions {
        font-size: 13px;
    }
}

/* 非常に小さな画面用 */
@media (max-width: 360px) {
    #game-info {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    
    .player-info {
        justify-content: center;
    }
}
