@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@600;700;800;900&family=Readex+Pro:wght@400;500;600;700;800&display=swap');

:root {
    --primary-blue: #0284c7;
    --primary-dark: #0369a1;
    --accent-gold: #f59e0b;
    --gold-glow: #fde047;
    --gold-dark: #b45309;
    --wood-board: #92400e;
    --wood-border: #78350f;
    --tile-bg: #ffffff;
    --tile-border: #e2e8f0;
    --tile-bottom: #cbd5e1;
    --tile-text: #0f172a;
    --bg-page: #0f172a;
    --card-bg: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: #0f172a;
    font-family: 'Readex Pro', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Arabic', Roboto, Tahoma, Arial, sans-serif;
    color: #0f172a;
    direction: rtl;
    line-height: 1.45;
}

html::-webkit-scrollbar, body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Background animated glow orbs */
.ambient-glow {
    position: fixed;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    opacity: 0.35;
    z-index: 0;
}
.glow-1 { top: -80px; right: -80px; background: #fde047; }
.glow-2 { bottom: 5%; left: -100px; background: #38bdf8; }

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* App Container - Responsive 100% Fullscreen Layout */
.app-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Splash Screen (Start Screen) */
.splash-screen {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem env(safe-area-inset-bottom, 0.75rem) 1rem;
    max-width: 500px;
    margin: 0 auto;
    background: #38bdf8 url('../assets/clean-sky.jpg') no-repeat center top;
    background-size: cover;
}

/* Content Container to center & widen cleanly on larger screens */
.content-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Professional Game Header Bar */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.9rem;
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    margin-bottom: 0.75rem;
    height: 56px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.school-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo-badge {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border: 2px solid #38bdf8;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.4);
    flex-shrink: 0;
}

.logo-badge svg {
    width: 22px;
    height: 22px;
    fill: #ffffff;
}

.brand-text h1 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
    line-height: 1.15;
}

.brand-text span {
    font-size: 0.72rem;
    color: #38bdf8;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: block;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

/* Professional Vector Action Buttons */
.btn-icon-svg {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-icon-svg svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}

.btn-icon-svg:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.2);
}

/* Game Card Panels */
.game-panel {
    background: #ffffff;
    border-radius: 1.25rem;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: fadeIn 0.25s ease-out;
}

/* Mode Switcher Tabs */
.game-mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.mode-tab-btn {
    padding: 0.75rem 0.5rem;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: #475569;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mode-tab-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.mode-tab-btn.active.crush-mode {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    border-color: #fde047;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.mode-tab-btn.active:not(.crush-mode) {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border-color: #7dd3fc;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

/* Stages Grid - Fluid & Expansive */
.stages-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0.5rem 0 1rem 0;
}

@media (min-width: 640px) {
    .stages-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stage-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.9rem 0.8rem;
    cursor: pointer;
    position: relative;
    text-align: right;
    transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stage-card:active {
    transform: scale(0.97);
}

.stage-card.selected {
    background: #f0fdf4;
    border-color: #10b981;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
    transform: scale(1.02);
}

.stage-card.selected::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3.5px;
    background: #10b981;
    border-radius: 14px 14px 0 0;
}

.stage-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.4rem;
}

.stage-card-icon svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}

.stage-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.stage-subtitle {
    font-size: 0.72rem;
    color: #0284c7;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.stage-desc {
    font-size: 0.68rem;
    color: #64748b;
    line-height: 1.25;
}

/* Professional Mobile Inputs */
.input-group {
    margin-bottom: 0.65rem;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: #334155;
}

.input-label svg {
    width: 15px;
    height: 15px;
    fill: #0284c7;
}

.text-input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    color: #0f172a;
    font-size: 0.92rem;
    font-family: inherit;
    font-weight: 600;
    outline: none;
    transition: all 0.2s ease;
}

.text-input:focus {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.avatar-selection {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    scrollbar-width: none;
}
.avatar-selection::-webkit-scrollbar { display: none; }

.avatar-opt {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.15s ease;
}

.avatar-opt.selected {
    border-color: #f59e0b;
    background: #fef3c7;
    transform: scale(1.08);
}

/* Primary Game Buttons */
.btn-primary-action {
    width: 100%;
    padding: 0.9rem;
    color: #ffffff;
    font-family: inherit;
    font-weight: 800;
    font-size: 1.05rem;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 52px;
    transition: all 0.15s ease;
}

.btn-primary-action svg {
    width: 22px;
    height: 22px;
    fill: #ffffff;
}

.btn-primary-action:active {
    transform: scale(0.98);
}

.btn-crush-start {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    box-shadow: 0 6px 18px rgba(234, 88, 12, 0.35);
}

.btn-olympiad-start {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
}

/* =======================================================
   WORDS CRUSH MODE - AAA MOBILE GAME DESIGN
   ======================================================= */
#screen-crush {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.crush-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.crush-top-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    background: transparent;
    border: none;
    padding: 0.35rem 0.25rem;
    border-radius: 0;
}

.crush-badge-pill {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.crush-badge-pill svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.crush-title-box {
    text-align: center;
    margin-bottom: 0.4rem;
}

.crush-title-box h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.crush-title-box p {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}

/* Live Word Preview Capsule */
.crush-preview-capsule {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 2px solid #0284c7;
    color: #0284c7;
    font-size: 1.25rem;
    font-weight: 800;
    padding: 0.35rem 1.5rem;
    border-radius: 999px;
    margin-bottom: 0.6rem;
    min-height: 42px;
    min-width: 180px;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}

/* Professional Board Tray */
.crush-grid {
    display: grid;
    gap: 0.35rem;
    width: min(92vw, 360px);
    height: min(92vw, 360px);
    aspect-ratio: 1;
    margin: 0 auto 0.75rem auto;
    padding: 0.55rem;
    background: #1e293b;
    border-radius: 1.25rem;
    border: 3px solid #334155;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35), inset 0 2px 6px rgba(0,0,0,0.4);
    touch-action: none;
}

/* Ultra-Crisp Tactile Letter Tiles */
.crush-cell {
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-bottom: 4px solid #94a3b8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Readex Pro', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Arabic', Roboto, Tahoma, Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transition: transform 0.08s ease;
}

.crush-grid[data-grid-size="7"] {
    gap: 0.25rem;
    padding: 0.45rem;
}

.crush-grid[data-grid-size="7"] .crush-cell {
    font-size: 1.25rem;
    border-radius: 10px;
    border-bottom-width: 3.5px;
}

.crush-grid[data-grid-size="8"],
.crush-grid[data-grid-size="9"] {
    gap: 0.2rem;
    padding: 0.4rem;
}

.crush-grid[data-grid-size="8"] .crush-cell,
.crush-grid[data-grid-size="9"] .crush-cell {
    font-size: 1.05rem;
    border-radius: 8px;
    border-bottom-width: 3px;
}

/* Active Drag Highlighting */
.crush-cell:active, .crush-cell.active-selection {
    background: linear-gradient(180deg, #fef08a 0%, #facc15 100%) !important;
    border-color: #ffffff !important;
    border-bottom: 2.5px solid #ca8a04 !important;
    transform: scale(1.1) translateY(-2px);
    color: #713f12 !important;
    box-shadow: 0 0 16px rgba(250, 204, 21, 0.7);
    z-index: 10;
}

/* Solved Tiles (High-contrast Candy Colors) */
.crush-cell.locked-found {
    background: var(--found-color, #10b981) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.7) !important;
    border-bottom: 4.5px solid rgba(0, 0, 0, 0.35) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    animation: popBounce 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.crush-cell.hint-pulse {
    animation: hintGlowAnim 0.4s 4 alternate ease-in-out;
}

@keyframes hintGlowAnim {
    from { transform: scale(1); background: #fef08a; }
    to { transform: scale(1.15); background: #f59e0b; color: #fff; box-shadow: 0 0 20px #f59e0b; }
}

/* Target Chips at Bottom */
.crush-targets-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
}

.crush-target-chip {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.crush-target-chip svg {
    width: 14px;
    height: 14px;
    fill: #94a3b8;
}

.crush-target-chip.completed {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.4);
    transform: scale(1.03);
}

.crush-target-chip.completed svg {
    fill: #ffffff !important;
    stroke: none !important;
}

/* Authentic Words Crush Wheel Slot Tiles */
.wheel-slot-row {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.wheel-slot-box {
    width: 28px;
    height: 28px;
    background: #1e293b;
    border: 1.5px solid #475569;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wheel-slot-row.completed .wheel-slot-box {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #fbbf24;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

/* =======================================================
   OLYMPIAD MODE - CLEAN MODERN GAME HUD
   ======================================================= */
.game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.8rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    margin-bottom: 0.7rem;
    font-size: 0.82rem;
}

.hud-badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.timer-container {
    margin-bottom: 0.75rem;
}

.timer-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: #64748b;
}

.timer-bar-bg {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.timer-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #10b981, #0284c7);
    border-radius: 999px;
    transition: width 0.1s linear;
}

.powerups-bar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.powerup-btn {
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.4rem 0.75rem;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.15s ease;
}

.powerup-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.question-text {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.45;
    color: #0f172a;
    margin-bottom: 1rem;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.option-btn {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    color: #0f172a;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: right;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
}

.option-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.option-btn.correct {
    background: #dcfce7 !important;
    border-color: #10b981 !important;
    color: #15803d !important;
}

.option-btn.wrong {
    background: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #b91c1c !important;
    animation: shake 0.4s ease;
}

.option-btn.faded {
    opacity: 0.25;
    pointer-events: none;
}

/* Streak Toast */
.streak-toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(-20px) scale(0.9);
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    border: 1.5px solid #fde047;
    color: white;
    font-weight: 800;
    font-size: 0.88rem;
    padding: 0.5rem 1.3rem;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(234, 88, 12, 0.4);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
}

.streak-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    padding: 1rem;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    border-radius: 1.5rem;
    max-width: 380px;
    width: 100%;
    padding: 1.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.btn-secondary, .btn-gold {
    width: 100%;
    padding: 0.85rem;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-secondary {
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    color: #334155;
}

.btn-gold {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

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

/* =======================================================
   AUTHENTIC WORDS CRUSH CASUAL GAME SPLASH SCREEN STYLES
   ======================================================= */

.splash-screen {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem 1.25rem 0.75rem;
    min-height: calc(100vh - 40px);
    position: relative;
}

/* Top Navigation Bar */
.splash-top-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    z-index: 20;
}

.splash-circle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(180deg, #fef08a 0%, #facc15 60%, #eab308 100%);
    border: 2.5px solid #ffffff;
    border-bottom: 5px solid #ca8a04;
    color: #713f12;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
    transition: transform 0.12s ease;
}

.splash-circle-btn svg {
    width: 22px;
    height: 22px;
    fill: #713f12;
}

.splash-circle-btn:active {
    transform: translateY(3px);
    border-bottom-width: 2px;
}

/* School Logo Medallion in Header */
.splash-school-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-bottom: 4px solid rgba(0, 0, 0, 0.9);
    border-radius: 14px;
    padding: 3px 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    height: 48px;
}

.splash-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* Pennant Garland (أعلام الزينة الاحتفالية) */
.pennant-garland {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    margin-bottom: -10px;
    z-index: 10;
    pointer-events: none;
    direction: ltr;
    position: relative;
}

.pennant-garland::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 15%;
    right: 15%;
    height: 14px;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    pointer-events: none;
}

.flag {
    width: 20px;
    height: 26px;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    animation: gentleWiggle 3s infinite ease-in-out;
}

.flag:nth-child(even) { animation-delay: 1.5s; }

.f-yellow { background: #facc15; }
.f-cyan   { background: #38bdf8; }
.f-green  { background: #22c55e; }
.f-orange { background: #f97316; }
.f-purple { background: #a855f7; }
.f-red    { background: #ef4444; }

@keyframes gentleWiggle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(3px) rotate(4deg); }
}

/* Cartoon Dove Mascot on Start Screen */
.splash-cartoon-mascot-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: -0.25rem 0 -0.75rem 0;
    z-index: 14;
    pointer-events: none;
}

.splash-cartoon-mascot {
    width: min(62vw, 185px);
    height: auto;
    border-radius: 20px;
    filter: drop-shadow(0 10px 24px rgba(2, 132, 199, 0.4));
    animation: gentleFloat 3.2s infinite ease-in-out;
}

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0px) scale(1) rotate(0deg); }
    50% { transform: translateY(-9px) scale(1.03) rotate(1.5deg); }
}

/* 3D Words Crush Game Title Container */
.splash-title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 1.25rem 0;
    z-index: 15;
}

.title-3d-row {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    direction: ltr !important;
}

/* Golden Blocks for CITY4U */
.block-3d-gold {
    width: 48px;
    height: 52px;
    background: linear-gradient(180deg, #fef9c3 0%, #fde047 35%, #eab308 85%, #ca8a04 100%);
    border: 2px solid #ffffff;
    border-bottom: 6px solid #854d0e;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cairo', 'Readex Pro', sans-serif;
    font-size: 1.85rem;
    font-weight: 900;
    color: #713f12;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

@media (min-width: 480px) {
    .block-3d-gold {
        width: 54px;
        height: 58px;
        font-size: 2.1rem;
    }
}

/* Tilted 3D White/Cyan Tiles for GAME */
.tile-3d-white {
    width: 60px;
    height: 64px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 40%, #e2e8f0 100%);
    border: 2.5px solid #ffffff;
    border-bottom: 7px solid #94a3b8;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cairo', 'Readex Pro', sans-serif;
    font-size: 2.25rem;
    font-weight: 900;
    color: #0284c7;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.tilt-left  { transform: rotate(-6deg); }
.tilt-right { transform: rotate(6deg); }

@media (min-width: 480px) {
    .tile-3d-white {
        width: 70px;
        height: 74px;
        font-size: 2.6rem;
    }
}

/* Giant 3D Hero Start Button (Iconic Words Crush "إبدأ" Style) */
.splash-play-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 1rem 0;
    z-index: 15;
}

.btn-giant-start {
    width: 100%;
    max-width: 320px;
    height: 74px;
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 45%, #16a34a 100%);
    border: 3.5px solid #dcfce7;
    border-bottom: 9px solid #14532d;
    border-radius: 999px;
    color: #ffffff;
    font-family: 'Readex Pro', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Arabic', Roboto, Tahoma, Arial, sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(34, 197, 94, 0.45);
    transition: all 0.12s ease;
    animation: breathingPulse 2.5s infinite ease-in-out;
}

.btn-giant-start svg {
    width: 32px;
    height: 32px;
    fill: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.btn-giant-start:active {
    transform: translateY(6px);
    border-bottom-width: 3px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.45);
}

@keyframes breathingPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 12px 30px rgba(34, 197, 94, 0.45); }
    50% { transform: scale(1.04); box-shadow: 0 16px 38px rgba(34, 197, 94, 0.65); }
}

/* Secondary Stage Pill Button (Words Crush Pill Style) */
.pill-stage-btn {
    margin-top: 0.85rem;
    padding: 0.65rem 1.4rem;
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 45%, #0369a1 100%);
    backdrop-filter: blur(8px);
    border: 2.5px solid #e0f2fe;
    border-bottom: 5.5px solid #0c4a6e;
    border-radius: 999px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: all 0.12s ease;
}

.pill-stage-btn svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.pill-stage-btn .arrow-down {
    width: 18px;
    height: 18px;
    fill: #fde047;
}

.pill-stage-btn:active {
    transform: translateY(2px);
    border-bottom-width: 2.5px;
}

/* Words Crush Brand Subtitle */
.splash-brand-subtitle {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(2, 132, 199, 0.9), 0 1px 3px rgba(15, 23, 42, 0.6);
    letter-spacing: 0.5px;
}

/* Bottom Shelf / Modes Carousel (Matching Words Crush Shelf) */
.splash-bottom-shelf {
    width: 100%;
    margin-top: auto;
    z-index: 15;
}

.shelf-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.shelf-header span {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0369a1;
    text-shadow: none;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.25rem 0.9rem;
    border-radius: 999px;
    border: 2px solid #38bdf8;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.shelf-cards-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    width: 100%;
}

.shelf-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: 2px solid #7dd3fc;
    border-bottom: 4.5px solid #0284c7;
    border-radius: 14px;
    padding: 0.6rem 0.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(2, 132, 199, 0.2);
    transition: all 0.15s ease;
}

.shelf-card:hover, .shelf-card.active {
    background: #ffffff;
    border-color: #0284c7;
    border-bottom-color: #0369a1;
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(2, 132, 199, 0.35);
}

.shelf-card.active .shelf-card-label {
    color: #0f172a;
}

.shelf-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.35rem;
}

.shelf-card-icon svg {
    width: 22px;
    height: 22px;
    fill: #ffffff;
}

.bg-orange { background: linear-gradient(135deg, #f59e0b, #ea580c); box-shadow: 0 3px 8px rgba(234, 88, 12, 0.4); }
.bg-blue   { background: linear-gradient(135deg, #0284c7, #0369a1); box-shadow: 0 3px 8px rgba(2, 132, 199, 0.4); }
.bg-purple { background: linear-gradient(135deg, #8b5cf6, #6366f1); box-shadow: 0 3px 8px rgba(99, 102, 241, 0.4); }

.shelf-card-label {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 0.15rem;
}

.shelf-card-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: #0284c7;
    background: #e0f2fe;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}

/* ========================================================
   Words Crush Stage Progression Map Screen (خريطة المراحل)
   ======================================================== */
#screen-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    z-index: 20;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #16779a;
}

.map-view-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #16779a;
}

.map-header-bar,
body[data-grade-theme] .map-header-bar {
    position: relative;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin: 0.35rem 0.5rem 0.2rem 0.5rem;
    padding: 0.2rem 0.35rem;
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    border-radius: 0;
    box-shadow: none;
    flex-shrink: 0;
}

.map-header-bar .btn-icon-svg {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f8fafc;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.16s ease;
}

.map-header-bar .btn-icon-svg svg {
    fill: #f8fafc;
    width: 17px;
    height: 17px;
}

.map-title-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: clamp(0.82rem, 2.8vw, 0.98rem);
    font-weight: 900;
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85), 0 1px 2px #000000;
    min-width: 0;
    flex: 1;
}

.map-title-badge span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff !important;
}

.map-title-badge svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.map-stats-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(8px) !important;
    border: 1.5px solid #facc15 !important;
    border-bottom: 3.5px solid #b45309 !important;
    border-radius: 999px;
    padding: 0.22rem 0.65rem;
    color: #fef08a !important;
    font-weight: 900;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.map-stats-pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(15, 23, 42, 0.65) !important;
    border: 1px solid rgba(250, 204, 21, 0.4) !important;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.78rem;
    color: #fef08a !important;
    white-space: nowrap;
    flex-shrink: 0;
    direction: ltr;
}

.map-viewport {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding-bottom: 0;
    cursor: grab;
    touch-action: pan-y;
}

.map-viewport.grabbing {
    cursor: grabbing;
    user-select: none;
    -webkit-user-select: none;
}

/* Floating Quick Jump Controls (Top-Left Compact Icons - Won't block any stages!) */
.map-floating-controls {
    position: absolute;
    left: 0.75rem;
    top: 128px;
    z-index: 45;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.map-floating-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border: 2px solid #bae6fd;
    border-bottom: 3.5px solid #0284c7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: #0284c7;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.map-floating-btn svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
    flex-shrink: 0;
}

.map-floating-btn:active {
    transform: translateY(2px);
    border-bottom-width: 1.5px;
}

.map-floating-btn.active-gold {
    background: linear-gradient(180deg, #fef08a 0%, #eab308 100%);
    border-color: #fef9c3;
    border-bottom-color: #a16207;
    color: #713f12;
}

/* Checkpoint Gates between subjects */
.map-checkpoints-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 8;
}

.map-checkpoint-gate {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    padding: 0 0.85rem;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    pointer-events: none;
    box-sizing: border-box;
}

.checkpoint-banner {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.2rem 0.45rem;
    padding: 0.42rem 0.9rem;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.95);
    border: 2px solid #f59e0b;
    border-bottom: 3.5px solid #b45309;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.35;
    white-space: normal;
    max-width: calc(100% - 24px);
    box-sizing: border-box;
    overflow-wrap: break-word;
}

.checkpoint-banner.unlocked {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95));
    border-color: #a7f3d0;
    border-bottom-color: #047857;
}

.checkpoint-banner.locked {
    border-color: #ef4444;
    border-bottom-color: #991b1b;
}

.checkpoint-line-left, .checkpoint-line-right {
    flex: 1;
    min-width: 10px;
    height: 2px;
    background: repeating-linear-gradient(90deg, rgba(255,255,255,0.7), rgba(255,255,255,0.7) 6px, transparent 6px, transparent 12px);
    opacity: 0.8;
}

/* Boss Milestone Nodes */
.map-node.boss-node {
    border-color: #fef08a !important;
    border-bottom-color: #b45309 !important;
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.85), 0 8px 0 #b45309 !important;
}

.boss-crown {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.15rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    animation: crownFloat 2s infinite ease-in-out;
}

@keyframes crownFloat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-4px); }
}

.map-viewport::-webkit-scrollbar {
    width: 6px;
}
.map-viewport::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
}

.map-canvas {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 1120px;
    margin: 0 auto;
    background: #178fae;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

/* High-Resolution Seamless 3-Zone Progression World (Zero Distortion, True 9:16 Aspect Ratio) */
.map-bg-layers {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.map-zone {
    position: absolute;
    left: 0;
    width: 100%;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}

.zone-top {
    top: 0;
    height: 900px;
    background-image: url('../assets/map-zone-top.jpg');
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

.zone-upper-mid {
    top: 780px;
    height: 900px;
    background-image: url('../assets/map-bg.jpg');
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 86%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 86%, transparent 100%);
}

.zone-middle {
    top: 1560px;
    height: 900px;
    background-image: url('../assets/map-zone-middle.jpg');
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 86%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 86%, transparent 100%);
}

.zone-lower-mid {
    top: 2340px;
    height: 900px;
    background-image: url('../assets/map-zone-island2.jpg');
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 86%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 86%, transparent 100%);
}

.zone-bottom {
    top: 3120px;
    height: 880px;
    background-image: url('../assets/map-zone-bottom.jpg');
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 14%, black 100%);
}

.map-trail-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.trail-shadow {
    stroke: rgba(2, 132, 199, 0.45);
    stroke-width: 12px;
    stroke-linecap: round;
    fill: none;
}

.trail-line {
    stroke: #ffffff;
    stroke-width: 5.5px;
    stroke-dasharray: 9 7;
    stroke-linecap: round;
    fill: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.map-nodes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* 3D Stepping Stone Nodes */
.map-node {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Readex Pro', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Arabic', Roboto, Tahoma, Arial, sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
    border: 3px solid rgba(255, 255, 255, 0.95);
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.map-node:hover {
    transform: translate(-50%, -54%) scale(1.06);
    filter: brightness(1.1);
}

.map-node:active {
    transform: translate(-50%, -46%) scale(0.96);
}

/* Theme Colors by Subject */
.theme-science {
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    border-bottom: 6px solid #b45309;
    box-shadow: 0 8px 18px rgba(217, 119, 6, 0.5);
}

.theme-geo {
    background: linear-gradient(180deg, #f472b6 0%, #ec4899 50%, #db2777 100%);
    border-bottom: 6px solid #9d174d;
    box-shadow: 0 8px 18px rgba(219, 39, 119, 0.5);
}

.theme-arabic {
    background: linear-gradient(180deg, #a78bfa 0%, #8b5cf6 50%, #7c3aed 100%);
    border-bottom: 6px solid #5b21b6;
    box-shadow: 0 8px 18px rgba(124, 58, 237, 0.5);
}

.theme-math {
    background: linear-gradient(180deg, #34d399 0%, #10b981 50%, #059669 100%);
    border-bottom: 6px solid #047857;
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.5);
}

.map-node.summit {
    background: linear-gradient(180deg, #fef08a 0%, #eab308 50%, #ca8a04 100%);
    border-bottom: 6px solid #713f12;
    box-shadow: 0 8px 24px rgba(234, 179, 8, 0.65);
    color: #713f12;
}

/* Locked Node */
.map-node.locked {
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 55%, #475569 100%) !important;
    border-bottom: 6px solid #1e293b !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3) !important;
    color: #cbd5e1 !important;
    cursor: not-allowed;
    opacity: 0.92;
}

.map-node-stars {
    position: absolute;
    bottom: -19px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    white-space: nowrap;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Current Active Node Pulse & Radiant Aura */
.map-node.current {
    z-index: 15;
    animation: currentNodePulse 2.2s infinite ease-in-out;
}

.map-node.current::after {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(253, 224, 71, 0.85) 0%, rgba(253, 224, 71, 0) 72%);
    z-index: -1;
    animation: sunburstPulse 1.8s infinite ease-in-out;
    pointer-events: none;
}

@keyframes currentNodePulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -54%) scale(1.08); }
}

@keyframes sunburstPulse {
    0%, 100% { transform: scale(1); opacity: 0.75; }
    50% { transform: scale(1.3); opacity: 1; }
}

/* Animated Player Pin ("أنت هنا") */
.map-player-pin {
    position: absolute;
    transform: translate(25px, -50%);
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    transition: all 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: pinFloat 2.4s infinite ease-in-out;
}

@keyframes pinFloat {
    0%, 100% { transform: translate(25px, -50%); }
    50% { transform: translate(25px, -62%); }
}

.avatar-bubble {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #000000;
    border: 3px solid #38bdf8;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-bubble img {
    width: 125%;
    height: 125%;
    object-fit: cover;
    object-position: center 20%;
}

.avatar-tag {
    margin-top: 3px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #ffffff;
    background: #0284c7;
    border: 1.5px solid #ffffff;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}

/* Level Preview Modal in Progression Map */
.map-level-popup {
    position: relative;
    text-align: center;
    max-width: 360px;
    padding: 1.5rem 1.25rem;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
    border: 3px solid #86efac;
    border-bottom: 7px solid #22c55e;
    border-radius: 1.5rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.btn-popup-close {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    font-size: 1rem;
    font-weight: 800;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-popup-close:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #b91c1c;
}

.popup-level-badge {
    display: inline-block;
    padding: 0.25rem 0.9rem;
    background: #fef08a;
    border: 2px solid #eab308;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #854d0e;
    margin-bottom: 0.5rem;
}

.popup-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.25rem;
}

.popup-book {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0284c7;
    margin-bottom: 0.75rem;
}

.popup-stars-row {
    font-size: 1.5rem;
    letter-spacing: 4px;
    margin-bottom: 1rem;
}

.popup-clue-box {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0.75rem;
    margin-bottom: 1.25rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.clue-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.clue-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.4rem;
}

.words-count-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    color: #059669;
    background: #dcfce7;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}

.btn-popup-play {
    max-width: 260px;
    height: 60px;
    font-size: 1.7rem;
    margin: 0 auto;
}

/* =======================================================
   WORDS CRUSH MULTI-MODE GAMEPLAY ENGINES
   ======================================================= */

/* Coins Badge */
.crush-coins-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(180deg, #fef9c3 0%, #fde047 100%);
    border: 2px solid #ffffff;
    border-bottom: 3.5px solid #ca8a04;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-weight: 800;
    font-size: 0.85rem;
    color: #713f12;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* Educational Media Box (Picture / Emojis) */
.crush-media-box {
    width: 100%;
    max-width: 320px;
    margin: 0 auto 0.5rem auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    border: 3px solid #ffffff;
    background: #0f172a;
    position: relative;
}

.crush-media-box img {
    width: 100%;
    height: auto;
    max-height: 160px;
    object-fit: cover;
    display: block;
}

.crush-media-emojis {
    padding: 0.85rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 2.2rem;
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Play Area Switcher */
.crush-play-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.6rem;
}

/* Mode 2: Word Connect Wheel (عجلة الحروف الدائرية) */
.crush-wheel-board {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto;
    touch-action: none;
    user-select: none;
}

.crush-wheel-center {
    position: absolute;
    inset: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, #1e293b 0%, #0f172a 100%);
    border: 8px solid #334155;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.crush-wheel-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.wheel-letter-node {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
    border: 2.5px solid #ffffff;
    border-bottom: 5px solid #94a3b8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: transform 0.1s ease, background 0.1s ease;
    z-index: 5;
}

.wheel-letter-node.selected {
    background: linear-gradient(180deg, #fef08a 0%, #facc15 100%);
    border-bottom-color: #ca8a04;
    color: #713f12;
    transform: translate(-50%, -50%) scale(1.18);
    box-shadow: 0 0 18px rgba(250, 204, 21, 0.85);
    z-index: 12;
}

/* Mode 3: Syllable Chunks (مقاطع الكلمات المبعثرة) */
.crush-chunks-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
    width: min(92vw, 360px);
    margin: 0 auto;
}

.chunk-btn {
    padding: 0.65rem 0.25rem;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    border: 2px solid #cbd5e1;
    border-bottom: 4.5px solid #94a3b8;
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e293b;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.08s ease;
}

.chunk-btn:active, .chunk-btn.selected {
    transform: translateY(2px);
    border-bottom-width: 2px;
    background: #e0f2fe;
    border-color: #38bdf8;
    color: #0369a1;
}

.chunk-btn.solved {
    opacity: 0.25;
    pointer-events: none;
    filter: grayscale(1);
}

/* Mode 4: Picture Crossword (كلمات متقاطعة مصورة) */
.crush-crossword-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0.6rem;
}

.crush-crossword-board {
    display: grid;
    gap: 3px;
    background: #0f172a;
    padding: 6px;
    border-radius: 14px;
    border: 2px solid #334155;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.cw-cell {
    width: var(--cw-cell-size, 38px);
    height: var(--cw-cell-size, 38px);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.9rem, 3.4vw, 1.25rem);
    font-weight: 800;
    background: transparent;
}

.cw-cell.empty-slot {
    background: #1e293b;
    border: 1.5px solid #475569;
    color: #cbd5e1;
    cursor: pointer;
}

.cw-cell.active-word-cell {
    background: #bae6fd !important;
    border-color: #0284c7 !important;
    color: #0369a1 !important;
}

.cw-cell.solved-tile {
    background: linear-gradient(180deg, #fef08a 0%, #facc15 100%) !important;
    border-bottom: 3.5px solid #ca8a04 !important;
    border-color: #ffffff !important;
    color: #713f12 !important;
    font-weight: 900;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.crush-keyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    max-width: 360px;
}

.cw-key {
    width: 40px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    border: 1.5px solid #cbd5e1;
    border-bottom: 4px solid #94a3b8;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.08s ease;
}

.cw-key:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

.cw-key.used {
    opacity: 0.35;
    pointer-events: none;
    filter: grayscale(1);
}

/* Action Controls at Bottom */
.crush-bottom-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.4rem;
}

.btn-crush-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.12s ease;
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-bottom: 3.5px solid #94a3b8;
    color: #334155;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn-crush-action:active {
    transform: translateY(2px);
    border-bottom-width: 1.5px;
}

.btn-crush-action.hint-action {
    background: linear-gradient(180deg, #fef08a 0%, #facc15 100%);
    border-color: #ffffff;
    border-bottom-color: #ca8a04;
    color: #713f12;
}

/* Map Node Mode Tag */
.map-node-mode-tag {
    position: absolute;
    top: -12px;
    left: -8px;
    font-size: 0.95rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* =======================================================
   LEVEL TRANSITION & VICTORY CELEBRATION ANIMATIONS
   ======================================================= */
.crush-transition-out {
    animation: crushSlideOut 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.crush-transition-in {
    animation: crushSlideIn 0.35s cubic-bezier(0, 0, 0.2, 1) forwards;
}

@keyframes crushSlideOut {
    0% {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.92) translateX(-60px);
    }
}

@keyframes crushSlideIn {
    0% {
        opacity: 0;
        transform: scale(0.92) translateX(60px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateX(0);
    }
}

/* Modal Victory Stars & Reward Styles */
.victory-popup-box {
    background: #ffffff !important;
    border: 3.5px solid #fde047 !important;
    border-radius: 28px !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 30px rgba(250, 204, 21, 0.3) !important;
    padding: 1.5rem 1.25rem !important;
}

.modal-stars-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 0.2rem 0 0.8rem 0;
}

.modal-star {
    font-size: 2.5rem;
    filter: drop-shadow(0 3px 10px rgba(245, 158, 11, 0.7));
    display: inline-block;
    animation: modalStarPop 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

.modal-star:nth-child(1) { animation-delay: 0.15s; }
.modal-star:nth-child(2) { animation-delay: 0.35s; }
.modal-star:nth-child(3) { animation-delay: 0.55s; }

@keyframes modalStarPop {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    70% { transform: scale(1.35) rotate(15deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.modal-reward-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: #92400e;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
    margin-bottom: 1rem;
    animation: rewardBounce 0.6s ease backwards 0.65s;
}

@keyframes rewardBounce {
    0% { transform: scale(0.7); opacity: 0; }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); opacity: 1; }
}

.btn-next-stage-pulse {
    animation: nextStageGlow 1.8s infinite ease-in-out;
}

@keyframes nextStageGlow {
    0%, 100% { box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 6px 25px rgba(34, 197, 94, 0.75); transform: scale(1.02); }
}

.modal-auto-timer {
    margin-top: 0.85rem;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 700;
}

.modal-auto-progress {
    width: 100%;
    height: 5px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 0.35rem;
}

.modal-auto-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981, #22c55e);
    transition: width 3.2s linear;
}

/* =======================================================
   EARN FREE COINS MODAL & SOCIAL MEDIA REWARDS
   ======================================================= */
.earn-coins-popup {
    background: #ffffff !important;
    border-radius: 26px !important;
    padding: 1.5rem 1.25rem !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45) !important;
    border: 3.5px solid #fde047 !important;
}

.earn-coins-header-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 0.6rem auto;
    background: #fef3c7;
    border: 2px solid #fde047;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.earn-plans-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.earn-plan-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.65rem 0.85rem;
    text-align: right;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.earn-plan-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.plan-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.plan-icon.tiktok-bg {
    background: #000000;
}

.plan-icon.fb-bg {
    background: #1877f2;
}

.plan-icon.daily-bg {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.plan-info {
    flex: 1;
}

.plan-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #0f172a;
}

.plan-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.btn-earn-claim {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    border: none;
    border-bottom: 3.5px solid #14532d;
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    color: #ffffff;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.btn-earn-claim:active {
    transform: translateY(2px);
    border-bottom-width: 1.5px;
}

.btn-earn-claim.claimed {
    background: #94a3b8 !important;
    border-bottom-color: #64748b !important;
    cursor: default !important;
    opacity: 0.85 !important;
}

.btn-earn-claim.gold-claim {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    border-bottom-color: #92400e;
}

.coins-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    background: #22c55e;
    color: #ffffff;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 900;
    margin-right: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cw-backspace-key {
    background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%) !important;
    border-color: #fca5a5 !important;
    border-bottom-color: #ef4444 !important;
    color: #dc2626 !important;
    font-size: 1.25rem !important;
    font-weight: 900 !important;
}

.cw-backspace-key:active {
    background: #fecaca !important;
}

/* =======================================================
   MODE 6: SILHOUETTE DISCOVERY (إكشف الظلال)
   ======================================================= */
.crush-silhouette-box {
    width: 100%;
    background: #ffffff;
    border-radius: 18px;
    padding: 0.75rem 0.65rem;
    margin-bottom: 0.55rem;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
}

.silhouette-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.silhouette-icon {
    font-size: 2.35rem;
    line-height: 1;
    filter: brightness(0);
    opacity: 0.85;
    transition: filter 0.4s ease, transform 0.35s ease, opacity 0.35s ease;
    user-select: none;
}

.silhouette-item.revealed {
    background: #f0fdf4;
    border-color: #4ade80;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
    transform: scale(1.06);
}

.silhouette-item.revealed .silhouette-icon {
    filter: brightness(1);
    opacity: 1;
    animation: silhouettePop 0.45s ease;
}

.silhouette-check {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: #22c55e;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 900;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.45);
}

.silhouette-item.revealed .silhouette-check {
    display: flex;
    animation: modalStarPop 0.35s ease backwards;
}

.silhouette-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: #15803d;
    margin-top: 2px;
    display: none;
}

.silhouette-item.revealed .silhouette-label {
    display: block;
}

@keyframes silhouettePop {
    0% { transform: scale(0.7); }
    50% { transform: scale(1.22); }
    100% { transform: scale(1); }
}

/* =======================================================
   GRID SVG PILL OVERLAY & WORDS CRUSH TEAL BOARD
   ======================================================= */
.crush-grid-wrapper {
    position: relative;
    width: min(92vw, 360px);
    height: min(92vw, 360px);
    margin: 0 auto 0.75rem auto;
}

.crush-grid-wrapper .crush-grid {
    width: 100%;
    height: 100%;
    margin: 0;
    position: relative;
    z-index: 2;
}

.crush-grid-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: visible;
}

/* Authentic Words Crush Dark Teal Board for Silhouette Mode */
.crush-grid-wrapper.silhouette-theme {
    background: linear-gradient(180deg, #0b4157 0%, #072c3d 100%);
    border-radius: 18px;
    border: 3px solid #165a75;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35), inset 0 2px 8px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.crush-grid-wrapper.silhouette-theme .crush-grid-svg {
    z-index: 1; /* Behind white letters, above dark teal board */
}

.crush-grid-wrapper.silhouette-theme .crush-grid {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    gap: 0 !important;
    padding: 0.4rem !important;
}

.crush-grid-wrapper.silhouette-theme .crush-cell {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0 !important;
    color: #ffffff !important;
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    box-shadow: none !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    z-index: 2;
}

.crush-grid-wrapper.silhouette-theme .crush-cell.active-selection {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #fef08a !important;
    transform: scale(1.15);
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.9);
    box-shadow: none !important;
}

.crush-grid-wrapper.silhouette-theme .crush-cell.locked-found {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    box-shadow: none !important;
    animation: none !important;
}

/* =======================================================
   DYNAMIC DAY -> SUNSET -> NIGHT -> DAWN -> DAY SKY CYCLE
   ======================================================= */
.map-sky-atmosphere {
    display: none !important;
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 12;
    background: transparent !important;
    overflow: hidden;
}

.map-stars-layer,
.map-moon-elem {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none;
}

.sky-star {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 6px #fef08a, 0 0 10px rgba(255, 255, 255, 0.8);
    animation: starTwinkle 2.4s infinite ease-in-out alternate;
}

@keyframes starTwinkle {
    0% { opacity: 0.35; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.25); }
}

.map-moon-elem {
    position: absolute;
    top: 85px;
    right: 22px;
    opacity: 0;
    transform: translateY(30px) scale(0.8);
    transition: opacity 0.25s linear, transform 0.25s linear;
    pointer-events: none;
    filter: drop-shadow(0 0 12px rgba(254, 240, 138, 0.65));
}

/* ==========================================================================
   SCREEN 0: INTERACTIVE CARTOON SPLASH SCREEN (CLEAN, NO CLUTTER)
   ========================================================================== */
.intro-splash-screen {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.25rem calc(2.25rem + env(safe-area-inset-bottom, 0px)) 1.25rem;
    background: linear-gradient(180deg, #38bdf8 0%, #7dd3fc 52%, #bae6fd 100%);
    background-image: url('../assets/clean-sky.jpg');
    background-size: cover;
    background-position: center;
    color: #ffffff;
    overflow: hidden;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.intro-splash-screen.fade-out {
    opacity: 0;
    transform: scale(1.04);
    pointer-events: none;
}

.cartoon-sky-decor {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.cartoon-cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    box-shadow: 0 8px 0 rgba(186, 230, 253, 0.7);
    animation: cloudDrift 10s ease-in-out infinite alternate;
}

.cartoon-cloud::before,
.cartoon-cloud::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

.cartoon-cloud.c1 {
    width: 110px;
    height: 38px;
    top: 10%;
    left: 6%;
}
.cartoon-cloud.c1::before { width: 48px; height: 48px; top: -22px; left: 16px; }
.cartoon-cloud.c1::after { width: 38px; height: 38px; top: -15px; right: 16px; }

.cartoon-cloud.c2 {
    width: 130px;
    height: 42px;
    top: 18%;
    right: -12px;
    animation-delay: 2s;
}
.cartoon-cloud.c2::before { width: 54px; height: 54px; top: -24px; left: 22px; }
.cartoon-cloud.c2::after { width: 40px; height: 40px; top: -16px; right: 18px; }

.cartoon-cloud.c3 {
    width: 96px;
    height: 32px;
    bottom: 22%;
    left: 10%;
    animation-delay: 4s;
}
.cartoon-cloud.c3::before { width: 42px; height: 42px; top: -18px; left: 15px; }
.cartoon-cloud.c3::after { width: 34px; height: 34px; top: -12px; right: 14px; }

@keyframes cloudDrift {
    0% { transform: translateX(0); }
    100% { transform: translateX(18px); }
}

.intro-interactive-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.cartoon-bubble {
    pointer-events: auto;
    position: absolute;
    width: 54px;
    height: 54px;
    border-radius: 1.1rem;
    border: 3px solid #ffffff;
    background: linear-gradient(180deg, #fef08a 0%, #f59e0b 100%);
    color: #78350f;
    font-family: 'Cairo', sans-serif;
    font-size: 1.45rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 0 #b45309, 0 10px 18px rgba(15, 23, 42, 0.22);
    animation: bubbleBob 3s ease-in-out infinite;
    transition: transform 0.15s ease;
}

.cartoon-bubble:active {
    transform: scale(0.88);
}

.cartoon-bubble.popped {
    animation: bubblePopBurst 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bubbleBob {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-10px) rotate(4deg); }
}

@keyframes bubblePopBurst {
    0% { transform: scale(1); }
    45% { transform: scale(1.38) rotate(14deg); }
    100% { transform: scale(1) rotate(-4deg); }
}

.cartoon-bubble.b1 { top: 15%; left: 10%; background: linear-gradient(180deg, #fde047 0%, #f59e0b 100%); animation-delay: 0s; }
.cartoon-bubble.b2 { top: 20%; right: 10%; background: linear-gradient(180deg, #a7f3d0 0%, #10b981 100%); color: #fff; box-shadow: 0 6px 0 #047857, 0 10px 18px rgba(15,23,42,0.22); animation-delay: 0.4s; }
.cartoon-bubble.b3 { bottom: 26%; left: 8%; background: linear-gradient(180deg, #fbcfe8 0%, #ec4899 100%); color: #fff; box-shadow: 0 6px 0 #be185d, 0 10px 18px rgba(15,23,42,0.22); animation-delay: 0.8s; }
.cartoon-bubble.b4 { bottom: 23%; right: 9%; background: linear-gradient(180deg, #c7d2fe 0%, #6366f1 100%); color: #fff; box-shadow: 0 6px 0 #4338ca, 0 10px 18px rgba(15,23,42,0.22); animation-delay: 1.2s; }
.cartoon-bubble.b5 { bottom: 13%; left: 14%; width: 46px; height: 46px; font-size: 1.2rem; background: linear-gradient(180deg, #fed7aa 0%, #f97316 100%); color: #fff; box-shadow: 0 5px 0 #c2410c, 0 8px 14px rgba(15,23,42,0.2); animation-delay: 1.6s; }
.cartoon-bubble.b6 { bottom: 13%; right: 14%; width: 46px; height: 46px; font-size: 1.2rem; background: linear-gradient(180deg, #bae6fd 0%, #0284c7 100%); color: #fff; box-shadow: 0 5px 0 #0369a1, 0 8px 14px rgba(15,23,42,0.2); animation-delay: 2s; }

.intro-skip-btn {
    align-self: flex-start;
    position: relative;
    z-index: 3;
    background: rgba(255, 255, 255, 0.92);
    border: 2.5px solid #ffffff;
    color: #0369a1;
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    font-weight: 900;
    padding: 0.35rem 0.95rem;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 0 #bae6fd, 0 6px 14px rgba(15, 23, 42, 0.18);
    transition: transform 0.15s;
}

.intro-skip-btn:active {
    transform: translateY(2px);
}

.intro-center-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: auto 0;
    pointer-events: none;
    animation: introCartoonBounce 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes introCartoonBounce {
    0% { opacity: 0; transform: scale(0.7) translateY(24px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.intro-logo-ring {
    width: 126px;
    height: 126px;
    border-radius: 50%;
    padding: 7px;
    background: linear-gradient(180deg, #fef08a 0%, #f59e0b 100%);
    border: 4px solid #ffffff;
    box-shadow: 0 8px 0 #b45309, 0 18px 34px rgba(15, 23, 42, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.15rem;
    animation: logoFloatPulse 2.8s ease-in-out infinite;
}

@keyframes logoFloatPulse {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-7px) scale(1.04); }
}

.intro-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    border-radius: 50%;
    background: #ffffff;
}

.intro-3d-title {
    margin: 0;
}

.intro-loader-wrap {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 280px;
}

.intro-progress-track {
    width: 100%;
    height: 18px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    overflow: hidden;
    border: 2.5px solid #ffffff;
    box-shadow: 0 5px 0 #7dd3fc, 0 8px 18px rgba(15, 23, 42, 0.22);
}

.intro-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e 0%, #fde047 55%, #f59e0b 100%);
    transition: width 0.25s ease-out;
}

/* ==========================================================================
   SCREEN 0.5: LIVING 3D CARTOON STAGE WORLD SELECTOR
   ========================================================================== */
.grade-gate-screen {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.9rem 1rem calc(1.1rem + env(safe-area-inset-bottom, 0px)) 1rem;
    background: #38bdf8 url('../assets/clean-sky.jpg') no-repeat center top;
    background-size: cover;
    overflow-y: auto;
    overflow-x: hidden;
    animation: gradeGateIn 0.4s ease-out;
}

@keyframes gradeGateIn {
    0% { opacity: 0; transform: scale(0.97); }
    100% { opacity: 1; transform: scale(1); }
}

.grade-gate-top {
    position: relative;
    z-index: 2;
    text-align: center;
    padding-bottom: 0.35rem;
}

.grade-gate-logo-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.88);
    border: 2px solid #ffffff;
    padding: 0.22rem 0.75rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    color: #0369a1;
    margin-bottom: 0.35rem;
    box-shadow: 0 3px 0 #bae6fd, 0 6px 14px rgba(15, 23, 42, 0.14);
}

.grade-gate-logo {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    object-fit: contain;
    padding: 2px;
}

.grade-gate-title {
    font-family: 'Cairo', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 3px 0 #0369a1, 0 6px 14px rgba(15, 23, 42, 0.3);
}

/* Interactive 3D Hero Carousel */
.grade-carousel-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex: 1;
    min-height: 0;
    margin: 0.25rem 0;
}

.carousel-arrow-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    background: linear-gradient(180deg, #fef08a 0%, #f59e0b 100%);
    color: #78350f;
    font-family: 'Cairo', sans-serif;
    font-size: 1.7rem;
    font-weight: 900;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 0 #b45309, 0 8px 16px rgba(15, 23, 42, 0.22);
    transition: transform 0.14s ease, box-shadow 0.14s ease;
    z-index: 4;
}

.carousel-arrow-btn:active {
    transform: translateY(3px) scale(0.95);
    box-shadow: 0 1px 0 #b45309;
}

.grade-carousel-stage {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-world-card {
    position: relative;
    width: 100%;
    max-width: 292px;
    background: rgba(255, 255, 255, 0.96);
    border: 4px solid #ffffff;
    border-radius: 1.75rem;
    padding: 0.85rem 0.9rem 1rem 0.9rem;
    text-align: center;
    box-shadow: 0 10px 0 rgba(186, 230, 253, 0.95), 0 20px 38px rgba(15, 23, 42, 0.28);
    animation: heroCardPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes heroCardPop {
    0% { opacity: 0; transform: scale(0.86) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.hero-world-art-wrap {
    position: relative;
    width: 100%;
    height: 175px;
    border-radius: 1.25rem;
    overflow: hidden;
    margin-bottom: 0.7rem;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.55), 0 8px 18px rgba(15, 23, 42, 0.18);
}

.hero-world-art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    animation: artFloatZoom 4.2s ease-in-out infinite alternate;
}

@keyframes artFloatZoom {
    0% { transform: scale(1.02) translateY(0); }
    100% { transform: scale(1.08) translateY(-4px); }
}

.hero-stars-float {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(180deg, #fef08a 0%, #f59e0b 100%);
    color: #78350f;
    font-family: 'Cairo', sans-serif;
    font-size: 0.78rem;
    font-weight: 900;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.hero-stage-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ffffff;
    font-family: 'Cairo', sans-serif;
    font-size: 0.74rem;
    font-weight: 900;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.hero-world-title {
    font-family: 'Cairo', sans-serif;
    font-size: 1.15rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: 0.15rem;
}

.hero-world-sub {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0284c7;
    margin-bottom: 0.55rem;
}

.hero-subjects-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.32rem;
}

.hero-subject-pill {
    font-size: 0.7rem;
    font-weight: 800;
    color: #1e293b;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    padding: 0.16rem 0.52rem;
    border-radius: 999px;
}

/* Bottom Interactive 3D Thumbnail Dock */
.grade-dock {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.7rem;
}

.dock-item-btn {
    position: relative;
    width: 64px;
    height: 64px;
    padding: 3px;
    border-radius: 1.15rem;
    border: 3px solid rgba(255, 255, 255, 0.85);
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 5px 0 rgba(125, 211, 252, 0.9), 0 8px 16px rgba(15, 23, 42, 0.18);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
}

.dock-item-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.85rem;
    display: block;
}

.dock-item-btn.active {
    transform: translateY(-6px) scale(1.12);
    border-color: #f59e0b;
    box-shadow: 0 6px 0 #d97706, 0 12px 24px rgba(245, 158, 11, 0.45);
}

.dock-item-tag {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.82);
    color: #ffffff;
    font-family: 'Cairo', sans-serif;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 0.04rem 0.38rem;
    border-radius: 999px;
    white-space: nowrap;
}

.grade-gate-footer {
    position: relative;
    z-index: 2;
}

.btn-enter-game {
    position: relative;
    overflow: hidden;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.9rem 1.25rem;
    border: 3px solid #ffffff;
    border-radius: 999px;
    background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
    color: #ffffff;
    font-family: 'Cairo', sans-serif;
    font-size: 1.12rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 0 #15803d, 0 12px 24px rgba(22, 163, 74, 0.4);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.btn-enter-game::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: enterBtnShimmer 2.5s infinite;
}

@keyframes enterBtnShimmer {
    0% { left: -120%; }
    45% { left: 140%; }
    100% { left: 140%; }
}

.btn-enter-game:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #15803d, 0 6px 12px rgba(22, 163, 74, 0.35);
}

.btn-enter-game svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* ==========================================================================
   DYNAMIC GRADE THEME SYSTEM (Changes colors, backgrounds & accents per grade)
   ========================================================================== */
body[data-grade-theme="grade6"] {
    background: #047857;
    --theme-accent: #10b981;
    --theme-accent-dark: #047857;
    --theme-soft: #d1fae5;
}

body[data-grade-theme="grade9"] {
    background: #0369a1;
    --theme-accent: #0284c7;
    --theme-accent-dark: #0369a1;
    --theme-soft: #e0f2fe;
}

body[data-grade-theme="grade12_sci"] {
    background: #312e81;
    --theme-accent: #6366f1;
    --theme-accent-dark: #4338ca;
    --theme-soft: #e0e7ff;
}

body[data-grade-theme="grade12_lit"] {
    background: #92400e;
    --theme-accent: #d97706;
    --theme-accent-dark: #b45309;
    --theme-soft: #fef3c7;
}

/* Grade-Gate & Welcome Screen Theme Transitions */
.splash-screen,
.grade-gate-screen,
.map-header-bar,
.crush-top-bar,
.pill-stage-btn,
.btn-enter-game {
    transition: background 0.35s ease, background-image 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

body[data-grade-theme="grade6"] .grade-gate-screen {
    background: linear-gradient(180deg, rgba(6, 78, 59, 0.35), rgba(16, 185, 129, 0.25)), url('../assets/grade6-3d.jpg') no-repeat center center / cover;
}

body[data-grade-theme="grade9"] .grade-gate-screen {
    background: linear-gradient(180deg, rgba(12, 74, 110, 0.35), rgba(2, 132, 199, 0.25)), url('../assets/grade9-3d.jpg') no-repeat center center / cover;
}

body[data-grade-theme="grade12_sci"] .grade-gate-screen {
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.45), rgba(79, 70, 229, 0.3)), url('../assets/grade12-sci-3d.jpg') no-repeat center center / cover;
}

body[data-grade-theme="grade12_lit"] .grade-gate-screen {
    background: linear-gradient(180deg, rgba(120, 53, 15, 0.45), rgba(217, 119, 6, 0.28)), url('../assets/grade12-lit-3d.jpg') no-repeat center center / cover;
}

/* Main Welcome Hub Background & Accents per Grade */
body[data-grade-theme="grade6"] .splash-screen {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.18) 0%, rgba(56, 189, 248, 0.22) 55%, rgba(6, 78, 59, 0.35) 100%), url('../assets/grade6-3d.jpg') no-repeat center center / cover;
}

body[data-grade-theme="grade9"] .splash-screen {
    background: linear-gradient(180deg, rgba(2, 132, 199, 0.22) 0%, rgba(14, 165, 233, 0.22) 55%, rgba(12, 74, 110, 0.4) 100%), url('../assets/grade9-3d.jpg') no-repeat center center / cover;
}

body[data-grade-theme="grade12_sci"] .splash-screen {
    background: linear-gradient(180deg, rgba(49, 46, 129, 0.35) 0%, rgba(99, 102, 241, 0.25) 55%, rgba(15, 23, 42, 0.55) 100%), url('../assets/grade12-sci-3d.jpg') no-repeat center center / cover;
}

body[data-grade-theme="grade12_lit"] .splash-screen {
    background: linear-gradient(180deg, rgba(146, 64, 14, 0.32) 0%, rgba(217, 119, 6, 0.22) 55%, rgba(69, 26, 3, 0.5) 100%), url('../assets/grade12-lit-3d.jpg') no-repeat center center / cover;
}

/* Launch Button, Stage Pill, Map Header & Crush Header Theme Overrides */
body[data-grade-theme="grade12_sci"] .btn-enter-game,
body[data-grade-theme="grade12_sci"] .btn-giant-start {
    background: linear-gradient(180deg, #818cf8 0%, #4f46e5 100%);
    box-shadow: 0 6px 0 #3730a3, 0 12px 24px rgba(79, 70, 229, 0.45);
}

body[data-grade-theme="grade12_lit"] .btn-enter-game,
body[data-grade-theme="grade12_lit"] .btn-giant-start {
    background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
    box-shadow: 0 6px 0 #92400e, 0 12px 24px rgba(217, 119, 6, 0.45);
}

body[data-grade-theme="grade9"] .btn-enter-game,
body[data-grade-theme="grade9"] .btn-giant-start {
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
    box-shadow: 0 6px 0 #075985, 0 12px 24px rgba(2, 132, 199, 0.45);
}

body[data-grade-theme="grade12_sci"] .pill-stage-btn {
    border-color: #a5b4fc;
    background: rgba(30, 27, 75, 0.85);
    color: #e0e7ff;
}

body[data-grade-theme="grade12_lit"] .pill-stage-btn {
    border-color: #fde68a;
    background: rgba(120, 53, 15, 0.85);
    color: #fef3c7;
}

body[data-grade-theme="grade6"] .pill-stage-btn {
    border-color: #6ee7b7;
    background: rgba(6, 78, 59, 0.85);
    color: #d1fae5;
}

body[data-grade-theme="grade9"] .pill-stage-btn {
    border-color: #7dd3fc;
    background: rgba(12, 74, 110, 0.85);
    color: #e0f2fe;
}

body[data-grade-theme="grade12_sci"] .map-header-bar {
    background: linear-gradient(90deg, rgba(49, 46, 129, 0.94), rgba(67, 56, 202, 0.94));
    border-bottom-color: rgba(165, 180, 252, 0.45);
}

body[data-grade-theme="grade12_lit"] .map-header-bar {
    background: linear-gradient(90deg, rgba(120, 53, 15, 0.94), rgba(180, 83, 9, 0.94));
    border-bottom-color: rgba(253, 230, 138, 0.45);
}

body[data-grade-theme="grade6"] .map-header-bar {
    background: linear-gradient(90deg, rgba(6, 95, 70, 0.94), rgba(5, 150, 105, 0.94));
    border-bottom-color: rgba(110, 231, 183, 0.45);
}

body[data-grade-theme="grade9"] .map-header-bar {
    background: linear-gradient(90deg, rgba(12, 74, 110, 0.94), rgba(3, 105, 161, 0.94));
    border-bottom-color: rgba(125, 211, 252, 0.45);
}

body[data-grade-theme] .map-header-bar .map-title-badge,
body[data-grade-theme] .map-header-bar .map-title-badge span {
    color: #ffffff;
}

body[data-grade-theme] .map-header-bar .map-title-badge svg {
    fill: #ffffff;
}

/* Biome Backdrops & Checkpoint Station Thumbnails on Map */
.map-zone-biome {
    position: absolute;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.9;
}

.checkpoint-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: center;
}

.checkpoint-station-thumb {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: cover;
    border: 2.5px solid #fde047;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
}

.map-landmark-float {
    position: absolute;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.map-landmark-img {
    width: 100%;
    height: auto;
    display: block;
    -webkit-mask-image: radial-gradient(ellipse 68% 64% at 50% 50%, black 38%, rgba(0, 0, 0, 0.65) 58%, transparent 84%);
    mask-image: radial-gradient(ellipse 68% 64% at 50% 50%, black 38%, rgba(0, 0, 0, 0.65) 58%, transparent 84%);
}

/* ==========================================================================
   40 WORLDS SYSTEM: NAVIGATOR BAR, AMBIENT PROPS & MODALS
   ========================================================================== */
.world-nav-bar {
    position: relative;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.world-nav-arrow {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease, background 0.15s ease;
}

.world-nav-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.world-nav-center {
    flex: 1;
    min-width: 0;
    text-align: center;
    cursor: pointer;
    padding: 0.1rem 0.25rem;
    border-radius: 0.65rem;
    transition: background 0.15s ease;
}

.world-nav-center:hover {
    background: rgba(255, 255, 255, 0.1);
}

.world-nav-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 900;
    color: #fef08a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.world-nav-sub {
    font-size: 0.68rem;
    font-weight: 600;
    color: #bae6fd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.world-achieve-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    border: 2px solid #fde047;
    background: linear-gradient(180deg, #fef08a 0%, #f59e0b 100%);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.world-hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.world-hero-backdrop-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.92;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, black 10%, black 90%, rgba(0,0,0,0.5) 100%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, black 10%, black 90%, rgba(0,0,0,0.5) 100%);
}

.world-ambient-layer,
.world-landmarks-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.world-ambient-layer { z-index: 2; }
.world-landmarks-layer { z-index: 3; }

.world-landmark-prop {
    position: absolute;
    font-size: 2.1rem;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
    animation: propFloat 4.2s ease-in-out infinite alternate;
}

@keyframes propFloat {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-8px) scale(1.06); }
}

.world-ambient-particle {
    position: absolute;
    font-size: 1rem;
    opacity: 0.55;
    animation: ambientDrift 5.5s ease-in-out infinite alternate;
}

@keyframes ambientDrift {
    0% { transform: translate(0, 0) scale(0.9); opacity: 0.35; }
    100% { transform: translate(10px, -14px) scale(1.15); opacity: 0.75; }
}

.ambient-rain {
    animation: ambientRainFall 1.8s linear infinite !important;
    opacity: 0.75;
    font-size: 1.15rem;
    filter: drop-shadow(0 2px 4px rgba(6, 182, 212, 0.4));
}
@keyframes ambientRainFall {
    0% { transform: translateY(-25px) translateX(0); opacity: 0; }
    20% { opacity: 0.85; }
    80% { opacity: 0.85; }
    100% { transform: translateY(90px) translateX(15px); opacity: 0; }
}

.ambient-cotton {
    animation: ambientCottonFloat 4.2s ease-in-out infinite alternate !important;
    opacity: 0.85;
    font-size: 1.25rem;
    filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.5));
}
@keyframes ambientCottonFloat {
    0% { transform: translateY(0) scale(0.85); }
    100% { transform: translateY(-20px) translateX(12px) scale(1.1); }
}

.ambient-sand_sparkle {
    animation: ambientSandGlow 2.6s ease-in-out infinite !important;
    opacity: 0.85;
    color: #fbbf24;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.7));
}
@keyframes ambientSandGlow {
    0%, 100% { transform: translateY(0) scale(0.8); opacity: 0.3; }
    50% { transform: translateY(-12px) scale(1.2); opacity: 1; }
}

/* 10 Worlds Modal & Achievements Modal */
.worlds-modal-box {
    max-width: 440px;
    width: 94%;
    max-height: 82vh;
    overflow-y: auto;
    padding: 1rem;
}

.worlds-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1.5px solid #e2e8f0;
    padding-bottom: 0.6rem;
    margin-bottom: 0.85rem;
}

.worlds-modal-header h3 {
    font-family: 'Cairo', sans-serif;
    font-size: 1.08rem;
    font-weight: 900;
    color: #0f172a;
}

.all-worlds-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}

.world-overview-card {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border: 2px solid #cbd5e1;
    border-radius: 0.95rem;
    overflow: hidden;
    cursor: pointer;
    text-align: right;
    transition: transform 0.14s ease, border-color 0.14s ease;
}

.world-overview-card.current {
    border-color: #f59e0b;
    background: #fffbeb;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.world-overview-card.locked {
    opacity: 0.62;
}

.wo-thumb-wrap {
    position: relative;
    width: 100%;
    height: 78px;
}

.wo-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wo-num {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0f172a;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wo-lock {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.wo-body {
    padding: 0.45rem 0.55rem;
}

.wo-title {
    font-family: 'Cairo', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
}

.wo-meta {
    font-size: 0.68rem;
    font-weight: 600;
    color: #475569;
    margin-top: 0.12rem;
}

/* World Complete Celebration Modal */
.wc-badge-icon {
    font-size: 3rem;
    margin-bottom: 0.25rem;
}

.wc-title {
    font-family: 'Cairo', sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    color: #0f172a;
}

.wc-desc {
    font-size: 0.86rem;
    font-weight: 600;
    color: #475569;
    margin-top: 0.2rem;
}

.wc-next-preview {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: #f0f9ff;
    border: 2px solid #7dd3fc;
    border-radius: 0.9rem;
    padding: 0.55rem;
    text-align: right;
    margin-top: 0.5rem;
}

.wc-next-preview img {
    width: 56px;
    height: 56px;
    border-radius: 0.7rem;
    object-fit: cover;
}

.wc-next-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #0284c7;
}

.wc-next-title {
    font-family: 'Cairo', sans-serif;
    font-size: 0.96rem;
    font-weight: 900;
    color: #0f172a;
}

/* Achievements List */
.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.achievement-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.9rem;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
}

.achievement-row.unlocked {
    border-color: #fbbf24;
    background: #fffbeb;
}

.achievement-row.locked {
    opacity: 0.65;
}

.ach-icon {
    font-size: 1.65rem;
    width: 40px;
    text-align: center;
}

.ach-info {
    flex: 1;
}

.ach-title {
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
}

.ach-desc {
    font-size: 0.74rem;
    color: #475569;
}

.ach-reward {
    font-size: 0.76rem;
    font-weight: 800;
    color: #b45309;
    background: #fef3c7;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
    .world-landmark-prop,
    .world-ambient-particle {
        animation: none !important;
    }
}


/* ==========================================================================
   EXTREME UI/UX REDESIGN - DELUXE 3D MOBILE GAME SUITE
   Benchmarks: Monument Valley, Alto's Odyssey, Township, References 1, 2, 3
   ========================================================================== */

/* 1. ADVENTURE TRAIL ROAD & STEPPING STONES (Reference 2) */
.map-trail-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.trail-road-border {
    stroke: rgba(15, 23, 42, 0.4);
    stroke-width: 28px;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    opacity: 0.6;
}

.trail-road-bed {
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 22px;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.trail-road-stones {
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 14px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 8 16;
    fill: none;
    opacity: 0.75;
}

.trail-line {
    stroke: #fde047;
    stroke-width: 3px;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 4 12;
    fill: none;
    filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.8));
    animation: trailGlowAnim 2.2s infinite ease-in-out;
}

@keyframes trailGlowAnim {
    0%, 100% { opacity: 0.85; filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.7)); }
    50% { opacity: 1; filter: drop-shadow(0 0 10px rgba(250, 204, 21, 1)); }
}

/* 2. 3D LEVEL PEDESTALS (Reference 2) */
.level-pedestal-node {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 66px;
    height: 72px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

.level-pedestal-node.theme-science,
.level-pedestal-node.theme-geo,
.level-pedestal-node.theme-arabic,
.level-pedestal-node.theme-math,
.level-pedestal-node.summit,
.level-pedestal-node.boss-node {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.level-pedestal-node:hover {
    transform: translate(-50%, -55%) scale(1.08);
}

.level-pedestal-node:active {
    transform: translate(-50%, -45%) scale(0.95);
}

.pedestal-shadow {
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 58px;
    height: 16px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.pedestal-cylinder {
    position: relative;
    width: 56px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(180deg, #0284c7 0%, #0369a1 40%, #0c4a6e 100%);
    box-shadow: 0 6px 0 #082f49, 0 10px 14px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all 0.2s ease;
}

.pedestal-top-plate {
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 70%, #0369a1 100%);
    border: 2px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pedestal-top-plate::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 14%;
    width: 72%;
    height: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 50%;
    pointer-events: none;
}

.pedestal-number {
    font-family: 'Readex Pro', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Arabic', Roboto, Tahoma, Arial, sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 8px rgba(56, 189, 248, 0.6);
    z-index: 3;
}

/* 3-Star Bracket Underneath */
.pedestal-stars-bracket {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 1px 7px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
    z-index: 4;
}

.p-star {
    font-size: 0.65rem;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5));
}

.p-star.filled {
    color: #facc15;
    text-shadow: 0 0 4px #eab308;
}

.p-star.empty {
    color: #475569;
    opacity: 0.65;
}

/* Current Stage Pedestal Glow */
.level-pedestal-node.current {
    z-index: 15;
}

.level-pedestal-node.current .pedestal-cylinder {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 40%, #b45309 100%);
    box-shadow: 0 6px 0 #78350f, 0 12px 20px rgba(245, 158, 11, 0.55);
}

.level-pedestal-node.current .pedestal-top-plate {
    background: linear-gradient(180deg, #fef08a 0%, #facc15 70%, #eab308 100%);
    border-color: #ffffff;
}

.level-pedestal-node.current .pedestal-number {
    color: #713f12;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.pedestal-current-glow {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.65) 0%, rgba(250, 204, 21, 0) 70%);
    animation: beaconHaloPulse 1.8s infinite ease-in-out;
    pointer-events: none;
}

@keyframes beaconHaloPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.25); opacity: 0.35; }
}

/* Locked Pedestal */
.level-pedestal-node.locked {
    filter: grayscale(0.5);
    opacity: 0.85;
    cursor: not-allowed;
}

.level-pedestal-node.locked .pedestal-cylinder {
    background: linear-gradient(180deg, #64748b 0%, #475569 40%, #334155 100%);
    box-shadow: 0 5px 0 #1e293b, 0 6px 12px rgba(0, 0, 0, 0.35);
}

.level-pedestal-node.locked .pedestal-top-plate {
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
    border-color: #cbd5e1;
}

.level-pedestal-node.locked .pedestal-number {
    color: #cbd5e1;
    opacity: 0.7;
}

.pedestal-lock-icon {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 0.88rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

/* Boss / Milestone Pedestal */
.level-pedestal-node.boss-stage .pedestal-cylinder {
    background: linear-gradient(180deg, #9333ea 0%, #7e22ce 40%, #581c87 100%);
    box-shadow: 0 6px 0 #3b0764, 0 12px 22px rgba(147, 51, 234, 0.55);
}

.level-pedestal-node.boss-stage .pedestal-top-plate {
    background: linear-gradient(180deg, #e9d5ff 0%, #c084fc 60%, #9333ea 100%);
    border-color: #fef08a;
}

.pedestal-boss-crown {
    position: absolute;
    top: -12px;
    font-size: 1.15rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
    animation: bossCrownBob 2.2s infinite ease-in-out;
}

@keyframes bossCrownBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* 3. DELUXE 3D VICTORY PLAQUE (Reference 3) */
.victory-modal-overlay {
    background: rgba(15, 23, 42, 0.82) !important;
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.victory-modal-overlay.active {
    display: flex !important;
}

.victory-popup-wrapper {
    position: relative;
    width: 100%;
    max-width: 370px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: victoryBounceIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes victoryBounceIn {
    0% { transform: scale(0.65) translateY(40px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.victory-sunburst-rays {
    position: absolute;
    top: -36px;
    width: 270px;
    height: 270px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.5) 0%, rgba(245, 158, 11, 0.25) 45%, rgba(245, 158, 11, 0) 70%);
    z-index: 0;
    pointer-events: none;
    animation: sunburstRotateAnim 16s linear infinite;
}

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

.victory-top-crest {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: -18px;
}

.victory-helm-container {
    position: relative;
    width: 76px;
    height: 76px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.helm-svg {
    width: 100%;
    height: 100%;
}

.helm-center-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
}

.victory-wing {
    position: absolute;
    top: 14px;
    width: 60px;
    height: 28px;
    background: linear-gradient(135deg, #a855f7 0%, #6b21a8 100%);
    border: 2px solid #fbbf24;
    border-radius: 999px 4px 999px 4px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
    z-index: -1;
}

.victory-wing.wing-left {
    left: -32px;
    transform: rotate(-18deg);
}

.victory-wing.wing-right {
    right: -32px;
    transform: rotate(18deg) scaleX(-1);
}

.victory-ribbon-banner {
    background: linear-gradient(180deg, #b45309 0%, #92400e 50%, #78350f 100%);
    border: 2.5px solid #fde047;
    border-bottom: 4px solid #451a03;
    border-radius: 12px;
    padding: 0.35rem 1.6rem;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
    transform: translateY(-8px);
}

.victory-ribbon-text {
    font-family: 'Readex Pro', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Arabic', Roboto, Tahoma, Arial, sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    color: #fef08a;
    text-shadow: 0 2px 4px #451a03, 0 0 8px rgba(253, 224, 71, 0.5);
}

.victory-wood-close {
    position: absolute;
    top: 8px;
    right: -14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(180deg, #b45309 0%, #78350f 100%);
    border: 2px solid #fde047;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    color: #ffffff;
    font-weight: 900;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.12s ease;
}

.victory-wood-close:active {
    transform: scale(0.92);
}

.victory-wood-frame {
    position: relative;
    z-index: 5;
    width: 100%;
    background: linear-gradient(180deg, #92400e 0%, #78350f 40%, #451a03 100%);
    border: 4px solid #b45309;
    border-radius: 28px;
    padding: 10px;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.6), inset 0 2px 6px rgba(255, 255, 255, 0.25);
    box-sizing: border-box;
}

.victory-parchment-inner {
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 60%, #fde68a 100%);
    border: 2px dashed #d97706;
    border-radius: 20px;
    padding: 1.25rem 1rem 0.95rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: inset 0 0 16px rgba(180, 83, 9, 0.15);
    box-sizing: border-box;
}

.victory-level-subtitle {
    font-size: 0.95rem;
    font-weight: 800;
    color: #92400e;
    margin-bottom: 0.15rem;
}

.victory-desc-text {
    font-size: 0.84rem;
    font-weight: 600;
    color: #78350f;
    margin-bottom: 0.65rem;
    line-height: 1.35;
}

.victory-3d-stars-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    margin: 0.4rem 0 0.85rem 0;
}

.victory-star-slot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.victory-star-slot .v-star-icon {
    font-size: 2.8rem;
    line-height: 1;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
}

.victory-star-slot.slot-left {
    transform: rotate(-12deg);
}

.victory-star-slot.slot-center {
    transform: translateY(-8px) scale(1.22);
}

.victory-star-slot.slot-right {
    transform: rotate(12deg);
}

.star-halo-glow {
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(250, 204, 21, 0.7) 0%, rgba(250, 204, 21, 0) 70%);
    animation: haloPulseAnim 2s infinite ease-in-out;
    pointer-events: none;
}

@keyframes haloPulseAnim {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.25); opacity: 0.4; }
}

.victory-rewards-shelf-wrap {
    position: relative;
    width: 100%;
    max-width: 290px;
    margin: 0.4rem auto 0.95rem auto;
}

.victory-shelf-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #92400e;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.gold-sparkle {
    color: #d97706;
}

.shelf-hanging-rope {
    position: absolute;
    top: 24px;
    width: 6px;
    height: 48px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.shelf-hanging-rope.rope-left { left: 18px; }
.shelf-hanging-rope.rope-right { right: 18px; }

.rope-ring-top {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #ca8a04;
    background: #fde047;
}

.rope-line {
    width: 4px;
    flex: 1;
    background: repeating-linear-gradient(180deg, #d97706 0px, #b45309 3px, #78350f 6px);
    box-shadow: 1px 0 2px rgba(0, 0, 0, 0.35);
}

.rope-knot-bottom {
    width: 8px;
    height: 12px;
    background: #b45309;
    border-radius: 2px 2px 4px 4px;
}

.shelf-wood-plank {
    position: relative;
    background: linear-gradient(180deg, #b45309 0%, #92400e 50%, #78350f 100%);
    border: 2px solid #d97706;
    border-bottom: 5px solid #451a03;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4), inset 0 1px 3px rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.shelf-reward-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.reward-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.coin-circle { background: linear-gradient(135deg, #facc15 0%, #eab308 100%); }
.hint-circle { background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%); }
.streak-circle { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); }

.reward-badge-pill {
    background: rgba(15, 23, 42, 0.85);
    color: #fef08a;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(250, 204, 21, 0.4);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.victory-actions-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 0.65rem;
}

.btn-3d-continue {
    width: 100%;
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 50%, #16a34a 100%);
    border: 2px solid #86efac;
    border-bottom: 6px solid #14532d;
    border-radius: 999px;
    padding: 0.7rem 1.5rem;
    font-family: 'Readex Pro', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Arabic', Roboto, Tahoma, Arial, sans-serif;
    font-size: 1.2rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 4px #14532d;
    box-shadow: 0 8px 18px rgba(34, 197, 94, 0.5);
    cursor: pointer;
    transition: transform 0.12s ease;
}

.btn-3d-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(34, 197, 94, 0.6);
}

.btn-3d-continue:active {
    transform: translateY(3px);
    border-bottom-width: 2px;
}

.btn-3d-map {
    width: 100%;
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 50%, #0369a1 100%);
    border: 2px solid #7dd3fc;
    border-bottom: 5px solid #0c4a6e;
    border-radius: 999px;
    padding: 0.5rem 1.2rem;
    font-family: 'Readex Pro', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Arabic', Roboto, Tahoma, Arial, sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 3px #0c4a6e;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
    cursor: pointer;
    transition: transform 0.12s ease;
}

.btn-3d-map:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

.victory-timer-track {
    width: 100%;
    height: 6px;
    background: rgba(180, 83, 9, 0.2);
    border-radius: 999px;
    overflow: hidden;
}

.victory-timer-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #facc15 0%, #eab308 100%);
    border-radius: 999px;
}

.victory-nature-base {
    position: relative;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-top: -14px;
    font-size: 1.45rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
    pointer-events: none;
}

/* 4. KINGDOM SELECTION MODAL (Reference 1) */
.kingdom-modal-overlay {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.kingdom-modal-overlay.active {
    display: flex !important;
}

.kingdom-selection-box {
    background: linear-gradient(180deg, #1e1b4b 0%, #0f172a 100%);
    border: 3px solid #818cf8;
    border-radius: 28px;
    padding: 1.2rem;
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.kingdom-ribbon-wrap {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.kingdom-ribbon-banner {
    flex: 1;
    background: linear-gradient(180deg, #9333ea 0%, #7e22ce 50%, #581c87 100%);
    border: 2px solid #fde047;
    border-bottom: 4px solid #3b0764;
    border-radius: 14px;
    padding: 0.45rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 6px 16px rgba(126, 34, 206, 0.45);
}

.kingdom-ribbon-icon {
    font-size: 1.3rem;
}

.kingdom-ribbon-title {
    font-family: 'Readex Pro', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Arabic', Roboto, Tahoma, Arial, sans-serif;
    font-size: 1.15rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 4px #3b0764;
}

.kingdom-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #334155;
    border: 2px solid #64748b;
    color: #cbd5e1;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    margin-right: 0.5rem;
}

.kingdom-selection-sub {
    font-size: 0.8rem;
    color: #cbd5e1;
    font-weight: 600;
    margin-bottom: 0.95rem;
    text-align: center;
}

.kingdom-islands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.85rem;
    width: 100%;
}

.kingdom-island-card {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid #334155;
    border-bottom: 5px solid #020617;
    border-radius: 18px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease;
    outline: none;
    box-sizing: border-box;
}

.kingdom-island-card:hover {
    transform: translateY(-4px);
    border-color: #38bdf8;
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.35);
}

.kingdom-island-card.current {
    border-color: #facc15;
    border-bottom-color: #ca8a04;
    box-shadow: 0 0 16px rgba(250, 204, 21, 0.45);
}

.kingdom-island-card.locked {
    filter: grayscale(0.5);
    opacity: 0.75;
    cursor: not-allowed;
}

.island-water-base {
    position: relative;
    width: 100%;
    height: 84px;
    border-radius: 14px;
    overflow: hidden;
    background: radial-gradient(circle, #0284c7 0%, #0369a1 60%, #0c4a6e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.island-foam-ring {
    position: absolute;
    width: 88%;
    height: 72%;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.island-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.island-biome-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 1rem;
    background: rgba(15, 23, 42, 0.75);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.island-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.island-info-tag {
    width: 100%;
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.island-title-pill {
    background: #0284c7;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #38bdf8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.island-star-pill {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fef08a;
}

/* 5. GAMEPLAY GRID & TILES RESPONSIVE OVERFLOW FIX */
.crush-grid {
    display: grid !important;
    gap: 0.35rem !important;
    width: min(92vw, 360px) !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 46vh !important;
    aspect-ratio: 1 !important;
    margin: 0 auto 0.65rem auto !important;
    padding: 0.5rem !important;
    background: #1e293b !important;
    border-radius: 1.25rem !important;
    border: 3px solid #334155 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35), inset 0 2px 6px rgba(0,0,0,0.4) !important;
    touch-action: none !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.crush-cell {
    min-width: 0 !important;
    min-height: 0 !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 !important;
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    border-bottom: 3.5px solid #94a3b8 !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: 'Readex Pro', 'Cairo', sans-serif !important;
    font-size: clamp(1rem, 4.2vw, 1.45rem) !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    box-sizing: border-box !important;
    user-select: none !important;
}

.crush-grid[data-grid-size="7"] .crush-cell {
    font-size: clamp(0.9rem, 3.8vw, 1.25rem) !important;
    border-radius: 8px !important;
}

.crush-grid[data-grid-size="8"] .crush-cell,
.crush-grid[data-grid-size="9"] .crush-cell {
    font-size: clamp(0.8rem, 3.2vw, 1.05rem) !important;
    border-radius: 6px !important;
}


/* ==========================================================================
   CINEMATIC 3D REALM SELECTION SUITE - AAA MOBILE GAME STANDARD
   Eliminates all kindergarten white cards, balloons, and clipart
   ========================================================================== */

.realm-select-screen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    z-index: 100;
    background: #020617;
    font-family: 'Readex Pro', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Arabic', Roboto, Tahoma, Arial, sans-serif;
}

/* Full-Bleed 3D WebGL Canvas Layer (360° Touch & Orbit across Entire Screen) */
.realm-3d-fullscreen-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto;
    touch-action: none;
    overflow: hidden;
}

.city4u-3d-canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
    outline: none;
    touch-action: none;
    cursor: grab;
}
.city4u-3d-canvas:active {
    cursor: grabbing;
}

/* Floating Interactive Speech Bubble */
.c3d-student-dialogue {
    position: absolute;
    top: 92px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 60;
    max-width: 90%;
    width: 330px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 1.25rem;
    padding: 0.65rem 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.35);
    animation: dialoguePopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

@keyframes dialoguePopIn {
    0% { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(0.92); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.c3d-bubble-avatar {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
    flex-shrink: 0;
}

.c3d-bubble-content {
    display: flex;
    flex-direction: column;
    text-align: right;
    flex: 1;
}

.c3d-bubble-name {
    font-family: 'Cairo', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    color: #38bdf8;
    margin-bottom: 0.15rem;
}

.c3d-bubble-msg {
    font-family: 'Cairo', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
    line-height: 1.35;
}

/* 3D Top Overlay Tools */
.city4u-3d-controls-overlay {
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    z-index: 25;
}

.c3d-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    pointer-events: none;
}

.realm-select-screen[style*="display: none"],
.universe-hub-screen[style*="display: none"] {
    display: none !important;
}

/* Panoramic Environmental Backdrop with Cinematic Shaders */
.realm-cinematic-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    transition: background 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    background: #020617;
}

/* Illustrated AAA Game Art Wallpaper */
.game-art-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/game-title-bg.jpg');
    background-position: center 65%;
    background-size: cover;
    background-repeat: no-repeat;
    transform: scale(1.04);
    animation: gameArtBreath 16s ease-in-out infinite alternate;
    z-index: 1;
}

@keyframes gameArtBreath {
    0% { transform: scale(1.02) translateY(0); }
    100% { transform: scale(1.06) translateY(-10px); }
}

/* Stage-specific Color Grade Layer */
.game-art-color-grade {
    position: absolute;
    inset: 0;
    z-index: 2;
    transition: background 0.7s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.7s ease;
    mix-blend-mode: overlay;
    pointer-events: none;
    opacity: 0.85;
}

.realm-theme-discovery .game-art-color-grade {
    background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.35) 0%, rgba(4, 78, 56, 0.75) 100%);
}

.realm-theme-history .game-art-color-grade {
    background: radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.4) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.realm-theme-literature .game-art-color-grade {
    background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.42) 0%, rgba(69, 26, 3, 0.8) 100%);
}

.realm-theme-science .game-art-color-grade {
    background: radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.45) 0%, rgba(46, 16, 101, 0.85) 100%);
}

/* AAA Mobile Game Professional Backdrops per Realm */
.realm-cinematic-backdrop.realm-theme-discovery {
    background:
        radial-gradient(ellipse at 50% 45%, rgba(52, 211, 153, 0.42) 0%, rgba(16, 185, 129, 0.28) 35%, rgba(4, 78, 56, 0.8) 70%, #011d16 100%),
        radial-gradient(circle at 50% 18%, rgba(110, 231, 183, 0.32) 0%, transparent 60%),
        linear-gradient(180deg, #022c22 0%, #064e3b 38%, #03231a 75%, #01120e 100%);
}

.realm-cinematic-backdrop.realm-theme-history {
    background:
        radial-gradient(ellipse at 50% 45%, rgba(56, 189, 248, 0.45) 0%, rgba(37, 99, 235, 0.3) 35%, rgba(15, 23, 42, 0.85) 70%, #030a16 100%),
        radial-gradient(circle at 50% 18%, rgba(147, 197, 253, 0.32) 0%, transparent 60%),
        linear-gradient(180deg, #082046 0%, #17386d 38%, #06152b 75%, #020712 100%);
}

.realm-cinematic-backdrop.realm-theme-literature {
    background:
        radial-gradient(ellipse at 50% 45%, rgba(251, 191, 36, 0.45) 0%, rgba(217, 119, 6, 0.32) 35%, rgba(69, 26, 3, 0.85) 70%, #150600 100%),
        radial-gradient(circle at 50% 18%, rgba(254, 240, 138, 0.35) 0%, transparent 60%),
        linear-gradient(180deg, #451a03 0%, #7c2d12 38%, #290e03 75%, #140500 100%);
}

.realm-cinematic-backdrop.realm-theme-science {
    background:
        radial-gradient(ellipse at 50% 45%, rgba(192, 132, 252, 0.46) 0%, rgba(124, 58, 237, 0.32) 35%, rgba(46, 16, 101, 0.85) 70%, #0a0314 100%),
        radial-gradient(circle at 50% 18%, rgba(233, 213, 255, 0.35) 0%, transparent 60%),
        linear-gradient(180deg, #2e1065 0%, #4c1d95 38%, #1e0942 75%, #0a0217 100%);
}

/* Rotating Divine God Rays (AAA Game Background Polish) */
.game-god-rays {
    position: absolute;
    top: 48%;
    left: 50%;
    width: 140vmax;
    height: 140vmax;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(
        from 0deg,
        rgba(255, 255, 255, 0.07) 0deg 12deg,
        transparent 12deg 24deg
    );
    border-radius: 50%;
    pointer-events: none;
    animation: rotateGodRays 45s linear infinite;
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.9) 0%, transparent 64%);
    -webkit-mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.9) 0%, transparent 64%);
    z-index: 3;
}

@keyframes rotateGodRays {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Central Radiant Core Aura behind the Button */
.game-core-aura {
    position: absolute;
    top: 48%;
    left: 50%;
    width: clamp(300px, 85vw, 480px);
    height: clamp(300px, 85vw, 480px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, var(--realm-core-glow, rgba(52, 211, 153, 0.65)) 0%, rgba(250, 204, 21, 0.3) 38%, transparent 72%);
    pointer-events: none;
    animation: auraPulse 4s ease-in-out infinite alternate;
    filter: blur(12px);
    z-index: 4;
}

.realm-theme-discovery { --realm-core-glow: rgba(52, 211, 153, 0.65); }
.realm-theme-history { --realm-core-glow: rgba(56, 189, 248, 0.65); }
.realm-theme-literature { --realm-core-glow: rgba(245, 158, 11, 0.7); }
.realm-theme-science { --realm-core-glow: rgba(168, 85, 247, 0.7); }

@keyframes auraPulse {
    0% { transform: translate(-50%, -50%) scale(0.92); opacity: 0.65; }
    100% { transform: translate(-50%, -50%) scale(1.18); opacity: 1; }
}

/* Floating Magical Bokeh / Firefly Particles */
.game-floating-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 5;
}

.m-particle {
    position: absolute;
    border-radius: 50%;
    background: #fef08a;
    box-shadow: 0 0 10px #facc15, 0 0 20px #f59e0b;
    pointer-events: none;
    animation: floatUpParticle linear infinite;
}

.p1 { width: 5px; height: 5px; left: 18%; bottom: -10px; animation-duration: 9s; animation-delay: 0s; }
.p2 { width: 8px; height: 8px; left: 35%; bottom: -10px; animation-duration: 12s; animation-delay: 2s; }
.p3 { width: 4px; height: 4px; left: 75%; bottom: -10px; animation-duration: 8s; animation-delay: 1s; }
.p4 { width: 6px; height: 6px; left: 88%; bottom: -10px; animation-duration: 11s; animation-delay: 4s; }
.p5 { width: 7px; height: 7px; left: 52%; bottom: -10px; animation-duration: 10s; animation-delay: 3s; }
.p6 { width: 4px; height: 4px; left: 24%; bottom: -10px; animation-duration: 7s; animation-delay: 5s; }
.p7 { width: 9px; height: 9px; left: 62%; bottom: -10px; animation-duration: 13s; animation-delay: 1.5s; }
.p8 { width: 5px; height: 5px; left: 8%; bottom: -10px; animation-duration: 9.5s; animation-delay: 3.5s; }

@keyframes floatUpParticle {
    0% { transform: translateY(0) scale(0.7); opacity: 0; }
    15% { opacity: 0.95; }
    85% { opacity: 0.95; }
    100% { transform: translateY(-110vh) scale(1.3); opacity: 0; }
}

/* Fantasy Horizon Silhouette */
.game-horizon-silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 38%;
    background:
        radial-gradient(ellipse at 50% 120%, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.85) 50%, transparent 80%),
        linear-gradient(0deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.4) 60%, transparent 100%);
    pointer-events: none;
    mask-image: linear-gradient(to top, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to top, black 50%, transparent 100%);
    z-index: 6;
}

.realm-ambient-light {
    position: absolute;
    top: 25%;
    left: 15%;
    width: 70%;
    height: 50%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.08) 45%, transparent 70%);
    pointer-events: none;
    animation: ambientLightPulse 5s ease-in-out infinite alternate;
}

@keyframes ambientLightPulse {
    0% { transform: scale(0.92); opacity: 0.55; }
    100% { transform: scale(1.12); opacity: 0.95; }
}

.realm-vignette-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, transparent 28%, rgba(0, 0, 0, 0.55) 75%, rgba(0, 0, 0, 0.88) 100%);
    pointer-events: none;
    z-index: 7;
}
    pointer-events: none;
}

.realm-horizon-landscape {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 38%;
    background:
        linear-gradient(0deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.55) 60%, transparent 100%),
        radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.8) 0%, transparent 75%);
    pointer-events: none;
}

/* Minimalist Top HUD Bar */
.realm-top-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: max(0.6rem, env(safe-area-inset-top)) 1rem 0.5rem 1rem;
    width: 100%;
    box-sizing: border-box;
    pointer-events: auto;
}

.realm-hud-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 0.35rem 0.95rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.realm-hud-brand span {
    font-size: 0.85rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.realm-hud-logo,
.realm-brand-logo {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: contain;
}

.realm-hud-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.realm-hud-name {
    font-size: 0.8rem;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 0.3px;
}

.realm-hud-stats {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(250, 204, 21, 0.4);
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    color: #fef08a;
    font-weight: 800;
    font-size: 0.82rem;
    direction: ltr;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* Center 3D Action Stage (Large & Centered) */
.realm-top-action-bar {
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 40;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    padding: 0;
    width: 100%;
    max-width: 480px;
    box-sizing: border-box;
}

/* 3D Juicy Cartoon Play Button (Dynamic Theme Match) */
.btn-cartoon-play {
    position: relative;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.16s ease;
    animation: cartoonPlayFloat 3s infinite ease-in-out;
}

.btn-play-graphic {
    width: clamp(285px, 80vw, 395px);
    height: auto;
    display: block;
    filter: drop-shadow(0 20px 42px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 45px rgba(250, 204, 21, 0.55));
    transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.16s ease;
    pointer-events: none;
    user-select: none;
}

.btn-cartoon-subtag {
    font-family: 'Cairo', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    background: rgba(10, 18, 30, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 0.45rem 1.8rem;
    border-radius: 999px;
    border: 2.5px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7), inset 0 1px 3px rgba(255, 255, 255, 0.45);
    margin-top: -1.5rem;
    z-index: 2;
    letter-spacing: 0.4px;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    user-select: none;
}

.btn-cartoon-play:hover {
    transform: translateY(-4px) scale(1.05);
}

.btn-cartoon-play:hover .btn-play-graphic {
    filter: drop-shadow(0 18px 32px rgba(0, 0, 0, 0.75)) brightness(1.06);
}

.btn-cartoon-play:active {
    transform: translateY(6px) scale(0.93);
}

.btn-cartoon-play:active .btn-play-graphic {
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.45)) brightness(0.94);
}

@keyframes cartoonPlayFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-6px) scale(1.025);
    }
}

.btn-3d-start-game {
    position: relative;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    padding: 0.6rem 1.8rem 0.55rem 1.8rem;
    background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 35%, #d97706 75%, #b45309 100%);
    border: 2.5px solid #fef08a;
    border-radius: 999px;
    box-shadow: 0 6px 0 #78350f, 0 12px 28px rgba(217, 119, 6, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.7);
    cursor: pointer;
    outline: none;
    transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease;
    animation: btnPulseGlow 2.4s infinite ease-in-out;
    box-sizing: border-box;
}

.btn-3d-start-game:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #78350f, 0 6px 14px rgba(217, 119, 6, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

@keyframes btnPulseGlow {
    0%, 100% {
        box-shadow: 0 6px 0 #78350f, 0 12px 28px rgba(217, 119, 6, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.7);
    }
    50% {
        box-shadow: 0 6px 0 #78350f, 0 14px 34px rgba(245, 158, 11, 0.85), inset 0 2px 4px rgba(255, 255, 255, 0.9);
    }
}

.btn-3d-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.btn-3d-icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.btn-3d-text {
    font-family: 'Cairo', sans-serif;
    font-size: 1.32rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 4px #451a03, 0 0 12px rgba(255, 255, 255, 0.4);
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.btn-3d-subtag {
    font-family: 'Cairo', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fef08a;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    margin-top: 0.1rem;
    letter-spacing: 0.3px;
}

.realm-dot-sep {
    color: #facc15;
    font-size: 0.65rem;
}

.realm-stars-stat {
    color: #fef08a;
}

.realm-synopsis-paragraph {
    display: none; /* Streamlined to prevent screen cropping */
}

.realm-runes-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: center;
    gap: 0.35rem;
    max-width: 100%;
    scrollbar-width: none;
}
.realm-runes-row::-webkit-scrollbar { display: none; }

.realm-rune-chip {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
}

/* Bottom Monolith Portals Dock (Only 4 Stage Selector Tabs) */
.realm-bottom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1rem max(1rem, env(safe-area-inset-bottom)) 1rem;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(2, 6, 23, 0) 0%, rgba(2, 6, 23, 0.75) 30%, rgba(2, 6, 23, 0.96) 100%);
    pointer-events: auto;
}

.realm-monolith-dock {
    display: flex;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    max-width: 360px;
}

.realm-monolith-btn {
    flex: 1;
    max-width: 80px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(14px);
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-bottom: 4px solid rgba(0, 0, 0, 0.6);
    border-radius: 18px;
    padding: 0.45rem 0.2rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
}

.realm-monolith-btn:hover,
.realm-monolith-btn.active {
    transform: translateY(-4px);
    border-color: #facc15;
    border-bottom-color: #ca8a04;
    box-shadow: 0 6px 18px rgba(250, 204, 21, 0.4);
    background: rgba(30, 41, 59, 0.9);
}

.monolith-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.monolith-glyph {
    font-size: 1.3rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.monolith-tag {
    font-family: 'Cairo', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    color: #e2e8f0;
}

.realm-monolith-btn.active .monolith-tag {
    color: #fef08a;
    font-weight: 900;
}

.monolith-glow-beam {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #facc15;
    box-shadow: 0 0 8px #facc15;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.realm-monolith-btn.active .monolith-glow-beam {
    opacity: 1;
}

.btn-realm-enter {
    position: relative;
    width: 100%;
    max-width: 360px;
    height: 52px;
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    border: 2px solid #fef08a;
    border-bottom: 5px solid #78350f;
    border-radius: 999px;
    padding: 0.55rem 1.6rem;
    font-family: 'Cairo', 'Readex Pro', sans-serif;
    font-size: 1.18rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 4px #451a03;
    box-shadow: 0 8px 22px rgba(217, 119, 6, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
    overflow: hidden;
    outline: none;
    margin-bottom: 0.2rem;
}
    color: #ffffff;
    text-shadow: 0 2px 4px #451a03;
    box-shadow: 0 10px 25px rgba(217, 119, 6, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
    overflow: hidden;
    outline: none;
}

.btn-realm-enter:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(217, 119, 6, 0.65);
}

.btn-realm-enter:active {
    transform: translateY(3px);
    border-bottom-width: 2px;
}

.btn-energy-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%);
    transform: skewX(-25deg);
    animation: shimmerSlide 3.5s infinite;
}

@keyframes shimmerSlide {
    0% { left: -100%; }
    25%, 100% { left: 180%; }
}


/* Architectural 3D Isometric Realm Model Styling & WebGL Three.js Container */
.realm-diorama-container {
    width: 100%;
    max-width: 390px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -14px auto 0.15rem auto;
    position: relative;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    border-radius: 1.25rem;
    overflow: visible;
}

.city4u-3d-canvas {
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
    touch-action: none;
    cursor: grab;
}
.city4u-3d-canvas:active {
    cursor: grabbing;
}

/* 3D Controls Overlay */
.city4u-3d-controls-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0.4rem 0.6rem;
    z-index: 20;
}

.c3d-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    pointer-events: none;
}

.c3d-hint-pill {
    align-self: center;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #f8fafc;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    transition: opacity 0.4s ease;
    animation: c3dHintPulse 2.5s ease-in-out infinite;
}

@keyframes c3dHintPulse {
    0%, 100% { transform: translateY(0); opacity: 0.95; }
    50% { transform: translateY(-3px); opacity: 0.7; }
}

.c3d-buttons-dock {
    align-self: flex-end;
    display: flex;
    gap: 0.4rem;
    pointer-events: auto;
}

.c3d-tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.c3d-tool-btn:hover,
.c3d-tool-btn:active {
    transform: scale(1.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.c3d-tool-btn.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.85), rgba(5, 150, 105, 0.95));
    border-color: #34d399;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}

.iso-realm-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.55));
}

.iso-floating-island {
    animation: dioramaFloatAnim 4s ease-in-out infinite alternate;
}

@keyframes dioramaFloatAnim {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

/* ==========================================================================
   SCREEN 2: UNIVERSE GATEWAY HUB (.universe-hub-screen)
   Replaces old kindergarten blocks, pennants & casual cards
   ========================================================================== */

.universe-hub-screen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    z-index: 10;
    background: transparent !important;
    pointer-events: none;
    font-family: 'Readex Pro', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans Arabic', Roboto, Tahoma, Arial, sans-serif;
}

.universe-hub-screen button,
.universe-hub-screen [role="button"],
.universe-hub-screen .hub-stage-selector-btn,
.universe-hub-screen .hub-portal-card,
.universe-hub-screen .btn-hub-play {
    pointer-events: auto !important;
}

/* Ambient Lighting Backdrop (Disabled to let full-bleed 3D scene show) */
.hub-ambient-backdrop {
    display: none !important;
}

#hub-diorama-preview {
    display: none !important;
}

.hub-ambient-backdrop.hub-theme-discovery {
    background: radial-gradient(circle at 50% 28%, rgba(52, 211, 153, 0.35) 0%, rgba(5, 150, 105, 0.25) 45%, rgba(6, 78, 59, 0.8) 75%, #022c22 100%),
                linear-gradient(180deg, #064e3b 0%, #065f46 45%, #022c22 100%);
}

.hub-ambient-backdrop.hub-theme-history {
    background: radial-gradient(circle at 50% 28%, rgba(251, 191, 36, 0.38) 0%, rgba(217, 119, 6, 0.28) 45%, rgba(120, 53, 15, 0.85) 75%, #290e03 100%),
                linear-gradient(180deg, #7c2d12 0%, #9a3412 40%, #1c0a00 100%);
}

.hub-ambient-backdrop.hub-theme-literature {
    background: radial-gradient(circle at 50% 28%, rgba(167, 139, 250, 0.42) 0%, rgba(124, 58, 237, 0.3) 45%, rgba(46, 16, 101, 0.85) 75%, #0f051d 100%),
                linear-gradient(180deg, #3b0764 0%, #1e1b4b 45%, #090214 100%);
}

.hub-ambient-backdrop.hub-theme-science {
    background: radial-gradient(circle at 50% 28%, rgba(34, 211, 238, 0.42) 0%, rgba(14, 165, 233, 0.3) 45%, rgba(12, 74, 110, 0.85) 75%, #020617 100%),
                linear-gradient(180deg, #0c4a6e 0%, #0369a1 45%, #020617 100%);
}

.hub-radial-glow {
    position: absolute;
    top: -15%;
    left: 15%;
    width: 70%;
    height: 55%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, transparent 70%);
    pointer-events: none;
    animation: hubGlowPulse 5s ease-in-out infinite alternate;
}

@keyframes hubGlowPulse {
    0% { transform: scale(0.96); opacity: 0.6; }
    100% { transform: scale(1.12); opacity: 1; }
}

.hub-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(0, 0, 0, 0.78) 100%);
    pointer-events: none;
}

/* Minimalist Top HUD Bar */
.hub-top-hud {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    width: 100%;
    box-sizing: border-box;
}

.hub-hud-left,
.hub-hud-right {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.hub-hud-circle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.16s ease;
    outline: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.hub-hud-circle-btn svg {
    width: 18px;
    height: 18px;
    fill: #f8fafc;
}

.hub-hud-circle-btn:hover {
    background: rgba(30, 41, 59, 0.88);
    border-color: #facc15;
    transform: scale(1.06);
}

.hub-hud-circle-btn:active {
    transform: scale(0.94);
}

.hub-brand-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    padding: 0.35rem 0.95rem;
    color: #f8fafc;
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
    z-index: 2;
}

.hub-brand-logo {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: contain;
}

/* Center Isometric World Sanctuary */
.hub-center-sanctuary {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 0.2rem 1rem 0.6rem 1rem;
    width: 100%;
    box-sizing: border-box;
    pointer-events: none;
}

.hub-center-sanctuary button,
.hub-center-sanctuary [role="button"] {
    pointer-events: auto;
}

.hub-diorama-preview {
    width: 100%;
    max-width: 320px;
    height: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -10px auto 0.4rem auto;
    position: relative;
    pointer-events: none;
}

.hub-realm-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1.15rem;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1.5px solid #f59e0b;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.35);
    color: #fde68a;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}

.hub-realm-badge .badge-gem {
    color: #f59e0b;
    font-size: 0.75rem;
    filter: drop-shadow(0 0 6px #fde047);
    animation: badgeGemTwinkle 2s infinite alternate;
}

@keyframes badgeGemTwinkle {
    0% { transform: scale(0.9); opacity: 0.7; }
    100% { transform: scale(1.2); opacity: 1; }
}

.hub-game-title {
    font-family: 'Outfit', 'Cairo', sans-serif !important;
    font-size: 1.85rem !important;
    font-weight: 900 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    background: linear-gradient(180deg, #ffffff 0%, #fef08a 35%, #fbbf24 65%, #f59e0b 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    filter: drop-shadow(0 3px 0 #78350f) drop-shadow(0 5px 0 #451a03) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.85)) !important;
    line-height: 1.15 !important;
    margin: 0.15rem 0 0.65rem 0 !important;
    animation: gameTitleFloat 3.8s ease-in-out infinite alternate !important;
}

@keyframes gameTitleFloat {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-3px) scale(1.02); }
}

.hub-stage-selector-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.88) 0%, rgba(15, 23, 42, 0.92) 100%);
    backdrop-filter: blur(14px);
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    border-bottom: 3.5px solid rgba(15, 23, 42, 0.95);
    border-radius: 999px;
    padding: 0.42rem 1.15rem;
    font-size: 0.84rem;
    font-weight: 900;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.35);
    outline: none;
}

.stage-rank-icon {
    font-size: 1rem;
}

.hub-stage-selector-btn:hover {
    transform: translateY(-2px);
    border-color: #facc15;
    box-shadow: 0 8px 22px rgba(250, 204, 21, 0.3);
}

.hub-stage-selector-btn:active {
    transform: translateY(2px);
    border-bottom-width: 1.5px;
}

.hub-change-pill {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
    border: 1px solid #fde68a;
    border-bottom: 2px solid #78350f;
    color: #ffffff;
    font-size: 0.72rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-weight: 900;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Bottom Tactical Action Portals */
.hub-bottom-actions {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 0.4rem 1rem 1.3rem 1rem;
    width: 100%;
    box-sizing: border-box;
}

.btn-hub-play {
    position: relative;
    width: 100%;
    max-width: 375px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    background: linear-gradient(180deg, #10e39b 0%, #10b981 40%, #059669 80%, #047857 100%);
    border: 2px solid #a7f3d0;
    border-bottom: 8px solid #064e3b;
    border-radius: 999px;
    padding: 0 1.8rem;
    font-family: 'Cairo', sans-serif;
    font-size: 1.45rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 0 #064e3b, 0 4px 10px rgba(0, 0, 0, 0.65);
    box-shadow: 0 10px 28px rgba(5, 150, 105, 0.55), inset 0 3px 2px rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease, border-bottom-width 0.12s ease;
    overflow: hidden;
    outline: none;
    animation: heroBtnBreathe 2.6s ease-in-out infinite;
}

@keyframes heroBtnBreathe {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 28px rgba(5, 150, 105, 0.55), inset 0 3px 2px rgba(255, 255, 255, 0.75); }
    50% { transform: scale(1.025); box-shadow: 0 14px 34px rgba(16, 227, 155, 0.75), inset 0 3px 2px rgba(255, 255, 255, 0.9); }
}

.btn-hub-play:hover {
    filter: brightness(1.06);
}

.btn-hub-play:active {
    transform: translateY(6px) scale(0.98) !important;
    border-bottom-width: 2px !important;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.4), inset 0 2px 2px rgba(0,0,0,0.2) !important;
    animation: none !important;
}

.hub-play-text {
    letter-spacing: 0.5px;
}

.hub-play-arrow {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    text-shadow: none;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.6);
}

.hub-play-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
    transform: skewX(-25deg);
    animation: shimmerSlide 3.5s infinite;
}

/* Portals Grid (3D Arcade Cartridges) */
.hub-portals-grid {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    max-width: 375px;
}

.hub-portal-card {
    position: relative;
    flex: 1;
    border-radius: 18px;
    padding: 0.65rem 0.35rem 0.5rem 0.35rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease, border-color 0.16s ease;
    outline: none;
    overflow: hidden;
    text-align: center;
}

/* Mode 1: World Map (Deep Nautical Adventure Cyan/Navy) */
.mode-card-map {
    background: linear-gradient(180deg, #0284c7 0%, #0369a1 50%, #0c4a6e 100%);
    border: 2px solid #7dd3fc;
    border-bottom: 6px solid #082f49;
    box-shadow: 0 8px 18px rgba(2, 132, 199, 0.35), inset 0 2px 2px rgba(255, 255, 255, 0.55);
}
.mode-card-map .portal-badge-chip {
    background: linear-gradient(180deg, #0284c7, #075985);
    border: 1px solid #bae6fd;
    color: #e0f2fe;
}

/* Mode 2: Word Crush (Jewel Emerald Candy) */
.mode-card-crush {
    background: linear-gradient(180deg, #10b981 0%, #059669 50%, #047857 100%);
    border: 2px solid #6ee7b7;
    border-bottom: 6px solid #064e3b;
    box-shadow: 0 8px 18px rgba(16, 185, 129, 0.35), inset 0 2px 2px rgba(255, 255, 255, 0.55);
}
.mode-card-crush .portal-badge-chip {
    background: linear-gradient(180deg, #059669, #064e3b);
    border: 1px solid #a7f3d0;
    color: #d1fae5;
}

/* Mode 3: Olympiad (Imperial Golden Champion) */
.mode-card-olympiad {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    border: 2px solid #fde047;
    border-bottom: 6px solid #78350f;
    box-shadow: 0 8px 18px rgba(245, 158, 11, 0.35), inset 0 2px 2px rgba(255, 255, 255, 0.55);
}
.mode-card-olympiad .portal-badge-chip {
    background: linear-gradient(180deg, #d97706, #78350f);
    border: 1px solid #fef08a;
    color: #fef9c3;
}

/* Floating Icon Plate */
.portal-icon-plate {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    display: grid;
    place-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 2px 3px rgba(255, 255, 255, 0.6);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portal-icon {
    font-size: 1.55rem;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
}

/* Portal Names */
.portal-name {
    font-size: 0.82rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    margin-top: 0.1rem;
}

/* Portal Badge Chips */
.portal-badge-chip {
    font-size: 0.66rem;
    font-weight: 900;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    letter-spacing: 0.3px;
}

/* Active Card State */
.hub-portal-card.active {
    transform: translateY(-5px);
    border-color: #ffffff;
    filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.5));
}

.hub-portal-card.active .portal-icon-plate {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.35);
    border-color: #ffffff;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.7);
}

/* Tactile Press Physics */
.hub-portal-card:hover {
    transform: translateY(-4px);
}

.hub-portal-card:active {
    transform: translateY(3px) !important;
    border-bottom-width: 2px !important;
}

/* Glass Shimmer on Cards */
.portal-card-sheen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, transparent 100%);
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

footer {
    display: none !important;
}

/* ==========================================================================
   SCREEN 4: PREMIUM 3D PUZZLE BOARD (#screen-crush)
   Replaces flat white container with a tactile 3D carved stone gaming tablet
   ========================================================================== */

#screen-crush.game-panel,
#screen-crush {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0.35rem 0.65rem 1rem 0.65rem !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: radial-gradient(circle at 50% 25%, #064e3b 0%, #022c22 55%, #011913 100%) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    font-family: 'Readex Pro', 'Cairo', sans-serif !important;
    z-index: 80 !important;
    box-sizing: border-box !important;
    scroll-behavior: smooth;
}

#screen-crush[style*="display: none"] {
    display: none !important;
}

/* Theme Backdrops for Screen 4 */
body[data-grade-theme="grade9"] #screen-crush {
    background: radial-gradient(circle at 50% 25%, #7c2d12 0%, #451a03 55%, #1c0a00 100%) !important;
}
body[data-grade-theme="grade12_lit"] #screen-crush {
    background: radial-gradient(circle at 50% 25%, #3b0764 0%, #1e1b4b 55%, #090214 100%) !important;
}
body[data-grade-theme="grade12_sci"] #screen-crush {
    background: radial-gradient(circle at 50% 25%, #0c4a6e 0%, #082f49 55%, #020617 100%) !important;
}

.crush-container {
    width: 100% !important;
    max-width: 420px !important;
    min-height: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 0.25rem !important;
    box-sizing: border-box !important;
}

/* Screen 4 Minimalist Obsidian HUD - STICKY TOP HEADER (UNBOXED FLOATING AAA STYLE) */
.crush-top-bar,
body[data-grade-theme] .crush-top-bar {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    flex-shrink: 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin: 0 0 0.25rem 0 !important;
    padding: 0.35rem 0.25rem 0.2rem 0.25rem !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    box-sizing: border-box !important;
}

/* High-Definition 3D Floating HUD Buttons */
.hud-btn-3d {
    width: 42px !important;
    height: 42px !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.88) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
    backdrop-filter: blur(12px) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
    border-bottom: 3.5px solid #0f172a !important;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.3) !important;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease !important;
    flex-shrink: 0 !important;
    outline: none !important;
    padding: 0 !important;
}

.hud-btn-3d:hover {
    transform: translateY(-2px) !important;
    border-color: #facc15 !important;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55), 0 0 10px rgba(250, 204, 21, 0.3) !important;
}

.hud-btn-3d:active {
    transform: translateY(2px) !important;
    border-bottom-width: 1.5px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6) !important;
}

.hud-btn-3d.btn-crush-home {
    background: linear-gradient(180deg, rgba(76, 29, 149, 0.75) 0%, rgba(30, 27, 75, 0.9) 100%) !important;
    border-color: rgba(196, 181, 253, 0.4) !important;
    border-bottom-color: #1e1b4b !important;
}

.hud-btn-3d.btn-crush-map {
    background: linear-gradient(180deg, rgba(14, 116, 144, 0.75) 0%, rgba(8, 47, 73, 0.9) 100%) !important;
    border-color: rgba(125, 211, 252, 0.4) !important;
    border-bottom-color: #082f49 !important;
}

.hud-svg-icon {
    display: block !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)) !important;
}

/* Open, Unboxed Stage Title & Mode Badge (Crystal Clear Floating Header) */
.crush-badge-open,
.crush-badge-pill,
#crush-stage-badge {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 0 0.2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    flex: 1 !important;
    min-width: 0 !important;
}

#crush-mode-icon {
    font-size: 1.1rem !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7)) !important;
    flex-shrink: 0 !important;
}

#crush-stage-name {
    font-family: 'Cairo', 'Readex Pro', sans-serif !important;
    font-size: clamp(0.78rem, 2.6vw, 0.95rem) !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 1px 3px #000000, 0 0 12px rgba(250, 204, 21, 0.45) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 190px !important;
    letter-spacing: 0.2px !important;
    line-height: 1.2 !important;
}

/* Floating 3D Jewel Coins Badge */
.crush-coins-badge,
#crush-coins-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(10px) !important;
    border: 1.5px solid #facc15 !important;
    border-bottom: 3.5px solid #b45309 !important;
    border-radius: 999px !important;
    padding: 0.22rem 0.55rem 0.22rem 0.35rem !important;
    color: #fef08a !important;
    font-weight: 900 !important;
    font-size: 0.88rem !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 10px rgba(250, 204, 21, 0.25) !important;
    transition: transform 0.12s ease !important;
    flex-shrink: 0 !important;
}

.crush-coins-badge:hover {
    transform: scale(1.05) !important;
    border-color: #fef08a !important;
}

.crush-coins-badge .coin-icon-svg {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)) !important;
    flex-shrink: 0 !important;
}

#crush-coins-count {
    color: #fef08a !important;
    font-weight: 900 !important;
    font-size: 0.88rem !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8) !important;
}

.coins-add-btn {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important;
    border: 1px solid #fef08a !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    border-radius: 50% !important;
    width: 18px !important;
    height: 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.78rem !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35) !important;
    line-height: 1 !important;
}

/* Responsive Adaptive Media Box */
.crush-media-box {
    width: auto !important;
    max-width: 280px !important;
    margin: 0.1rem auto 0.25rem auto !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    background: #0f172a !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

.crush-media-box img {
    width: 100% !important;
    height: auto !important;
    max-height: clamp(65px, 11vh, 100px) !important;
    object-fit: contain !important;
    display: block;
}

#crush-media-img[style*="display: none"],
.crush-media-box img[style*="display: none"],
.crush-media-emojis[style*="display: none"] {
    display: none !important;
}

.crush-media-emojis {
    padding: 0.35rem 0.8rem !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0.75rem !important;
    font-size: clamp(1.3rem, 3.8vh, 1.7rem) !important;
    background: linear-gradient(135deg, #ffffff, #f1f5f9) !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    line-height: 1.2 !important;
}

/* Title & Clue Box */
.crush-title-box {
    margin-bottom: 0.15rem !important;
    text-align: center !important;
    flex-shrink: 0 !important;
}

.crush-title-box h3 {
    font-family: 'Cairo', 'Readex Pro', sans-serif !important;
    font-size: clamp(0.85rem, 2.8vw, 1.05rem) !important;
    font-weight: 900 !important;
    color: #facc15 !important;
    margin: 0 0 0.1rem 0 !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6) !important;
    line-height: 1.25 !important;
}

.crush-title-box p {
    font-size: clamp(0.72rem, 2.2vw, 0.82rem) !important;
    font-weight: 600 !important;
    color: #e2e8f0 !important;
    margin: 0 !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5) !important;
    line-height: 1.2 !important;
}

/* Target Word Chips */
.crush-targets-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    margin: 0.2rem auto !important;
    max-width: 380px !important;
}

.target-chip {
    background: rgba(15, 23, 42, 0.72) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 999px !important;
    padding: 0.22rem 0.65rem !important;
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    color: #f1f5f9 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

.target-chip.found {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%) !important;
    border-color: #a7f3d0 !important;
    color: #ffffff !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6) !important;
}

/* Word Preview Capsule */
.crush-preview-capsule {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    border: 1.5px solid #facc15 !important;
    border-radius: 999px !important;
    padding: 0.32rem 1.2rem !important;
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    color: #fef08a !important;
    margin: 0.25rem auto !important;
    box-shadow: 0 4px 14px rgba(250, 204, 21, 0.35) !important;
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.5) !important;
    min-height: 32px !important;
    box-sizing: border-box !important;
}

/* 3D Carved Stone Letter Tablet (The Grid) */
.crush-grid {
    display: grid;
    gap: 0.32rem !important;
    width: min(92vw, 360px) !important;
    aspect-ratio: 1 !important;
    margin: 0 auto 0.45rem auto !important;
    padding: 0.55rem !important;
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(16px) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    border-bottom: 5px solid rgba(0, 0, 0, 0.65) !important;
    border-radius: 20px !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.12) !important;
    box-sizing: border-box !important;
}

/* Tactile 3D Stone Letter Stones */
.crush-cell {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 70%, #cbd5e1 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.85) !important;
    border-bottom: 4px solid #64748b !important;
    border-radius: 12px !important;
    color: #0f172a !important;
    font-family: 'Readex Pro', 'Cairo', sans-serif !important;
    font-size: clamp(1rem, 4.2vw, 1.45rem) !important;
    font-weight: 900 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25) !important;
    cursor: pointer !important;
    transition: transform 0.08s ease, box-shadow 0.08s ease !important;
}

.crush-cell:active,
.crush-cell.active-selection {
    background: linear-gradient(180deg, #fef08a 0%, #facc15 100%) !important;
    border-color: #ffffff !important;
    border-bottom-width: 2px !important;
    transform: translateY(2px) scale(1.05) !important;
    color: #713f12 !important;
    box-shadow: 0 0 16px rgba(250, 204, 21, 0.8) !important;
}

.crush-cell.locked-found {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%) !important;
    border-color: #a7f3d0 !important;
    border-bottom: 4px solid #064e3b !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6) !important;
}

/* Mode Boards Display None override */
.crush-grid[style*="display: none"],
.crush-grid-wrapper[style*="display: none"],
.crush-wheel-board[style*="display: none"],
.crush-chunks-board[style*="display: none"],
.crush-crossword-wrapper[style*="display: none"] {
    display: none !important;
}

/* Mode 3: 3D Carved Syllable Chunks Board */
.crush-chunks-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.55rem !important;
    width: min(92vw, 360px) !important;
    margin: 0.35rem auto !important;
    padding: 0.85rem !important;
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(16px) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    border-bottom: 5px solid rgba(0, 0, 0, 0.65) !important;
    border-radius: 20px !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6) !important;
    box-sizing: border-box !important;
}

.chunk-btn {
    padding: 0.75rem 0.35rem !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%) !important;
    border: 1.5px solid #cbd5e1 !important;
    border-bottom: 4px solid #94a3b8 !important;
    font-family: 'Cairo', 'Readex Pro', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    cursor: pointer !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.08s ease, background 0.12s ease !important;
}

.chunk-btn:active, .chunk-btn.selected {
    transform: translateY(2px) !important;
    border-bottom-width: 2px !important;
    background: linear-gradient(180deg, #fef08a 0%, #facc15 100%) !important;
    border-color: #fde047 !important;
    border-bottom-color: #ca8a04 !important;
    color: #713f12 !important;
    box-shadow: 0 0 14px rgba(250, 204, 21, 0.7) !important;
}

.chunk-btn.solved {
    opacity: 0.2 !important;
    pointer-events: none !important;
    filter: grayscale(1) !important;
    transform: scale(0.92) !important;
}

/* Bottom 3D Action Controls */
.crush-bottom-actions {
    display: flex !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    margin: 0.2rem auto 0 auto !important;
    width: 100% !important;
    max-width: 360px !important;
}

.btn-crush-action {
    flex: 1 !important;
    max-width: 160px !important;
    background: rgba(30, 41, 59, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
    border-bottom: 4px solid #0f172a !important;
    border-radius: 999px !important;
    padding: 0.55rem 1rem !important;
    font-family: 'Cairo', 'Readex Pro', sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    color: #f1f5f9 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    cursor: pointer !important;
    transition: transform 0.12s ease !important;
    outline: none !important;
}

.btn-crush-action:hover {
    transform: translateY(-2px) !important;
    border-color: #facc15 !important;
}

.btn-crush-action:active {
    transform: translateY(2px) !important;
    border-bottom-width: 2px !important;
}

.btn-crush-action.hint-action {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%) !important;
    border: 1.5px solid #fef08a !important;
    border-bottom: 4px solid #78350f !important;
    color: #ffffff !important;
    text-shadow: 0 1px 3px #451a03 !important;
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.45) !important;
}

/* Mode 4: Picture Crossword (كلمات متقاطعة مصورة) */
.crush-crossword-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
}

.crush-crossword-board {
    display: grid !important;
    gap: 3px !important;
    background: rgba(15, 23, 42, 0.9) !important;
    padding: 6px !important;
    border-radius: 14px !important;
    border: 2px solid #334155 !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4) !important;
}

.cw-cell {
    width: var(--cw-cell-size, 34px) !important;
    height: var(--cw-cell-size, 34px) !important;
    border-radius: 7px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: clamp(0.85rem, 3.2vw, 1.15rem) !important;
    font-weight: 800 !important;
    background: transparent;
}

.crush-keyboard {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.28rem !important;
    max-width: 380px !important;
    margin: 0.2rem auto !important;
}

.cw-key {
    width: clamp(28px, 8.5vw, 36px) !important;
    height: clamp(34px, 5.2vh, 40px) !important;
    border-radius: 8px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important;
    border: 1.5px solid #cbd5e1 !important;
    border-bottom: 3.5px solid #94a3b8 !important;
    font-family: inherit !important;
    font-size: clamp(1rem, 3.2vw, 1.2rem) !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15) !important;
    transition: transform 0.08s ease !important;
}

.cw-key:active {
    transform: translateY(2px) !important;
    border-bottom-width: 2px !important;
}

.cw-key.delete-key {
    background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%) !important;
    border-color: #fca5a5 !important;
    border-bottom-color: #ef4444 !important;
    color: #dc2626 !important;
}

/* ==========================================================================
   SCREEN: FULL-SCREEN QUESTIONS / QUIZ MODE (#screen-game)
   Full-screen cinematic experience with exit button & 3D tactile options
   ========================================================================== */

#screen-game.game-panel,
#screen-game.quiz-fullscreen-screen,
#screen-game {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    background: radial-gradient(circle at 50% 20%, #064e3b 0%, #022c22 45%, #020617 85%, #01040f 100%) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    font-family: 'Readex Pro', 'Cairo', sans-serif !important;
    z-index: 1000 !important;
    box-sizing: border-box !important;
}

#screen-game::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

#screen-game[style*="display: none"] {
    display: none !important;
}

body[data-grade-theme="grade9"] #screen-game {
    background: radial-gradient(circle at 50% 20%, #7c2d12 0%, #451a03 45%, #180902 85%, #090300 100%) !important;
}
body[data-grade-theme="grade12_lit"] #screen-game {
    background: radial-gradient(circle at 50% 20%, #4c1d95 0%, #2e1065 45%, #0f051d 85%, #05010b 100%) !important;
}
body[data-grade-theme="grade12_sci"] #screen-game {
    background: radial-gradient(circle at 50% 20%, #0c4a6e 0%, #082f49 45%, #020617 85%, #01030a 100%) !important;
}

.quiz-container {
    width: 100% !important;
    max-width: 396px !important;
    margin: 0 auto !important;
    padding: 0.6rem 0.75rem 2rem 0.75rem !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    box-sizing: border-box !important;
}

/* Quiz Top Control Header (Exit + Stage + Score/Hearts) - STICKY TOP */
.quiz-top-bar {
    position: sticky !important;
    top: 0 !important;
    z-index: 60 !important;
    flex-shrink: 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.35rem 0.25rem 0.2rem 0.25rem !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    box-sizing: border-box !important;
}

/* Red Exit Button (زر خروج) */
.btn-quiz-exit {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%) !important;
    border: 1.5px solid #fca5a5 !important;
    border-bottom: 3.5px solid #991b1b !important;
    border-radius: 999px !important;
    padding: 0.35rem 0.85rem !important;
    color: #ffffff !important;
    font-family: 'Cairo', 'Readex Pro', sans-serif !important;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    transition: all 0.16s ease !important;
    outline: none !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.45) !important;
    flex-shrink: 0 !important;
}

.btn-quiz-exit svg {
    width: 14px !important;
    height: 14px !important;
    fill: #ffffff !important;
}

.btn-quiz-exit:hover {
    background: #b91c1c !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.6) !important;
}

.btn-quiz-exit:active {
    transform: translateY(2px) !important;
    border-bottom-width: 1.5px !important;
}

/* Stage Name & Question Counter Capsule */
.quiz-stage-indicator {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 0.3rem !important;
    font-size: 0.85rem !important;
    font-weight: 900 !important;
    color: #f8fafc !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9) !important;
    min-width: 0 !important;
    flex: 1 !important;
    justify-content: center !important;
}

.quiz-stage-name {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 90px !important;
}

.quiz-sep {
    color: #facc15 !important;
    font-size: 0.6rem !important;
}

.quiz-progress-text {
    color: #93c5fd !important;
    font-weight: 900 !important;
    direction: ltr !important;
}

/* Stats Group: Score + Hearts */
.quiz-stats-group {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    flex-shrink: 0 !important;
}

.quiz-score-pill {
    background: rgba(250, 204, 21, 0.18) !important;
    border: 1px solid rgba(250, 204, 21, 0.4) !important;
    border-radius: 999px !important;
    padding: 0.18rem 0.45rem !important;
    color: #fef08a !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}

/* Timer Box */
.quiz-timer-box {
    background: rgba(15, 23, 42, 0.72) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 14px !important;
    padding: 0.45rem 0.85rem !important;
    box-sizing: border-box !important;
}

.quiz-timer-labels {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    color: #cbd5e1 !important;
    margin-bottom: 0.35rem !important;
}

.timer-countdown {
    color: #fef08a !important;
    font-weight: 900 !important;
}

.timer-track {
    height: 8px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: 999px !important;
    overflow: hidden !important;
}

.timer-fill {
    height: 100% !important;
    background: linear-gradient(90deg, #10b981, #facc15) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6) !important;
    transition: width 0.1s linear !important;
}

/* Powerups Row */
.quiz-powerups-row {
    display: flex !important;
    gap: 0.5rem !important;
    justify-content: center !important;
}

.quiz-powerup-btn {
    flex: 1 !important;
    max-width: 130px !important;
    background: rgba(15, 23, 42, 0.78) !important;
    backdrop-filter: blur(12px) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.18) !important;
    border-bottom: 3.5px solid rgba(0, 0, 0, 0.55) !important;
    border-radius: 999px !important;
    padding: 0.45rem 0.5rem !important;
    color: #f8fafc !important;
    font-family: 'Cairo', 'Readex Pro', sans-serif !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.3rem !important;
    cursor: pointer !important;
    transition: all 0.14s ease !important;
    outline: none !important;
}

.quiz-powerup-btn:hover:not(:disabled) {
    border-color: #facc15 !important;
    transform: translateY(-2px) !important;
    background: rgba(30, 41, 59, 0.9) !important;
}

.quiz-powerup-btn:active:not(:disabled) {
    transform: translateY(2px) !important;
    border-bottom-width: 1.5px !important;
}

.quiz-powerup-btn:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    filter: grayscale(0.8) !important;
}

/* Question Area: 3D Carved Obsidian Tablet */
.quiz-question-tablet {
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(16px) !important;
    border: 2px solid rgba(255, 255, 255, 0.18) !important;
    border-bottom: 5px solid rgba(0, 0, 0, 0.65) !important;
    border-radius: 20px !important;
    padding: 1.15rem 1rem !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6) !important;
    box-sizing: border-box !important;
}

.q-subject-tag-row {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem !important;
}

.q-subject-pill {
    background: rgba(250, 204, 21, 0.2) !important;
    border: 1px solid rgba(250, 204, 21, 0.45) !important;
    color: #fef08a !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    padding: 0.22rem 0.8rem !important;
    border-radius: 999px !important;
    display: inline-block !important;
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.4) !important;
}

.quiz-question-title {
    font-family: 'Cairo', 'Readex Pro', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 900 !important;
    line-height: 1.55 !important;
    color: #ffffff !important;
    margin-bottom: 1.15rem !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7) !important;
}

/* Options Grid: Tactile 3D Stone Buttons */
.quiz-options-grid,
#screen-game .options-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.6rem !important;
}

#screen-game .option-btn {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%) !important;
    border: 1.5px solid #cbd5e1 !important;
    border-bottom: 4px solid #94a3b8 !important;
    border-radius: 14px !important;
    padding: 0.85rem 1rem !important;
    color: #0f172a !important;
    font-family: 'Cairo', 'Readex Pro', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    transition: transform 0.1s ease, box-shadow 0.1s ease, border-color 0.1s ease !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25) !important;
    text-align: right !important;
    box-sizing: border-box !important;
}

#screen-game .option-btn:hover:not(:disabled) {
    border-color: #38bdf8 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 14px rgba(56, 189, 248, 0.35) !important;
}

#screen-game .option-btn:active:not(:disabled) {
    transform: translateY(2px) !important;
    border-bottom-width: 2px !important;
}

#screen-game .option-btn .opt-indicator {
    font-size: 1rem !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2)) !important;
}

#screen-game .option-btn.correct {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%) !important;
    border-color: #a7f3d0 !important;
    border-bottom-color: #047857 !important;
    color: #ffffff !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.6) !important;
}

#screen-game .option-btn.wrong {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%) !important;
    border-color: #fca5a5 !important;
    border-bottom-color: #991b1b !important;
    color: #ffffff !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.6) !important;
}

#screen-game .option-btn.faded {
    opacity: 0.3 !important;
    pointer-events: none !important;
    filter: grayscale(0.8) !important;
}

/* Explanation Card */
.quiz-explanation-card {
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(14px) !important;
    border: 1.5px solid #10b981 !important;
    border-radius: 14px !important;
    padding: 0.85rem !important;
    color: #f8fafc !important;
    box-sizing: border-box !important;
}

.explanation-badge {
    color: #34d399 !important;
    font-weight: 900 !important;
    margin-bottom: 0.3rem !important;
    font-size: 0.88rem !important;
}

.explanation-body {
    color: #e2e8f0 !important;
    font-size: 0.86rem !important;
    line-height: 1.5 !important;
}

/* Next Question CTA */
.btn-quiz-next {
    width: 100% !important;
    background: linear-gradient(180deg, #10b981 0%, #059669 50%, #047857 100%) !important;
    border: 2px solid #a7f3d0 !important;
    border-bottom: 5px solid #064e3b !important;
    border-radius: 999px !important;
    padding: 0.85rem !important;
    font-family: 'Cairo', 'Readex Pro', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    cursor: pointer !important;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.45) !important;
    transition: transform 0.12s ease !important;
    outline: none !important;
}

.btn-quiz-next:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.6) !important;
}

.btn-quiz-next:active {
    transform: translateY(2px) !important;
    border-bottom-width: 2px !important;
}

/* ========================================================
   Results & Certificate Victory Screen (#screen-results)
   Renders in FRONT of 3D Scene with 3D island/students in the background
   ======================================================== */
#screen-results.results-screen,
#screen-results.game-panel,
#screen-results {
    position: relative !important;
    z-index: 100 !important;
    width: 94% !important;
    max-width: 440px !important;
    margin: auto !important;
    align-self: center !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    border: 3px solid #f59e0b !important;
    border-radius: 24px !important;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(245, 158, 11, 0.35) !important;
    padding: 1rem 0.95rem 1.25rem 0.95rem !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    pointer-events: auto !important;
    animation: resultCardPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    box-sizing: border-box !important;
}

@keyframes resultCardPop {
    0% { transform: scale(0.9) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

#screen-results::-webkit-scrollbar {
    width: 4px;
}
#screen-results::-webkit-scrollbar-thumb {
    background: #f59e0b;
    border-radius: 4px;
}

.cert-name-input-block {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 0 0.85rem 0 !important;
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 14px !important;
    padding: 0.55rem 0.75rem !important;
    text-align: right !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.cert-name-label-row {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.35rem !important;
    margin-bottom: 0.4rem !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    color: #334155 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.cert-name-label-icon {
    font-size: 0.95rem !important;
}

.cert-name-label-text {
    white-space: nowrap !important;
}

.cert-name-edit-hint {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    color: #d97706 !important;
    margin-right: auto !important;
    white-space: nowrap !important;
}

#res-student-name-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 10px !important;
    border: 2px solid #e2e8f0 !important;
    text-align: center !important;
    color: #0f172a !important;
    background: #ffffff !important;
    transition: all 0.2s ease !important;
    outline: none !important;
    min-width: 0 !important;
    display: block !important;
}

#res-student-name-input:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2) !important;
    background: #ffffff !important;
}

.cert-preview-container {
    width: 100% !important;
    max-width: 420px !important;
    margin: 0.5rem auto 1rem auto !important;
    border: 2.5px solid #f59e0b !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    background: #0f172a !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 16px rgba(245, 158, 11, 0.25) !important;
    box-sizing: border-box !important;
}

#certificateCanvas {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    aspect-ratio: 16 / 11 !important;
}
