/* Four doors, hubs, passport, channel, games, drawing, discover, store. Tokens come from style.css. */
.passport-pill{display:inline-flex;align-items:center;gap:6px;background:var(--butter)!important;border-color:var(--plate-butter)!important;font-weight:800;font-size:16px!important}
.passport-pill .star-icon{width:20px;height:20px;color:var(--gold)}
.doors{grid-template-columns:repeat(4,minmax(0,1fr))}
.door-svg{width:86%;height:100%}
.hub-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.hub .cell-art{height:170px}
.art-missing{background:var(--paper);position:relative}
.art-missing::after{content:"رسمه قادم";position:absolute;inset:0;display:grid;place-items:center;color:var(--ink-soft);font-size:14px;font-weight:700;border:3px dashed var(--line);border-radius:18px;margin:6px}
.toast{position:fixed;inset-inline:0;bottom:24px;margin:auto;width:max-content;max-width:calc(100% - 32px);display:flex;align-items:center;gap:8px;background:var(--ink);color:#fff;font-weight:800;padding:10px 20px;border-radius:99px;box-shadow:0 12px 30px #2a2f5a55;z-index:20;animation:toast-in .4s cubic-bezier(.22,1,.36,1)}
.toast .star-icon{width:22px;height:22px;color:#ffc23d}
@keyframes toast-in{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}

/* Channel card */
.channel-card{margin-top:28px;background:var(--paper);border:var(--keyline);border-radius:var(--radius);box-shadow:var(--lift);padding:18px}
.channel-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.channel-head h2{margin:0;font-size:22px}
.channel-badge{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:var(--blush);color:#e5484d}
.channel-badge svg{width:28px;height:28px}
.channel-body{display:grid;grid-template-columns:minmax(0,320px) minmax(0,1fr);gap:16px;align-items:center}
.channel-play{position:relative;padding:0;border:var(--keyline);border-radius:20px;overflow:hidden;aspect-ratio:16/9;background:var(--sky);min-height:0}
.channel-play img{width:100%;height:100%;object-fit:cover;display:block}
.play-disc{position:absolute;inset:0;margin:auto;width:64px;height:64px;display:grid;place-items:center;border-radius:50%;background:var(--ribbon);color:#fff;box-shadow:0 6px 16px #0004}
.play-disc svg{width:30px;height:30px}
.channel-title{font-weight:700;color:var(--ink);margin:0}
.channel-msg{margin:0;grid-column:1/-1}
.channel-frame{grid-column:1/-1;width:100%;aspect-ratio:16/9;border:0;border-radius:20px;background:#000}

/* Story flip + narration */
.page-story[data-flip=next] .story-layout{animation:flip-next .45s cubic-bezier(.22,1,.36,1)}
.page-story[data-flip=prev] .story-layout{animation:flip-prev .45s cubic-bezier(.22,1,.36,1)}
@keyframes flip-next{from{opacity:0;transform:perspective(900px) rotateY(-28deg) translateX(-30px)}to{opacity:1;transform:none}}
@keyframes flip-prev{from{opacity:0;transform:perspective(900px) rotateY(28deg) translateX(30px)}to{opacity:1;transform:none}}
.page-story{touch-action:pan-y;user-select:none}
.narration{display:flex;flex-direction:column;align-items:center;gap:4px;margin-top:14px}
.narrate-btn{display:inline-flex;align-items:center;gap:8px;border-radius:99px}

/* Shared game card */
.game-card{max-width:820px;margin:auto;border:var(--keyline);text-align:center}
.page-inventor{background:var(--lilac)}.page-space{background:var(--sky)}
.game-head{display:flex;justify-content:space-between;align-items:center;gap:12px;text-align:start}
.game-head h2{margin:6px 0 0}
.guide{margin:0;display:grid;justify-items:center;flex:none}
.guide img{width:76px;height:76px;border-radius:50%;object-fit:cover;object-position:50% 20%;border:var(--keyline);box-shadow:var(--lift);background:var(--paper)}
.guide .plate{font-size:15px;padding:0 12px;margin-top:-10px;position:relative}
.guide.art-missing{background:transparent}
.guide.art-missing::after{inset:0 0 auto;width:76px;height:76px;margin:0 auto;border-radius:50%;font-size:11px;background:var(--paper)}
.guide.art-missing .plate{margin-top:66px}
.game-msg{min-height:28px;font-weight:700;color:var(--ink);margin:12px 0}
.puzzle-dots{display:flex;justify-content:center;gap:8px;margin-top:16px;flex-wrap:wrap}
.puzzle-dots button{width:44px;height:44px;min-height:44px;padding:0;border-radius:50%}
.puzzle-dots [aria-current=true]{border-color:var(--ribbon);border-width:3px}
.puzzle-dots [data-done]{background:var(--plate-mint)}

/* Inventor */
.legend{font-size:13px;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;margin:12px 0}
.port{display:inline-block;width:14px;height:14px;border-radius:50%;border:2px solid var(--ink);background:var(--paper);flex:none}
.port-power{background:#ffd23f}.port-spin{background:#4f9de8}.port-air{background:#7fe3d0}.port-light{background:#fff3a6}.port-bubbles{background:#ff9cc6}.port-lift{background:#c9a27a}.port-none{visibility:hidden}
.goal.port-light,.goal.port-air,.goal.port-bubbles,.goal.port-lift{visibility:visible}
.machine{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;background:var(--paper);border-radius:22px;padding:14px;min-height:130px}
.slot{display:grid;place-items:center;width:96px;height:104px;border:3px dashed var(--plate-lilac);border-radius:18px;color:var(--ink-soft);font-weight:800}
.joint{width:10px;height:4px;background:var(--line);border-radius:4px}
.goal{display:grid;place-items:center;width:auto;height:48px;min-width:70px;padding:0 12px;border-radius:99px;font-weight:800;border:3px solid var(--ink)}
.part{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;width:96px;height:104px;min-height:0;padding:4px;border:var(--keyline);border-radius:18px;background:var(--butter);box-shadow:0 4px 10px #2a2f5a14}
.part svg{width:52px;height:52px;color:var(--ink)}
.part-name{font-size:13px;font-weight:800;line-height:1.3}
.part .port{position:absolute;top:44px}
.part .port-in{inset-inline-start:-8px}.part .port-out{inset-inline-end:-8px}
.part[data-broken]{border-color:#e5484d;animation:shake .4s}
@keyframes shake{25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}
.tray{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;margin-top:6px;min-height:110px}
.page-inventor[data-result=ok] .machine{background:var(--mint);box-shadow:0 0 0 4px var(--leaf) inset}

/* Space */
.route{display:flex;align-items:center;justify-content:center;gap:4px;margin:14px 0}
.route-stop{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:var(--paper);border:3px solid var(--plate-sky);font-weight:800}
.route-stop.is-here{border-color:var(--ribbon)}.route-stop.is-done{background:var(--plate-mint);border-color:var(--leaf)}
.route-end svg{width:20px;height:20px;color:var(--ink)}
.route-line{width:22px;height:4px;background:var(--plate-sky);border-radius:4px}
.paths{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.path-btn{display:flex;flex-direction:column;align-items:center;gap:8px;background:var(--tint);border:var(--keyline);border-radius:var(--radius);padding:18px 10px;box-shadow:var(--lift)}
.planet-dot{width:72px;height:72px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff 0 8%,var(--flag) 9% 100%);box-shadow:inset -8px -8px 0 #0002}
.sequence,.answers{display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin:10px 0}
.token{display:grid;place-items:center;width:56px;height:56px;background:var(--paper);border-radius:16px;font-size:26px;font-weight:800}
.token svg,.token-btn svg{width:40px;height:40px}
.token-q{background:var(--butter);border:3px dashed var(--gold)}
.token-btn{width:76px;height:76px;padding:0;font-size:30px;border:var(--keyline);border-radius:20px;background:var(--butter)}
.token-btn.is-right{background:var(--plate-mint);border-color:var(--leaf)}
.token-btn.is-wrong{background:var(--blush);border-color:#e5484d;animation:shake .4s}
.q{font-weight:700;color:var(--ink);margin:10px 0}
.mission-done{display:grid;justify-items:center;gap:8px;padding:12px}

/* Drawing */
.page-draw{max-width:860px;margin:auto;border:var(--keyline);text-align:center}
.page-draw.tint-mint{background:var(--mint)}.page-draw.tint-blush{background:var(--blush)}.page-draw.tint-sky{background:var(--sky)}
.trace-step{font-weight:700;color:var(--ink)}
.trace-step b{font-size:26px}
.board{position:relative;width:100%;border-radius:22px;overflow:hidden;border:var(--keyline);box-shadow:var(--lift);background:#fff;line-height:0}
.board canvas{display:block;touch-action:none}
#lines{position:absolute;inset:0;pointer-events:none}
.toolbar{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;margin-top:12px}
.swatches{display:flex;flex-wrap:wrap;gap:6px}
.swatch{width:36px;height:36px;min-height:36px;padding:0;border-radius:50%;background:var(--sw)!important;border:3px solid var(--paper);box-shadow:0 2px 5px #2a2f5a33}
.swatch.is-on{outline:3px solid var(--ink);outline-offset:1px}
.swatch-locked{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;border:2px dashed var(--ink-soft);font-size:12px;font-weight:800;color:var(--ink-soft)}
.tools{display:flex;gap:6px}
.tool,.size{width:46px;height:46px;min-height:46px;padding:0;display:grid;place-items:center;border-radius:14px}
.tool svg{width:24px;height:24px}
.tool[aria-pressed=true],.tool.is-on,.size.is-on{background:var(--plate-lilac);border-color:var(--flag-lilac)}
.size span{display:block;width:var(--d);height:var(--d);border-radius:50%;background:var(--ink)}
.gallery-title{margin:22px 0 8px;font-size:18px}
.gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.gallery figure{margin:0;background:var(--paper);border-radius:16px;padding:6px;box-shadow:0 2px 8px #2a2f5a14}
.gallery img{width:100%;border-radius:12px;display:block}
.gallery p{grid-column:1/-1}

/* Discover */
.discover h2{margin:18px 0 12px}
.land-map{background:var(--sky);border:var(--keyline);border-radius:var(--radius);padding:18px;display:grid;justify-items:center;gap:10px;box-shadow:var(--lift)}
.land-map-empty img{width:min(260px,70%)}
.char-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.char-card{max-width:520px;margin:auto;text-align:center;border:var(--keyline)}
.char-card.tint-lilac{background:var(--lilac)}.char-card.tint-sky{background:var(--sky)}
.char-art{margin:0 auto 12px;max-width:320px;display:grid;justify-items:center}
.char-art img{width:100%;aspect-ratio:1;object-fit:cover;object-position:50% 25%;border-radius:24px;border:var(--keyline);box-shadow:var(--lift)}
.char-art.art-missing{width:100%;aspect-ratio:1;border-radius:24px}
.char-art .plate{margin-top:-18px;position:relative;z-index:1;border:3px solid var(--paper)}
.char-art.art-missing .plate{position:absolute;bottom:-14px}
.char-links{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px}
.door-mini{min-height:64px;border:var(--keyline);border-radius:20px;font-size:18px;font-weight:800}
.door-play{background:var(--butter)}.door-listen{background:var(--lilac)}.door-draw{background:var(--blush)}

/* Passport */
.passport{max-width:860px;margin:auto;border:var(--keyline);background:var(--butter)}
.passport-head{display:flex;align-items:center;gap:16px;text-align:start}
.passport-head h2{margin:0}
.star-pill.big{font-size:32px;padding:6px 20px}
.star-pill.big .star-icon{width:32px;height:32px}
.next-unlock{color:var(--ink);font-weight:600;margin-top:14px}
.unlock-bar{appearance:none;width:100%;height:12px;border:0;border-radius:99px;background:var(--paper);overflow:hidden}
.unlock-bar::-webkit-progress-bar{background:var(--paper)}
.unlock-bar::-webkit-progress-value{background:var(--ribbon);border-radius:99px}
.unlock-bar::-moz-progress-bar{background:var(--ribbon);border-radius:99px}
.passport h3{margin:22px 0 10px}
.badges,.unlocks{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:12px}
.badge,.unlock{display:grid;justify-items:center;gap:4px;text-align:center;background:var(--paper);border-radius:20px;padding:14px 8px;filter:grayscale(1);opacity:.6}
.badge.is-earned,.unlock.is-open{filter:none;opacity:1;box-shadow:var(--lift)}
.badge small,.unlock small{font-size:12px;color:var(--ink-soft);line-height:1.4}
.badge-disc{display:grid;place-items:center;width:60px;height:60px;border-radius:50%;background:var(--plate-butter);border:3px solid var(--gold)}
.badge-disc .star-icon{width:32px;height:32px;color:var(--gold)}
.mini-palette{display:flex;gap:3px}.mini-palette i{width:18px;height:40px;border-radius:9px}
.sticker{display:grid;place-items:center;width:64px;height:64px;border-radius:50%;overflow:hidden;border:3px solid var(--paper);box-shadow:0 2px 6px #2a2f5a26;background:var(--lilac)}
.sticker img{width:100%;height:100%;object-fit:cover;object-position:50% 20%}
.sticker.art-missing::after{display:none}
.sticker small{font-size:10px}

/* Store (parents) */
.store{margin-top:22px;background:var(--paper)}
.store-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.store-item{display:grid;justify-items:center;gap:4px;background:var(--ground);border:3px dashed var(--line);border-radius:20px;padding:16px}
.store-slot{display:grid;place-items:center;width:56px;height:56px;border-radius:16px;background:var(--lilac);font-weight:800}

@media(max-width:720px){
 .doors,.hub-grid,.char-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .hub .cell-art{height:110px}
 .channel-body{grid-template-columns:1fr}
 .gallery{grid-template-columns:repeat(3,minmax(0,1fr))}
 .part,.slot{width:78px;height:90px}
 .part svg{width:40px;height:40px}
 .part .port{top:36px}
 .store-grid{grid-template-columns:1fr}
 .header-actions{flex-wrap:wrap;justify-content:flex-end}
 .passport-head{flex-direction:column;text-align:center}
}
@media(prefers-reduced-motion:reduce){.page-story .story-layout,.toast,.part[data-broken],.token-btn.is-wrong{animation:none!important}}

/* Fix pass: compact phone header, missing guide art, path plates */
.guide{position:relative}
.guide.art-missing{width:80px;height:96px}
.guide.art-missing::after{content:"";inset:0 2px 18px;margin:0;border-radius:50%;background:var(--paper)}
.guide.art-missing .plate{position:absolute;bottom:0;inset-inline:0;margin:auto;width:max-content;z-index:1}
.path-btn .plate{font-size:18px;padding-inline:14px}
@media(max-width:720px){
 #mute span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 #mute{padding-inline:12px}
 .header-actions{flex-wrap:nowrap}
}

/* Age picker, play hub by age, mini games */
.age-pick{max-width:860px;margin:auto;text-align:center;border:var(--keyline);background:var(--paper)}
.age-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:16px}
.age-btn .cell-art{height:150px}
.face{width:100%;height:100%;object-fit:cover;object-position:50% 18%;border-radius:18px}
.cell-art .face{background:var(--paper)}
.age-bar{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.char-thumb{object-position:50% 15%}
.mini-game{background:var(--butter)}
.round-dots{display:flex;gap:6px;margin-top:6px}
.round-dots i{width:12px;height:12px;border-radius:50%;background:var(--paper);border:2px solid var(--plate-butter)}
.round-dots i.is-done{background:var(--leaf);border-color:var(--leaf)}.round-dots i.is-here{border-color:var(--ribbon)}
.answers.big .token-btn{width:112px;height:112px;background:var(--paper)}
.answers.big .token-btn svg{width:70px;height:70px}
.answers.big .token-btn b{font-size:40px;line-height:1}
.opt{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;overflow:hidden}
.opt img{width:100%;height:100%;object-fit:contain}
.opt .face{height:76px;width:76px;border-radius:50%}
.opt span{font-size:14px;font-weight:800}
.dots{display:flex;flex-wrap:wrap;justify-content:center;gap:3px;max-width:60px}
.dots i{width:8px;height:8px;border-radius:50%;background:var(--ink)}
.blob-target{width:120px;height:120px;margin:10px auto;background:var(--paper);border-radius:28px;display:grid;place-items:center}
.blob-target svg{width:90px;height:90px}
.count-field{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;max-width:420px;margin:10px auto;background:var(--paper);border-radius:22px;padding:14px}
.count-field svg{width:44px;height:44px}
.count-field.small svg{width:30px;height:30px}
.plus{font-size:30px;font-weight:800;align-self:center}
.shadow-box{width:150px;height:170px;margin:10px auto;background:var(--paper);border-radius:24px;overflow:hidden;display:grid;place-items:center}
.is-shadow{filter:blur(9px) saturate(1.3);transform:scale(1.15);object-position:50% 0!important}
.clue-letter{display:grid;place-items:center;width:110px;height:110px;margin:10px auto;border-radius:28px;background:var(--paper);font-size:72px;font-weight:800;line-height:1}
.sum{font-size:44px;font-weight:800;margin:10px 0;direction:rtl}
.memory-grid{display:grid;gap:10px;margin:14px auto;max-width:560px}
.memory-grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.memory-grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.mem-card{aspect-ratio:3/4;min-height:0;padding:6px;border:var(--keyline);border-radius:18px;background:var(--lilac);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;overflow:hidden}
.mem-card .face{height:75%;border-radius:12px}
.mem-card span{font-size:13px;font-weight:800}
.mem-back{width:60%;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff 0 10%,var(--flag-lilac) 11% 100%)}
.mem-card.is-up{background:var(--paper)}.mem-card.is-matched{background:var(--plate-mint);border-color:var(--leaf)}
.word-pic{width:150px;height:150px;margin:8px auto;background:var(--paper);border-radius:24px;display:grid;place-items:center}
.word-pic img{width:85%;height:85%;object-fit:contain}
.word-built{display:flex;justify-content:center;gap:8px;margin:10px 0}
.slot-letter{display:grid;place-items:center;width:62px;height:66px;border:3px dashed var(--plate-butter);border-radius:16px;background:var(--paper);font-size:36px;font-weight:800}
.built-word{font-size:34px}
.letter-tile{font-size:38px}
.pic-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;max-width:400px;margin:12px auto;padding:8px;background:var(--ink);border-radius:20px}
.pic-grid .grid-cell:nth-child(4n+2){margin-inline-end:6px}
.pic-grid .grid-cell:nth-child(n+5):nth-child(-n+8){margin-bottom:6px}
.grid-cell{aspect-ratio:1;min-height:0;padding:3px;border:0;border-radius:12px;background:var(--paper)}
.grid-cell.is-fixed{background:var(--plate-butter)}
.grid-cell:disabled{opacity:1;filter:none}
.grid-cell .face{border-radius:10px}
.grid-legend{display:flex;justify-content:center;flex-wrap:wrap;gap:10px}
.grid-legend span{display:flex;align-items:center;gap:4px;font-weight:700;font-size:14px}
.grid-legend .face{width:34px;height:34px;border-radius:50%}
@media(max-width:720px){
 .age-grid{grid-template-columns:1fr}
 .age-btn{flex-direction:row;justify-content:flex-start;gap:12px;text-align:start}
 .age-btn .cell-art{width:96px;height:96px;flex:none}
 .answers.big .token-btn{width:96px;height:96px}
 .slot-letter{width:52px;height:58px;font-size:30px}
}

.char-thumb,.cell-face,.age-btn .face{object-position:50% 0!important}
