/* Magic square — extends sudoku.css tokens */

/* ========== Play page — ambient & shell ========== */
.ms-play-main {
    max-width: 1180px;
    position: relative;
}

.ms-play-page {
    position: relative;
    z-index: 0;
}

.ms-play-page::before {
    content: "";
    position: fixed;
    inset: auto auto 35% -15%;
    width: min(52vw, 420px);
    height: min(52vw, 420px);
    background: radial-gradient(circle at 40% 40%, rgba(29, 155, 240, 0.22), transparent 68%);
    pointer-events: none;
    z-index: 0;
}

.ms-play-page::after {
    content: "";
    position: fixed;
    inset: 18% -12% auto auto;
    width: min(44vw, 360px);
    height: min(44vw, 360px);
    background: radial-gradient(circle at 60% 50%, rgba(120, 180, 255, 0.12), transparent 65%);
    pointer-events: none;
    z-index: 0;
}

[data-theme="light"] .ms-play-page::before {
    background: radial-gradient(circle at 40% 40%, rgba(14, 165, 233, 0.14), transparent 68%);
}

[data-theme="light"] .ms-play-page::after {
    background: radial-gradient(circle at 60% 50%, rgba(59, 130, 246, 0.08), transparent 65%);
}

.ms-play-page .row {
    position: relative;
    z-index: 1;
}

/* ========== Main panel ========== */
.ms-play-panel {
    position: relative;
    border-radius: 24px;
    padding: clamp(1.25rem, 3.5vw, 2rem);
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(26, 35, 50, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 0 0 1px rgba(29, 155, 240, 0.06),
        0 24px 48px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.ms-play-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), rgba(120, 180, 255, 0.6), transparent);
    opacity: 0.85;
    pointer-events: none;
}

[data-theme="light"] .ms-play-panel {
    background: rgba(255, 255, 255, 0.78);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow:
        0 0 0 1px rgba(14, 165, 233, 0.08),
        0 20px 40px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.ms-play-panel__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.ms-play-panel__lead {
    max-width: 36rem;
}

.ms-play-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.ms-play-eyebrow__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
    animation: ms-pulse-dot 2.2s ease-in-out infinite;
}

@keyframes ms-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.65; transform: scale(0.92); }
}

.ms-play-panel__title {
    font-weight: 800;
    font-size: clamp(1.65rem, 4vw, 2.15rem);
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 0.35rem;
    background: linear-gradient(125deg, var(--text-primary) 20%, var(--accent) 95%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@supports not (background-clip: text) {
    .ms-play-panel__title {
        background: none;
        -webkit-text-fill-color: unset;
        color: var(--text-primary);
    }
}

.ms-play-panel__subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0;
}

.ms-play-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}

.ms-play-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
    padding: 0.5rem 0.95rem;
    border-radius: 14px;
    background: rgba(29, 155, 240, 0.1);
    border: 1px solid rgba(29, 155, 240, 0.28);
    min-width: 5.75rem;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.ms-play-chip:hover {
    border-color: rgba(29, 155, 240, 0.45);
    transform: translateY(-1px);
}

[data-theme="light"] .ms-play-chip {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.22);
}

.ms-play-chip__label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.ms-play-chip__value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

/* ========== Board shell & toolbar ========== */
.ms-board-shell {
    border-radius: 20px;
    padding: 1rem;
    background: linear-gradient(160deg, rgba(15, 20, 28, 0.55) 0%, rgba(26, 35, 50, 0.35) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 12px 40px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .ms-board-shell {
    background: linear-gradient(160deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.85));
    border-color: rgba(15, 23, 42, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 28px rgba(15, 23, 42, 0.06);
}

.ms-play-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    padding: 0.65rem 1rem;
    margin-bottom: 1rem;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .ms-play-toolbar {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(15, 23, 42, 0.06);
}

.ms-toolbar-item {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.ms-toolbar-item__icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 1rem;
}

.ms-toolbar-item__icon--accent {
    background: linear-gradient(145deg, rgba(29, 155, 240, 0.35), rgba(29, 155, 240, 0.12));
    color: var(--accent);
}

[data-theme="light"] .ms-toolbar-item__icon {
    background: rgba(15, 23, 42, 0.05);
}

.ms-toolbar-item__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
}

.ms-toolbar-item__label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
}

.ms-toolbar-item__value {
    font-size: 1.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.ms-toolbar-item__value--accent {
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@supports not (background-clip: text) {
    .ms-toolbar-item__value--accent {
        background: none;
        -webkit-text-fill-color: unset;
        color: var(--accent);
    }
}

.ms-toolbar-item--glow .ms-toolbar-item__icon--accent {
    box-shadow: 0 0 24px rgba(29, 155, 240, 0.25);
}

.ms-toolbar-rail {
    width: 1px;
    height: 2.25rem;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

[data-theme="light"] .ms-toolbar-rail {
    background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.12), transparent);
}

@media (max-width: 420px) {
    .ms-toolbar-rail {
        display: none;
    }
    .ms-play-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .ms-toolbar-item {
        justify-content: flex-start;
    }
}

/* ========== Feedback & actions ========== */
.ms-check-msg {
    margin-top: 1.15rem;
    min-height: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.ms-check-msg:not(:empty) {
    color: var(--text-primary);
}

.ms-check-msg.ms-check-msg--success {
    color: var(--success);
}

.ms-check-msg.ms-check-msg--warn {
    color: var(--error);
}

.ms-check-msg.ms-check-msg--muted {
    color: var(--text-muted);
}

.ms-play-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

[data-theme="light"] .ms-play-actions {
    border-top-color: rgba(15, 23, 42, 0.06);
}

.ms-action-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    border: none;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
    color: #fff;
    cursor: pointer;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent) 0%, #2563eb 48%, #1d4ed8 100%);
    box-shadow:
        0 4px 16px rgba(29, 155, 240, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ms-action-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 28px rgba(29, 155, 240, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.ms-action-primary:active {
    transform: translateY(0);
}

.ms-action-primary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.ms-action-primary__shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.18) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.ms-action-primary:hover .ms-action-primary__shine {
    transform: translateX(100%);
}

.ms-action-primary__icon {
    font-size: 1.1rem;
    opacity: 0.95;
}

.ms-play-actions__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

@media (max-width: 480px) {
    .ms-play-actions__row {
        grid-template-columns: 1fr;
    }
}

.ms-action-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.72rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.ms-action-secondary:hover {
    background: rgba(29, 155, 240, 0.12);
    border-color: rgba(29, 155, 240, 0.35);
    transform: translateY(-1px);
}

.ms-action-secondary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.ms-action-secondary--outline {
    background: transparent;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.18);
}

[data-theme="light"] .ms-action-secondary {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .ms-action-secondary:hover {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.35);
}

[data-theme="light"] .ms-action-secondary--outline {
    background: rgba(248, 250, 252, 0.5);
}

/* ========== Sidebar ========== */
.ms-play-sidebar {
    position: relative;
}

@media (min-width: 992px) {
    .ms-play-sidebar {
        position: sticky;
        top: 1rem;
    }
}

.ms-side-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(26, 35, 50, 0.42);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.ms-side-card::before {
    content: "";
    position: absolute;
    left: 1.25rem;
    right: 1.25rem;
    top: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.65;
}

.ms-side-card--muted::before {
    opacity: 0.35;
}

[data-theme="light"] .ms-side-card {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(15, 23, 42, 0.07);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.ms-side-card__head {
    padding: 1.15rem 1.25rem 0;
}

.ms-side-card__kicker {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.ms-side-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.ms-side-card__body {
    padding: 1rem 1.25rem 1.25rem;
}

.ms-side-label {
    color: var(--text-muted);
}

.ms-side-select {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-primary);
}

[data-theme="light"] .ms-side-select {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(15, 23, 42, 0.12);
}

.ms-side-submit {
    border: none;
    border-radius: 14px;
    padding: 0.75rem 1rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), #1e40af);
    box-shadow: 0 4px 14px rgba(29, 155, 240, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ms-side-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(29, 155, 240, 0.38);
}

.ms-side-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.ms-side-rules {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.ms-play-nav-stack .ms-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.78rem 1rem;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.ms-play-nav-stack .ms-nav-link:hover {
    background: rgba(29, 155, 240, 0.12);
    border-color: rgba(29, 155, 240, 0.28);
    color: var(--accent);
    transform: translateX(2px);
}

.ms-play-nav-stack .ms-nav-link--quiet {
    background: transparent;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="light"] .ms-play-nav-stack .ms-nav-link {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .ms-play-nav-stack .ms-nav-link--quiet {
    border-color: rgba(15, 23, 42, 0.12);
}

/* ========== Completion modal ========== */
.ms-complete-modal {
    background: var(--bg-card) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="light"] .ms-complete-modal {
    border-color: rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.12) !important;
}

.ms-complete-modal__confetti {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 25%, rgba(250, 204, 21, 0.15), transparent 35%),
        radial-gradient(circle at 80% 20%, rgba(29, 155, 240, 0.12), transparent 30%),
        radial-gradient(circle at 50% 85%, rgba(34, 197, 94, 0.1), transparent 35%);
    pointer-events: none;
}

.ms-complete-modal__icon-wrap {
    display: inline-flex;
    padding: 1rem;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(250, 204, 21, 0.2), rgba(250, 204, 21, 0.05));
}

.ms-complete-modal__time {
    font-size: 2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@supports not (background-clip: text) {
    .ms-complete-modal__time {
        background: none;
        -webkit-text-fill-color: unset;
        color: var(--accent);
    }
}

/* Home hero Lo Shu SVG */
.ms-hero-svg {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto;
}

.ms-board-wrap {
    max-width: min(36rem, 100%);
    margin: 0 auto;
}

.ms-board {
    display: grid;
    grid-template-columns: repeat(var(--ms-n, 3), minmax(2.5rem, 1fr));
    gap: 2px;
    padding: 4px;
    border-radius: 12px;
    background: var(--border-grid, rgba(255, 255, 255, 0.12));
    box-shadow: inset 0 0 0 1px var(--border-grid, rgba(255, 255, 255, 0.08));
}

.ms-board--play {
    gap: 5px;
    padding: 10px;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(40, 52, 68, 0.95), rgba(22, 28, 38, 0.98));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.35),
        0 0 40px rgba(29, 155, 240, 0.06);
}

[data-theme="light"] .ms-board--play {
    background: linear-gradient(145deg, #ffffff, #f1f5f9);
    box-shadow:
        inset 0 0 0 1px rgba(15, 23, 42, 0.06),
        0 8px 28px rgba(15, 23, 42, 0.07);
}

.ms-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-cell, rgba(30, 34, 42, 0.92));
    border-radius: 8px;
    min-height: 2.75rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ms-board--play .ms-cell {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

@media (hover: hover) {
    .ms-board--play .ms-cell:has(.ms-input:not(:disabled)):hover {
        transform: scale(1.02);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
        z-index: 1;
    }
}

.ms-board--play .ms-cell:has(.ms-input:focus-visible) {
    z-index: 2;
    box-shadow: 0 0 0 2px rgba(29, 155, 240, 0.55);
}

.ms-cell.ms-cell--error {
    outline: none;
    animation: ms-cell-shake 0.35s ease;
    box-shadow: 0 0 0 2px rgba(244, 33, 46, 0.85);
}

@keyframes ms-cell-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.ms-given {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--accent, #6ea8fe);
}

.ms-input {
    width: 100%;
    height: 100%;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.25rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: inherit;
}

.ms-board--play .ms-input {
    border-radius: 10px;
}

.ms-input::-webkit-outer-spin-button,
.ms-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ms-input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.ms-input:focus {
    outline: none;
}

.ms-input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 10px;
}

.ms-board[data-n="5"] .ms-input,
.ms-board[data-n="5"] .ms-given,
.ms-board[data-n="6"] .ms-input,
.ms-board[data-n="6"] .ms-given {
    font-size: 1rem;
}

.ms-input.ms-given {
    color: var(--accent, #6ea8fe);
    font-weight: 700;
}

[data-theme="light"] .ms-cell {
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .ms-board:not(.ms-board--play) {
    background: #dee2e6;
}

[data-theme="light"] .ms-board--play .ms-cell {
    border-color: rgba(15, 23, 42, 0.06);
}

.ms-board--print {
    max-width: 14rem;
}

.ms-cell--print {
    border: 1px solid #333;
    border-radius: 0;
    min-height: 2rem;
    font-weight: 600;
}

.ms-print-blank {
    display: block;
    min-height: 1.5rem;
}

/* ----- Printable hub (/magic-square/print) ----- */
.ms-print-only-header {
    display: none;
}

.ms-print-area {
    margin-top: 0.5rem;
}

.ms-print-puzzles-grid {
    display: grid;
    gap: 2rem;
    justify-items: center;
    align-content: start;
    margin-bottom: 1rem;
}

.ms-print-puzzles-grid[data-count="1"] {
    grid-template-columns: 1fr;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.ms-print-puzzles-grid[data-count="2"],
.ms-print-puzzles-grid[data-count="3"],
.ms-print-puzzles-grid[data-count="4"] {
    grid-template-columns: repeat(2, 1fr);
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.ms-print-puzzle-block {
    width: 100%;
    max-width: 22rem;
}

.ms-print-puzzle-title {
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.ms-print-puzzle-meta {
    max-width: 20rem;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 767px) {
    .ms-print-puzzles-grid[data-count="2"],
    .ms-print-puzzles-grid[data-count="3"],
    .ms-print-puzzles-grid[data-count="4"] {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        margin: 12mm;
    }

    .no-print,
    .navbar,
    .site-footer,
    .propuz-cookie-banner {
        display: none !important;
    }

    .magic-square-print .btn,
    .magic-square-print form {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #111 !important;
    }

    .ms-print-only-header {
        display: block !important;
        margin-bottom: 1rem;
        text-align: center;
        color: #1f2937;
    }

    .ms-print-puzzles-grid[data-count="2"] {
        grid-template-columns: repeat(2, 1fr);
    }

    .ms-print-puzzles-grid[data-count="3"],
    .ms-print-puzzles-grid[data-count="4"] {
        grid-template-columns: repeat(2, 1fr);
    }

    .ms-print-puzzle-title {
        color: #111;
        font-size: 0.95rem;
    }

    .ms-board--print {
        max-width: 14rem;
    }

    .ms-cell--print {
        border-color: #222 !important;
        background: #fff !important;
        color: #111 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

