body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f2f5;
}

.game-container {
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #333;
    margin-bottom: 2rem;
}

.board {
    display: grid;
    gap: 4px;
    background-color: #ccc;
    padding: 8px;
    border-radius: 8px;
    margin: 0 auto;
}

.panel {
    width: 50px;
    height: 50px;
    background-color: white;
    /* デフォルトは白 */
    border: 1px solid #999;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.panel:hover {
    transform: scale(1.05);
}

.panel:active {
    transform: scale(0.95);
}

/* 黒の状態 */
.panel.black {
    background-color: #333;
    border-color: #111;
}

/* 座標表示用のラベル */
.axis-label {
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 16px;
    color: #333;
    user-select: none;
}

.info-panel {
    margin: 0 auto 20px auto;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    max-width: 450px;
}

.code-display {
    font-size: 1.2rem;
    font-family: monospace;
    letter-spacing: 2px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: bold;
    text-align: left;
    line-height: 1.6;
}

#timer {
    font-size: 2.5rem;
    font-weight: bold;
    color: #e74c3c;
    font-family: monospace;
    margin-bottom: 5px;
}

#message {
    font-size: 1.5rem;
    font-weight: bold;
    height: 2rem;
    line-height: 2rem;
}

#start-btn {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 1.2rem;
    font-weight: bold;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#start-btn:hover {
    background-color: #2980b9;
}

#start-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.split-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    margin-top: 20px;
}

.left-pane {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.right-pane {
    display: flex;
    justify-content: center;
}

/* 既存のinfo-panelのマージンをリセットし、縦に整列させる */
.info-panel {
    margin: 0 0 20px 0;
}

#score-display {
    font-size: 1.8rem;
    font-weight: bold;
    color: #f39c12;
    margin-bottom: 10px;
    text-align: left;
}

.button-group {
    display: flex;
    gap: 15px;
}

#check-btn {
    padding: 12px 24px;
    font-size: 1.2rem;
    font-weight: bold;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#check-btn:hover:not(:disabled) {
    background-color: #27ae60;
}

#check-btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#check-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    box-shadow: none;
}

.difficulty-group {
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
}

#difficulty {
    font-size: 1.1rem;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: white;
}

/* --- チュートリアル / モーダル関連 --- */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal-content {
    transform: translateY(-20px);
}

.modal-content h2 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.tutorial-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #444;
    min-height: 120px;
    margin: 20px 0;
}

.tutorial-text ul {
    text-align: left;
    padding-left: 20px;
}

.tutorial-text code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #e74c3c;
}

.mini-board-wrapper {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    background: #f9f9f9;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 10px;
}

.tutorial-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.dots-indicator {
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    transition: background 0.2s;
}

.dot.active {
    background: #3498db;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: #333;
}

.secondary-btn {
    padding: 8px 16px;
    border: 1px solid #ccc;
    background: #f8f9fa;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s;
}

.secondary-btn:hover:not(:disabled) {
    background: #e2e6ea;
}

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

.primary-btn {
    padding: 8px 16px;
    border: none;
    background: #3498db;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s;
}

.primary-btn:hover {
    background: #2980b9;
}