/* ルール説明画面の chrome 。各ゲーム個別の盤面スタイルは games/<kind>.css を再利用する。*/

.rules-index {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.rules-back-row {
    display: flex;
    justify-content: flex-start;
}

.rules-back-button {
    background: var(--surface, #ffffff);
    border: 1px solid #e2e8f0;
    border-radius: var(--r-md, 12px);
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
    transition: background 0.15s ease, transform 0.12s ease;
}

.rules-back-button:hover {
    background: #f1f5f9;
}

.rules-back-button:active {
    transform: translateY(1px);
}

.rules-index-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: #1e293b;
    text-align: center;
}

.rules-index-lead {
    color: #475569;
    text-align: center;
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

.rules-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.rules-index-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: var(--surface, #ffffff);
    border: 1px solid #e2e8f0;
    border-radius: var(--r-md, 12px);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background 0.15s ease, transform 0.12s ease,
        box-shadow 0.15s ease, border-color 0.15s ease;
}

.rules-index-card:hover {
    background: #fafafa;
    border-color: var(--accent, #6366f1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.rules-index-card:active {
    transform: translateY(1px);
}

.rules-index-card-arrow {
    color: var(--accent, #6366f1);
    font-size: 18px;
}

/* 個別ゲームのルール画面 chrome */

.rules-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.rules-page-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #1e293b;
    text-align: center;
}

.rules-page-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
}

.rules-content,
.rules-screen,
.rules-chess,
.rules-mancala,
.rules-nmm,
.game-gomoku {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.rules-step-text {
    width: 100%;
    background: var(--surface, #ffffff);
    border: 1px solid #e2e8f0;
    border-radius: var(--r-md, 12px);
    padding: 14px 16px;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.7;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.rules-step-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 2px;
}

.rules-step-controls button {
    background: var(--surface, #ffffff);
    border: 1px solid #e2e8f0;
    border-radius: var(--r-sm, 8px);
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
    transition: background 0.15s ease, transform 0.12s ease,
        border-color 0.15s ease;
}

.rules-step-controls button:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: var(--accent, #6366f1);
}

.rules-step-controls button:active:not(:disabled) {
    transform: translateY(1px);
}

.rules-step-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.rules-step-controls .primary {
    background: var(--accent, #6366f1);
    border-color: var(--accent, #6366f1);
    color: #ffffff;
}

.rules-step-controls .primary:hover:not(:disabled) {
    background: #4f46e5;
}

.rules-step-progress {
    width: 100%;
    text-align: center;
    color: #64748b;
    font-size: 12px;
    margin: 0;
}

@media (max-width: 640px) {
    .rules-page {
        gap: 14px;
    }

    .rules-page-body,
    .rules-content,
    .rules-screen,
    .rules-chess,
    .rules-mancala,
    .rules-nmm,
    .game-gomoku {
        gap: 12px;
    }

    .rules-step-text {
        padding: 12px 14px;
    }
}

.rules-stub {
    padding: 24px;
    text-align: center;
    color: #64748b;
}
