/* Mathcraft shell: the 🗼 button, the tower map, the stairs sticker, and keeping the shared corner
   buttons off the message bar. Colours come from each floor's own :root (they all share one
   palette); the fallbacks only matter if a floor ever drops a variable. */

/* The message bar runs edge to edge along the bottom. 🔊 and 📮 (sound.js, postcard.js) sit in
   the bottom-left corner and the portal's 💬 floats over the bottom-right, so keep the words out
   of both. The safe-area padding used to come from the "Look A" label under the message. */
body .msgbar { padding: 6px 64px calc(8px + env(safe-area-inset-bottom)); min-height: calc(64px + env(safe-area-inset-bottom)); }
/* ⛶ (fullscreen.js) sits at 12..60px from the top and treats anything within 6px of it as "in the
   way", then dodges down the page. A 56px HUD let the room's top row graze it, and on a phone (and
   Floor 2 on an upright iPad) the ⛶ wandered off its corner onto the room. 68px keeps the room
   clear of that zone. */
body .hud { min-height: 68px; }

.mc-tower {
	width: 50px; height: 44px; padding: 0;
	border: 3px solid var(--ink, #130b10); border-radius: 12px;
	background: var(--sky, #5bc8ff); color: var(--ink, #130b10);
	box-shadow: 3px 3px 0 var(--ink, #130b10);
	font-size: 24px; line-height: 1; display: grid; place-items: center;
	transform: rotate(2deg); cursor: pointer;
}
.mc-tower:active { transform: translate(2px, 2px) rotate(2deg); box-shadow: 1px 1px 0 var(--ink, #130b10); }
/* On a phone the 🗼 would push the HUD onto a second row and take ~47px off a room that is already
   tight there. Squeeze the HUD instead: smaller dots and gaps, 44px buttons (still the tap floor). */
@media (max-width: 560px) {
	body .hud { column-gap: 6px; } /* 8px left Floor 3's six dots grazing the ⛶ at 390px */
	body .dots { gap: 4px; }
	body .dot { width: 11px; height: 11px; }
	body .satbtn, body .mc-tower { width: 44px; }
}

.mc-map {
	position: fixed; inset: 0; z-index: 300; display: none;
	align-items: center; justify-content: center; padding: 12px;
	background: rgba(5, 3, 8, 0.72); touch-action: manipulation;
}
.mc-map.show { display: flex; }
.mc-card {
	position: relative; width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto;
	background: var(--paper, #f6e4b8); color: var(--ink, #130b10);
	border: 3px solid var(--ink, #130b10); border-radius: 16px; box-shadow: 4px 4px 0 var(--ink, #130b10);
	padding: 14px 14px 10px; transform: rotate(-0.6deg);
	animation: mcpop 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
	font-family: Nunito, system-ui, sans-serif; font-weight: 600;
}
@keyframes mcpop { from { opacity: 0; scale: 0.9; } to { opacity: 1; scale: 1; } }
.mc-card h2 { font-family: Fredoka, Nunito, sans-serif; font-weight: 600; font-size: 24px; margin: 0 44px 2px 0; line-height: 1.2; }
.mc-sub { margin: 0 0 10px; font-size: 15px; }
.mc-note { margin: 8px 0 0; font-size: 15px; text-align: center; min-height: 1.4em; }
.mc-x {
	position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; padding: 0;
	border: 3px solid var(--ink, #130b10); border-radius: 12px; background: var(--coral, #ff6b4a); color: var(--ink, #130b10);
	box-shadow: 2px 2px 0 var(--ink, #130b10); font-family: Fredoka, sans-serif; font-weight: 600; font-size: 22px; line-height: 1;
	display: grid; place-items: center; cursor: pointer;
}

/* The tower, top floor first. Each floor is a stone ledge she can tap. */
.mc-floors { display: flex; flex-direction: column; gap: 8px; }
.mc-fl {
	display: flex; align-items: center; gap: 10px; width: 100%; min-height: 60px; padding: 8px 12px; text-align: left;
	border: 3px solid var(--ink, #130b10); border-radius: 14px;
	background: var(--stone-top, #3f7079); color: var(--butter, #ffe9a8);
	box-shadow: 3px 3px 0 var(--ink, #130b10); font: inherit; cursor: pointer;
}
.mc-fl:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink, #130b10); }
.mc-fl.done { background: var(--stone, #2b5058); }
.mc-fl.here { background: var(--gold, #f2c94c); color: var(--ink, #130b10); }
.mc-fl.locked { background: #4a4452; color: rgba(255, 233, 168, 0.7); box-shadow: none; cursor: default; }
.mc-em { font-size: 28px; line-height: 1; flex: none; width: 34px; text-align: center; }
.mc-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mc-tx b { font-family: Fredoka, Nunito, sans-serif; font-weight: 600; font-size: 17px; line-height: 1.2; }
.mc-tx small { font-size: 14px; line-height: 1.25; opacity: 0.85; }
.mc-st { flex: none; font-size: 14px; font-weight: 700; white-space: nowrap; }
.mc-fl.mc-no { animation: mcno 0.4s; }
@keyframes mcno { 25% { translate: -6px 0; } 50% { translate: 5px 0; } 75% { translate: -3px 0; } }
@media (max-width: 420px) { .mc-stw { display: none; } .mc-st { font-size: 20px; } }

/* The stairs sticker on the win card: the biggest thing there, so the way on is obvious. */
.sticker.mc-up { background: var(--gold, #f2c94c); font-size: 22px; min-height: 64px; padding: 10px 22px; transform: rotate(1.5deg); }
.sticker.mc-up:active { transform: translate(3px, 3px) rotate(1.5deg); }
.mc-topline { font-family: Fredoka, Nunito, sans-serif; font-weight: 600; font-size: 18px; margin: 12px 0 0; }
@media (prefers-reduced-motion: reduce) { .mc-card, .mc-fl.mc-no { animation: none; } }

/* The door on a short landscape screen: MC.fitDoor() (mc-shell.js) adds .tight to the stage only
   when the note, the lock and the thing below the door collide (her iPad in Safari, 1180x688).
   The note keeps its short words (tap it for the whole card) and the lock loses its slack, never
   its 44px tap floor. Heights only: the dials stay as wide as each floor made them. */
.stage.tight .note .long { display: none; }
.stage.tight .note .short { display: inline; }
.stage.tight .note { top: 3%; }
.stage.tight .lock { padding-top: 6px; padding-bottom: 5px; }
.stage.tight .lock .dial { gap: 2px; }
.stage.tight .lock .darr { height: 44px; }
.stage.tight .lock .dnum { height: 46px; font-size: 26px; }
.stage.tight .lock .trylock { height: 48px; margin-top: 5px; font-size: 18px; }

/* Her little figure is scenery: she stood on Try the lock (Floor 2) and the worm tray (Floor 1).
   Every room thing is z-index 4 and up, so at 3 she stands behind them, never on them. */
body .stage .maya { z-index: 3; }

/* One thing at a time (Maya, 2026-10-19: "a bit hard, couldn't figure out the puzzles"). Every floor walks
   its door's path in steps: what is not this step's sleeps (.zz, dimmed) and wakes with a flash (.wake)
   when its turn comes; .mc-hand (MC.hand) taps the next thing; #steps (MC.steps) shows the plan in pictures. */
.zz{filter:brightness(.42) saturate(.45);transition:filter .6s}
.wake{animation:wakeup .9s ease-out}
@keyframes wakeup{0%{filter:brightness(2.2) saturate(1.5)}100%{filter:brightness(1) saturate(1)}}
.mc-hand{position:fixed;z-index:140;pointer-events:none;font-size:46px;line-height:1;transform:translate(-50%,-100%);display:none;filter:drop-shadow(2px 3px 0 rgba(19,11,16,.55));animation:handtap .85s ease-in-out infinite}
.mc-hand.up{transform:translate(-50%,0);animation-name:handtapup}
.mc-hand.show{display:block}
@keyframes handtap{0%,100%{translate:0 -12px}50%{translate:0 2px}}
@keyframes handtapup{0%,100%{translate:0 12px}50%{translate:0 -2px}}
/* the steps, in pictures, beside the words in the message bar */
.msgbar{display:flex;align-items:center;justify-content:center;gap:14px}
.msgbar .msg{flex:1 1 auto;min-width:0}
.steps{display:flex;align-items:center;gap:3px;flex:none}
.steps i{width:8px;height:3px;background:rgba(255,233,168,.3);border-radius:2px}
.steps .st{min-width:38px;height:38px;padding:0 5px;box-sizing:border-box;border-radius:10px;border:2px solid rgba(255,233,168,.3);background:rgba(19,11,16,.6);display:grid;place-items:center;font:600 19px/1 Fredoka,sans-serif;color:#ffe9a8;opacity:.5;position:relative;transition:transform .3s,opacity .3s}
.steps .st.dl{background:var(--paper2,#fff7e6);color:#b23a1e;border-color:var(--ink)}
.steps .st.now{opacity:1;border-color:var(--butter);transform:scale(1.18);box-shadow:0 0 12px rgba(255,225,77,.85)}
.steps .st.done{opacity:.95;border-color:#7bd94a}
.steps .st.done::after{content:"✓";position:absolute;right:-7px;top:-8px;width:18px;height:18px;border-radius:50%;background:#7bd94a;color:#130b10;border:2px solid #130b10;font-size:12px;line-height:14px;text-align:center}
@media (max-width:560px){.steps{display:none}}
