body { 
    font-family: 'Helvetica Neue', Arial, sans-serif; 
    background: #f0f0f0; 
    padding: 10px; 
    margin: 0; 
}

.container { 
    max-width: 850px; 
    margin: 0 auto; 
    background: white; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
    display: flex; 
    gap: 20px;
    align-items: flex-start; 
}

.game-area { 
    flex: 1; 
    min-width: 0; 
    display: flex; 
    flex-direction: column;
    align-items: center; 
}

.hint-area { 
    width: 350px; 
    display: flex; 
    flex-direction: column; 
    transition: width 0.3s ease; 
}

.hint-area.minimized { 
    width: auto; 
    min-width: 200px;
}

.status { 
    font-size: 1.2rem; 
    font-weight: bold; 
    margin-bottom: 10px; 
    text-align: center; 
}

.board { 
    display: grid; 
    grid-template-columns: repeat(3, 90px); 
    gap: 4px; 
    margin: 20px auto; 
    background: #444; 
    border: 4px solid #444; 
    width: fit-content; 
}

.cell { 
    width: 90px; 
    height: 90px; 
    background: #f5e6c8; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    position: relative; 
    cursor: pointer; 
}

.cell.selected { background: #ffe082; }

.piece { 
    position: absolute; 
    border-radius: 50%; 
    border: 2px solid black; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.3); 
    pointer-events: none; 
    transition: all 0.2s; 
}

.piece.s { width: 24px; height: 24px; }
.piece.m { width: 44px; height: 44px; }
.piece.l { width: 68px; height: 68px; }
.piece.O { background: #c62828; } 
.piece.B { background: #1565c0; } 

.hand-container { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    margin-bottom: 10px; 
    flex-wrap: wrap; 
}

.hand-btn { 
    padding: 8px 12px; 
    font-size: 0.95rem; 
    cursor: pointer; 
    background: #eee; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    white-space: nowrap; 
}

.hand-btn.selected { background: #ffe082; border-color: #f5b041; }
.hand-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.color-O { color: #c62828; font-weight: bold; }
.color-B { color: #1565c0; font-weight: bold; }

.controls { 
    margin-top: 20px; 
    display: flex; 
    gap: 10px; 
    align-items: center; 
    justify-content: center; 
    flex-wrap: wrap; 
}

select, button { padding: 8px; font-size: 1rem; }

.hint-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-weight: bold; 
    padding-bottom: 8px; 
    border-bottom: 1px solid #eee; 
    margin-bottom: 8px; 
    width: 100%;
}

.hint-box { 
    width: 100%; 
    border: 1px solid #ccc; 
    background: #fafafa; 
    overflow-y: auto; 
    max-height: 400px; 
    font-family: monospace; 
    padding: 5px; 
    box-sizing: border-box;
}

.hint-item { 
    padding: 6px; 
    border-bottom: 1px solid #eee; 
    cursor: pointer; 
    display: flex; 
    justify-content: space-between; 
}

.hint-item:hover { background: #e0e0e0; }
.hint-win { color: #2e7d32; }
.hint-loss { color: #c62828; }
.hint-best { color: #1b5e20; background: #e8f5e9; font-weight: bold; }

/* スマホ用レスポンシブデザイン */
@media screen and (max-width: 768px) {
    .container { 
        flex-direction: column; 
        padding: 10px;
        gap: 15px;
        align-items: center;
    }
    .game-area {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .hint-area { 
        width: 100%; 
        max-width: 400px; 
    }
    .hint-area.minimized {
        width: 100%; 
    }
}