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

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

.container {
    width: 100%;
    max-width: 700px;
}

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

header h1 {
    color: white;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

main {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ゲーム情報パネル */
.game-info {
    margin-bottom: 25px;
}

.score-board {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 15px;
}

.player-score {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-indicator {
    font-size: 3rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.player-indicator.black {
    color: #000;
}

.player-indicator.white {
    color: #666;
}

.score-details {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.score {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.vs {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.turn-indicator {
    text-align: center;
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    padding: 15px;
    background: #e3f2fd;
    border-radius: 10px;
    margin-bottom: 10px;
}

.turn-indicator #currentPlayer {
    color: #667eea;
}

.message {
    text-align: center;
    font-size: 1rem;
    color: #ff6b6b;
    min-height: 24px;
    font-weight: 500;
}

/* オセロボード */
.board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    background: #2c3e50;
    padding: 2px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1;
}

.cell {
    background: #27ae60;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
    border-radius: 2px;
}

.cell:hover {
    background: #2ecc71;
}

.cell.hint {
    background: #3498db;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.piece {
    width: 85%;
    height: 85%;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: placepiece 0.3s ease-out;
}

@keyframes placepiece {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.piece.black {
    background: radial-gradient(circle at 30% 30%, #4a4a4a, #000);
}

.piece.white {
    background: radial-gradient(circle at 30% 30%, #fff, #ddd);
}

.piece.flipping {
    animation: flip 0.6s ease-in-out;
}

@keyframes flip {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(90deg);
    }
    100% {
        transform: rotateY(180deg);
    }
}

/* コントロールパネル */
.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63368d 100%);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 設定 */
.settings {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.settings label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #555;
}

.settings input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.settings select {
    padding: 6px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    background: white;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

#gameOverMessage {
    font-size: 1.3rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* レスポンシブ */
@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 20px;
    }

    .score-board {
        flex-direction: column;
        gap: 15px;
    }

    .vs {
        transform: rotate(90deg);
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .settings {
        flex-direction: column;
        align-items: stretch;
    }

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

    .modal-buttons {
        flex-direction: column;
    }
}
