/* Game shell layout — extracted from Views/Game/Index.cshtml (presentation only).
   Bright theme overrides live in game-bright.css. */
/* ===== Kurdish Pattern Background ===== */
            * {
                font-family: 'Vazirmatn', 'Noto Naskh Arabic', 'Segoe UI', Tahoma, sans-serif;
                user-select: none;
                box-sizing: border-box;
                -webkit-tap-highlight-color: transparent;
            }

            html.pwa-root {
                height: 100%;
                height: 100svh;
                height: var(--app-height, 100svh);
                overflow: hidden;
                overscroll-behavior: none;
                background: #1a0e0a;
                touch-action: none;
            }

            body {
                position: fixed;
                top: var(--app-top, 0px);
                left: var(--app-left, 0px);
                width: var(--app-width, 100%);
                height: var(--app-height, 100svh);
                max-height: none;
                min-height: 0;
                right: auto;
                bottom: auto;
                margin: 0;
                padding: 0;
                display: flex;
                flex-direction: column;
                align-items: stretch;
                justify-content: flex-start;
                background: #1a0e0a;
                overflow: hidden;
                overscroll-behavior: none;
                -webkit-overflow-scrolling: touch;
                touch-action: none;
            }

            @media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
                html, body {
                    overscroll-behavior: none;
                    max-height: none;
                    height: var(--app-height, 100svh);
                }
            }

                /* ===== Kurdish Kilim Carpet Background ===== */
                body::before {
                    content: '';
                    position: fixed;
                    inset: 0;
                    z-index: 0;
                    background:
                        linear-gradient(180deg, rgba(13, 8, 6, 0.55) 0%, rgba(26, 14, 10, 0.35) 40%, rgba(13, 8, 6, 0.7) 100%),
                        url('/images/kurdish/carpet-pattern.svg') center / 180px 180px repeat,
                        linear-gradient(145deg, #2a120e 0%, #1a0c08 45%, #0d0604 100%);
                }

                body::after {
                    content: '';
                    position: fixed;
                    inset: 0;
                    z-index: 0;
                    pointer-events: none;
                    background:
                        radial-gradient(ellipse at 50% 12%, rgba(240, 192, 0, 0.1) 0%, transparent 40%),
                        radial-gradient(ellipse at 18% 78%, rgba(139, 42, 26, 0.14) 0%, transparent 42%),
                        radial-gradient(ellipse at 82% 72%, rgba(13, 92, 46, 0.12) 0%, transparent 42%);
                }

            .app-container {
                width: 100%;
                max-width: 820px;
                margin: 0 auto;
                padding: 0;
                position: relative;
                z-index: 1;
                flex: 1 1 auto;
                min-height: 0;
                display: flex;
                flex-direction: column;
            }

            .app-container > .row {
                flex: 1 1 auto;
                min-height: 0;
                width: 100%;
                margin: 0;
            }

            .app-container > .row > [class*="col-"] {
                display: flex;
                flex-direction: column;
                min-height: 0;
                padding-left: 0;
                padding-right: 0;
            }

            .game-back-btn {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                flex-shrink: 0;
                width: 44px;
                height: 44px;
                padding: 0;
                border: none;
                border-radius: 50%;
                background: rgba(255, 255, 255, 0.5);
                color: inherit;
            }

            /* ===== Kurdish Border Pattern ===== */
            .card-mamosta {
                background:
                    linear-gradient(180deg, rgba(26, 18, 14, 0.94) 0%, rgba(20, 12, 10, 0.96) 100%);
                border: 3px solid rgba(201, 162, 39, 0.35);
                border-radius: 2rem;
                box-shadow:
                    0 30px 80px rgba(0, 0, 0, 0.6),
                    0 0 0 1px rgba(139, 42, 26, 0.35) inset,
                    0 0 40px rgba(13, 92, 46, 0.08);
                overflow: hidden;
                width: 100%;
                position: relative;
                flex: 1 1 auto;
                min-height: 0;
                display: flex;
                flex-direction: column;
            }

                /* ===== Kurdish Corner Ornaments ===== */
                .card-mamosta::before {
                    content: '⬡ ⬡ ⬡';
                    position: absolute;
                    top: -5px;
                    left: 20px;
                    color: rgba(200, 160, 100, 0.08);
                    font-size: 0.8rem;
                    letter-spacing: 15px;
                    z-index: 0;
                }

                .card-mamosta::after {
                    content: '⬡ ⬡ ⬡';
                    position: absolute;
                    bottom: -5px;
                    right: 20px;
                    color: rgba(200, 160, 100, 0.08);
                    font-size: 0.8rem;
                    letter-spacing: 15px;
                    z-index: 0;
                }

            .header-persian {
                background:
                    linear-gradient(135deg, rgba(58, 24, 16, 0.92) 0%, rgba(109, 63, 38, 0.95) 35%, rgba(138, 90, 58, 0.95) 70%, rgba(61, 34, 22, 0.95) 100%),
                    url('/images/kurdish/carpet-pattern.svg') center / 120px 120px repeat;
                padding: 1.2rem 1.5rem;
                padding-top: max(1.2rem, env(safe-area-inset-top, 0px));
                padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
                padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
                position: relative;
                overflow: hidden;
                border-bottom: 3px solid rgba(201, 162, 39, 0.35);
                flex-shrink: 0;
            }

                .header-persian::before {
                    content: "✦ ✦ ✦";
                    position: absolute;
                    top: 8px;
                    left: 0;
                    right: 0;
                    text-align: center;
                    color: rgba(255, 215, 150, 0.08);
                    font-size: 1.2rem;
                    letter-spacing: 20px;
                }

                /* ===== Kurdish Geometric Pattern on Header ===== */
                .header-persian::after {
                    content: '';
                    position: absolute;
                    bottom: 0;
                    left: 0;
                    right: 0;
                    height: 2px;
                    background: repeating-linear-gradient(90deg, rgba(200, 160, 100, 0.15) 0px, rgba(200, 160, 100, 0.15) 10px, transparent 10px, transparent 20px );
                }

                .header-persian h1 {
                    font-weight: 900;
                    color: #fff6e5;
                    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), 0 0 60px rgba(200, 160, 100, 0.05);
                    font-size: clamp(1.2rem, 4vw, 2rem);
                    letter-spacing: 2px;
                }

                    .header-persian h1 i {
                        color: #ffd700;
                    }

                .header-persian .subtitle {
                    color: #e8d5b8;
                    font-size: clamp(0.6rem, 1.5vw, 0.9rem);
                    opacity: 0.9;
                    letter-spacing: 3px;
                }

            /* ===== Badges ===== */
            .badge-custom {
                font-size: clamp(0.55rem, 1.2vw, 0.85rem);
                padding: 0.3rem 0.6rem;
                border: 1px solid rgba(255, 255, 255, 0.1);
                backdrop-filter: blur(4px);
            }

                .badge-custom.bg-warning {
                    background: rgba(255, 193, 7, 0.2) !important;
                    color: #ffd700 !important;
                    border-color: rgba(255, 193, 7, 0.2);
                }

                .badge-custom.bg-success {
                    background: rgba(40, 167, 69, 0.2) !important;
                    color: #6fcf97 !important;
                    border-color: rgba(40, 167, 69, 0.2);
                }

                .badge-custom.bg-info {
                    background: rgba(23, 162, 184, 0.2) !important;
                    color: #6fc3cf !important;
                    border-color: rgba(23, 162, 184, 0.2);
                }

            .badge-combo {
                display: none;
                align-items: center;
                gap: 0.2rem;
                background: linear-gradient(135deg, #ff6b35, #ffd54f) !important;
                color: #1a0e0a !important;
                border-color: rgba(255, 213, 79, 0.7) !important;
                font-weight: 800;
                box-shadow: 0 0 14px rgba(255, 140, 0, 0.45);
            }

            .badge-combo.is-on {
                display: inline-flex;
                animation: comboPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            }

            .badge-combo.is-hot {
                background: linear-gradient(135deg, #ff3d00, #ffd54f) !important;
                box-shadow: 0 0 18px rgba(255, 80, 0, 0.65);
            }

            @keyframes comboPop {
                0% { transform: scale(0.55); }
                55% { transform: scale(1.18); }
                100% { transform: scale(1); }
            }

            body.is-drawing {
                overflow: hidden;
                touch-action: none;
                overscroll-behavior: none;
            }

            /* ===== میز کوردی + سینی حروف (شبیه ئامامۆستا) ===== */
            .kurdish-table-scene {
                position: relative;
                width: 100%;
                max-width: min(560px, 92vw);
                margin: 0.75rem auto 0.5rem;
                padding: clamp(1.2rem, 4vw, 2.2rem) clamp(1rem, 3vw, 1.8rem) clamp(1.4rem, 4vw, 2.4rem);
                border-radius: clamp(1rem, 2vw, 1.5rem);
                background:
                    linear-gradient(180deg, rgba(40, 22, 12, 0.15) 0%, rgba(20, 10, 6, 0.25) 100%),
                    url('/images/kurdish/wood-table.svg') center / cover no-repeat;
                box-shadow:
                    0 18px 40px rgba(0, 0, 0, 0.55),
                    inset 0 1px 0 rgba(232, 200, 120, 0.2),
                    inset 0 0 0 2px rgba(139, 42, 26, 0.25),
                    inset 0 0 0 5px rgba(201, 162, 39, 0.18);
                overflow: hidden;
                touch-action: none;
            }

                .kurdish-table-scene::before {
                    content: '';
                    position: absolute;
                    inset: 10px;
                    border-radius: inherit;
                    border: 1px solid rgba(201, 162, 39, 0.2);
                    pointer-events: none;
                    z-index: 0;
                }

                .kurdish-table-scene::after {
                    content: '';
                    position: absolute;
                    top: 12px;
                    left: 50%;
                    transform: translateX(-50%);
                    width: 44px;
                    height: 44px;
                    background: url('/icons/mamosta-192.png') center / contain no-repeat;
                    opacity: 0.4;
                    pointer-events: none;
                    z-index: 0;
                    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
                }

            .tray-container {
                position: relative;
                z-index: 1;
                background:
                    radial-gradient(ellipse at 45% 40%, rgba(74, 52, 36, 0.35) 0%, rgba(26, 18, 12, 0.55) 55%, rgba(18, 12, 8, 0.75) 100%),
                    url('/images/kurdish/tray-rim.svg') center / 108% 108% no-repeat;
                border-radius: 50%;
                padding: clamp(1.1rem, 4vw, 2.4rem);
                border: none;
                box-shadow:
                    0 10px 28px rgba(0, 0, 0, 0.45),
                    0 2px 0 rgba(90, 69, 16, 0.5),
                    inset 0 0 40px rgba(0, 0, 0, 0.35);
                width: 100%;
                aspect-ratio: 1 / 1;
                max-width: min(460px, 78vw);
                margin: 0 auto;
                cursor: default;
                touch-action: none;
                overflow: hidden;
                contain: layout paint;
            }

                .tray-container::before {
                    content: '';
                    position: absolute;
                    inset: 12%;
                    border-radius: 50%;
                    background: radial-gradient(circle at 50% 45%, rgba(201, 162, 39, 0.06) 0%, transparent 70%);
                    pointer-events: none;
                    z-index: 0;
                }

                .tray-container::after {
                    content: '';
                    position: absolute;
                    inset: 8%;
                    border-radius: 50%;
                    border: 1px dashed rgba(201, 162, 39, 0.15);
                    pointer-events: none;
                    z-index: 0;
                }

            .word-display {
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                background: rgba(26, 18, 14, 0.95);
                border: clamp(2px, 0.4vw, 3px) solid rgba(200, 160, 100, 0.25);
                border-radius: clamp(12px, 2vw, 20px);
                padding: clamp(0.3rem, 1vw, 0.8rem) clamp(0.8rem, 2vw, 1.5rem);
                min-height: clamp(40px, 8vw, 60px);
                min-width: clamp(80px, 20vw, 140px);
                display: flex;
                align-items: center;
                justify-content: center;
                gap: clamp(2px, 0.5vw, 4px);
                font-size: clamp(1rem, 3vw, 1.8rem);
                font-weight: 700;
                color: #f0e4d3;
                box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(200, 160, 100, 0.03);
                z-index: 20;
                letter-spacing: 0;
                direction: rtl;
            }

                .word-display .word-display-text {
                    display: inline-block;
                    color: #ffd700;
                    font-size: clamp(1.2rem, 3.6vw, 2rem);
                    font-weight: 800;
                    letter-spacing: 0;
                    white-space: nowrap;
                    line-height: 1.2;
                    animation: popIn 0.15s ease;
                }

                .word-display .word-display-text.already-solved {
                    color: #7ec8ff;
                    font-size: clamp(0.95rem, 2.8vw, 1.35rem);
                }

                .word-display .word-display-text.bonus-found {
                    color: #7dffb0;
                }

                .word-display .char-slot {
                    display: inline-block;
                    min-width: clamp(22px, 4.5vw, 34px);
                    width: auto;
                    padding: 0 0.08em;
                    height: clamp(30px, 6vw, 44px);
                    text-align: center;
                    line-height: clamp(30px, 6vw, 44px);
                    border-bottom: clamp(2px, 0.4vw, 3px) solid rgba(180, 140, 100, 0.3);
                    color: #f0e4d3;
                    font-size: clamp(1.15rem, 3.4vw, 1.9rem);
                }

                    .word-display .char-slot.filled {
                        color: #ffd700;
                        border-bottom-color: #ffd700;
                        animation: popIn 0.15s ease;
                    }

                    .word-display .char-slot.empty,
                    .word-display .word-display-placeholder {
                        border-bottom-color: transparent;
                        min-width: 2rem;
                        letter-spacing: 0.2em;
                        opacity: 0.45;
                        color: rgba(240, 228, 211, 0.4);
                    }

            @keyframes popIn {
                0% {
                    transform: scale(0.7) translateY(-12px);
                    opacity: 0.3;
                }

                100% {
                    transform: scale(1) translateY(0);
                    opacity: 1;
                }
            }

            .tray-container svg {
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                pointer-events: none;
                z-index: 5;
                border-radius: 50%;
            }

                .tray-container svg line {
                    stroke: #ffd700;
                    stroke-width: clamp(3px, 0.6vw, 6px);
                    stroke-linecap: round;
                }

            /* ===== Letter Cells ===== */
            .letter-cell {
                position: absolute;
                display: flex;
                align-items: center;
                justify-content: center;
                width: clamp(44px, 10vw, 68px);
                height: clamp(44px, 10vw, 68px);
                background: radial-gradient(ellipse at 30% 28%, #6b4530, #3d2416 55%, #2a1810);
                border-radius: 50%;
                font-size: clamp(1.2rem, 3.5vw, 2.2rem);
                font-weight: 900;
                color: #f5e6d0;
                box-shadow: 0 clamp(3px, 0.6vw, 6px) 0 rgba(60, 35, 18, 0.55), 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 0 clamp(1px, 0.2vw, 2px) rgba(201, 162, 39, 0.2) inset;
                border: clamp(2px, 0.4vw, 3px) solid rgba(201, 162, 39, 0.35);
                cursor: pointer;
                /* Avoid transition:all — transform must stay stable while dragging lines */
                transition: background-color 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, opacity 0.12s ease, filter 0.12s ease;
                z-index: 10;
                transform: translate(-50%, -50%) scale(1);
                touch-action: none;
                -webkit-tap-highlight-color: transparent;
                text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
                will-change: auto;
            }

            .letter-cell.drop-in {
                /* forwards only: if the animation never runs, letters stay at
                   the resting scale(1) instead of freezing on the 0% keyframe. */
                animation: dropInKurdish 0.6s ease forwards;
            }

                .letter-cell.drop-in:nth-child(1) { animation-delay: 0.05s; }
                .letter-cell.drop-in:nth-child(2) { animation-delay: 0.10s; }
                .letter-cell.drop-in:nth-child(3) { animation-delay: 0.15s; }
                .letter-cell.drop-in:nth-child(4) { animation-delay: 0.20s; }
                .letter-cell.drop-in:nth-child(5) { animation-delay: 0.25s; }
                .letter-cell.drop-in:nth-child(6) { animation-delay: 0.30s; }
                .letter-cell.drop-in:nth-child(7) { animation-delay: 0.35s; }
                .letter-cell.drop-in:nth-child(8) { animation-delay: 0.40s; }
                .letter-cell.drop-in:nth-child(9) { animation-delay: 0.45s; }
                .letter-cell.drop-in:nth-child(10) { animation-delay: 0.50s; }
                .letter-cell.drop-in:nth-child(11) { animation-delay: 0.55s; }
                .letter-cell.drop-in:nth-child(12) { animation-delay: 0.60s; }

            @keyframes dropInKurdish {
                0% {
                    transform: translate(-50%, -50%) scale(0) translateY(-150px) rotate(-180deg);
                    opacity: 0;
                }

                50% {
                    transform: translate(-50%, -50%) scale(1.3) translateY(5px) rotate(5deg);
                    opacity: 1;
                }

                70% {
                    transform: translate(-50%, -50%) scale(0.95) translateY(-3px) rotate(-2deg);
                }

                100% {
                    transform: translate(-50%, -50%) scale(1) translateY(0) rotate(0deg);
                    opacity: 1;
                }
            }

            .letter-cell:hover {
                box-shadow: 0 clamp(4px, 0.8vw, 8px) 0 rgba(80, 50, 30, 0.5), 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(200, 160, 100, 0.15) inset;
                border-color: rgba(200, 160, 100, 0.3);
                z-index: 20;
            }

            body.is-drawing .letter-cell:hover,
            body.is-drawing .letter-cell:active {
                box-shadow: inherit;
                border-color: inherit;
                z-index: 10;
            }

            .letter-cell:active {
                /* no transform bounce while pressing — keeps line stable */
            }

            .letter-cell.dragging {
                background: radial-gradient(ellipse at 30% 30%, #5a3a2a, #2a1a12);
                box-shadow: 0 0 0 clamp(2px, 0.5vw, 4px) #ffd700, 0 clamp(3px, 0.6vw, 6px) 0 rgba(80, 50, 30, 0.5), 0 0 40px rgba(255, 215, 0, 0.2);
                transform: translate(-50%, -50%) scale(1);
                border-color: #ffd700;
                z-index: 15;
            }

                .letter-cell.dragging::after {
                    content: "✦";
                    position: absolute;
                    bottom: -8px;
                    left: 50%;
                    transform: translateX(-50%);
                    color: #ffd700;
                    font-size: clamp(0.6rem, 1vw, 1rem);
                    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
                    pointer-events: none;
                }

            .letter-cell.used {
                opacity: 0.15;
                transform: translate(-50%, -50%) scale(0.7);
                box-shadow: 0 2px 0 rgba(80, 50, 30, 0.3);
                pointer-events: none;
                filter: grayscale(1);
                border-color: rgba(100, 80, 60, 0.1);
            }

            /* ===== Word Boxes ===== */
            .word-box {
                border: clamp(2px, 0.3vw, 3px) solid rgba(180, 140, 100, 0.2);
                border-radius: clamp(8px, 1vw, 12px);
                padding: clamp(0.2rem, 0.5vw, 0.5rem);
                text-align: center;
                background: rgba(26, 18, 14, 0.6);
                transition: all 0.3s ease;
                cursor: default;
                min-height: clamp(40px, 8vw, 60px);
                display: flex;
                align-items: center;
                justify-content: center;
                gap: clamp(2px, 0.3vw, 4px);
                flex-wrap: wrap;
                backdrop-filter: blur(4px);
                border: 1px solid rgba(200, 160, 100, 0.05);
            }

                .word-box .letter-slot {
                    display: inline-block;
                    width: clamp(22px, 4vw, 32px);
                    height: clamp(26px, 5vw, 38px);
                    border-bottom: clamp(2px, 0.3vw, 3px) solid rgba(180, 140, 100, 0.2);
                    font-size: clamp(0.9rem, 2vw, 1.4rem);
                    font-weight: 700;
                    text-align: center;
                    line-height: clamp(26px, 5vw, 38px);
                    color: #8a7a6a;
                    transition: all 0.3s ease;
                }

                    .word-box .letter-slot.filled {
                        border-bottom-color: #6fcf97;
                        color: #6fcf97;
                    }

                .word-box.completed {
                    border-color: rgba(40, 167, 69, 0.3);
                    background: rgba(40, 167, 69, 0.05);
                    box-shadow: 0 0 30px rgba(40, 167, 69, 0.05);
                }

                    .word-box.completed .letter-slot {
                        border-bottom-color: #6fcf97;
                        color: #6fcf97;
                    }

                .word-box.wrong {
                    border-color: rgba(220, 53, 69, 0.3);
                    background: rgba(220, 53, 69, 0.05);
                    animation: shakeKurdish 0.4s ease;
                }

            @keyframes shakeKurdish {
                0%, 100% {
                    transform: translateX(0) rotate(0deg);
                }

                20% {
                    transform: translateX(-8px) rotate(-2deg);
                }

                40% {
                    transform: translateX(8px) rotate(2deg);
                }

                60% {
                    transform: translateX(-4px) rotate(-1deg);
                }

                80% {
                    transform: translateX(4px) rotate(1deg);
                }
            }

            .word-box .hint-letter {
                color: #ffd700;
                font-weight: 900;
                font-size: clamp(1rem, 2.5vw, 1.6rem);
                border-bottom-color: #ffd700 !important;
                text-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
            }

            /* ===== Buttons ===== */
            .btn-mamosta {
                background: linear-gradient(135deg, #5a3a2a, #3d2216);
                border: 1px solid rgba(200, 160, 100, 0.15);
                border-radius: 60px;
                padding: clamp(0.4rem, 1vw, 0.7rem) clamp(1rem, 3vw, 2rem);
                font-weight: 700;
                font-size: clamp(0.65rem, 1.5vw, 0.95rem);
                color: #f0e4d3;
                box-shadow: 0 clamp(3px, 0.6vw, 6px) 0 rgba(30, 18, 12, 0.5), 0 8px 30px rgba(0, 0, 0, 0.3);
                transition: all 0.15s ease;
                touch-action: manipulation;
                position: relative;
                overflow: hidden;
            }

                .btn-mamosta::before {
                    content: '';
                    position: absolute;
                    inset: 0;
                    background: linear-gradient(135deg, rgba(200, 160, 100, 0.05), transparent);
                    pointer-events: none;
                }

                .btn-mamosta:active {
                    transform: translateY(4px);
                    box-shadow: 0 2px 0 rgba(30, 18, 12, 0.5);
                }

            .btn-outline-mamosta {
                background: transparent;
                border: clamp(1.5px, 0.3vw, 2px) solid rgba(180, 140, 100, 0.2);
                color: #c9b09b;
                border-radius: 60px;
                padding: clamp(0.3rem, 0.8vw, 0.6rem) clamp(0.8rem, 2vw, 1.8rem);
                font-weight: 700;
                font-size: clamp(0.65rem, 1.5vw, 0.95rem);
                transition: all 0.15s ease;
                touch-action: manipulation;
            }

                .btn-outline-mamosta:active {
                    background: rgba(180, 140, 100, 0.1);
                    border-color: rgba(200, 160, 100, 0.3);
                }

            .feedback {
                border-radius: 16px;
                padding: clamp(0.3rem, 0.8vw, 0.6rem) clamp(0.6rem, 1.5vw, 1.2rem);
                font-weight: 600;
                font-size: clamp(0.8rem, 1.5vw, 1rem);
                display: none;
                background: rgba(26, 18, 14, 0.8);
                backdrop-filter: blur(8px);
                border: 1px solid rgba(200, 160, 100, 0.05);
            }

                .feedback.show {
                    display: block;
                    animation: fadeSlideKurdish 0.3s ease;
                }

            @keyframes fadeSlideKurdish {
                0% {
                    opacity: 0;
                    transform: translateY(-10px) scale(0.95);
                }

                100% {
                    opacity: 1;
                    transform: translateY(0) scale(1);
                }
            }

            .feedback.alert-success {
                color: #6fcf97;
                border-color: rgba(40, 167, 69, 0.2);
            }

            .feedback.alert-danger {
                color: #f08080;
                border-color: rgba(220, 53, 69, 0.2);
            }

            .feedback.alert-warning {
                color: #ffd700;
                border-color: rgba(255, 193, 7, 0.2);
            }

            .feedback.alert-info {
                color: #6fc3cf;
                border-color: rgba(23, 162, 184, 0.2);
            }

            /* ===== Scrollbar ===== */
            ::-webkit-scrollbar {
                width: 4px;
            }

            ::-webkit-scrollbar-track {
                background: rgba(26, 18, 14, 0.5);
            }

            ::-webkit-scrollbar-thumb {
                background: rgba(180, 140, 100, 0.3);
                border-radius: 10px;
            }

            /* ===== Loading ===== */
            .loading-overlay.is-hidden,
            .loading-overlay[hidden] {
                display: none !important;
                visibility: hidden !important;
                pointer-events: none !important;
            }

            .loading-overlay {
                position: fixed;
                inset: 0;
                background: rgba(13, 8, 6, 0.98);
                display: flex;
                align-items: center;
                justify-content: center;
                z-index: 9999;
                flex-direction: column;
                gap: 1.5rem;
                backdrop-filter: blur(20px);
            }

            .loading-spinner {
                width: 70px;
                height: 70px;
                border: 4px solid rgba(200, 160, 100, 0.05);
                border-top-color: #ffd700;
                border-right-color: rgba(200, 160, 100, 0.2);
                border-radius: 50%;
                animation: spinKurdish 0.8s cubic-bezier(0.6, 0, 0.4, 1) infinite;
                box-shadow: 0 0 60px rgba(255, 215, 0, 0.05);
            }

            @keyframes spinKurdish {
                to {
                    transform: rotate(360deg);
                }
            }

            .loading-text {
                color: #c9b09b;
                font-weight: 700;
                font-size: 1.2rem;
                letter-spacing: 4px;
                opacity: 0.6;
            }

                .loading-text i {
                    color: #ffd700;
                    opacity: 0.4;
                }

            /* ===== Register Modal ===== */
            .register-modal-backdrop {
                background: rgba(13, 8, 6, 0.95) !important;
                backdrop-filter: blur(20px);
            }

                .register-modal-backdrop > div {
                    background: rgba(26, 18, 14, 0.95) !important;
                    border: 1px solid rgba(200, 160, 100, 0.1) !important;
                    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
                }

                .register-modal-backdrop h3 {
                    color: #f0e4d3 !important;
                }

                .register-modal-backdrop p {
                    color: #8a7a6a !important;
                }

                .register-modal-backdrop a {
                    color: #c9b09b !important;
                }

                    .register-modal-backdrop a.btn-mamosta {
                        color: #f0e4d3 !important;
                    }

            /* ===== Responsive ===== */
            .game-play-body {
                flex: 1 1 auto;
                min-height: 0;
                overflow-y: auto;
                overscroll-behavior: contain;
                -webkit-overflow-scrolling: touch;
                padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
            }

            .game-hint-footer {
                display: none;
            }

            @media (min-width: 768px) {
                .game-hint-footer {
                    display: block;
                    flex-shrink: 0;
                }

                .card-mamosta {
                    border-radius: 2rem;
                    margin: 0.5rem;
                }
            }

            @media (max-width: 576px) {
                .header-persian {
                    padding: 0.8rem 1rem;
                    padding-top: max(0.8rem, env(safe-area-inset-top, 0px));
                    padding-left: max(1rem, env(safe-area-inset-left, 0px));
                    padding-right: max(1rem, env(safe-area-inset-right, 0px));
                }

                .card-mamosta {
                    border-radius: 0;
                    border-left: none;
                    border-right: none;
                }
            }

            @media (max-width: 400px) {
                .kurdish-table-scene {
                    max-width: 96vw;
                    padding: 1rem 0.7rem 1.3rem;
                }

                .tray-container {
                    max-width: 88vw;
                    padding: 0.8rem;
                }
            }

            @media (hover: none) {
                .letter-cell:hover {
                    transform: translate(-50%, -50%) scale(1);
                    box-shadow: 0 clamp(3px, 0.6vw, 6px) 0 rgba(80, 50, 30, 0.5), 0 8px 30px rgba(0, 0, 0, 0.4);
                    border-color: rgba(180, 140, 100, 0.2);
                }

                .btn-mamosta:hover {
                    transform: none;
                    background: linear-gradient(135deg, #5a3a2a, #3d2216);
                }

                .btn-outline-mamosta:hover {
                    background: transparent;
                    border-color: rgba(180, 140, 100, 0.2);
                    color: #c9b09b;
                }
            }

            /* ===== Kurdish Decorative Elements ===== */
            .kurdish-ornament {
                color: rgba(200, 160, 100, 0.06);
                font-size: 0.6rem;
                letter-spacing: 10px;
                text-align: center;
                padding: 0.3rem 0;
            }

/* ===== Native-like shell refinements ===== */
html.game-shell {
    background: #fff8f0;
}

/* Pin overlays to the visible game viewport (not under the URL bar). */
html.game-shell .loading-overlay.is-hidden,
html.game-shell .loading-overlay[hidden] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}
html.game-shell .loading-overlay,
html.game-shell .online-required-overlay,
html.game-shell .level-end-overlay,
html.game-shell .tutorial-overlay,
html.game-shell .register-modal-backdrop,
html.game-shell .mirza-afarin-overlay {
    position: fixed !important;
    inset: auto !important;
    top: var(--app-top, 0px) !important;
    left: var(--app-left, 0px) !important;
    right: auto !important;
    bottom: auto !important;
    width: var(--app-width, 100%) !important;
    height: var(--app-height, 100dvh) !important;
}

html.game-shell .tutorial-card {
    position: absolute !important;
    width: min(400px, calc(100% - 1.25rem));
    bottom: 0.75rem;
}

html.game-shell .tutorial-card.is-top {
    top: 0.65rem;
    bottom: auto;
}

html.game-shell .tutorial-finger {
    position: absolute !important;
}

html.game-shell,
body.game-shell {
    touch-action: pan-y;
}

body.game-shell.is-drawing {
    touch-action: none;
}

body.game-shell .game-play-body {
    touch-action: pan-y;
}

body.game-shell .kurdish-table-scene,
body.game-shell .tray-container,
body.game-shell .letter-cell {
    touch-action: none;
}

@media (max-width: 576px) {
    body.game-shell.mamosta-bright {
        padding: 0 !important;
    }

    body.game-shell .app-container {
        max-width: none;
        padding: 0;
    }

    body.game-shell .card-mamosta {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
    html.game-shell,
    body.game-shell {
        background: #fff8f0;
    }

    body.game-shell .header-persian {
        padding-top: max(0.7rem, env(safe-area-inset-top, 0px));
    }

    body.game-shell .game-play-body {
        padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    }
}

body.game-shell .tray-container,
body.game-shell .letter-cell {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

body.game-shell.is-drawing,
body.game-shell.is-drawing .game-play-body {
    overflow: hidden;
    overscroll-behavior: none;
}

@media (prefers-reduced-motion: reduce) {
    body.game-shell .letter-cell,
    body.game-shell .mirza-spark,
    body.game-shell .mirza-confetti {
        animation: none !important;
        transition: none !important;
    }
}
