/* Fun Zone Game Styles */

/* Game Cards on Index Page */
.fz-game-card {
    transition: transform 0.2s, box-shadow 0.2s;
}
.fz-game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.fz-card-icon {
    font-size: 3rem;
}

/* Memory Match */
.fz-memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
}
.fz-memory-card {
    aspect-ratio: 1;
    perspective: 600px;
    cursor: pointer;
}
.fz-memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.4s;
    transform-style: preserve-3d;
}
.fz-memory-card.flipped .fz-memory-card-inner {
    transform: rotateY(180deg);
}
.fz-memory-card-front,
.fz-memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 2px solid var(--bs-border-color, #dee2e6);
}
.fz-memory-card-back {
    background: linear-gradient(135deg, var(--bs-primary, #0d6efd), var(--bs-indigo, #6610f2));
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
}
.fz-memory-card-front {
    background: var(--bs-body-bg, #fff);
    transform: rotateY(180deg);
}
.fz-memory-card.matched .fz-memory-card-inner {
    transform: rotateY(180deg);
}
.fz-memory-card.matched {
    opacity: 0.7;
    pointer-events: none;
}

/* Sliding Tile */
.fz-slide-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-width: 320px;
    margin: 0 auto;
    background: var(--bs-tertiary-bg, #e9ecef);
    padding: 8px;
    border-radius: 0.5rem;
}
.fz-slide-tile {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--bs-body-bg, #fff);
    border: 2px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: transform 0.12s, background-color 0.15s;
    user-select: none;
}
.fz-slide-tile:hover:not(.fz-slide-empty) {
    background-color: var(--bs-primary-bg-subtle, #cfe2ff);
    transform: scale(1.03);
}
.fz-slide-tile.fz-slide-empty {
    visibility: hidden;
    pointer-events: none;
}

/* Math Quest */
.fz-math-answers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}
.fz-math-answer-btn {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 1rem;
    border: 2px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
    background: var(--bs-body-bg, #fff);
    cursor: pointer;
    transition: all 0.2s;
}
.fz-math-answer-btn:hover {
    border-color: var(--bs-primary, #0d6efd);
    background-color: var(--bs-primary-bg-subtle, #cfe2ff);
    transform: translateY(-2px);
}
.fz-math-answer-btn.correct {
    background-color: var(--bs-success, #198754) !important;
    color: #fff !important;
    border-color: var(--bs-success, #198754) !important;
}
.fz-math-answer-btn.incorrect {
    background-color: var(--bs-danger, #dc3545) !important;
    color: #fff !important;
    border-color: var(--bs-danger, #dc3545) !important;
    animation: fz-shake 0.4s;
}
.fz-math-equation {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 2px;
}
.fz-math-timer-bar {
    height: 10px;
    transition: width 0.1s linear, background-color 0.3s;
}

/* Magic Canvas */
.fz-canvas-workspace {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.fz-canvas-toolbox {
    flex: 1 1 220px;
    min-width: 220px;
}
.fz-canvas-area {
    flex: 2 1 400px;
    min-width: 300px;
}
.fz-drawing-canvas {
    background-color: #fff;
    cursor: crosshair;
    touch-action: none;
    display: block;
    width: 100%;
    border-radius: 0.375rem;
    border: 2px solid var(--bs-border-color, #dee2e6);
}
.fz-color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s;
    padding: 0;
}
.fz-color-dot:hover {
    transform: scale(1.2);
}
.fz-color-dot.active {
    border-color: var(--bs-body-color, #212529);
    transform: scale(1.1);
}

/* Sound Studio */
.fz-piano {
    display: flex;
    justify-content: center;
    background: #2d3748;
    padding: 8px 8px 16px;
    border-radius: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}
.fz-piano-key {
    flex: 1;
    min-height: 180px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0 0 6px 6px;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.1s;
    user-select: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 10px;
    position: relative;
}
.fz-piano-key:hover {
    background-color: #f0f0f0;
}
.fz-piano-key.active {
    transform: translateY(3px);
    background-color: #e2e8f0;
}
.fz-piano-key[data-note="C4"] { border-top: 6px solid #dc3545; }
.fz-piano-key[data-note="D4"] { border-top: 6px solid #fd7e14; }
.fz-piano-key[data-note="E4"] { border-top: 6px solid #ffc107; }
.fz-piano-key[data-note="F4"] { border-top: 6px solid #198754; }
.fz-piano-key[data-note="G4"] { border-top: 6px solid #0d6efd; }
.fz-piano-key[data-note="A4"] { border-top: 6px solid #6f42c1; }
.fz-piano-key[data-note="B4"] { border-top: 6px solid #d63384; }
.fz-piano-key[data-note="C5"] { border-top: 6px solid #fd7e14; }

.fz-sfx-btn {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 0.75rem;
    cursor: pointer;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: transform 0.15s;
}
.fz-sfx-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}
.fz-sfx-btn:active {
    transform: translateY(1px);
}

/* Leaderboard table */
.lb-table-container .table td,
.lb-table-container .table th {
    vertical-align: middle;
}
.lb-rank-1 { color: #ffc107; font-weight: bold; }
.lb-rank-2 { color: #adb5bd; font-weight: bold; }
.lb-rank-3 { color: #cd7f32; font-weight: bold; }

/* Pause Overlay */
.fz-pause-overlay-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1050;
}
.fz-pause-overlay-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1051;
    text-align: center;
    color: #fff;
    padding: 2rem;
}
.fz-pause-overlay-content h2 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.fz-pause-overlay-content p {
    color: rgba(255, 255, 255, 0.7);
}

/* Animations */
@keyframes fz-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Minesweeper - Modern Emerald & Slate (inside grid) */
.fz-ms-hud {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 0.75rem 1.25rem;
    max-width: 460px;
    margin: 0 auto 1rem auto;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}
.fz-ms-hud-label {
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #94a3b8;
}
.fz-ms-counter {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.4rem;
    font-weight: 900;
    min-width: 75px;
    text-align: center;
    background: #022c22;
    color: #34d399;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid #065f46;
    text-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
    display: inline-block;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}
.fz-ms-face-btn {
    font-size: 1.6rem;
    line-height: 1;
    padding: 0.35rem 0.55rem;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #475569;
    background: #334155;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.12s, border-color 0.15s, background-color 0.15s;
}
.fz-ms-face-btn:hover {
    transform: scale(1.12);
    border-color: #10b981;
    background-color: #3e526d;
}
.fz-ms-face-btn:active {
    transform: scale(0.92);
}
.fz-ms-active-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
}
.fz-ms-active-badge.dig {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.fz-ms-active-badge.dig:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: #10b981;
    transform: scale(1.05);
}
.fz-ms-active-badge.flag {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    border-color: rgba(244, 63, 94, 0.5);
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.2);
}
.fz-ms-active-badge.flag:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: #f43f5e;
    transform: scale(1.05);
}
/* Mouse Cursor Mode Follower */
.fz-ms-cursor-tracker {
    position: fixed;
    pointer-events: none;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    transition: background-color 0.15s, border-color 0.15s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    will-change: left, top;
}
.fz-ms-cursor-tracker.dig {
    background: rgba(16, 185, 129, 0.9);
    border: 1.5px solid #34d399;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}
.fz-ms-cursor-tracker.flag {
    background: rgba(244, 63, 94, 0.9);
    border: 1.5px solid #fb7185;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.6);
}
@media (hover: none) or (pointer: coarse) {
    .fz-ms-cursor-tracker {
        display: none !important;
    }
}
.fz-ms-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    max-width: 380px;
    margin: 0 auto;
    background: #1e293b;
    padding: 10px;
    border-radius: 0.75rem;
    border: 2px solid #334155;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.fz-ms-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 800;
    border-radius: 6px;
    cursor: pointer;
    background: #334155;
    border: 2px solid #475569;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    transition: background-color 0.12s, border-color 0.12s, transform 0.1s, box-shadow 0.12s;
    position: relative;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}
.fz-ms-cell:hover:not(.revealed):not(.disabled) {
    background-color: #3e526d;
    border-color: #10b981;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.25);
}
.fz-ms-cell:active:not(.revealed):not(.disabled) {
    transform: scale(0.95);
}
.fz-ms-cell.revealed {
    background: #0f172a;
    border: 1px solid #1e293b;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    cursor: default;
}
.fz-ms-cell.flagged {
    color: #f43f5e;
    background: #334155;
    border-color: #f43f5e;
}
.fz-ms-cell.mine {
    background: #2a1b24;
    border-color: #f43f5e;
}
.fz-ms-cell.mine-exploded {
    background-color: #e11d48 !important;
    color: #ffffff !important;
    border-color: #f43f5e !important;
    box-shadow: 0 0 14px rgba(225, 29, 72, 0.7);
    animation: fz-shake 0.4s ease;
}
.fz-ms-cell.mine-wrong {
    position: relative;
    background: #371d24;
}
.fz-ms-cell.mine-wrong::after {
    content: "❌";
    position: absolute;
    font-size: 1.1rem;
}

/* Vibrant High-Contrast Number Colors for Modern Emerald/Slate */
.fz-ms-cell[data-count="1"] { color: #38bdf8; text-shadow: 0 0 6px rgba(56, 189, 248, 0.3); }
.fz-ms-cell[data-count="2"] { color: #34d399; text-shadow: 0 0 6px rgba(52, 211, 153, 0.3); }
.fz-ms-cell[data-count="3"] { color: #fb7185; text-shadow: 0 0 6px rgba(251, 113, 133, 0.3); }
.fz-ms-cell[data-count="4"] { color: #818cf8; text-shadow: 0 0 6px rgba(129, 140, 248, 0.3); }
.fz-ms-cell[data-count="5"] { color: #fb923c; text-shadow: 0 0 6px rgba(251, 146, 60, 0.3); }
.fz-ms-cell[data-count="6"] { color: #2dd4bf; text-shadow: 0 0 6px rgba(45, 212, 191, 0.3); }
.fz-ms-cell[data-count="7"] { color: #f472b6; text-shadow: 0 0 6px rgba(244, 114, 182, 0.3); }
.fz-ms-cell[data-count="8"] { color: #cbd5e1; }

.btn-emerald {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    color: #ffffff;
}
.btn-emerald:hover {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: #047857;
    color: #ffffff;
}
.text-emerald {
    color: #10b981 !important;
}

/* Sudoku */
.fz-sdk-wrapper {
    max-width: 480px;
    margin: 0 auto;
}
.fz-sdk-diff-group {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.fz-sdk-diff-btn {
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.9rem;
    border: 1.5px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    transition: all 0.15s ease;
    cursor: pointer;
}
.fz-sdk-diff-btn:hover {
    border-color: var(--bs-primary, #0d6efd);
    color: var(--bs-primary, #0d6efd);
}
.fz-sdk-diff-btn.active {
    background: var(--bs-primary, #0d6efd);
    border-color: var(--bs-primary, #0d6efd);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}
.fz-sdk-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bs-tertiary-bg, #f8f9fa);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
}
.fz-sdk-grid-wrapper {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 0 auto 1rem auto;
}
.fz-sdk-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    gap: 1.5px;
    background: #64748b;
    border: 3.5px solid #1e293b;
    border-radius: 0.5rem;
    overflow: hidden;
    margin: 0 auto 1rem auto;
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1 / 1;
    min-height: 340px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.fz-sdk-cell {
    width: 100%;
    height: 100%;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    background-color: #ffffff;
    color: #0f172a;
    cursor: pointer;
    position: relative;
    transition: background-color 0.12s ease;
}
.fz-sdk-cell.fz-sdk-box-right {
    border-right: 3px solid #1e293b !important;
}
.fz-sdk-cell.fz-sdk-box-bottom {
    border-bottom: 3px solid #1e293b !important;
}
.fz-sdk-cell.given {
    font-weight: 800;
    color: #0f172a !important;
    background-color: #f8fafc;
}
.fz-sdk-cell.user-val {
    color: #0284c7 !important;
    font-weight: 700;
}
.fz-sdk-cell.highlighted {
    background-color: #f0f9ff !important;
}
.fz-sdk-cell.same-digit {
    background-color: #dcfce7 !important;
}
.fz-sdk-cell.selected {
    background-color: #bae6fd !important;
    outline: 2.5px solid #0284c7;
    z-index: 5;
}
.fz-sdk-cell.error {
    background-color: #ffe4e6 !important;
    color: #e11d48 !important;
    animation: fz-shake 0.3s ease;
}

/* Dark mode theme support */
[data-bs-theme="dark"] .fz-sdk-grid {
    background: #475569;
    border-color: #0f172a;
}
[data-bs-theme="dark"] .fz-sdk-cell {
    background-color: #1e293b;
    color: #f8fafc;
}
[data-bs-theme="dark"] .fz-sdk-cell.fz-sdk-box-right {
    border-right-color: #0f172a !important;
}
[data-bs-theme="dark"] .fz-sdk-cell.fz-sdk-box-bottom {
    border-bottom-color: #0f172a !important;
}
[data-bs-theme="dark"] .fz-sdk-cell.given {
    color: #ffffff !important;
    background-color: #0f172a;
}
[data-bs-theme="dark"] .fz-sdk-cell.user-val {
    color: #38bdf8 !important;
}
[data-bs-theme="dark"] .fz-sdk-cell.highlighted {
    background-color: #1e3a5f !important;
}
[data-bs-theme="dark"] .fz-sdk-cell.same-digit {
    background-color: #064e3b !important;
}
[data-bs-theme="dark"] .fz-sdk-cell.selected {
    background-color: #0369a1 !important;
    outline-color: #38bdf8;
}
.fz-sdk-notes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    padding: 1px;
    pointer-events: none;
}
.fz-sdk-note-num {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--bs-secondary-color, #6c757d);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
/* Keypad & Action Tools */
.fz-sdk-tools {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0.75rem;
}
.fz-sdk-tool-btn {
    flex: 1;
    max-width: 120px;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    cursor: pointer;
    transition: all 0.15s;
}
.fz-sdk-tool-btn:hover {
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-color: var(--bs-primary, #0d6efd);
}
.fz-sdk-tool-btn.active {
    background: var(--bs-warning-bg-subtle, #fff3cd);
    border-color: var(--bs-warning, #ffc107);
    color: var(--bs-emphasis-color, #000);
}
.fz-sdk-keypad {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 6px;
    max-width: 450px;
    margin: 0 auto 1rem auto;
}
.fz-sdk-key-btn {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 0.5rem;
    border: 1.5px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-body-bg, #fff);
    color: var(--bs-primary, #0d6efd);
    cursor: pointer;
    transition: transform 0.1s, background-color 0.15s;
    user-select: none;
    padding: 0;
}
.fz-sdk-key-btn:hover:not(:disabled) {
    background-color: var(--bs-primary-bg-subtle, #cfe2ff);
    transform: translateY(-2px);
    border-color: var(--bs-primary, #0d6efd);
}
.fz-sdk-key-btn:active:not(:disabled) {
    transform: scale(0.95);
}
.fz-sdk-key-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}


/* Responsive */
@media (max-width: 576px) {
    .fz-memory-grid {
        gap: 8px;
        max-width: 320px;
    }
    .fz-memory-card-front,
    .fz-memory-card-back {
        font-size: 1.5rem;
    }
    .fz-ms-grid {
        gap: 4px;
        max-width: 340px;
        padding: 8px;
    }
    .fz-ms-cell {
        font-size: 1.2rem;
        min-height: 42px;
    }
    .fz-ms-hud {
        padding: 0.5rem 0.75rem;
        max-width: 340px;
    }
    .fz-sdk-grid {
        max-width: 350px;
        min-height: 280px;
    }
    .fz-sdk-cell {
        font-size: 1.15rem;
    }
    .fz-sdk-note-num {
        font-size: 0.5rem;
    }
    .fz-sdk-keypad {
        gap: 4px;
        max-width: 350px;
    }
    .fz-sdk-key-btn {
        font-size: 1.1rem;
    }
    .fz-math-equation {
        font-size: 1.8rem;
    }
    .fz-math-answers {
        grid-template-columns: 1fr;
    }
    .fz-canvas-workspace {
        flex-direction: column;
    }
    .fz-piano-key {
        min-height: 140px;
    }
    .fz-arr-board-container {
        padding: 8px;
    }
    .fz-arr-grid {
        gap: 6px;
    }
    .fz-arr-icon {
        font-size: 1.25rem;
    }
}

/* ==========================================================================
   Winding Arrow Maze Puzzle Styles & Animations
   ========================================================================== */
.fz-arr-wrapper {
    max-width: 540px;
    margin: 0 auto;
}
.fz-arr-diff-group {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.fz-arr-diff-btn {
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.35rem 0.9rem;
    border: 1.5px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    transition: all 0.15s ease;
    cursor: pointer;
}
.fz-arr-diff-btn:hover {
    border-color: var(--bs-primary, #0d6efd);
    color: var(--bs-primary, #0d6efd);
}
.fz-arr-diff-btn.active {
    background: var(--bs-primary, #0d6efd);
    border-color: var(--bs-primary, #0d6efd);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}
.fz-arr-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bs-tertiary-bg, #f8f9fa);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}
.fz-arr-tools {
    display: flex;
    justify-content: center;
    gap: 8px;
}
.fz-arr-tool-btn {
    flex: 1;
    max-width: 140px;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    cursor: pointer;
    transition: all 0.15s;
}
.fz-arr-tool-btn:hover:not(:disabled) {
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-color: var(--bs-primary, #0d6efd);
    color: var(--bs-primary, #0d6efd);
}
.fz-arr-tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Maze Board & SVG Container */
.fz-arr-maze-box {
    background: #090d16;
    border: 3px solid #1e293b;
    border-radius: 1.25rem;
    padding: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), inset 0 2px 8px rgba(255, 255, 255, 0.05);
    margin: 0 auto 1rem auto;
    max-width: 480px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.fz-arr-svg-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    background: radial-gradient(circle at center, #111827 0%, #030712 100%);
}
.fz-arr-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Winding Arrow SVG Group Interactivity */
.fz-arr-group {
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
    transform-origin: center center;
}
.fz-arr-group:hover {
    filter: brightness(1.25) drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
}
.fz-arr-group:active {
    transform: scale(0.97);
}

/* Slither / Fly Out Directional Animations */
.fz-arr-slithering {
    pointer-events: none;
}
.fz-arr-slither-up {
    animation: fz-arr-slither-up-anim 0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.fz-arr-slither-down {
    animation: fz-arr-slither-down-anim 0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.fz-arr-slither-left {
    animation: fz-arr-slither-left-anim 0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.fz-arr-slither-right {
    animation: fz-arr-slither-right-anim 0.32s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fz-arr-slither-up-anim {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(-700px); opacity: 0; }
}
@keyframes fz-arr-slither-down-anim {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(700px); opacity: 0; }
}
@keyframes fz-arr-slither-left-anim {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(-700px); opacity: 0; }
}
@keyframes fz-arr-slither-right-anim {
    0% { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(700px); opacity: 0; }
}

/* Shaking on Blocked Move */
.fz-arr-shake {
    animation: fz-arr-svg-shake 0.35s ease;
}
@keyframes fz-arr-svg-shake {
    0%, 100% { transform: translate(0, 0); }
    20% { transform: translate(-8px, -4px); }
    40% { transform: translate(8px, 4px); }
    60% { transform: translate(-5px, 2px); }
    80% { transform: translate(5px, -2px); }
}

/* Blocker Red Glow Highlight */
.fz-arr-blocker-glow {
    filter: drop-shadow(0 0 16px #ef4444) brightness(1.4) !important;
}

/* Hint Golden Pulse */
.fz-arr-hint {
    animation: fz-arr-svg-hint 0.75s ease-in-out infinite alternate;
}
@keyframes fz-arr-svg-hint {
    0% { filter: drop-shadow(0 0 8px #fbbf24) brightness(1.2); }
    100% { filter: drop-shadow(0 0 24px #f59e0b) drop-shadow(0 0 8px #ffffff) brightness(1.6); }
}

/* ==========================================================================
   Inspiring Story Book Styles & Reader Themes
   ========================================================================== */
.fz-sb-wrapper {
    max-width: 980px;
    margin: 0 auto;
}
.fz-sb-story-card {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    border-radius: 1rem;
    overflow: hidden;
}
.fz-sb-story-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12) !important;
}
.fz-sb-story-icon {
    font-size: 2.4rem;
    line-height: 1;
}
.fz-sb-pill-btn {
    border-radius: 2rem;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    transition: all 0.15s;
    cursor: pointer;
}
.fz-sb-pill-btn:hover {
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-color: var(--bs-primary, #0d6efd);
    color: var(--bs-primary, #0d6efd);
}
.fz-sb-pill-btn.active {
    background: var(--bs-primary, #0d6efd);
    border-color: var(--bs-primary, #0d6efd);
    color: #fff;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}

/* Reader Container */
.fz-sb-reader-wrapper {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: background-color 0.25s, color 0.25s;
}
.fz-sb-reader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-tertiary-bg, #f8f9fa);
}
.fz-sb-narration-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.25rem;
    background: rgba(13, 110, 253, 0.06);
    border-bottom: 1px solid rgba(13, 110, 253, 0.15);
}
.fz-sb-speed-btn {
    border: 1px solid var(--bs-border-color, #dee2e6);
    background: transparent;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    margin-left: 2px;
}
.fz-sb-speed-btn.active {
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    border-color: var(--bs-primary, #0d6efd);
}

/* Page Card Content */
.fz-sb-page-card {
    padding: 2.5rem 2rem;
    min-height: 380px;
}
.fz-sb-page-inner {
    max-width: 660px;
    margin: 0 auto;
}
.fz-sb-paragraph {
    line-height: 1.85;
    margin-bottom: 1.25rem;
    text-align: justify;
}
.fz-sb-first-para::first-letter {
    float: left;
    font-size: 3.2rem;
    line-height: 0.85;
    font-weight: bold;
    margin-right: 0.6rem;
    margin-top: 0.15rem;
    color: var(--bs-primary, #0d6efd);
    font-family: Georgia, 'Times New Roman', serif;
}

/* Themes */
.theme-parchment {
    background-color: #fbf7ee !important;
    color: #2b2520 !important;
}
.theme-parchment .fz-sb-page-card {
    background: #fbf7ee;
}
.theme-sepia {
    background-color: #f4ebd7 !important;
    color: #3b2c1a !important;
}
.theme-sepia .fz-sb-page-card {
    background: #f4ebd7;
}
.theme-light {
    background-color: #ffffff !important;
    color: #1e293b !important;
}
.theme-light .fz-sb-page-card {
    background: #ffffff;
}
.theme-dark {
    background-color: #0f172a !important;
    color: #f1f5f9 !important;
}
.theme-dark .fz-sb-page-card {
    background: #0f172a;
}
.theme-dark .fz-sb-reader-header,
.theme-dark .fz-sb-narration-bar {
    background: #1e293b;
    border-color: #334155;
}
.theme-dark .fz-sb-page-nav {
    background: #1e293b;
    border-top: 1px solid #334155;
}

/* Font Scales */
.font-small .fz-sb-paragraph { font-size: 0.98rem; }
.font-medium .fz-sb-paragraph { font-size: 1.14rem; }
.font-large .fz-sb-paragraph { font-size: 1.34rem; }

/* Page Nav Bar */
.fz-sb-page-nav {
    padding: 0.75rem 1.25rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
    border-top: 1px solid var(--bs-border-color, #dee2e6);
}

/* Moral Box */
.fz-sb-moral-quote-box {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid #f59e0b;
    padding: 1.25rem 1.5rem;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

