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

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #2c2416 0%, #3d3426 50%, #2c2416 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #3a3a3a;
}

.container {
    text-align: center;
    background: linear-gradient(145deg, #f4f1e8, #ebe6d6);
    padding: 25px;
    border-radius: 18px;
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 2px solid #d4c5a0;
    max-width: 585px;
    width: 95%;
    min-width: 290px;
    transform: scale(0.9);
    transform-origin: center;
}

h1 {
    color: #2c2416;
    margin-bottom: 22px;
    font-size: 2.5em;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: 1.8px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 18px;
    background: linear-gradient(145deg, #f0ede4, #e8e3d6);
    border-radius: 12px;
    border: 2px solid #d4c5a0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.current-player {
    font-weight: 500;
    font-size: 1.2em;
    color: #2c2416;
}

.game-status {
    font-size: 1.1em;
    padding: 10px 20px;
    border-radius: 25px;
    background: linear-gradient(145deg, #8B7355, #6d5a42);
    color: #f4f1e8;
    border: 1px solid #5a4732;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.game-board {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    gap: 1px;
    background: #8B4513;
    padding: 18px;
    border-radius: 11px;
    margin: 18px auto;
    width: min(calc(100% - 18px), 67vh);
    max-width: min(520px, 75vw);
    aspect-ratio: 1;
    box-shadow: 0 9px 27px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 3px solid #8B7355;
    position: relative;
}

.cell {
    background: #DEB887;
    border: none;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    aspect-ratio: 1;
    border-radius: 2px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell:hover {
    background: #F5DEB3;
    transform: scale(1.02);
}

.cell.black {
    background: #DEB887;
    cursor: default;
    position: relative;
}

.cell.black::after {
    content: '';
    position: absolute;
    top: 8%;
    left: 8%;
    width: 84%;
    height: 84%;
    background: radial-gradient(ellipse at 30% 30%, #2a2a2a 10%, #1a1a1a 25%, #000 50%, #0a0a0a 80%, #000 100%);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8), 
                inset 0 2px 4px rgba(255, 255, 255, 0.05),
                inset -2px -2px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
}

.cell.white {
    background: #DEB887;
    cursor: default;
    position: relative;
}

.cell.white::after {
    content: '';
    position: absolute;
    top: 8%;
    left: 8%;
    width: 84%;
    height: 84%;
    background: radial-gradient(ellipse at 30% 30%, #ffffff 15%, #f5f5f5 30%, #e8e8e8 50%, #d8d8d8 70%, #c8c8c8 90%);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 
                inset 0 3px 6px rgba(255, 255, 255, 0.9),
                inset -2px -2px 4px rgba(0, 0, 0, 0.1),
                0 1px 2px rgba(255, 255, 255, 0.8);
    border: 1px solid #ddd;
}

.cell.black:hover,
.cell.white:hover {
    transform: none;
}

.cell.winning {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.controls {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

button {
    padding: 12px 24px;
    font-size: 16px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Georgia', serif;
    letter-spacing: 0.5px;
}

#reset-btn {
    background: linear-gradient(145deg, #8B4A42, #6d3732);
    color: #f4f1e8;
    border: 2px solid #5a2e29;
}

#reset-btn:hover {
    background: linear-gradient(145deg, #6d3732, #8B4A42);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 74, 66, 0.4);
}

#undo-btn {
    background: linear-gradient(145deg, #8B7355, #6d5a42);
    color: #f4f1e8;
    border: 2px solid #5a4732;
}

#undo-btn:hover {
    background: linear-gradient(145deg, #6d5a42, #8B7355);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 115, 85, 0.4);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* スタート画面 */
.start-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 500px;
}

.start-screen-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.start-content {
    margin-top: 0;
}

.game-description {
    font-size: 1.2em;
    color: #5a4732;
    margin-bottom: 40px;
    line-height: 1.5;
}

.cpu-level-section, .two-player-section {
    margin: 30px 0;
}

.section-title {
    font-size: 1.4em;
    color: #2c2416;
    margin-bottom: 15px;
    font-weight: 500;
}

.cpu-level-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.level-button {
    padding: 12px 24px;
    font-size: 16px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Georgia', serif;
    min-width: 120px;
}

.easy-button {
    background: linear-gradient(145deg, #7a8471, #5f6b56);
    color: #f4f1e8;
    border: 2px solid #4a5541;
    box-shadow: 0 3px 8px rgba(122, 132, 113, 0.3);
}

.easy-button:hover {
    background: linear-gradient(145deg, #5f6b56, #7a8471);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(122, 132, 113, 0.4);
}

.normal-button {
    background: linear-gradient(145deg, #B8860B, #9a7209);
    color: #f4f1e8;
    border: 2px solid #7d5f07;
    box-shadow: 0 3px 8px rgba(184, 134, 11, 0.3);
}

.normal-button:hover {
    background: linear-gradient(145deg, #9a7209, #B8860B);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.4);
}

.hard-button {
    background: linear-gradient(145deg, #8B4A42, #6d3732);
    color: #f4f1e8;
    border: 2px solid #5a2e29;
    box-shadow: 0 3px 8px rgba(139, 74, 66, 0.3);
}

.hard-button:hover {
    background: linear-gradient(145deg, #6d3732, #8B4A42);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 74, 66, 0.4);
}

.mode-button {
    padding: 16px 32px;
    font-size: 18px;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Georgia', serif;
    letter-spacing: 0.5px;
    min-width: 200px;
}

.player-button {
    background: linear-gradient(145deg, #8B7355, #6d5a42);
    color: #f4f1e8;
    border: 2px solid #5a4732;
    box-shadow: 0 4px 12px rgba(139, 115, 85, 0.3);
}

.player-button:hover {
    background: linear-gradient(145deg, #6d5a42, #8B7355);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 115, 85, 0.4);
}

.game-screen {
    animation: slideIn 0.5s ease-in-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-over {
    animation: gameOverPulse 2s ease-in-out;
}

@keyframes gameOverPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
        margin: 5px;
        width: calc(100vw - 20px);
        max-width: none;
    }
    
    h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .game-board {
        width: calc(100% - 10px);
        max-width: min(320px, calc(100vw - 40px));
        padding: 5px;
        margin: 10px auto;
    }
    
    
    .controls {
        flex-direction: column;
        align-items: center;
        margin-top: 15px;
    }
    
    .cell {
        padding: 0;
        width: auto;
    }
    
    #reset-btn, #undo-btn {
        width: 180px;
        padding: 10px 20px;
        font-size: 14px;
    }
}