@import "https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap";:root{--font-main:"Fredoka", system-ui, -apple-system, sans-serif;--bg-gradient:linear-gradient(135deg, #dbeafe 0%, #fef3c7 50%, #fed7aa 100%);--q-blue:#2563eb;--q-bg:#eff6ff;--a-orange:#ea580c;--a-bg:#fff7ed;--match-green:#10b981;--match-bg:#ecfdf5;--text-dark:#1e293b}*{box-sizing:border-box;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;margin:0;padding:0}html,body{width:100%;height:100dvh;min-height:100dvh;max-height:100dvh;font-family:var(--font-main);background:var(--bg-gradient);color:var(--text-dark);touch-action:manipulation;overscroll-behavior:none;overflow:hidden}#app{width:100%;height:100dvh;min-height:100dvh;max-height:100dvh;padding:max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));touch-action:manipulation;overscroll-behavior:none;flex-direction:column;display:flex;position:relative;overflow:hidden}.mute-btn{top:max(8px, env(safe-area-inset-top));right:max(8px, env(safe-area-inset-right));-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);z-index:100;cursor:pointer;touch-action:manipulation;background:#fffffff0;border:2px solid #94a3b8;border-radius:50%;justify-content:center;align-items:center;width:44px;min-width:44px;height:44px;min-height:44px;font-size:20px;transition:transform .1s;display:flex;position:fixed;box-shadow:0 4px 10px #00000014}.mute-btn:active{transform:scale(.92)}.bg-drifting-elements{pointer-events:none;z-index:0;position:absolute;inset:0;overflow:hidden}.drift-item{opacity:.38;will-change:transform;font-size:clamp(24px,3.5vw,38px);position:absolute}.drift-cloud-1{animation:24s linear infinite driftRight;top:10%}.drift-coin-1{animation:20s linear -7s infinite driftLeft;top:36%}.drift-cloud-2{animation:28s linear -12s infinite driftRight;top:66%}.drift-coin-2{animation:22s linear -3s infinite driftLeft;top:86%}@keyframes driftRight{0%{transform:translate(-15vw)}to{transform:translate(115vw)}}@keyframes driftLeft{0%{transform:translate(115vw)}to{transform:translate(-15vw)}}.hidden{display:none!important}.screen{z-index:10;touch-action:manipulation;background:0 0;flex-direction:column;justify-content:center;align-items:center;padding:12px;display:flex;position:absolute;inset:0}.start-title{color:#1e3a8a;text-shadow:0 3px #fffc,0 6px 14px #1e3a8a26;align-items:center;gap:10px;margin-bottom:6px;font-size:clamp(2rem,5.5vw,3.2rem);font-weight:700;display:flex}.start-subtitle{color:#334155;margin-bottom:20px;font-size:clamp(1.15rem,3.2vw,1.5rem);font-weight:600}.hero-select-row{justify-content:center;gap:16px;width:100%;max-width:480px;display:flex}.hero-card{aspect-ratio:1/1.15;cursor:pointer;touch-action:manipulation;background:#fff;border:4px solid #3b82f6;border-radius:24px;flex-direction:column;flex:1;justify-content:center;align-items:center;min-width:120px;max-width:190px;min-height:56px;padding:12px;transition:transform .1s;display:flex;box-shadow:0 6px #1d4ed8,0 10px 20px #0000001a}.hero-card:active{transform:scale(.95)}.hero-avatar-wrap{background:#eff6ff;border:3px solid #93c5fd;border-radius:50%;justify-content:center;align-items:center;width:clamp(64px,10vw,84px);height:clamp(64px,10vw,84px);margin-bottom:8px;display:flex;overflow:hidden}.hero-avatar-wrap img{object-fit:contain;width:100%;max-width:100%;height:100%;max-height:100%}.hero-name{color:#1e293b;font-size:clamp(1.1rem,2.8vw,1.3rem);font-weight:700}.hero-badge-tag{color:#2563eb;margin-top:2px;font-size:.9rem;font-weight:600}.top-bar{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#ffffffe6;border-radius:18px;flex-shrink:0;justify-content:space-between;align-items:center;gap:10px;width:100%;max-width:860px;height:44px;min-height:44px;margin:0 auto 6px;padding:4px 12px;display:flex;box-shadow:0 4px 10px #0000000d}.stage-dots-group{align-items:center;gap:6px;display:flex}.stage-dot{color:#64748b;background:#e2e8f0;border:2px solid #cbd5e1;border-radius:50%;justify-content:center;align-items:center;width:28px;height:28px;font-size:14px;font-weight:700;transition:transform .2s,background .2s;display:flex}.stage-dot.active{color:#fff;background:#3b82f6;border-color:#1d4ed8;transform:scale(1.12);box-shadow:0 0 0 3px #3b82f640}.stage-dot.completed{color:#fff;background:#10b981;border-color:#059669}.pair-pips-group{align-items:center;gap:5px;display:flex}.pair-pip{color:#94a3b8;background:#f1f5f9;border:2px dashed #94a3b8;border-radius:7px;justify-content:center;align-items:center;width:24px;height:24px;font-size:15px;transition:transform .25s cubic-bezier(.34,1.56,.64,1),background .2s;display:flex}.pair-pip.filled{color:#ca8a04;background:#fef08a;border:2px solid #eab308;transform:scale(1.15)}.game-playfield{flex:1;width:100%;min-width:0;max-width:960px;min-height:0;margin:0 auto;display:flex;position:relative}.hero-box-wrap{flex-shrink:0;justify-content:center;align-items:center;display:flex}.hero-box{background:#fff;border:3px solid #3b82f6;border-radius:20px;flex-shrink:0;justify-content:center;align-items:flex-end;width:100%;max-width:110px;height:100%;max-height:100px;padding:4px;display:flex;position:relative;overflow:hidden;box-shadow:0 4px 12px #3b82f62e}.hero-avatar-scaler{transform-origin:bottom;width:100%;height:100%;transform:scale(var(--hero-scale,.5));justify-content:center;align-items:flex-end;transition:transform .8s cubic-bezier(.34,1.56,.64,1);display:flex;position:relative}.hero-avatar-scaler img{object-fit:contain;border-radius:50%;width:100%;max-width:100%;height:100%;max-height:100%}.hero-avatar-fallback{justify-content:center;align-items:center;font-size:clamp(34px,5.5vh,48px);line-height:1;display:none}.hero-bob-loop{animation:2s ease-in-out infinite heroBob}@keyframes heroBob{0%,to{transform:translateY(0)}50%{transform:translateY(-4px)}}.hero-hop{animation:.5s cubic-bezier(.34,1.56,.64,1) both heroHopAnim}@keyframes heroHopAnim{0%{transform:translateY(0)}45%{transform:translateY(-14px)}to{transform:translateY(0)}}.hero-jump{animation:.35s cubic-bezier(.34,1.56,.64,1) both heroJumpAnim}@keyframes heroJumpAnim{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}.hero-head-shake{animation:.35s both heroHeadShakeAnim}@keyframes heroHeadShakeAnim{0%,to{transform:rotate(0)}25%{transform:rotate(-9deg)}75%{transform:rotate(9deg)}}.hero-wiggle{animation:.9s ease-in-out infinite heroWiggleAnim}@keyframes heroWiggleAnim{0%,to{transform:rotate(0)translateY(0)}25%{transform:rotate(-7deg)translateY(-3px)}75%{transform:rotate(7deg)translateY(-3px)}}.board-container{flex:1;place-content:stretch;gap:8px;width:100%;min-width:0;height:100%;min-height:0;display:grid}.card-slot{perspective:1000px;cursor:pointer;touch-action:manipulation;width:100%;height:100%;min-height:72px;animation:.35s cubic-bezier(.2,.8,.2,1) both cardDealIn;animation-delay:calc(var(--deal-idx,0) * 45ms);transition:transform .1s;position:relative}@keyframes cardDealIn{0%{opacity:0;transform:translateY(16px)scale(.94)}to{opacity:1;transform:translateY(0)scale(1)}}.card-slot:active{transform:scale(.95)}.card-slot.mismatch-shake{animation:.35s both cardShakeAnim}@keyframes cardShakeAnim{0%,to{transform:translate(0)}20%,60%{transform:translate(-6px)}40%,80%{transform:translate(6px)}}.card-inner{width:100%;height:100%;transform-style:preserve-3d;border-radius:16px;transition:transform .4s;position:relative}.card-slot.flipped .card-inner,.card-slot.flipping .card-inner{will-change:transform}.card-slot.flipped .card-inner,.card-slot.matched .card-inner{transform:rotateY(180deg)}.card-face{backface-visibility:hidden;text-align:center;border-radius:16px;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;padding:4px 6px;display:flex;position:absolute;inset:0;overflow:hidden}.card-back{border:2px solid #fff9;box-shadow:0 4px #0000001f,0 6px 12px #00000014}.card-back.type-q{color:#fff;background:linear-gradient(135deg,#3b82f6 0%,#1d4ed8 100%)}.card-back.type-a{color:#fff;background:linear-gradient(135deg,#f97316 0%,#c2410c 100%)}.card-back-icon{filter:drop-shadow(0 2px 4px #0003);font-size:clamp(26px,4vh,36px);line-height:1}.card-back-label{letter-spacing:.5px;text-transform:uppercase;opacity:.9;margin-top:2px;font-size:11px;font-weight:700}.card-front{border-style:solid;border-width:2.5px;position:relative;transform:rotateY(180deg);box-shadow:0 3px 8px #0000000f}.card-front.type-q{background:var(--q-bg);color:#1e3a8a;border-color:#3b82f6}.card-front.type-a{background:var(--a-bg);color:#7c2d12;border-color:#f97316}.card-front-emoji{flex-shrink:0;margin-bottom:2px;font-size:clamp(22px,3.5vh,32px);line-height:1}.card-front-text{text-align:center;overflow-wrap:anywhere;word-break:normal;text-wrap:balance;-webkit-line-clamp:3;-webkit-box-orient:vertical;max-height:3.6em;font-size:clamp(15px,2vh,18px);font-weight:700;line-height:1.15;display:-webkit-box;overflow:hidden}.card-slot.matched .card-inner{animation:.38s cubic-bezier(.34,1.56,.64,1) both matchPulseAnim}@keyframes matchPulseAnim{0%{transform:rotateY(180deg)scale(1)}50%{transform:rotateY(180deg)scale(1.08)}to{transform:rotateY(180deg)scale(1)}}.card-slot.matched .card-front{background:#ecfdf5;border-color:#10b981}.card-slot.matched .card-front:after{content:"";opacity:0;pointer-events:none;border-radius:18px;animation:.3s forwards glowFadeAnim;position:absolute;inset:-3px;box-shadow:0 0 16px #10b981bf}@keyframes glowFadeAnim{0%{opacity:0}to{opacity:1}}.match-check{color:#fff;background:#10b981;border-radius:50%;justify-content:center;align-items:center;width:22px;height:22px;font-size:14px;font-weight:800;display:none;position:absolute;top:3px;right:4px}.card-slot.matched .match-check{animation:.32s cubic-bezier(.34,1.56,.64,1) both badgePopAnim;display:flex}@keyframes badgePopAnim{0%{opacity:0;transform:scale(0)}75%{transform:scale(1.25)}to{opacity:1;transform:scale(1)}}.sparkle-particle{pointer-events:none;z-index:60;font-size:16px;line-height:1;animation:.5s cubic-bezier(.2,.8,.2,1) forwards sparkleBurstAnim;position:absolute}@keyframes sparkleBurstAnim{0%{opacity:1;transform:translate(0)scale(0)}60%{transform:translate(var(--tx), var(--ty)) scale(1.15);opacity:1}to{transform:translate(var(--tx), var(--ty)) scale(.4);opacity:0}}.stage-banner-overlay{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:50;background:#0f172a73;justify-content:center;align-items:center;padding:12px;animation:.2s fadeIn;display:flex;position:absolute;inset:0}.stage-banner-box{text-align:center;background:#fff;border:4px solid #3b82f6;border-radius:26px;width:100%;max-width:420px;padding:clamp(18px,3vh,26px) clamp(20px,4vw,32px);box-shadow:0 16px 36px #0003}.stage-banner-title{color:#1e3a8a;margin-bottom:6px;font-size:clamp(1.4rem,3.8vw,2rem);font-weight:700}.stage-banner-emoji{margin:4px 0;font-size:clamp(38px,6vh,48px)}.stage-banner-hint{color:#ea580c;background:#fff7ed;border:2px dashed #fdba74;border-radius:12px;margin-top:8px;padding:6px 12px;font-size:clamp(1rem,2.5vw,1.15rem);font-weight:600;display:inline-block}.stage-complete-box{text-align:center;z-index:55;background:#fff;border:4px solid #10b981;border-radius:26px;flex-direction:column;align-items:center;width:100%;max-width:420px;padding:clamp(20px,3vh,28px) clamp(22px,4vw,32px);display:flex;position:relative;box-shadow:0 16px 36px #0003}.stage-star-icon{margin-bottom:4px;font-size:clamp(40px,6vh,52px);line-height:1;animation:.6s cubic-bezier(.34,1.56,.64,1) both starSpringAnim}@keyframes starSpringAnim{0%{opacity:0;transform:scale(0)}70%{transform:scale(1.35)}to{opacity:1;transform:scale(1)}}.stage-complete-title{color:#065f46;margin-bottom:6px;font-size:clamp(1.6rem,4.2vw,2.2rem);font-weight:700}.stage-recap-text{color:#334155;background:#f0fdf4;border:2px solid #bbf7d0;border-radius:14px;width:100%;margin:10px 0 18px;padding:10px 14px;font-size:clamp(1rem,2.8vw,1.25rem);font-weight:600}.confetti-container{pointer-events:none;z-index:52;position:absolute;inset:0;overflow:hidden}.confetti-piece{width:var(--cw,8px);height:var(--ch,10px);background-color:var(--cc,#eab308);border-radius:var(--cr,2px);will-change:transform, opacity;animation:2s cubic-bezier(.25,.46,.45,.94) forwards confettiFallAnim;position:absolute;top:-16px}@keyframes confettiFallAnim{0%{opacity:1;transform:translateY(-20px)rotate(0)}85%{opacity:1}to{opacity:0;transform:translateY(115vh)rotate(540deg)}}.game-btn{font-family:var(--font-main);color:#fff;cursor:pointer;touch-action:manipulation;background:#2563eb;border:none;border-radius:18px;justify-content:center;align-items:center;min-height:56px;padding:12px 28px;font-size:clamp(1.15rem,2.8vw,1.25rem);font-weight:700;transition:transform .1s;display:inline-flex;box-shadow:0 5px #1d4ed8,0 8px 16px #2563eb40}.game-btn:active{transform:scale(.95);box-shadow:0 2px #1d4ed8}.game-btn-green{background:#10b981;box-shadow:0 5px #059669,0 8px 16px #10b98140}.game-btn-green:active{box-shadow:0 2px #059669}.victory-card{text-align:center;z-index:55;background:#fff;border:4px solid #eab308;border-radius:30px;flex-direction:column;align-items:center;width:100%;max-width:440px;padding:clamp(20px,3vh,28px) clamp(22px,4vw,34px);display:flex;position:relative;box-shadow:0 16px 36px #00000024}.victory-crown-wrap{flex-direction:column;align-items:center;margin-bottom:12px;display:flex;position:relative}.victory-crown{z-index:5;margin-bottom:-8px;font-size:38px;line-height:1;animation:2s ease-in-out infinite crownFloatAnim}@keyframes crownFloatAnim{0%,to{transform:translateY(0)}50%{transform:translateY(-5px)}}.victory-hero-wrap{background:#fef08a;border:4px solid #eab308;border-radius:50%;justify-content:center;align-items:center;width:clamp(80px,12vh,104px);height:clamp(80px,12vh,104px);display:flex;overflow:hidden;box-shadow:0 6px 14px #eab3084d}.victory-hero-wrap img{object-fit:contain;width:100%;max-width:100%;height:100%;max-height:100%}.victory-hero-wrap .hero-avatar-fallback{font-size:56px;line-height:1}.victory-title{color:#854d0e;margin-bottom:4px;font-size:clamp(2rem,5vw,2.7rem);font-weight:700;animation:.7s cubic-bezier(.34,1.56,.64,1) both victoryBadgeGlowPop}@keyframes victoryBadgeGlowPop{0%{opacity:0;transform:scale(.6)}75%{transform:scale(1.08)}to{opacity:1;transform:scale(1)}}.victory-sub{color:#475569;margin-bottom:18px;font-size:clamp(1.1rem,2.8vw,1.25rem);font-weight:600}@keyframes fadeIn{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}@media (width<=599px){.game-playfield{flex-direction:column;gap:6px}.hero-box-wrap{width:100%;height:14dvh;min-height:80px;max-height:120px;margin-bottom:2px}.board-container{flex:1;grid-template-rows:repeat(5,1fr);grid-template-columns:repeat(2,1fr);grid-auto-rows:1fr;gap:8px;min-height:0}}@media (width>=600px) and (height>=500px){.game-playfield{flex-direction:row;justify-content:center;align-items:center;gap:14px}.hero-box-wrap{flex-direction:column;justify-content:center;align-items:center;width:110px;height:100%;max-height:380px;display:flex}.hero-box{width:100px;max-width:100px;height:100px;max-height:100px}.board-container{flex:1;grid-template-rows:repeat(2,minmax(0,1fr));grid-template-columns:repeat(5,minmax(90px,1fr));grid-auto-rows:1fr;gap:10px;min-height:0;max-height:calc(100dvh - 75px)}}.rotate-overlay{display:none}@media (orientation:landscape) and (height<=499px){.rotate-overlay{z-index:9999;background:var(--bg-gradient);touch-action:none;pointer-events:auto;justify-content:center;align-items:center;padding:20px;position:fixed;inset:0;display:flex!important}.rotate-box{text-align:center;background:#fff;border:4px solid #3b82f6;border-radius:24px;flex-direction:column;align-items:center;max-width:360px;padding:22px 28px;display:flex;box-shadow:0 16px 36px #0003}.rotate-icon{margin-bottom:6px;font-size:44px;animation:1.8s ease-in-out infinite rotatePhoneAnim}.rotate-title{color:#1e3a8a;margin-bottom:4px;font-size:clamp(1.2rem,3.5vw,1.5rem);font-weight:700}.rotate-sub{color:#64748b;font-size:.95rem}}@keyframes rotatePhoneAnim{0%,to{transform:rotate(0)}50%{transform:rotate(-90deg)}}@media (prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}.bg-drifting-elements,.confetti-container,.sparkle-particle,.rotate-icon{display:none!important}}
