/* Sudoku Rules Page */

.rules-page {
    padding-top: 1.75rem;
    padding-bottom: 3rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--color-primary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.rules-page h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.rules-intro {
    font-size: 1.05rem;
    color: var(--color-text);
    max-width: 65ch;
    margin-bottom: 2.5rem;
}

/* Section */
.rule-block {
    margin-bottom: 2.5rem;
}

.rule-block h2 {
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rule-block > p {
    color: var(--color-text-muted);
    max-width: 65ch;
    margin-bottom: 1rem;
}

/* Grid overview */
.grid-overview {
    display: flex;
    justify-content: flex-start;
    margin: 0.75rem 0 1rem;
}

.grid-overview svg {
    width: min(100%, 260px);
    height: auto;
    display: block;
}

/* Right / wrong examples */
.examples-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.example {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 14px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.example.wrong { border-color: #fca5a5; background: #fff5f5; }
.example.right  { border-color: #86efac; background: #f0fdf4; }

.example-label {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.3;
}
.example.wrong .example-label { color: #dc2626; }
.example.right  .example-label { color: #16a34a; }

/* Row SVG: very wide, render full width of card */
.row-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Column SVG: constrain height so it doesn't balloon */
.col-svg {
    height: 220px;
    width: auto;
    display: block;
}

/* Box SVG: square, cap max size */
.box-svg {
    width: min(100%, 160px);
    height: auto;
    display: block;
}

/* Tip box */
.tip-box {
    background: #eff6ff;
    border-left: 3px solid #2563eb;
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin-top: 0.75rem;
}
.tip-box p {
    color: #1d4ed8;
    margin: 0;
    font-size: 0.9rem;
}

/* How to solve steps */
.solve-steps {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.solve-steps li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: #2563eb;
    color: white;
    border-radius: 50%;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Difficulty table */
.diff-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.95rem;
}
.diff-table th,
.diff-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}
.diff-table th {
    font-weight: 600;
    color: var(--color-text);
    background: #f9fafb;
}
.diff-table td { color: var(--color-text-muted); }
.diff-table tr:last-child td { border-bottom: none; }

/* Play CTA */
.play-cta {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
}
.play-cta p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}
.play-cta .button {
    font-size: 1rem;
    padding: 12px 28px;
    text-decoration: none;
}

/* Mobile */
@media (max-width: 540px) {
    .examples-grid { grid-template-columns: 1fr; }
    .grid-overview svg { width: min(100%, 220px); }
    .col-svg { height: 200px; }
}
