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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-title {
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
    letter-spacing: 8px;
}

.stone-counter {
    font-size: 24px;
    color: #fff;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 24px;
    border-radius: 20px;
}

.game-area {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* 左サイドパネル */
.left-panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 200px;
}

.reset-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(180deg, #4CAF50 0%, #388E3C 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

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

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

.navi-check {
    margin-top: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 6px;
}

.navi-check label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

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

.board-size-settings {
    margin-top: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 6px;
}

.size-input-group {
    margin-bottom: 8px;
}

.size-input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.size-input-group select {
    width: 70px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.size-input-group input[type="number"] {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.random-size-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
}

.legend {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border: 1px solid #333;
    border-radius: 3px;
}

.legend-color.normal {
    background-color: green;
}

.legend-color.blocked {
    background-color: gray;
}

.legend-color.safezone {
    background-color: lightgreen;
}

.legend-color-inline {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid #333;
    border-radius: 2px;
    vertical-align: middle;
}

.blocked-inline {
    background-color: gray;
}

/* オセロ盤 */
.board-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.board {
    display: grid;
    gap: 1px;
    background-color: #000;
    border: 2px solid #000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.cell {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
}

.cell.normal {
    background-color: green;
}

.cell.safezone {
    background-color: lightgreen;
}

.cell.blocked {
    background-color: gray;
    cursor: not-allowed;
}

.cell:hover:not(.blocked) {
    filter: brightness(1.1);
}

/* 石のスタイル */
.stone {
    width: 85%;
    height: 85%;
    border-radius: 50%;
    position: absolute;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4), inset -2px -2px 4px rgba(0, 0, 0, 0.2), inset 2px 2px 4px rgba(255, 255, 255, 0.2);
    transition: background-color 0.3s ease;
}

.stone.blue {
    background: radial-gradient(circle at 30% 30%, #4a90d9, #1a5ab8);
}

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

.stone.red {
    background: radial-gradient(circle at 30% 30%, #e74c3c, #c0392b);
}

.stone.white {
    background: radial-gradient(circle at 30% 30%, #ffffff, #d0d0d0);
}

/* 仮の石（透明度80%） */
.stone.preview {
    opacity: 0.8;
    pointer-events: none;
}

/* ナビプレビュー用 */
.stone.navi-preview {
    animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(0.95);
    }
}

/* 石のフリップアニメーション */
.stone.flipping {
    animation: flip 0.3s ease-in-out;
}

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

/* 右サイドパネル */
.right-panel {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 180px;
}

.player-list-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

.player-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f5f5f5;
    font-weight: 500;
    transition: all 0.3s;
}

.player-item.active {
    background: #e8f5e9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.player-arrow {
    font-size: 14px;
    min-width: 16px;
}

.player-arrow.blue {
    color: #1a5ab8;
}

.player-arrow.black {
    color: #1a1a1a;
}

.player-arrow.red {
    color: #c0392b;
}

.player-arrow.white {
    color: #888;
    text-shadow: 0 0 2px #000;
}

.player-name {
    font-size: 14px;
}

.player-name.blue {
    color: #1a5ab8;
}

.player-name.black {
    color: #1a1a1a;
}

.player-name.red {
    color: #c0392b;
}

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

/* メッセージウィンドウ */
.message-window {
    width: 100%;
    max-width: 800px;
    min-height: 100px;
    max-height: 150px;
    overflow-y: auto;
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.message-window p {
    margin-bottom: 5px;
}

.message-window .skip-message {
    color: #e67e22;
    font-weight: 500;
}

.message-window .win-message {
    color: #27ae60;
    font-weight: bold;
    font-size: 16px;
}

.message-window .draw-message {
    color: #3498db;
    font-weight: bold;
    font-size: 16px;
}

/* 配置できるマスのハイライト */
.cell.can-place {
    position: relative;
}

.cell.can-place::after {
    content: '';
    position: absolute;
    width: 30%;
    height: 30%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
}

/* レスポンシブ対応 */
@media (max-width: 900px) {
    .game-area {
        flex-direction: column;
        align-items: center;
    }
    
    .left-panel,
    .right-panel {
        width: 100%;
        max-width: 400px;
    }
    
    .cell {
        width: 30px;
        height: 30px;
    }
}
