html, body, #game-container { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { touch-action: manipulation; font-family: 'Cairo', sans-serif; direction: rtl; color: #3b2a5c; }
#game-container { background: url(assets/garden-bg.webp) center/cover, #9fdcf5; position: relative; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 14px; box-sizing: border-box; overflow-y: auto; animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes bob { 50% { transform: translateY(-10px); } }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
h1, h2, .big { font-family: 'Baloo Bhaijaan 2', 'Cairo', sans-serif; margin: 6px 0; text-align: center; }
h1 { font-size: 40px; color: #fff; text-shadow: 0 4px 0 #7b4fc9, 0 6px 12px #0004; }
h2 { font-size: 30px; color: #5b2ea6; background: #fffd; padding: 4px 22px; border-radius: 30px; }
.mascot { width: 150px; animation: bob 2.4s ease-in-out infinite; }
.bubble { background: #fff; border-radius: 22px; padding: 10px 18px; font-size: 20px; font-weight: 800; box-shadow: 0 4px 0 #0002; text-align: center; }
.btn { border: 4px solid #fff; border-radius: 26px; padding: 12px 18px; font: 800 22px 'Cairo', sans-serif; color: #fff; box-shadow: 0 6px 0 #0003; min-height: 60px; cursor: pointer; transition: transform .1s; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #0003; }
.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 520px; margin-top: 10px; }
.menu .wide { grid-column: span 2; font-size: 28px; }
.c0 { background: #ff8a5c; } .c1 { background: #4cc38a; } .c2 { background: #5aa9f0; } .c3 { background: #b07cf0; } .c4 { background: #f5b82e; } .c5 { background: #f06f9b; } .c6 { background: #2fc0c0; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; max-width: 520px; }
.tile { background: #fff; border-radius: 20px; font: 800 44px 'Baloo Bhaijaan 2', sans-serif; text-align: center; padding: 6px 0; box-shadow: 0 5px 0 #0002; border: 4px solid #ffd76a; cursor: pointer; position: relative; min-height: 64px; }
.tile.learned::after { content: '⭐'; position: absolute; top: -6px; left: -4px; font-size: 18px; }
.tile.sel { border-color: #5aa9f0; background: #e4f2ff; }
.tile.ok { border-color: #4cc38a; background: #dcf7e8; animation: pop .4s; }
.tile.no { animation: shake .3s; }
.tile.done { opacity: .35; pointer-events: none; }
.card { background: #fffe; border-radius: 28px; padding: 14px; width: 100%; max-width: 520px; box-sizing: border-box; text-align: center; box-shadow: 0 6px 0 #0002; margin: 8px 0; }
.giant { font: 800 130px/1.2 'Baloo Bhaijaan 2', sans-serif; color: #ff6f3c; animation: pop .5s; }
.emoji { font-size: 90px; animation: pop .5s; }
.forms { display: flex; justify-content: center; gap: 10px; font: 800 34px 'Cairo'; }
.forms span { background: #f3eaff; border-radius: 14px; padding: 2px 12px; }
.forms small { display: block; font-size: 13px; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; width: 100%; max-width: 520px; }
.top { display: flex; justify-content: space-between; width: 100%; max-width: 520px; align-items: center; }
.back { background: #fff; color: #5b2ea6; border-color: #b07cf0; padding: 6px 16px; min-height: 52px; }
.stars { background: #fff; border-radius: 20px; padding: 6px 14px; font-weight: 800; font-size: 20px; }
#toast { position: fixed; top: 40%; left: 50%; transform: translate(-50%,-50%); font: 800 40px 'Baloo Bhaijaan 2'; color: #fff; text-shadow: 0 4px 0 #7b4fc9; pointer-events: none; z-index: 9; animation: pop .5s; }
.confetti { position: fixed; top: -20px; font-size: 26px; pointer-events: none; z-index: 8; transition: transform 1.6s ease-out, opacity 1.6s; }
.stat { display: flex; justify-content: space-between; font-size: 20px; font-weight: 800; padding: 8px 4px; border-bottom: 2px dashed #e5d8ff; }
.bar { height: 22px; background: #eee; border-radius: 12px; overflow: hidden; } .bar div { height: 100%; background: linear-gradient(90deg,#4cc38a,#f5b82e); }
.trace-entry { margin: 8px 0 12px; width: min(100%, 520px); }
.trace-hint { margin: 4px 0 14px; }
.trace-coach { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 520px; margin: 2px 0 8px; }
.trace-owl { width: 66px; height: 76px; object-fit: contain; animation: bob 2.4s ease-in-out infinite; }
.trace-coach .bubble { font-size: 16px; padding: 8px 12px; }
.trace-board { width: min(100%, 520px); height: clamp(220px, 38vh, 320px); border: 5px solid #fff; border-radius: 26px; overflow: hidden; box-shadow: 0 6px 0 #0002; background: #fffdf7; box-sizing: border-box; }
.trace-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.trace-meter { width: min(100%, 520px); box-sizing: border-box; margin: 10px 0; padding: 9px 12px; border-radius: 18px; background: linear-gradient(90deg, #bdf1d1 var(--trace-progress, 0%), #fff var(--trace-progress, 0%)); border: 2px solid #fff; text-align: center; font-weight: 800; font-size: 16px; }
.trace-actions { margin: 4px 0; }
.trace-actions .btn { min-height: 54px; padding: 8px 13px; font-size: 18px; }
