/* Rebeca's Learning Park. Cut-paper look: flat shapes, hard offset shadows, chunky rounded type. */
:root {
  --ink: #23304a;
  --paper: #fffdf7;
  --sky: #8fd3f4;
  --grass: #3fa66b;
  --leaf: #1e6b4a;
  --sun: #ffc93c;
  --pink: #ff5d8f;
  --grape: #7a5ce0;
  --tang: #ff8a3d;
  --line: #e6e0d0;
  --font: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", sans-serif;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--sky); }
body {
  font-family: var(--font); font-weight: 800; color: var(--ink);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: none; position: fixed; inset: 0;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; touch-action: none; }
#app { position: absolute; inset: 0; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.screen.on { display: flex; }

/* ---------- hub ---------- */
#hub { background: var(--sky); }
.sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.sky .sun { position: absolute; right: 7%; top: 5%; width: 13vmin; height: 13vmin; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 3vmin rgba(255, 201, 60, .28), 0 0 0 7vmin rgba(255, 201, 60, .14); }
.sky .cloud { position: absolute; width: 22vmin; height: 7vmin; border-radius: 7vmin; background: #fff; opacity: .9; animation: drift 70s linear infinite; }
.sky .cloud::before { content: ""; position: absolute; left: 18%; bottom: 40%; width: 44%; height: 130%; border-radius: 50%; background: #fff; }
.sky .cloud::after { content: ""; position: absolute; left: 48%; bottom: 30%; width: 34%; height: 100%; border-radius: 50%; background: #fff; }
.sky .c1 { top: 9%; left: 12%; }
.sky .c2 { top: 20%; left: 55%; transform: scale(.7); animation-duration: 95s; animation-delay: -30s; }
@keyframes drift { from { translate: -30vw 0; } to { translate: 60vw 0; } }
.sky .hill { position: absolute; border-radius: 50%; }
.sky .h1 { left: -20%; right: 30%; bottom: -34vh; height: 62vh; background: #57bb7c; }
.sky .h2 { left: 25%; right: -25%; bottom: -40vh; height: 66vh; background: var(--grass); }

.hubhead { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 2.2vmin 3vmin 0; }
.hubhead h1 { margin: 0; font-size: clamp(22px, 5vmin, 46px); font-weight: 900; letter-spacing: -.01em; color: var(--ink); text-shadow: 0 3px 0 #fff; }
.gear { position: relative; width: 56px; height: 56px; border-radius: 50%; background: rgba(255, 255, 255, .55); font-size: 26px; display: grid; place-items: center; }
.gear svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.gear circle { fill: none; stroke: var(--ink); stroke-width: 3; stroke-dasharray: 114; stroke-dashoffset: 114; }
.gear.holding circle { transition: stroke-dashoffset 1.3s linear; stroke-dashoffset: 0; }

.tiles { position: relative; flex: 1; min-height: 0; display: grid; gap: 2.4vmin; padding: 2.4vmin 3vmin 1vmin;
  grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(2, 1fr); }
.tile { position: relative; border-radius: 4vmin; background: var(--c); color: #fff; box-shadow: 0 1.2vmin 0 var(--d), 0 2vmin 0 rgba(35, 48, 74, .16);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6vmin; padding: 1.5vmin; transition: transform .08s, box-shadow .08s; }
.tile.press { transform: translateY(1vmin); box-shadow: 0 .2vmin 0 var(--d), 0 .6vmin 0 rgba(35, 48, 74, .16); }
.tile .ico { font-family: var(--emoji); font-size: min(11vmin, 13vh); line-height: 1.1; filter: drop-shadow(0 .5vmin 0 rgba(0, 0, 0, .18)); }
.tile .nm { font-size: clamp(14px, 2.5vmin, 24px); text-align: center; line-height: 1.1; text-shadow: 0 2px 0 var(--d); }
.tile .lv { position: absolute; top: 1.2vmin; left: 1.4vmin; font-size: clamp(12px, 2vmin, 18px); background: rgba(255, 255, 255, .92); color: var(--ink); border-radius: 99px; padding: .3vmin 1.2vmin; }
.tile.pick::after { content: "☀️"; font-family: var(--emoji); position: absolute; top: -1.2vmin; right: -1.2vmin; font-size: 4.4vmin; animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(1.18) rotate(18deg); } }

.meadow { position: relative; height: 12vh; min-height: 62px; display: flex; align-items: flex-end; justify-content: center; gap: .6vmin; padding: 0 2vmin 1.4vmin; overflow: hidden; }
.friend { font-family: var(--emoji); font-size: min(6vmin, 7vh); line-height: 1; animation: bob 3s ease-in-out infinite; }
.friend.boing { animation: boing .5s ease; }
.meadow-empty { font-family: var(--emoji); font-size: 5vmin; opacity: .8; }
@keyframes bob { 50% { transform: translateY(-.8vmin); } }
@keyframes boing { 30% { transform: translateY(-4vmin) scale(1.15, .9); } 60% { transform: translateY(0) scale(.9, 1.1); } }

@media (max-aspect-ratio: 11/10) {
  .tiles { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(5, 1fr); }
  .tile { flex-direction: row; justify-content: flex-start; gap: 3vmin; padding-left: 5vmin; }
  .tile .ico { font-size: min(11vmin, 8vh); }
  .tile .nm { text-align: left; font-size: clamp(15px, 3.4vmin, 28px); }
  .tile .lv { top: auto; bottom: 1.2vmin; left: auto; right: 1.6vmin; }
  .meadow { height: 9vh; }
}

/* ---------- game shell ---------- */
#game { background: var(--paper); --c: var(--grape); --d: #4d37a8; }
.bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--c); box-shadow: 0 6px 0 var(--d); position: relative; z-index: 3; }
.rbtn { width: 60px; height: 60px; flex: none; border-radius: 50%; background: #fff; font-family: var(--emoji); font-size: 30px; display: grid; place-items: center; box-shadow: 0 5px 0 rgba(0, 0, 0, .22); transition: transform .08s, box-shadow .08s; }
.rbtn.press { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, .22); }
.pips { flex: 1; display: flex; justify-content: center; gap: 12px; }
.pip { width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .32); transition: background .3s, transform .3s; }
.pip.full { background: var(--sun); transform: scale(1.1); box-shadow: 0 3px 0 rgba(0, 0, 0, .18); }
.pip.now { background: #fff; }
.lvl { color: #fff; font-size: 22px; min-width: 56px; text-align: right; text-shadow: 0 2px 0 var(--d); }
.stage { position: relative; flex: 1; min-height: 0; padding: 18px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.stage.locked { pointer-events: none; }

/* shared bits */
.em { font-family: var(--emoji); }
.chunk { border-radius: 22px; background: #fff; border: 4px solid var(--ink); box-shadow: 0 7px 0 var(--ink); transition: transform .08s, box-shadow .08s, opacity .2s; }
.chunk.press { transform: translateY(5px); box-shadow: 0 2px 0 var(--ink); }
.chunk.off { opacity: .28; pointer-events: none; }
.chunk.yes { background: #c9f2d6; border-color: var(--leaf); box-shadow: 0 7px 0 var(--leaf); }
.chunk.glow { animation: glow 1s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 7px 0 var(--ink), 0 0 0 10px rgba(255, 201, 60, .75); } }
.wob { animation: wob .4s; }
@keyframes wob { 20% { transform: translateX(-10px) rotate(-4deg); } 50% { transform: translateX(9px) rotate(3deg); } 80% { transform: translateX(-5px); } }
.popin { animation: popin .35s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes popin { from { transform: scale(0); } }
.choices { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.choice { min-width: 120px; height: 120px; padding: 0 18px; font-size: 64px; display: grid; place-items: center; }
.col { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; width: 100%; height: 100%; }

/* ---------- overlay ---------- */
.overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(35, 48, 74, .55); z-index: 20; padding: 20px; }
.overlay.on { display: flex; }
.card { background: var(--paper); border-radius: 36px; border: 5px solid var(--ink); box-shadow: 0 12px 0 var(--ink); padding: 30px 40px; text-align: center; max-width: 92vw; max-height: 92vh; }
.card.win { animation: popin .4s cubic-bezier(.3, 1.5, .5, 1) both; }
.newfriend { font-family: var(--emoji); font-size: min(26vmin, 190px); line-height: 1.15; animation: boing .8s ease .3s; }
.praise { font-size: clamp(24px, 5vmin, 44px); font-weight: 900; margin: 6px 0 4px; }
.up { font-size: clamp(18px, 3.2vmin, 28px); color: var(--grape); margin-bottom: 6px; }
.row { display: flex; gap: 26px; justify-content: center; margin-top: 20px; }
.big { width: 124px; height: 124px; border-radius: 50%; background: #fff; border: 5px solid var(--ink); box-shadow: 0 8px 0 var(--ink); font-family: var(--emoji); font-size: 56px; display: grid; place-items: center; transition: transform .08s, box-shadow .08s; }
.big.go { background: var(--grass); color: #fff; font-family: var(--font); padding-left: 8px; }
.big.press { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.big.hold { margin: 18px auto 0; position: relative; }
.big.hold.holding { background: var(--sun); transition: background 1.3s linear; }
.small { font-size: 15px; font-weight: 600; opacity: .75; margin: 6px 0; }

.card.settings { text-align: left; width: 640px; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; font-weight: 700; padding: 24px 28px; }
.settings h2 { margin: 0 0 12px; font-size: 30px; font-weight: 900; }
.settings h3 { margin: 22px 0 2px; font-size: 20px; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 2px solid var(--line); font-size: 17px; }
.srow small { display: block; font-weight: 600; opacity: .65; font-size: 13px; }
.srow.end { border: 0; margin-top: 12px; }
.seg { display: flex; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; flex: none; }
.seg button { padding: 9px 14px; font-size: 16px; touch-action: manipulation; }
.seg button + button { border-left: 3px solid var(--ink); }
.seg button.sel { background: var(--ink); color: #fff; }
.step { display: flex; align-items: center; gap: 10px; flex: none; }
.step button { width: 42px; height: 42px; border-radius: 12px; border: 3px solid var(--ink); font-size: 24px; line-height: 1; touch-action: manipulation; }
.step b { min-width: 24px; text-align: center; font-size: 20px; }
.step i { font-style: normal; opacity: .5; font-size: 14px; }
.settings .primary, .settings .danger { padding: 12px 22px; border-radius: 14px; border: 3px solid var(--ink); font-size: 17px; touch-action: manipulation; }
.settings .primary { background: var(--ink); color: #fff; }
.settings .danger { color: #b3261e; border-color: #b3261e; }

/* ---------- confetti ---------- */
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.bit { position: absolute; top: -20px; width: 14px; height: 20px; border-radius: 4px; animation: fall 1.6s cubic-bezier(.2, .6, .6, 1) forwards; }
.bit.em { width: auto; height: auto; background: none; font-family: var(--emoji); font-size: 40px; font-style: normal; }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: .9; } }

@media (prefers-reduced-motion: reduce) {
  .sky .cloud, .friend, .tile.pick::after { animation: none; }
}

/* =====================================================================
   Games
   ===================================================================== */

/* ---------- Bug Path ---------- */
.code-wrap { display: flex; align-items: center; justify-content: center; gap: 26px; width: 100%; height: 100%; }
.code-wrap.tall { flex-direction: column; gap: 16px; }
.cboard { position: relative; display: grid; gap: 5px; background: #cfe8c6; padding: 8px; border-radius: 22px; border: 4px solid var(--leaf); flex: none; }
.ccell { background: #eaf7e2; border-radius: 12px; display: grid; place-items: center; font-family: var(--emoji); position: relative; }
.ccell.dot::after { content: ""; width: 26%; height: 26%; border-radius: 50%; background: var(--sun); animation: popin .3s both; }
.cbug { position: absolute; display: grid; place-items: center; font-family: var(--emoji); transition: left .32s ease, top .32s ease; pointer-events: none; z-index: 2; }
.cbug.hop span { display: block; animation: hop .32s; }
@keyframes hop { 50% { transform: translateY(-18%) scale(1.12); } }
.cbug.bonk { animation: wob .4s; }
.cside { display: flex; flex-direction: column; align-items: center; gap: 16px; flex: none; }
.tall .cside { flex-direction: row; gap: 22px; }
.cprog { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-start; align-content: flex-start; background: #f1ecdf; border-radius: 18px; padding: 10px; width: 292px; min-height: 112px; }
.cstep { width: 48px; height: 48px; border-radius: 12px; background: #fff; border: 3px dashed #cfc7b2; display: grid; place-items: center; font-size: 26px; color: #fff; }
.cstep.set { background: var(--c); border: 3px solid var(--d); }
.cstep.run { outline: 5px solid var(--sun); transform: scale(1.12); }
.cstep.err { background: #b3261e; border-color: #7d1a15; animation: wob .4s; }
.cpad { display: grid; grid-template-columns: repeat(3, 70px); grid-template-rows: repeat(3, 70px); gap: 6px; }
.cpad button { font-size: 36px; border-radius: 18px; }
.cpad .arrow { background: var(--c); color: #fff; border-color: var(--d); box-shadow: 0 6px 0 var(--d); }
.cpad .arrow.press { box-shadow: 0 1px 0 var(--d); }
.cpad .go { background: var(--grass); color: #fff; border-color: var(--leaf); box-shadow: 0 6px 0 var(--leaf); font-size: 30px; }
.cpad .undo { font-size: 28px; }

/* ---------- Dino Snacks ---------- */
.num-eq { font-size: clamp(44px, 9vmin, 84px); font-weight: 900; display: flex; gap: .3em; align-items: center; }
.num-eq .q { color: var(--c); border-bottom: 8px solid var(--c); min-width: 1em; text-align: center; }
.num-vis { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; max-width: 100%; }
.grp { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-content: center; background: #fff; border: 4px solid var(--line); border-radius: 22px; padding: 12px; font-family: var(--emoji); font-size: clamp(30px, 6vmin, 52px); line-height: 1.1; max-width: 46vw; }
.grp span.gone { opacity: .22; filter: grayscale(1); position: relative; }
.grp.tap { border-color: var(--ink); box-shadow: 0 7px 0 var(--ink); min-width: 28vmin; min-height: 28vmin; }
.grp.tap.press { transform: translateY(5px); box-shadow: 0 2px 0 var(--ink); }
.op { font-size: clamp(40px, 8vmin, 72px); font-weight: 900; margin: 0 6px; }
.frame { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; background: var(--ink); padding: 5px; border-radius: 14px; }
.frame i { width: clamp(44px, 8.4vmin, 74px); height: clamp(44px, 8.4vmin, 74px); background: #fff; border-radius: 8px; display: grid; place-items: center; font-style: normal; font-family: var(--emoji); font-size: clamp(28px, 5.6vmin, 50px); }
.frames { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.scatter { position: relative; width: min(74vmin, 560px); height: min(34vmin, 260px); background: #fff; border: 4px solid var(--line); border-radius: 22px; }
.scatter span { position: absolute; font-family: var(--emoji); font-size: clamp(30px, 6vmin, 50px); line-height: 1; transform: translate(-50%, -50%); }
.cards { display: flex; gap: 12px; }
.cards b { width: clamp(64px, 13vmin, 110px); height: clamp(80px, 16vmin, 130px); border-radius: 16px; background: #fff; border: 4px solid var(--ink); display: grid; place-items: center; font-size: clamp(36px, 7.5vmin, 64px); }
.cards b.q { border-style: dashed; color: var(--c); border-color: var(--c); }
.feed { display: flex; align-items: center; justify-content: center; gap: 3vmin; width: 100%; }
.dino { font-family: var(--emoji); font-size: min(24vmin, 180px); line-height: 1; transition: transform .2s; }
.dino.chomp { animation: chomp .5s 2; }
@keyframes chomp { 50% { transform: scale(1.18) rotate(-8deg); } }
.sign { background: var(--c); color: #fff; font-size: min(15vmin, 110px); font-weight: 900; border-radius: 24px; padding: 0 .35em; line-height: 1.25; box-shadow: 0 7px 0 var(--d); }
.feedrow { display: flex; gap: 22px; align-items: center; justify-content: center; }
.jar, .okbtn { width: 116px; height: 116px; font-family: var(--emoji); font-size: 60px; display: grid; place-items: center; }
.okbtn { background: var(--grass); border-color: var(--leaf); box-shadow: 0 7px 0 var(--leaf); color: #fff; font-family: var(--font); }

/* ---------- Word Parrot ---------- */
.wpic { font-family: var(--emoji); font-size: min(30vmin, 220px); line-height: 1.1; }
.wpic.sm { font-size: min(20vmin, 150px); }
.letter { font-size: 60px; min-width: 150px; }
.bigletter { font-size: min(26vmin, 190px); font-weight: 900; line-height: 1; color: var(--c); }
.pic { width: min(26vmin, 190px); height: min(26vmin, 190px); font-family: var(--emoji); font-size: min(15vmin, 110px); display: grid; place-items: center; }
.slots, .trayrow { display: flex; gap: 14px; justify-content: center; }
.slot { width: min(15vmin, 108px); height: min(17vmin, 124px); border-radius: 18px; border: 5px dashed #cfc7b2; display: grid; place-items: center; font-size: min(11vmin, 80px); font-weight: 900; background: #fff; }
.slot.filled { border: 5px solid var(--ink); }
.slot.ok { border: 5px solid var(--leaf); background: #c9f2d6; }
.slot.ghost { color: #cfc7b2; }
.ltile { width: min(14vmin, 100px); height: min(14vmin, 100px); font-size: min(9.5vmin, 68px); font-weight: 900; display: grid; place-items: center; background: #fff3c9; }
.ltile.used { visibility: hidden; }
.readword { font-size: min(22vmin, 160px); font-weight: 900; letter-spacing: .06em; line-height: 1; }

/* ---------- Pattern Train ---------- */
.train { display: flex; align-items: flex-end; justify-content: center; gap: 6px; animation: rollin .7s cubic-bezier(.2, .8, .3, 1) both; }
.train.leave { animation: rollout 1s ease-in forwards; }
@keyframes rollin { from { transform: translateX(110vw); } }
@keyframes rollout { to { transform: translateX(-120vw); } }
.engine { font-family: var(--emoji); line-height: 1; margin-right: 4px; }
.car { position: relative; background: #fff; border: 4px solid var(--ink); border-radius: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; align-content: center; font-family: var(--emoji); margin-bottom: 12px; line-height: 1; }
.car::before, .car::after { content: ""; position: absolute; bottom: -14px; width: 22%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); }
.car::before { left: 12%; } .car::after { right: 12%; }
.car.q { border-style: dashed; border-color: var(--c); background: #fff8e1; font-family: var(--font); color: var(--c); font-weight: 900; }
.car .it { display: inline-block; }
.popt { width: 124px; height: 124px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; align-content: center; font-family: var(--emoji); line-height: 1; }

/* ---------- Fruit Box ---------- */
.sud-wrap { display: flex; align-items: center; justify-content: center; gap: 30px; width: 100%; height: 100%; }
.sud-wrap.tall { flex-direction: column; }
.sgrid { display: grid; gap: 5px; background: var(--ink); padding: 6px; border-radius: 20px; flex: none; }
.scell { background: #fff; border-radius: 10px; display: grid; place-items: center; font-family: var(--emoji); line-height: 1; position: relative; }
.scell.given { background: #f1ecdf; }
.sgrid { position: relative; }
.sgrid.four::before, .sgrid.four::after { content: ""; position: absolute; background: var(--ink); z-index: 2; pointer-events: none; }
.sgrid.four::before { left: calc(50% - 7px); width: 14px; top: 0; bottom: 0; }
.sgrid.four::after { top: calc(50% - 7px); height: 14px; left: 0; right: 0; }
.scell.sel { outline: 6px solid var(--c); outline-offset: -3px; z-index: 1; }
.scell.clash { animation: clash .7s; }
.scell.pulse { animation: cpulse 1s 2; }
@keyframes clash { 0%, 100% { background: #fff; } 30%, 70% { background: #ffb3b3; } }
@keyframes cpulse { 50% { background: #ffe58a; } }
.spal { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.tall .spal { grid-template-columns: repeat(4, 1fr); }
.spal button { width: 112px; height: 112px; font-family: var(--emoji); font-size: 62px; display: grid; place-items: center; }

/* ---------- Block Fit ---------- */
.stage.g-blocks { padding: 0; display: block; }
.bboard { position: absolute; background: #e9e3d2; border-radius: 12px; box-shadow: 0 0 0 6px var(--ink); }
.bboard i { position: absolute; border: 2px dashed #cfc7b2; border-radius: 8px; }
.bghost { position: absolute; background: rgba(255, 201, 60, .7); border-radius: 8px; animation: glowfade 2.6s forwards; pointer-events: none; }
@keyframes glowfade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.bpiece { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; transition: transform .18s; will-change: transform; }
.bpiece.drag { transition: none; z-index: 10; }
.bpiece b { position: absolute; pointer-events: auto; background: var(--pc); border-radius: 9px; box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .2), inset 0 0 0 3px rgba(255, 255, 255, .35); touch-action: none; }
.bpiece.drag b { box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .2), inset 0 0 0 3px rgba(255, 255, 255, .35), 0 12px 18px rgba(35, 48, 74, .3); }
.bpiece.nudge { animation: nudge .5s 3; }
@keyframes nudge { 50% { filter: brightness(1.5); } }

/* ---------- Bunny Maze ---------- */
.mboard { position: relative; background: #eaf7e2; border: 6px solid var(--leaf); border-radius: 16px; flex: none; touch-action: none; }
.mcell { position: absolute; border: 0 solid var(--leaf); display: grid; place-items: center; font-family: var(--emoji); line-height: 1; }
.mcell.trail::before { content: ""; position: absolute; width: 34%; height: 34%; border-radius: 50%; background: var(--sun); opacity: .8; }
.mcell.hintc::before { content: ""; position: absolute; width: 60%; height: 60%; border-radius: 50%; background: var(--pink); opacity: .55; animation: glowfade 2.4s forwards; }
.mcell span { position: relative; }
.mcell .lock { opacity: .5; }
.mbun { position: absolute; display: grid; place-items: center; font-family: var(--emoji); line-height: 1; transition: left .1s linear, top .1s linear; pointer-events: none; z-index: 2; }

/* ---------- Elephant Memory ---------- */
.mem { display: grid; gap: 14px; }
.mcard { perspective: 700px; }
.mcard .in { position: relative; width: 100%; height: 100%; transition: transform .35s; transform-style: preserve-3d; }
.mcard.up .in { transform: rotateY(180deg); }
.mcard .f, .mcard .b { position: absolute; inset: 0; border-radius: 18px; border: 4px solid var(--ink); display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.mcard .b { background: var(--c); box-shadow: 0 6px 0 var(--d); border-color: var(--d); }
.mcard .b::after { content: "?"; color: rgba(255, 255, 255, .7); font-size: 44px; }
.mcard .f { background: #fff; transform: rotateY(180deg); font-family: var(--emoji); line-height: 1; text-align: center; }
.mcard .f.txt { font-family: var(--font); font-weight: 900; }
.mcard.got .f { background: #c9f2d6; border-color: var(--leaf); }
.dots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12%; width: 62%; aspect-ratio: 1; align-content: center; }
.dots.wide { grid-template-columns: repeat(5, 1fr); width: 84%; aspect-ratio: auto; gap: 7%; }
.dots i { aspect-ratio: 1; border-radius: 50%; background: var(--pink); }

/* ---------- Echo Band ---------- */
.echo { display: grid; gap: 22px; }
.pad { width: min(26vmin, 200px); height: min(26vmin, 200px); border-radius: 30px; background: var(--pc); box-shadow: 0 10px 0 rgba(0, 0, 0, .25); font-family: var(--emoji); font-size: min(15vmin, 112px); display: grid; place-items: center; opacity: .78; transition: transform .08s, opacity .08s, box-shadow .08s; }
.pad.lit { opacity: 1; transform: scale(1.1); box-shadow: 0 10px 0 rgba(0, 0, 0, .25), 0 0 0 10px var(--sun); }
.echo.listen .pad { pointer-events: none; }
.ear { font-family: var(--emoji); font-size: 54px; height: 64px; }

/* ---------- Mirror Paint ---------- */
.stage.g-paint { padding: 0; display: block; }
.pcanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.ptools { position: absolute; left: 10px; top: 10px; bottom: 10px; display: flex; flex-direction: column; flex-wrap: wrap; gap: 8px; align-content: flex-start; z-index: 2; }
.ptools.right { left: auto; right: 10px; align-content: flex-end; }
.ptools button { width: 58px; height: 58px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--ink); font-family: var(--emoji); font-size: 28px; display: grid; place-items: center; background: #fff; }
.ptools button.sel { box-shadow: 0 0 0 3px var(--ink), 0 0 0 8px var(--sun); transform: scale(1.06); }
.ptools .rain { background: conic-gradient(#ff5d8f, #ffc93c, #3fa66b, #2fb5e8, #7a5ce0, #ff5d8f); }
.ptools .sz i { display: block; border-radius: 50%; background: var(--ink); }
.ptools button.boing { animation: boing .5s ease; }
.pflash { position: absolute; inset: 0; background: #fff; z-index: 4; pointer-events: none; animation: pflash .5s ease-out forwards; }
@keyframes pflash { from { opacity: .9; } to { opacity: 0; } }
.pgallery { position: absolute; inset: 0; z-index: 5; background: var(--paper); overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; padding: 16px 84px 16px 16px; }
.pclose, .pvbar button { width: 64px; height: 64px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--ink); font-family: var(--emoji); font-size: 30px; display: grid; place-items: center; background: #fff; }
.pclose { position: absolute; top: 12px; right: 12px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(30vw, 200px), 1fr)); gap: 16px; }
.pthumb { padding: 0; border: 4px solid var(--ink); border-radius: 18px; overflow: hidden; background: #fff; aspect-ratio: 4 / 3; box-shadow: 0 6px 0 var(--ink); }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-touch-callout: none; }
.pempty { grid-column: 1 / -1; text-align: center; font-family: var(--emoji); font-size: min(16vmin, 120px); padding-top: 12vh; opacity: .7; }
.pview { position: fixed; inset: 0; z-index: 30; background: rgba(35, 48, 74, .85); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 16px; }
.pview img { max-width: 100%; max-height: calc(100% - 100px); border: 5px solid #fff; border-radius: 18px; background: #fff; -webkit-touch-callout: none; }
.pvbar { display: flex; gap: 22px; }
.pvbar button.armed { background: #ff5d8f; animation: wob .5s ease; }
