        /* ==========================================================
                   1. ROOT VARIABLES & RESET
                   ========================================================== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --bg-body: #f4f7fc;
            --bg-header: #ffffff;
            --bg-footer: #ffffff;
            --text-color: #1e293b;
            --border-color: #e2e8f0;
            --shadow-color: rgba(0, 0, 0, 0.05);
            --ad-bg: #f8fafc;
            --ad-border: #e2e8f0;
            --game-bg: #ffffff;
            --cell-bg: #f1f5f9;
            --cell-border: #cbd5e1;
            --modal-overlay: rgba(0, 0, 0, 0.5);
            --modal-bg: #ffffff;
            --modal-text: #1e293b;
            --num-btn-bg: linear-gradient(145deg, #4f46e5, #6366f1);
            --num-btn-hover: linear-gradient(145deg, #4338ca, #4f46e5);
            --num-btn-shadow: #312e81;
            --num-btn-color: #ffffff;
        }

        [data-theme="dark"] {
            --bg-body: #0f172a;
            --bg-header: #1e293b;
            --bg-footer: #1e293b;
            --text-color: #e8edf5;
            --border-color: #334155;
            --shadow-color: rgba(0, 0, 0, 0.3);
            --ad-bg: #1a2332;
            --ad-border: #334155;
            --game-bg: #1e293b;
            --cell-bg: #243447;
            --cell-border: #334155;
            --modal-bg: #1e293b;
            --modal-text: #e8edf5;
            --modal-overlay: rgba(0, 0, 0, 0.7);
            --num-btn-bg: linear-gradient(145deg, #6366f1, #818cf8);
            --num-btn-hover: linear-gradient(145deg, #4f46e5, #6366f1);
            --num-btn-shadow: #312e81;
            --num-btn-color: #ffffff;
        }

        body {
            font-family: 'Quicksand', sans-serif;
            background: var(--bg-body);
            color: var(--text-color);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            padding: 20px;
            transition: background 0.3s;
        }

        .theme-wrapper {
            max-width: 1300px;
            width: 100%;
            background: transparent;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        /* ==========================================================
                   2. HEADER
                   ========================================================== */
        .game-header {
            background: var(--bg-header);
            border-radius: 30px;
            border: 1px solid var(--border-color);
            padding: 12px 24px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 12px;
            box-shadow: 0 2px 8px var(--shadow-color);
            transition: background 0.3s, border-color 0.3s;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .brand-logo {
            width: 40px;
            height: 40px;
            border-radius: 12px;
            display: block;
            box-shadow: 0 3px 8px rgba(99, 102, 241, 0.35);
            flex-shrink: 0;
        }

        .game-brand {
            font-family: 'Bebas Neue', sans-serif;
            font-size: 32px;
            font-weight: 400;
            color: var(--text-color);
            letter-spacing: 2px;
            text-decoration: none;
            background: linear-gradient(135deg, #3b82f6, #8b5cf6);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .header-btn {
            background: var(--cell-bg);
            border: 1px solid var(--border-color);
            color: var(--text-color);
            padding: 8px 14px;
            border-radius: 30px;
            cursor: pointer;
            font-size: 18px;
            transition: 0.3s;
            box-shadow: 0 2px 0 var(--cell-border);
            line-height: 1;
            min-width: 44px;
            min-height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Quicksand', sans-serif;
        }
        .header-btn:hover {
            background: var(--border-color);
            transform: scale(1.05);
        }
        .header-btn:active {
            transform: scale(0.95);
        }
        .header-btn.muted {
            opacity: 0.5;
        }
        .share-btn {
            transition: 0.3s;
        }
        .share-facebook:hover { background: #1877f2; color: #fff; }
        .share-x:hover { background: #000000; color: #fff; }
        .share-whatsapp:hover { background: #25d366; color: #fff; }
        .share-linkedin:hover { background: #0a66c2; color: #fff; }

        .header-btn .label {
            font-size: 12px;
            font-weight: 600;
            margin-left: 4px;
        }

        /* ==========================================================
                   3. LANGUAGE SELECTOR (في الهيدر)
                   ========================================================== */
        .lang-selector-header {
            display: flex;
            align-items: center;
            gap: 6px;
            background: var(--cell-bg);
            padding: 4px 10px 4px 14px;
            border-radius: 30px;
            border: 1px solid var(--border-color);
            transition: background 0.3s;
        }
        .lang-selector-header label {
            color: var(--text-color);
            font-size: 13px;
            font-weight: 500;
        }
        .lang-selector-header select {
            background: transparent;
            color: var(--text-color);
            border: none;
            padding: 4px 4px 4px 0;
            border-radius: 30px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            font-family: 'Quicksand', sans-serif;
            outline: none;
            min-width: 140px;
        }
        .lang-selector-header select option {
            padding: 6px;
            background: var(--bg-body);
            color: var(--text-color);
        }

        /* ==========================================================
                   5. MAIN LAYOUT
                   ========================================================== */
        .main-layout {
            display: flex;
            justify-content: center;
            align-items: start;
        }

        /* ==========================================================
                   6. GAME CONTAINER
                   ========================================================== */
        .game-container {
            background: var(--game-bg);
            border-radius: 32px;
            padding: 24px 20px 28px;
            box-shadow: 0 8px 30px var(--shadow-color);
            border: 1px solid var(--border-color);
            transition: background 0.3s, border-color 0.3s;
        }

        .game-container .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
            flex-wrap: wrap;
            gap: 8px;
        }
        .game-container .header h1 {
            display: none;
        }

        .game-container .header-controls {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        .game-container .icon-btn {
            background: var(--cell-bg);
            border: 1px solid var(--border-color);
            color: var(--text-color);
            padding: 8px 14px;
            border-radius: 30px;
            cursor: pointer;
            font-size: 18px;
            transition: 0.3s;
            box-shadow: 0 2px 0 var(--cell-border);
            line-height: 1;
            min-width: 44px;
            min-height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .game-container .icon-btn:active {
            transform: translateY(2px);
            box-shadow: none;
        }
        .game-container .icon-btn.muted {
            opacity: 0.5;
        }

        .game-container .top-bar {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            color: #64748b;
            font-size: 14px;
            padding: 0 4px 12px 4px;
            border-bottom: 2px solid var(--border-color);
            gap: 6px;
        }
        .game-container .top-bar span {
            background: var(--cell-bg);
            padding: 4px 12px;
            border-radius: 30px;
            font-weight: 500;
            font-size: 13px;
            color: var(--text-color);
        }

        .game-container .difficulty-selector {
            display: flex;
            gap: 4px;
            flex-wrap: wrap;
        }
        .game-container .difficulty-selector button {
            background: var(--cell-bg);
            border: 1px solid var(--border-color);
            color: var(--text-color);
            padding: 4px 10px;
            border-radius: 30px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            transition: 0.2s;
            font-family: 'Quicksand', sans-serif;
        }
        .game-container .difficulty-selector button.active {
            background: #3b82f6;
            color: white;
            border-color: #3b82f6;
            box-shadow: 0 0 16px #2563eb55;
        }

        /* ==========================================================
                   BOARD + SIDE NUMPAD
                   ========================================================== */
        .board-numpad-wrapper {
            display: flex;
            flex-direction: row;
            gap: 12px;
            align-items: stretch;
            margin: 14px 0;
        }

        .game-container .board {
            display: grid;
            grid-template-columns: repeat(9, 1fr);
            gap: 1px;
            background: var(--cell-border);
            padding: 2px;
            border-radius: 12px;
            border: 2px solid var(--cell-border);
            flex: 1;
            min-width: 0;
            aspect-ratio: 1/1;
            max-width: 100%;
        }

        .game-container .cell {
            aspect-ratio: 1/1;
            background: var(--game-bg);
            color: var(--text-color);
            font-size: 24px;
            font-weight: 600;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: 0.15s ease;
            user-select: none;
            font-family: 'Quicksand', sans-serif;
        }
        .game-container .cell.given {
            color: var(--text-color);
            font-weight: 700;
        }
        .game-container .cell.selected {
            background: #3b82f6 !important;
            color: white;
            transform: scale(0.94);
            border-radius: 4px;
        }
        .game-container .cell.highlight {
            background: rgba(59, 130, 246, 0.16) !important;
        }
        .game-container .cell.error {
            background: #fee2e2 !important;
            color: #991b1b;
            animation: shake 0.2s;
        }
        .game-container .cell.hint {
            background: #dcfce7;
            color: #166534;
        }
        .game-container .cell.same-number {
            background: #bfdbfe !important;
            color: #1e3a5f;
            transition: 0.2s;
        }
        .game-container .cell.box-0 { background: var(--game-bg); }
        .game-container .cell.box-1 { background: var(--cell-bg); }
        .game-container .cell.box-2 { background: var(--game-bg); }
        .game-container .cell.box-3 { background: var(--cell-bg); }
        .game-container .cell.box-4 { background: var(--game-bg); }
        .game-container .cell.box-5 { background: var(--cell-bg); }
        .game-container .cell.box-6 { background: var(--game-bg); }
        .game-container .cell.box-7 { background: var(--cell-bg); }
        .game-container .cell.box-8 { background: var(--game-bg); }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }

        /* ==========================================================
                   SIDE NUMPAD
                   ========================================================== */
        .side-numpad {
            display: flex;
            flex-direction: column;
            gap: 6px;
            flex-shrink: 0;
            justify-content: center;
            padding: 4px;
            background: var(--cell-bg);
            border-radius: 16px;
            border: 1px solid var(--border-color);
            min-width: 52px;
        }

        .sn-btn {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            font-size: 20px;
            font-weight: 800;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: 0.15s ease;
            background: var(--num-btn-bg);
            border: none;
            color: var(--num-btn-color);
            box-shadow: 0 4px 0 var(--num-btn-shadow);
            font-family: 'Quicksand', sans-serif;
            position: relative;
            user-select: none;
        }
        .sn-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 0 var(--num-btn-shadow), 0 0 20px rgba(99, 102, 241, 0.4);
        }
        .sn-btn:active {
            transform: translateY(4px);
            box-shadow: 0 1px 0 var(--num-btn-shadow);
        }
        .sn-btn .sn-label {
            font-size: 9px;
            opacity: 0.5;
            position: absolute;
            bottom: 2px;
            right: 6px;
            font-weight: 400;
        }

        /* ==========================================================
                   إخفاء لوحة الأرقام القديمة
                   ========================================================== */
        .game-container .num-pad {
            display: none !important;
        }

        /* ==========================================================
                   RESPONSIVE
                   ========================================================== */
        @media (max-width: 820px) {
            .board-numpad-wrapper {
                gap: 10px;
            }
            .sn-btn {
                width: 38px;
                height: 38px;
                font-size: 17px;
                border-radius: 10px;
            }
            .side-numpad {
                min-width: 44px;
                gap: 5px;
                padding: 4px;
            }
            .game-container .cell {
                font-size: 20px;
            }
        }

        @media (max-width: 600px) {
            .board-numpad-wrapper {
                flex-direction: column;
                align-items: center;
            }
            .game-container .board {
                max-width: 100%;
                width: 100%;
                aspect-ratio: 1/1;
            }
            .side-numpad {
                flex-direction: row;
                flex-wrap: wrap;
                justify-content: center;
                width: 100%;
                min-width: unset;
                gap: 5px;
                padding: 8px 4px;
                border-radius: 14px;
            }
            .sn-btn {
                width: 36px;
                height: 36px;
                font-size: 16px;
                border-radius: 9px;
                flex: 0 0 auto;
            }
            .sn-btn .sn-label {
                display: none;
            }
            .game-container .cell {
                font-size: 18px;
            }
        }

        @media (max-width: 400px) {
            .sn-btn {
                width: 30px;
                height: 30px;
                font-size: 14px;
                border-radius: 7px;
            }
            .side-numpad {
                gap: 4px;
                padding: 6px 3px;
            }
            .game-container .cell {
                font-size: 15px;
            }
        }

        /* ==========================================================
                   ACTIONS
                   ========================================================== */
        .game-container .actions {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            justify-content: center;
            margin-top: 6px;
        }
        .game-container .actions button {
            background: var(--cell-bg);
            border: none;
            color: var(--text-color);
            padding: 8px 14px;
            border-radius: 40px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            box-shadow: 0 4px 0 var(--cell-border);
            transition: 0.1s ease;
            flex: 1 0 auto;
            min-width: 60px;
            border: 1px solid var(--border-color);
            font-family: 'Quicksand', sans-serif;
        }
        .game-container .actions button:active {
            transform: translateY(3px);
            box-shadow: 0 1px 0 var(--cell-border);
        }
        .game-container .actions .primary {
            background: #3b82f6;
            color: white;
            border-color: #3b82f6;
        }

        .game-container .score-area {
            display: flex;
            justify-content: space-between;
            color: var(--text-color);
            margin: 10px 0 8px;
            padding: 8px 14px;
            background: var(--cell-bg);
            border-radius: 30px;
            font-size: 15px;
            font-weight: 500;
            transition: background 0.3s;
            font-family: 'Quicksand', sans-serif;
        }

        .game-container .leaderboard {
            margin-top: 14px;
            background: var(--cell-bg);
            border-radius: 24px;
            padding: 12px 14px;
            max-height: 200px;
            overflow-y: auto;
            transition: background 0.3s;
        }
        .game-container .leaderboard h3 {
            color: var(--text-color);
            font-size: 14px;
            font-weight: 500;
            margin-bottom: 10px;
            text-align: center;
            font-family: 'Quicksand', sans-serif;
        }
        .game-container #playerRankDisplay {
            background: var(--game-bg);
            padding: 8px 14px;
            border-radius: 30px;
            margin-bottom: 10px;
            text-align: center;
            color: var(--text-color);
            font-weight: 600;
            font-size: 15px;
            border: 2px solid #3b82f6;
            font-family: 'Quicksand', sans-serif;
        }
        .game-container .leaderboard table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
            color: var(--text-color);
        }
        .game-container .leaderboard td,
        .game-container .leaderboard th {
            padding: 4px 6px;
            text-align: center;
            border-bottom: 1px solid var(--border-color);
        }
        .game-container .leaderboard th {
            color: var(--text-color);
            font-weight: 500;
            font-size: 12px;
            font-family: 'Quicksand', sans-serif;
        }
        .game-container .leaderboard tr.current-player {
            background: #3b82f6;
            color: white;
            font-weight: bold;
        }
        .game-container .footer-text {
            text-align: center;
            color: #94a3b8;
            font-size: 12px;
            margin-top: 12px;
            font-family: 'Quicksand', sans-serif;
        }

        /* ==========================================================
                   8. FOOTER LINKS
                   ========================================================== */
        .footer-links {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 20px;
            padding: 12px 0 4px 0;
            flex-wrap: wrap;
            border-top: 1px solid var(--border-color);
            margin-top: 8px;
        }
        .footer-links a {
            color: var(--text-color);
            text-decoration: none;
            font-size: 13px;
            font-weight: 500;
            transition: color 0.3s;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 30px;
        }
        .footer-links a:hover {
            color: #3b82f6;
            background: var(--cell-bg);
        }
        .footer-links .divider {
            color: var(--border-color);
            font-size: 18px;
            user-select: none;
        }
        .footer-links .copy {
            color: var(--text-color);
            font-size: 12px;
            font-weight: 400;
            opacity: 0.7;
        }

        /* ==========================================================
                   9. POLICY PAGES - صفحات ثابتة واحترافية
                   ========================================================== */
        .policy-page {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--bg-body);
            z-index: 10000;
            overflow-y: auto;
            padding: 30px 20px;
        }
        .policy-page.active {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .policy-page-container {
            max-width: 900px;
            width: 100%;
            background: var(--game-bg);
            border-radius: 32px;
            padding: 40px 45px;
            border: 1px solid var(--border-color);
            box-shadow: 0 8px 40px var(--shadow-color);
            margin: 20px auto;
        }

        .policy-page-container h1 {
            font-size: 32px;
            font-weight: 700;
            margin-bottom: 6px;
            color: var(--text-color);
            display: flex;
            align-items: center;
            gap: 14px;
        }
        .policy-page-container .policy-subtitle {
            font-size: 15px;
            color: #94a3b8;
            margin-bottom: 24px;
            border-bottom: 2px solid var(--border-color);
            padding-bottom: 16px;
        }
        .policy-page-container .policy-date {
            font-size: 13px;
            color: #94a3b8;
            margin-bottom: 20px;
        }
        .policy-page-container h2 {
            font-size: 20px;
            font-weight: 600;
            margin-top: 28px;
            margin-bottom: 12px;
            color: var(--text-color);
        }
        .policy-page-container h3 {
            font-size: 17px;
            font-weight: 600;
            margin-top: 22px;
            margin-bottom: 10px;
            color: var(--text-color);
        }
        .policy-page-container p {
            font-size: 15px;
            line-height: 1.8;
            color: var(--text-color);
            margin-bottom: 12px;
            opacity: 0.92;
        }
        .policy-page-container ul {
            list-style: none;
            padding: 0;
            margin: 10px 0 16px 0;
        }
        .policy-page-container ul li {
            font-size: 15px;
            line-height: 1.8;
            color: var(--text-color);
            padding: 6px 0 6px 28px;
            position: relative;
            opacity: 0.92;
        }
        .policy-page-container ul li::before {
            content: "◆";
            position: absolute;
            left: 2px;
            color: #3b82f6;
            font-weight: 700;
            font-size: 14px;
        }
        .policy-page-container .policy-highlight {
            background: var(--cell-bg);
            padding: 16px 20px;
            border-radius: 12px;
            margin: 16px 0;
            border-left: 4px solid #3b82f6;
        }
        .policy-page-container .policy-highlight strong {
            color: #3b82f6;
        }

        .policy-page-close {
            position: fixed;
            top: 20px;
            right: 30px;
            background: var(--cell-bg);
            border: 1px solid var(--border-color);
            color: var(--text-color);
            width: 48px;
            height: 48px;
            border-radius: 50%;
            font-size: 26px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: 0.3s;
            z-index: 10001;
            box-shadow: 0 4px 16px var(--shadow-color);
        }
        .policy-page-close:hover {
            background: var(--border-color);
            transform: rotate(90deg);
        }

        .policy-back-link {
            display: inline-block;
            margin-top: 24px;
            padding: 10px 28px;
            background: var(--num-btn-bg);
            color: var(--num-btn-color);
            border-radius: 40px;
            text-decoration: none;
            font-weight: 600;
            font-size: 14px;
            transition: 0.3s;
            box-shadow: 0 4px 0 var(--num-btn-shadow);
            font-family: 'Quicksand', sans-serif;
            border: none;
            cursor: pointer;
            text-align: center;
        }
        .policy-back-link:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 0 var(--num-btn-shadow), 0 0 20px rgba(99, 102, 241, 0.3);
        }
        .policy-back-link:active {
            transform: translateY(4px);
            box-shadow: 0 1px 0 var(--num-btn-shadow);
        }

        body.policy-active .theme-wrapper {
            display: none;
        }

        /* ==========================================================
                   9B. صفحة طبع شبكات السودوكو (داخل الموقع)
                   ========================================================== */
        .print-page-diff {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin: 6px 0 26px 0;
        }
        .print-page-diff button {
            flex: 1;
            min-width: 100px;
            padding: 12px 10px;
            border-radius: 14px;
            border: 1px solid var(--border-color);
            background: var(--cell-bg);
            color: var(--text-color);
            font-family: 'Quicksand', sans-serif;
            font-weight: 700;
            font-size: 14px;
            cursor: pointer;
            transition: 0.25s;
        }
        .print-page-diff button.active {
            background: var(--num-btn-bg);
            color: var(--num-btn-color);
            border-color: transparent;
            box-shadow: 0 4px 0 var(--num-btn-shadow);
        }
        .print-count-row {
            display: flex;
            align-items: center;
            gap: 14px;
            margin-bottom: 26px;
            flex-wrap: wrap;
        }
        .print-count-row label {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-color);
            opacity: 0.85;
        }
        .print-count-row select {
            padding: 10px 16px;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            background: var(--game-bg);
            color: var(--text-color);
            font-family: 'Quicksand', sans-serif;
            font-size: 14px;
            font-weight: 600;
        }
        .print-generate-btn {
            display: inline-block;
            padding: 13px 32px;
            border-radius: 40px;
            background: var(--num-btn-bg);
            color: var(--num-btn-color);
            font-weight: 700;
            font-size: 15px;
            border: none;
            cursor: pointer;
            box-shadow: 0 4px 0 var(--num-btn-shadow);
            font-family: 'Quicksand', sans-serif;
            transition: 0.25s;
            margin-bottom: 30px;
        }
        .print-generate-btn:active {
            transform: translateY(3px);
            box-shadow: 0 1px 0 var(--num-btn-shadow);
        }
        .print-sheet {
            background: #ffffff;
            border-radius: 18px;
            padding: 25px;
            border: 1px solid var(--border-color);
        }
        .print-sheet-header {
            text-align: center;
            border-bottom: 3px solid #2d3748;
            padding-bottom: 16px;
            margin-bottom: 22px;
        }
        .print-sheet-header h2 {
            font-size: 26px;
            font-weight: 800;
            color: #1a202c;
            letter-spacing: 3px;
        }
        .print-sheet-header .print-meta {
            font-size: 13px;
            color: #718096;
            margin-top: 6px;
        }
        .print-grids-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 26px 34px;
        }
        .print-grids-container.count-1 { grid-template-columns: 1fr; max-width: 380px; margin: 0 auto; }
        .print-grids-container.count-6 { grid-template-columns: 1fr 1fr 1fr; }
        .print-grid-wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .print-grid-title {
            font-size: 14px;
            font-weight: 700;
            color: #2d3748;
            margin-bottom: 8px;
            background: #edf2f7;
            padding: 3px 16px;
            border-radius: 20px;
        }

        /* === PROFI GRID — with proper thick 3x3 borders === */
        .print-grid {
            display: grid;
            grid-template-columns: repeat(9, 1fr);
            border: 3px solid #2d3748;
            width: 100%;
            max-width: 300px;
            aspect-ratio: 1/1;
            background: #fff;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        }
        .print-grid .cell {
            background: #ffffff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            font-weight: 700;
            color: #1a202c;
            font-family: 'Courier New', monospace;
            border-right: 1px solid #cbd5e1;
            border-bottom: 1px solid #cbd5e1;
            aspect-ratio: 1/1;
        }
        /* thick borders for 3×3 box boundaries */
        .print-grid .cell.box-right {
            border-right: 3px solid #2d3748;
        }
        .print-grid .cell.box-bottom {
            border-bottom: 3px solid #2d3748;
        }
        /* no border on outer edges (handled by grid border) */
        .print-grid .cell.col-last {
            border-right: none;
        }
        .print-grid .cell.row-last {
            border-bottom: none;
        }
        .print-grid .cell.empty {
            color: #a0aec0;
            font-weight: 300;
        }

        /* === PRINT STYLES — A4 friendly, large grids === */
        @media print {
            body * { visibility: hidden; }
            #printPage, #printPage * { visibility: visible; }
            #printPage {
                position: absolute;
                top: 0; left: 0;
                width: 100%;
                padding: 0;
                background: #fff !important;
            }
            .policy-page-close,
            .print-page-diff,
            .print-count-row,
            .print-generate-btn,
            .policy-back-link,
            #printNowBtn {
                display: none !important;
            }
            .print-sheet {
                border: none !important;
                padding: 4px 0 !important;
                border-radius: 0 !important;
                background: #fff !important;
            }
            .print-sheet-header {
                border-bottom-color: #2d3748 !important;
                padding-bottom: 8px !important;
                margin-bottom: 10px !important;
            }
            .print-sheet-header h2 {
                font-size: 22px !important;
            }
            .print-grids-container {
                gap: 12px 16px !important;
                width: 100% !important;
                max-width: 100% !important;
            }
            .print-grid {
                max-width: 100% !important;
                border-width: 3px !important;
                width: 100% !important;
                aspect-ratio: 1/1 !important;
            }
            .print-grid .cell {
                font-size: 20px !important;
                border-right: 1px solid #cbd5e1 !important;
                border-bottom: 1px solid #cbd5e1 !important;
            }
            .print-grid .cell.box-right {
                border-right-width: 3px !important;
                border-right-color: #2d3748 !important;
            }
            .print-grid .cell.box-bottom {
                border-bottom-width: 3px !important;
                border-bottom-color: #2d3748 !important;
            }
            .print-grid .cell.col-last { border-right: none !important; }
            .print-grid .cell.row-last { border-bottom: none !important; }
            .print-grid .cell.empty { color: #a0aec0 !important; }

            /* A4 page margins minimized */
            @page { size: A4; margin: 6mm 8mm 8mm 8mm; }

            /* Force grids to expand and fill space */
            .print-grids-container.count-1 .print-grid { max-width: 100% !important; }
            .print-grids-container.count-1 { max-width: 100% !important; margin: 0; }
            .print-grids-container.count-2 .print-grid { max-width: 100% !important; }
            .print-grids-container.count-4 .print-grid { max-width: 100% !important; }
            .print-grids-container.count-6 .print-grid { max-width: 100% !important; }
            .print-grids-container.count-6 { gap: 10px 14px !important; }
        }

        @media (max-width: 700px) {
            .article-container { padding: 26px 20px; }
            .print-grids-container, .print-grids-container.count-6 { grid-template-columns: 1fr 1fr; }
        }
        @media (max-width: 480px) {
            .print-grids-container, .print-grids-container.count-6 { grid-template-columns: 1fr; }
        }
        /* ==========================================================
                   9C. ARTICLE — Sudoku deep-dive (English)
                   ========================================================== */
        .article-container {
            background: var(--game-bg);
            border-radius: 30px;
            border: 1px solid var(--border-color);
            padding: 36px 40px;
            box-shadow: 0 2px 8px var(--shadow-color);
            text-align: left;
            direction: ltr;
        }
        .article-container h2 {
            font-size: 26px;
            font-weight: 700;
            color: var(--text-color);
            margin-bottom: 6px;
        }
        .article-container .article-sub {
            font-size: 14px;
            color: #94a3b8;
            margin-bottom: 22px;
            padding-bottom: 18px;
            border-bottom: 2px solid var(--border-color);
        }
        .article-container h3 {
            font-size: 19px;
            font-weight: 700;
            color: var(--text-color);
            margin-top: 28px;
            margin-bottom: 10px;
        }
        .article-container p {
            font-size: 15.5px;
            line-height: 2;
            color: var(--text-color);
            opacity: 0.92;
            margin-bottom: 14px;
        }
        .article-container ul {
            margin: 8px 0 16px 20px;
            padding-left: 10px;
        }
        .article-container ul li {
            font-size: 15.5px;
            line-height: 1.95;
            color: var(--text-color);
            opacity: 0.92;
            margin-bottom: 8px;
            list-style: disc;
        }

        /* ==========================================================
                   11. WIN CELEBRATION POPUP
                   ========================================================== */
        #winCelebration {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.75);
            backdrop-filter: blur(8px);
            z-index: 99999;
            justify-content: center;
            align-items: center;
            padding: 20px;
            animation: fadeInPopup 0.5s ease;
        }
        #winCelebration.show {
            display: flex;
        }

        @keyframes fadeInPopup {
            from { opacity: 0; transform: scale(0.8); }
            to { opacity: 1; transform: scale(1); }
        }

        .win-popup {
            background: var(--game-bg);
            border-radius: 36px;
            padding: 40px 36px 32px;
            max-width: 480px;
            width: 100%;
            text-align: center;
            border: 2px solid var(--border-color);
            box-shadow: 0 0 80px rgba(99, 102, 241, 0.4);
            animation: popupBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
            position: relative;
            overflow: hidden;
        }

        @keyframes popupBounce {
            from { transform: scale(0.3) rotate(-5deg); opacity: 0; }
            to { transform: scale(1) rotate(0deg); opacity: 1; }
        }

        .win-popup::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: conic-gradient(from 0deg, transparent, rgba(99, 102, 241, 0.05), transparent, rgba(236, 72, 153, 0.05), transparent);
            animation: rotateGlow 8s linear infinite;
            z-index: 0;
        }

        @keyframes rotateGlow {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        .win-popup > * {
            position: relative;
            z-index: 1;
        }

        .win-trophy {
            font-size: 72px;
            display: block;
            margin-bottom: 4px;
            animation: trophyBounce 0.8s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
        }

        @keyframes trophyBounce {
            from { transform: scale(0) rotate(-30deg); opacity: 0; }
            to { transform: scale(1) rotate(0deg); opacity: 1; }
        }

        .win-title {
            font-size: 36px;
            font-weight: 800;
            background: linear-gradient(135deg, #fbbf24, #f97316, #ef4444, #ec4899);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 2px;
            font-family: 'Quicksand', sans-serif;
        }

        .win-subtitle {
            font-size: 14px;
            color: #94a3b8;
            margin-bottom: 16px;
        }

        .win-stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            margin-bottom: 16px;
        }

        .win-stat {
            background: var(--cell-bg);
            border: 1px solid var(--border-color);
            border-radius: 14px;
            padding: 12px 8px;
            transition: background 0.3s;
        }

        .win-stat-val {
            font-size: 24px;
            font-weight: 800;
            color: #3b82f6;
            display: block;
            font-family: 'Quicksand', sans-serif;
        }

        .win-stat-lbl {
            font-size: 10px;
            color: #94a3b8;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            font-weight: 500;
        }

        .win-buttons {
            display: flex;
            gap: 10px;
            justify-content: center;
            flex-wrap: wrap;
        }

        .win-btn {
            padding: 12px 28px;
            border-radius: 40px;
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            border: none;
            font-family: 'Quicksand', sans-serif;
            transition: 0.2s ease;
            flex: 1;
            min-width: 120px;
        }

        .win-btn-primary {
            background: linear-gradient(135deg, #3b82f6, #6366f1);
            color: white;
            box-shadow: 0 4px 0 #1e3a7a;
        }
        .win-btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 0 #1e3a7a, 0 0 30px rgba(99, 102, 241, 0.3);
        }
        .win-btn-primary:active {
            transform: translateY(4px);
            box-shadow: 0 1px 0 #1e3a7a;
        }

        .win-btn-secondary {
            background: var(--cell-bg);
            color: var(--text-color);
            border: 1px solid var(--border-color);
        }
        .win-btn-secondary:hover {
            background: var(--border-color);
        }

        /* ==========================================================
                   CONFETTI CANVAS
                   ========================================================== */
        #confettiCanvas {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 99998;
        }

        /* ==========================================================
                   RESPONSIVE - WIN POPUP
                   ========================================================== */
        @media (max-width: 480px) {
            .win-popup {
                padding: 28px 20px 24px;
            }
            .win-title {
                font-size: 28px;
            }
            .win-trophy {
                font-size: 56px;
            }
            .win-stats {
                grid-template-columns: repeat(3, 1fr);
                gap: 6px;
            }
            .win-stat-val {
                font-size: 20px;
            }
            .win-btn {
                font-size: 13px;
                padding: 10px 16px;
                min-width: 80px;
            }
        }

        @media (max-width: 360px) {
            .win-stats {
                grid-template-columns: 1fr 1fr;
            }
            .win-stat:last-child {
                grid-column: span 2;
            }
        }

        /* ==========================================================
                   RESPONSIVE للصفحات
                   ========================================================== */
        @media (max-width: 820px) {
            .game-header {
                flex-direction: column;
                align-items: stretch;
                gap: 8px;
                padding: 14px 16px;
            }
            .header-left {
                justify-content: center;
            }
            .header-right {
                justify-content: center;
                flex-wrap: wrap;
            }
            .game-brand {
                font-size: 28px;
            }
            .lang-selector-header {
                width: 100%;
                justify-content: center;
            }
            .lang-selector-header select {
                min-width: 120px;
            }
            .policy-page-container {
                padding: 24px 20px;
            }
            .policy-page-container h1 {
                font-size: 26px;
            }
        }

        @media (max-width: 480px) {
            body { padding: 10px; }
            .game-container { padding: 16px 12px 20px; border-radius: 24px; }
            .footer-links { gap: 12px; }
            .footer-links a { font-size: 12px; }
            .footer-links .copy { font-size: 11px; width: 100%; text-align: center; }
            .game-container .actions button { font-size: 12px; padding: 6px 8px; }
            .game-container .top-bar { font-size: 11px; }
            .game-container .icon-btn { font-size: 16px; min-width: 36px; min-height: 36px; padding: 5px 8px; }
            .game-container .score-area { font-size: 12px; }
            .game-brand { font-size: 24px; }
            .header-btn { font-size: 14px; min-width: 36px; min-height: 36px; padding: 4px 10px; }
            .header-btn .label { font-size: 10px; }
            .lang-selector-header select { min-width: 100px; font-size: 11px; }
            .lang-selector-header label { font-size: 11px; }
            .policy-page-container {
                padding: 18px 16px;
            }
            .policy-page-container h1 {
                font-size: 22px;
            }
            .policy-page-container h2 {
                font-size: 18px;
            }
            .policy-page-container p,
            .policy-page-container ul li {
                font-size: 14px;
            }
            .policy-back-link {
                font-size: 13px;
                padding: 8px 20px;
                width: 100%;
                text-align: center;
            }
        }
