@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@500;600;700;800;900&family=Nunito:wght@700;800;900&display=swap');
:root{--ink:#211a46;--muted:#6b6788;--purple:#7055d8;--pink:#f2789d;--yellow:#ffc94f;--mint:#7bd9c2;--cream:#fffaf0;--shadow:0 18px 40px #1e165326}*{box-sizing:border-box}html{background:#201a4b}body{margin:0;min-height:100vh;font-family:Cairo,Tahoma,sans-serif;color:var(--ink);background:radial-gradient(circle at 10% 0,#7467df 0 16%,transparent 42%),linear-gradient(145deg,#f8f3ff 0%,#fff8e9 50%,#e4fbf8 100%);background-attachment:fixed}button,a{font:inherit}button{cursor:pointer}.topbar{height:72px;padding:12px clamp(14px,4vw,64px);display:flex;align-items:center;justify-content:space-between;gap:16px;background:#211a46;color:white;box-shadow:0 5px 0 #15112f;position:sticky;top:0;z-index:10}.brand{display:flex;align-items:center;gap:9px;font-weight:900}.brand small{font:900 10px Nunito,Arial;letter-spacing:.18em;color:#ffd66b;display:block}.brand-mark{display:grid;place-items:center;width:38px;height:38px;border-radius:13px;background:linear-gradient(145deg,#ffd65c,#f27a9c);font-size:23px;color:white;box-shadow:0 4px 0 #bd5379}.back,.sound-btn{border:2px solid #ffffff33;border-radius:999px;padding:9px 14px;color:white;text-decoration:none;background:#ffffff12;font-weight:800}.sound-btn{font-size:.86rem}.page-shell{width:min(1500px,100%);margin:auto;padding:26px clamp(12px,4vw,64px) 60px}.hero-panel{min-height:290px;border-radius:34px;padding:32px clamp(22px,5vw,70px);display:flex;align-items:center;justify-content:space-between;gap:30px;overflow:hidden;background:linear-gradient(125deg,#fff4d3 0%,#ffe8ef 48%,#dbf9f2 100%);border:5px solid white;box-shadow:var(--shadow);position:relative}.hero-panel:before{content:"";position:absolute;inset:auto -40px -90px auto;width:310px;height:210px;background:#ffffff77;border-radius:50%;transform:rotate(-18deg)}.hero-copy{max-width:690px;position:relative;z-index:1}.eyebrow,.modal-kicker{display:inline-block;background:#7055d8;color:white;padding:6px 15px;border-radius:99px;font-size:.82rem;font-weight:900;box-shadow:0 4px 0 #4a3aa1}.hero-copy h1{font-size:clamp(2rem,4.5vw,4rem);line-height:1.1;margin:16px 0 8px;color:#2b215d}.hero-copy h1 b{display:block;font:900 clamp(.85rem,1.7vw,1.45rem) Nunito,Arial;letter-spacing:.22em;color:#e46793;margin-top:7px;direction:ltr;text-align:right}.hero-copy p{font-size:1.1rem;font-weight:700;color:#5e577d;max-width:590px}.hero-actions,.modal-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:20px}.primary-btn,.ghost-btn,.tool-btn{border:0;border-radius:16px;padding:12px 19px;font-weight:900;min-height:50px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px}.primary-btn{background:linear-gradient(135deg,#f4789c,#dd5481);color:white;box-shadow:0 5px 0 #b33e67}.ghost-btn{background:white;color:#5942be;border:3px solid #e3dafa;box-shadow:0 4px 0 #d0c5f2}.hero-scene{width:330px;height:230px;flex:none;border-radius:30px;background:linear-gradient(#9cecf0,#d8fbf1 62%,#8bd28c 63%);position:relative;box-shadow:inset 0 -15px #59af7d;transform:rotate(2deg);border:6px solid white}.cloud{position:absolute;width:98px;height:30px;border-radius:30px;background:white;opacity:.75}.cloud:before,.cloud:after{content:"";position:absolute;background:white;border-radius:50%}.cloud:before{width:44px;height:44px;left:18px;bottom:7px}.cloud:after{width:32px;height:32px;left:55px;bottom:6px}.c1{top:30px;right:28px}.c2{top:60px;left:22px;transform:scale(.65)}.bookshelf{position:absolute;bottom:24px;left:42px;width:245px;height:148px;padding:12px 14px;background:#91572e;border:7px solid #66371e;border-radius:15px;box-shadow:0 9px 0 #5d942e}.bookshelf i{display:inline-block;width:25px;height:74px;margin:4px 3px;background:#ee617f;border-radius:5px 5px 2px 2px;box-shadow:inset 4px 0 #fff4;transform:rotate(-3deg)}.bookshelf i:nth-child(2){height:96px;background:#5c86e5}.bookshelf i:nth-child(3){height:65px;background:#ffc94f}.bookshelf i:nth-child(4){height:85px;background:#65c99b}.bookshelf span{position:absolute;right:12px;bottom:7px;font-size:30px}.hero-star{position:absolute;right:28px;bottom:57px;font-size:55px;color:#ffd047;filter:drop-shadow(0 5px 0 #dd9c2e);animation:float 2.5s ease-in-out infinite}@keyframes float{50%{transform:translateY(-10px) rotate(10deg)}}.library-layout{display:grid;grid-template-columns:315px 1fr;gap:22px;margin-top:24px;align-items:start}.control-card,.game-card{background:#ffffffd9;border:4px solid white;border-radius:28px;box-shadow:var(--shadow);backdrop-filter:blur(8px)}.control-card{padding:18px}.mascot-line{display:flex;gap:10px;align-items:center;background:#fff5c9;border-radius:20px;padding:10px;border:2px solid #f7d86d}.mascot-face{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#ffd84d,#f2789d);color:white;font-size:1.8rem;font-weight:900;box-shadow:0 4px 0 #c65a77}.mascot-line p{margin:3px 0 0;font-size:.9rem;color:#675d74;font-weight:700}.control-section{border-top:2px dashed #ddd6f2;margin-top:16px;padding-top:14px}.control-section h2{font-size:1.03rem;margin:0 0 10px}.picture-list{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.picture-btn{position:relative;border:3px solid transparent;padding:4px;border-radius:13px;background:#f7f3ff;min-width:0;color:var(--ink);text-align:right}.picture-btn.active{border-color:#f2789d;background:#fff2f6;box-shadow:0 3px 0 #f8bacb}.picture-btn img{display:block;width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:9px;filter:saturate(.8) sepia(.08)}.picture-btn span{display:block;font-size:.65rem;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:3px 2px 0}.picture-btn em{position:absolute;top:6px;right:6px;background:#7055d8;color:white;border-radius:99px;padding:1px 5px;font-size:.65rem;font-style:normal}.difficulty-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}.diff-btn{background:#f7f5ff;border:3px solid #e6defb;border-radius:14px;padding:9px 6px;color:#4e4383;font-weight:900;font-size:.82rem}.diff-btn small{display:block;color:#8880a2;font-size:.68rem}.diff-btn.active{background:#7055d8;border-color:#7055d8;color:white;box-shadow:0 4px 0 #4b389e}.diff-btn.active small{color:#eee6ff}.compact-controls{display:grid;grid-template-columns:1fr 1fr;gap:8px}.tool-btn{min-height:42px;padding:8px 6px;font-size:.78rem;background:#f4f0ff;color:#5f4bc1;border:2px solid #e1d9fa}.timer-toggle{grid-column:span 2;display:flex;align-items:center;justify-content:center;gap:7px;font-size:.82rem;font-weight:800;color:#6d6684;padding:6px}.best-card{margin-top:15px;background:linear-gradient(135deg,#fff3b1,#ffdfed);border-radius:16px;padding:10px 13px;display:grid;grid-template-columns:1fr auto;align-items:center}.best-card span{font-weight:900;font-size:.8rem}.best-card strong{font-size:1.4rem;color:#de5e89}.best-card small{grid-column:1/-1;color:#81758e;font-size:.7rem}.game-card{padding:22px;min-width:0}.game-header{display:flex;align-items:start;justify-content:space-between;gap:14px}.round-label{color:#755ed0;font-weight:900;font-size:.85rem}.game-header h2{font-size:clamp(1.2rem,2.5vw,2rem);margin:3px 0 0}.stats{display:flex;gap:8px;direction:rtl}.stats div{min-width:68px;text-align:center;background:#fff6cf;border-radius:13px;padding:5px 9px}.stats div+div{background:#dff9f0}.stats span{display:block;font-size:.65rem;color:#766f88}.stats b{font-size:1rem}.progress-track{height:10px;background:#eee9fa;border-radius:99px;margin:15px 0;overflow:hidden}.progress-track i{display:block;height:100%;width:0;background:linear-gradient(90deg,#70d7ba,#f7bd50,#f2789d);border-radius:inherit;transition:width .35s}.preview-note{background:#f3efff;color:#6d6095;border-radius:12px;padding:7px 12px;font-size:.8rem;font-weight:800;margin-bottom:14px}.board-wrap{width:min(100%,760px);margin:auto;position:relative;aspect-ratio:4/3;background:#e9e2cf;border:9px solid #fff;border-radius:22px;box-shadow:inset 0 0 0 3px #ccbda1,0 10px 24px #36245a24;overflow:hidden}.puzzle-board{position:absolute;inset:0;display:grid}.slot{position:relative;border:1px dashed #bcae93;background:#f1eadb}.slot:after{content:"";position:absolute;inset:8%;border:2px dashed #cfc1a6;border-radius:10px}.piece{touch-action:none;user-select:none;background-repeat:no-repeat;background-size:100% 100%;border:3px solid white;border-radius:10px;box-shadow:0 4px 0 #75614b55,0 7px 12px #2d204333;cursor:grab;z-index:2;transition:transform .16s,box-shadow .16s;position:relative}.piece:after{content:"";position:absolute;inset:0;border-radius:7px;background:linear-gradient(135deg,#fff7 0 12%,transparent 35% 70%,#0001)}.piece.dragging{cursor:grabbing;z-index:30;transform:scale(1.06) rotate(2deg);box-shadow:0 12px 20px #2d204355}.piece.locked{cursor:default;border-color:#ffe187;box-shadow:0 0 0 3px #ffe187aa,0 5px 0 #8b744f55}.piece-tray{min-height:132px;padding:12px;display:grid;grid-template-columns:repeat(auto-fill,minmax(82px,1fr));gap:10px;background:#f7f1ff;border-radius:18px;border:3px dashed #d4c7f2;max-width:100%;touch-action:none}.piece-tray .piece{width:100%;aspect-ratio:4/3}.tray-title{display:flex;justify-content:space-between;align-items:center;margin:15px 0 8px;font-weight:900}.tray-title small{font-size:.72rem;color:#8a829e}.hint-overlay{position:absolute;inset:0;background-size:100% 100%;background-position:center;background-repeat:no-repeat;opacity:.32;z-index:5;pointer-events:none;animation:hintpulse 1.2s ease-in-out infinite}@keyframes hintpulse{50%{opacity:.16}}.modal{position:fixed;inset:0;z-index:50;background:#201a4bcc;display:grid;place-items:center;padding:18px}.modal-box{width:min(480px,100%);background:#fffaf0;border:5px solid white;border-radius:30px;box-shadow:0 20px 70px #130d3777;text-align:center;padding:24px;animation:pop .35s ease-out}.modal-box h2{margin:10px 0 4px;font-size:1.8rem}.modal-box p{color:#6b6380;font-weight:700}.preview-image{width:min(100%,360px);aspect-ratio:4/3;margin:15px auto 8px;border:7px solid white;border-radius:18px;background-size:100% 100%;background-position:center;box-shadow:0 5px 0 #d8c9ae}.win-box{background:linear-gradient(#fffaf0,#fff0f8)}.confetti-emoji{font-size:2rem}.win-stars{font-size:2rem;letter-spacing:8px;margin:8px}.win-stats{display:inline-flex;gap:9px;background:#fff;padding:8px 14px;border-radius:14px;color:#655985;font-weight:800}.toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,20px);opacity:0;background:#211a46;color:#fff;padding:12px 18px;border-radius:99px;font-weight:800;z-index:80;transition:.25s;pointer-events:none}.toast.show{opacity:1;transform:translate(-50%,0)}[hidden]{display:none!important}@keyframes pop{from{transform:scale(.8);opacity:0}}
@media(max-width:1000px){.library-layout{grid-template-columns:260px 1fr}.hero-scene{width:270px}.picture-list{grid-template-columns:repeat(3,1fr)}}@media(max-width:760px){.topbar{height:auto;min-height:64px;flex-wrap:wrap;justify-content:center}.brand{order:-1;width:100%;justify-content:center}.back,.sound-btn{font-size:.75rem}.hero-panel{padding:22px;min-height:0}.hero-scene{display:none}.library-layout{display:block}.control-card{margin-bottom:18px}.picture-list{grid-template-columns:repeat(5,1fr)}.picture-btn span{font-size:.56rem}.game-card{padding:13px}.game-header{display:block}.stats{margin-top:10px;justify-content:flex-start}.piece-tray{grid-template-columns:repeat(auto-fill,minmax(66px,1fr));gap:7px}.tray-title{font-size:.85rem}.tray-title small{font-size:.66rem}}@media(max-width:470px){.page-shell{padding-inline:8px}.hero-copy h1{font-size:1.9rem}.picture-list{grid-template-columns:repeat(5,1fr);gap:5px}.picture-btn{padding:2px;border-width:2px}.picture-btn em{font-size:.5rem;top:3px;right:3px}.difficulty-list{grid-template-columns:repeat(4,1fr)}.diff-btn{padding:7px 2px;font-size:.68rem}.diff-btn small{font-size:.57rem}.board-wrap{border-width:6px}.piece-tray{min-height:110px;grid-template-columns:repeat(auto-fill,minmax(56px,1fr));padding:8px;gap:5px}.piece{border-width:2px;border-radius:7px}.game-card{border-radius:20px}.hero-actions .primary-btn,.hero-actions .ghost-btn{flex:1}.modal-box{padding:18px}}
