/* Mark's Business Quest: cosy isometric edition.
   Palette: soft sky blue, chunky dark-brown outlines, rounded pastel flats, wood signs. */
:root {
  --ink: #4b2e2a;
  --ink-soft: #7a5a50;
  --sky: #a9d9f2;
  --sky-2: #d4eefb;
  --cream: #fff6e3;
  --cream-2: #fbe9c9;
  --wood-1: #e0a866;
  --wood-2: #c58a52;
  --wood-3: #9a6236;
  --coral: #f2907c;
  --teal: #6cc4be;
  --lav: #cdbdea;
  --butter: #ffd45e;
  --house: #f2907c;
  --office: #a995e0;
  --workshop: #6cc4be;
  --font: "Fredoka", "Baloo 2", "Nunito", "Trebuchet MS", "Comic Sans MS", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(#97d1f1 0%, #bfe5f8 55%, #def3fc 100%) fixed;
  min-height: 100vh;
  overflow-x: hidden;
}
button { font-family: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- sky ---------- */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky-svg { width: 100%; height: 100%; }
.sc { animation: skydrift 60s ease-in-out infinite alternate; }
.sc2 { animation-duration: 75s; animation-direction: alternate-reverse; }
.sc3 { animation-duration: 90s; }
.sc4 { animation-duration: 70s; animation-direction: alternate-reverse; }
.sc5 { animation-duration: 55s; }
.sc6 { animation-duration: 80s; animation-direction: alternate-reverse; }
@keyframes skydrift { from { transform: translateX(-22px); } to { transform: translateX(26px); } }

.page { position: relative; z-index: 1; width: 100%; max-width: 480px; margin: 0 auto; padding-bottom: 30px; }

/* ---------- phone column ---------- */
.phone {
  position: relative;
  height: 100vh; height: 100dvh;
  min-height: 640px; max-height: 940px;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* HUD */
.hud { position: relative; z-index: 5; padding: calc(10px + env(safe-area-inset-top)) 12px 0; }
.banner {
  position: relative; margin: 0 auto; width: min(76%, 320px);
  padding: 7px 14px 8px; text-align: center;
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(75,46,42,.10) 46px 48px),
    linear-gradient(#e8b572, #cc8f55);
  border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.4), inset 0 -4px 0 rgba(75,46,42,.2), 0 4px 0 rgba(75,46,42,.35);
}
.banner::before, .banner::after { content: ""; position: absolute; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: #7a5a50; box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.banner::before { left: 9px; } .banner::after { right: 9px; }
.rope { position: absolute; top: -14px; width: 3px; height: 14px; background: #8a6a4a; border-left: 1px solid var(--ink); border-right: 1px solid var(--ink); }
.rope.l { left: 24%; } .rope.r { right: 24%; }
.banner h1 { margin: 0; font-size: clamp(17px, 5.1vw, 23px); line-height: 1.1; font-weight: 700; letter-spacing: .2px; color: var(--cream);
  text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink); }
.banner .sub { margin: 2px 0 0; font-size: 11px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: #fff0d0; text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); }

.pills { display: flex; justify-content: space-between; margin-top: 9px; padding: 0 2px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cream); border: 3px solid var(--ink); border-radius: 999px;
  padding: 3px 14px 3px 7px; min-height: 36px;
  box-shadow: 0 3px 0 rgba(75,46,42,.35), inset 0 -3px 0 rgba(75,46,42,.08);
}
.pill b { font-size: 19px; font-weight: 700; line-height: 1; }
.pill-ico { width: 24px; height: 24px; }
.pill-unit { font-size: 11px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .6px; }
.pill.lv { background: #e3d8f6; padding-left: 8px; }
.lv-tag { background: var(--ink); color: #fff0d0; font-size: 10px; font-weight: 700; letter-spacing: 1px; padding: 3px 7px; border-radius: 999px; }
.pill.bump { animation: pillbump .7s ease; }
@keyframes pillbump { 30% { transform: scale(1.14) rotate(-2deg); } 60% { transform: scale(.97); } }

/* stage */
.stage { position: relative; flex: 1 1 auto; min-height: 0; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
#scene * { vector-effect: non-scaling-stroke; }
.o { stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.t { stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; }
.n { stroke: none; }
.char .o { stroke-width: 1.7; } .char .t { stroke-width: 1.1; }
#scene text { stroke-linejoin: round; }
#sceneRoot { animation: sceneIn .45s cubic-bezier(.2,.9,.3,1.2); transform-box: view-box; }
@keyframes sceneIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

.round-btn {
  position: absolute; z-index: 6; top: 6px; width: 62px; padding: 6px 0 5px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: var(--cream); border: 3px solid var(--ink); border-radius: 18px; cursor: pointer;
  box-shadow: 0 4px 0 rgba(75,46,42,.4), inset 0 -4px 0 rgba(75,46,42,.08);
  transition: transform .12s;
}
.round-btn svg { width: 30px; height: 30px; }
.round-btn span { font-size: 10px; font-weight: 700; letter-spacing: .3px; }
.round-btn.left { left: 8px; } .round-btn.right { right: 8px; }
.round-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(75,46,42,.4); }

/* speech bubble */
.bubble {
  position: absolute; z-index: 4; left: 14px; right: 14px; bottom: 6px;
  background: #fffdf5; border: 3px solid var(--ink); border-radius: 20px;
  padding: 9px 14px 10px; min-height: 58px;
  box-shadow: 0 4px 0 rgba(75,46,42,.3);
  --tail: 50%;
}
.bubble::before, .bubble::after { content: ""; position: absolute; left: var(--tail); border: solid transparent; }
.bubble::before { top: -17px; margin-left: -12px; border-width: 0 12px 15px 12px; border-bottom-color: var(--ink); }
.bubble::after { top: -11px; margin-left: -9px; border-width: 0 9px 12px 9px; border-bottom-color: #fffdf5; }
.bubble-name { position: absolute; top: -13px; left: 16px; background: var(--coral); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 2px 10px; border: 2.5px solid var(--ink); border-radius: 999px; text-shadow: 0 1px 0 rgba(75,46,42,.5); }
.bubble p { margin: 4px 0 0; font-size: 14px; line-height: 1.3; font-weight: 500; }

/* tabs */
.tabs {
  position: relative; z-index: 5; display: flex; gap: 8px; align-items: flex-end;
  padding: 14px 10px calc(10px + env(safe-area-inset-bottom));
  background:
    repeating-linear-gradient(90deg, transparent 0 58px, rgba(75,46,42,.14) 58px 60px),
    linear-gradient(#b9783f, #94602f);
  border-top: 4px solid var(--ink);
  box-shadow: inset 0 4px 0 rgba(255,255,255,.22);
}
.tab {
  position: relative; flex: 1; height: 66px; padding: 5px 4px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(75,46,42,.1) 28px 30px),
    linear-gradient(#d29a5c, #b57a43);
  border: 3px solid var(--ink); border-radius: 14px;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.35), inset 0 -4px 0 rgba(75,46,42,.22), 0 4px 0 var(--ink);
  transition: transform .15s, background .15s;
}
.tab svg { width: 28px; height: 28px; margin-top: -2px; }
.tab b { font-size: 13px; font-weight: 700; letter-spacing: .8px; color: var(--cream);
  text-shadow: 0 1.5px 0 var(--ink), 1.5px 0 0 var(--ink), -1.5px 0 0 var(--ink), 0 -1.5px 0 var(--ink); }
.tab .tab-count { font-style: normal; font-size: 10px; font-weight: 600; color: #fff0d0; opacity: .9; margin-top: 0; text-shadow: 0 1px 0 var(--ink); }
.tab.active { transform: translateY(-9px); background: repeating-linear-gradient(90deg, transparent 0 28px, rgba(75,46,42,.08) 28px 30px), linear-gradient(#f6cf8c, #e3a45d);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.55), inset 0 -4px 0 rgba(75,46,42,.18), 0 5px 0 var(--ink), 0 0 0 3px rgba(255,240,170,.9); }
.tab.active b { color: #fff; }
.tab:active { transform: translateY(2px); }
.tab.active:active { transform: translateY(-6px); }
.tab-new { position: absolute; top: -12px; right: -5px; z-index: 2; background: #ff6f61; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .8px; padding: 2px 7px; border: 2.5px solid var(--ink); border-radius: 999px; animation: newpop 1s ease-in-out infinite; text-shadow: 0 1px 0 rgba(75,46,42,.6); }
@keyframes newpop { 50% { transform: scale(1.14) rotate(4deg); } }

/* ---------- bottom sheets ---------- */
.sheet-backdrop { position: absolute; inset: 0; z-index: 20; background: rgba(75,46,42,.42); display: flex; align-items: flex-end; animation: fade .2s; }
.sheet {
  width: 100%; max-height: 82%; overflow: auto; padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  background: var(--cream); border: 4px solid var(--ink); border-bottom: 0; border-radius: 26px 26px 0 0;
  box-shadow: inset 0 4px 0 rgba(255,255,255,.7);
  animation: sheetup .28s cubic-bezier(.2,.9,.3,1.1);
}
@keyframes sheetup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--cream); padding: 4px 18px 6px; border: 3px solid var(--ink); border-radius: 12px;
  background: linear-gradient(#e0a866, #c58a52); text-shadow: 0 2px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); box-shadow: 0 3px 0 rgba(75,46,42,.35); }
.x-btn { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--ink); background: #ff8d7c; color: #fff; font-size: 24px; line-height: 1; font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 rgba(75,46,42,.4); padding: 0 0 3px; }
.sheet-note { margin: 0 2px 8px; font-size: 13px; color: var(--ink-soft); }
.up-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.up-row {
  position: relative; display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left;
  padding: 8px 10px 8px 8px; background: #fffdf5; border: 3px solid var(--ink); border-radius: 16px; cursor: pointer;
  box-shadow: 0 3px 0 rgba(75,46,42,.3);
}
.up-row .ic { width: 46px; height: 46px; display: grid; place-items: center; background: #fbe9c9; border: 2.5px solid var(--ink); border-radius: 14px; }
.up-row .ic svg { width: 34px; height: 34px; }
.up-row h3 { margin: 0; font-size: 15px; line-height: 1.15; font-weight: 700; }
.up-row p { margin: 2px 0 0; font-size: 12px; line-height: 1.25; color: var(--ink-soft); }
.up-row .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; font-weight: 700; }
.chip { display: inline-block; padding: 1px 8px 2px; border: 2px solid var(--ink); border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--ink); }
.chip.house { background: #f8b3a4; } .chip.office { background: #cfc2f0; } .chip.workshop { background: #9adcd6; }
.up-row.locked { background: #efe6d4; }
.up-row.locked .ic { background: #ddd2bd; }
.up-row.locked .ic svg { filter: grayscale(1) opacity(.55); }
.up-row.locked h3 { color: #8c7a70; }
.up-row.next { box-shadow: 0 3px 0 rgba(75,46,42,.3), 0 0 0 3px #ffd45e; }
.up-row .tick { position: absolute; left: -6px; top: -6px; width: 22px; height: 22px; border-radius: 50%; background: #62c58c; border: 2.5px solid var(--ink); display: grid; place-items: center; }
.up-row .tick svg { width: 12px; height: 12px; }
.up-row .lock { position: absolute; left: -6px; top: -6px; width: 22px; height: 22px; border-radius: 50%; background: #b7a99a; border: 2.5px solid var(--ink); display: grid; place-items: center; }
.up-row .lock svg { width: 12px; height: 12px; }

.stat-hero { display: flex; gap: 12px; align-items: center; margin: 4px 0 12px; }
.stat-lv { flex: none; width: 68px; height: 68px; border-radius: 50%; border: 4px solid var(--ink); background: #e3d8f6; display: grid; place-content: center; text-align: center; box-shadow: 0 4px 0 rgba(75,46,42,.3); }
.stat-lv span { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; margin-bottom: -4px; }
.stat-lv b { font-size: 28px; line-height: 1; }
.stat-hero h3 { margin: 0; font-size: 18px; }
.muted { color: var(--ink-soft); }
.stat-hero p { margin: 2px 0 0; font-size: 13px; }
.bar { height: 24px; border: 3px solid var(--ink); border-radius: 999px; background: #efe0c0; overflow: hidden; box-shadow: inset 0 3px 0 rgba(75,46,42,.12); }
.bar-fill { height: 100%; width: 0; background: repeating-linear-gradient(-45deg, #ffd45e 0 10px, #ffc43d 10px 20px); border-right: 3px solid var(--ink); border-radius: 999px; transition: width .6s cubic-bezier(.2,.9,.3,1.1); }
.next-line { margin: 8px 2px 4px; font-size: 14px; font-weight: 500; }
.sheet h4 { margin: 12px 2px 6px; font-size: 13px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-soft); }
.scene-stats { display: grid; gap: 8px; }
.scene-stat { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; background: #fffdf5; border: 3px solid var(--ink); border-radius: 14px; cursor: pointer; width: 100%; text-align: left; }
.scene-stat svg { width: 30px; height: 30px; }
.scene-stat b { font-size: 14px; }
.scene-stat .mini { height: 10px; border: 2px solid var(--ink); border-radius: 999px; background: #efe0c0; overflow: hidden; margin-top: 3px; }
.scene-stat .mini i { display: block; height: 100%; background: var(--c, #ffd45e); }
.scene-stat em { font-style: normal; font-weight: 700; font-size: 13px; }

/* ---------- level-up pop-up ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; background: rgba(75,46,42,.5); animation: fade .2s; }
.modal {
  position: relative; width: min(100%, 360px); text-align: center; padding: 34px 18px 16px;
  background: var(--cream); border: 4px solid var(--ink); border-radius: 26px;
  box-shadow: inset 0 4px 0 rgba(255,255,255,.8), 0 8px 0 rgba(75,46,42,.35);
  animation: modalpop .45s cubic-bezier(.2,1.3,.4,1);
}
@keyframes modalpop { from { transform: scale(.6) rotate(-3deg); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-ribbon { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); padding: 4px 22px 6px; white-space: nowrap;
  font-size: 20px; font-weight: 700; letter-spacing: 2px; color: #fff; background: linear-gradient(#ff8d7c, #ef6e60); border: 3.5px solid var(--ink); border-radius: 12px;
  text-shadow: 0 2px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); box-shadow: 0 4px 0 rgba(75,46,42,.4); }
.modal-icon { width: 92px; height: 92px; margin: 4px auto 4px; display: grid; place-items: center; border-radius: 50%; border: 4px solid var(--ink);
  background: radial-gradient(circle at 50% 35%, #fff9d6, #ffe58a); box-shadow: 0 4px 0 rgba(75,46,42,.3); animation: iconbounce 1.3s ease-in-out infinite; }
.modal-icon svg { width: 60px; height: 60px; }
.modal-icon.wide { display: flex; align-items: center; justify-content: center; width: fit-content; min-width: 170px; padding: 0 18px; gap: 6px; border-radius: 48px; }
.modal-icon.wide svg { flex: none; }
.modal-icon.wide svg:nth-child(2) { width: 24px; height: 24px; }
@keyframes iconbounce { 50% { transform: translateY(-5px) rotate(3deg); } }
.modal-level { margin: 4px 0 0; font-size: 12px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--ink-soft); }
.modal h2 { margin: 2px 0 6px; font-size: 24px; line-height: 1.12; }
.scene-chip { display: inline-block; margin: 0 0 8px; padding: 3px 14px 4px; border: 3px solid var(--ink); border-radius: 999px; font-size: 13px; font-weight: 700; letter-spacing: .6px; }
.scene-chip.house { background: #f8b3a4; } .scene-chip.office { background: #cfc2f0; } .scene-chip.workshop { background: #9adcd6; }
.modal-desc { margin: 0 4px 10px; font-size: 14px; line-height: 1.35; }
.modal-say { display: flex; align-items: center; gap: 8px; text-align: left; margin: 0 0 12px; }
.say-face { flex: none; width: 52px; height: 74px; background: #cdebfa; border: 3px solid var(--ink); border-radius: 16px; overflow: hidden; }
.modal-say p { position: relative; flex: 1; margin: 0; padding: 8px 10px; font-size: 13px; line-height: 1.3; font-style: italic; background: #fffdf5; border: 3px solid var(--ink); border-radius: 14px; }
.modal-say p::before { content: ""; position: absolute; left: -12px; top: 24px; border: solid transparent; border-width: 8px 10px 8px 0; border-right-color: var(--ink); }
.modal-say p::after { content: ""; position: absolute; left: -7px; top: 26px; border: solid transparent; border-width: 6px 8px 6px 0; border-right-color: #fffdf5; }
.modal-actions { display: flex; gap: 10px; }
.wood-btn { flex: 1; padding: 10px 8px 12px; font-size: 16px; font-weight: 700; letter-spacing: .4px; cursor: pointer; color: var(--cream);
  background: linear-gradient(#e8b572, #c58a52); border: 3.5px solid var(--ink); border-radius: 14px;
  text-shadow: 0 2px 0 var(--ink), 1.5px 0 0 var(--ink), -1.5px 0 0 var(--ink);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.4), 0 4px 0 var(--ink); }
.wood-btn.go { flex: 1.7; background: linear-gradient(#7fd9a6, #3fb57a); }
.wood-btn.later { background: linear-gradient(#c9b9a8, #a8978a); flex: .8; }
.wood-btn:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255,255,255,.4), 0 1px 0 var(--ink); }

.confetti-layer { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* ---------- test panel (red dashed) ---------- */
.test-panel { margin: 18px 12px 0; padding: 12px 14px; border: 3px dashed #d93a2f; border-radius: 14px; background: rgba(255,240,238,.92); color: #8c1d14; }
.test-head { font-weight: 700; letter-spacing: 1px; color: #d93a2f; }
.test-head span { font-weight: 500; font-size: 12px; letter-spacing: 0; }
.test-note { margin: 4px 0 8px; font-size: 12px; }
.test-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.test-buttons button { font-size: 14px; font-weight: 700; padding: 7px 14px; border: 2px dashed #d93a2f; border-radius: 10px; background: #fff; color: #b3261e; cursor: pointer; }
.test-buttons button:active { background: #ffe3df; }
.test-buttons .reset { margin-left: auto; background: #d93a2f; color: #fff; border-style: solid; }
.test-readout { margin: 8px 0 0; font-size: 11px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.foot { margin: 12px 14px 0; font-size: 12px; text-align: center; color: #3e6a86; }

/* ---------- scene animations ---------- */
.flick { animation: flick 3.2s steps(1) infinite; }
@keyframes flick { 0%, 100% { opacity: 1; } 6% { opacity: .2; } 9% { opacity: .95; } 14% { opacity: .15; } 17% { opacity: 1; } 55% { opacity: .9; } 58% { opacity: .1; } 61% { opacity: 1; } 64% { opacity: .3; } 67% { opacity: 1; } }
.bob .char { animation: charbob 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.bob2 .char { animation: charbob 1.8s ease-in-out infinite .4s; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes charbob { 50% { transform: translateY(-1.8px) scale(1.01, 1.025); } }
.sweat { animation: sweat 2.2s ease-in infinite; }
@keyframes sweat { 0% { transform: translateY(-2px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(8px); opacity: 0; } }
.steam, .steamk { animation: steam 2.4s ease-out infinite; transform-box: fill-box; }
@keyframes steam { from { transform: translateY(2px); opacity: .9; } to { transform: translateY(-6px); opacity: 0; } }
.breath { animation: breath 3s ease-out infinite; }
@keyframes breath { 0% { transform: translate(0,3px) scale(.4); opacity: 0; } 30% { opacity: .9; } 100% { transform: translate(7px,-6px) scale(1.5); opacity: 0; } }
.drift2 { animation: skydrift 40s ease-in-out infinite alternate; }
.prop { animation: propbob 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes propbob { 50% { transform: translateY(-2px) rotate(-3deg); } }
.neon { animation: neon 4.5s steps(1) infinite; }
@keyframes neon { 0%, 100% { opacity: 1; } 91% { opacity: .55; } 93% { opacity: 1; } 96% { opacity: .5; } 97% { opacity: 1; } }
.heat { animation: heat 1.8s ease-in-out infinite; }
@keyframes heat { 50% { opacity: .55; } }
.beaconL { animation: beacon 1s steps(1) infinite; }
@keyframes beacon { 50% { opacity: .15; } }
.beacon { animation: beacon 1.2s steps(1) infinite; }
.botEyes { animation: blink 4s steps(1) infinite; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.drip { animation: drip 2s ease-in infinite; }
@keyframes drip { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(40px); opacity: 0; } }
.aerial { animation: aerial 5s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes aerial { 50% { transform: rotate(4deg); } }
.beltmove { animation: beltmove 1s linear infinite; }
@keyframes beltmove { to { transform: translate(-10.5px, 5.25px); } }
.trays { animation: trays 3s linear infinite; }
@keyframes trays { to { transform: translate(-24px, 12px); } }
.arm1 { animation: arm1 6s ease-in-out infinite; transform-origin: 0 0; }
.arm2 { animation: arm2 6s ease-in-out infinite; transform-origin: 0 0; }
.arm3 { animation: arm3 6s ease-in-out infinite; transform-origin: 0 0; }
@keyframes arm1 { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(8deg); } }
@keyframes arm2 { 0%, 100% { transform: rotate(8deg); } 50% { transform: rotate(-14deg); } }
@keyframes arm3 { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(14deg); } }
.glowc { animation: glow 2.6s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .15; } }
.steadyL .glowc { animation: none; }

/* freshly unlocked items */
.up.fresh { animation: freshpulse 1s ease-in-out infinite alternate; }
@keyframes freshpulse { from { filter: drop-shadow(0 0 1px #ffe27a); } to { filter: drop-shadow(0 0 9px #ffd23a) brightness(1.08); } }
.spark { animation: twinkle 1.1s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes twinkle { 0%, 100% { transform: scale(.2) rotate(0); opacity: 0; } 50% { transform: scale(1.15) rotate(25deg); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; }
}
@media (min-width: 520px) {
  .phone { margin-top: 10px; border-radius: 30px; box-shadow: 0 0 0 4px rgba(75,46,42,.0); }
  .tabs { border-radius: 0 0 26px 26px; }
}
@media (max-height: 720px) { .bubble p { font-size: 13px; } .bubble { min-height: 50px; padding-bottom: 8px; } }

/* ---------- extras: second row of round buttons, mystery, quests, perks, secrets ---------- */
.round-btn.second { top: 78px; }
.round-btn .dot { position: absolute; top: -9px; right: -7px; min-width: 22px; height: 22px; padding: 0 4px; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 700; line-height: 1;
  color: #fff; background: #ff6f61; border: 2.5px solid var(--ink); border-radius: 999px; text-shadow: 0 1px 0 rgba(75,46,42,.6); animation: newpop 1s ease-in-out infinite; }
.fork-btn { background: linear-gradient(#fff6e3, #ffe9b0); animation: forkglow 1.6s ease-in-out infinite alternate; }
@keyframes forkglow { from { box-shadow: 0 4px 0 rgba(75,46,42,.4), 0 0 0 0 rgba(255,212,94,0); } to { box-shadow: 0 4px 0 rgba(75,46,42,.4), 0 0 0 5px rgba(255,212,94,.9); } }

.sheet-note.small { font-size: 12px; margin-top: 8px; }
.up-row.mystery { cursor: default; background: #e9dfcd; }
.up-row.mystery.teaser { cursor: pointer; background: repeating-linear-gradient(135deg, #e4d9c4 0 10px, #ebe1cf 10px 20px); }
.up-row.mystery .ic { background: #cdbfa8; }
.up-row.mystery .ic.sil svg { filter: brightness(0) opacity(.55); }
.up-row.mystery .ic.q { font-size: 26px; font-weight: 700; color: #8c7a70; }
.up-row.mystery h3 { color: #6f5c52; letter-spacing: 3px; }
.up-row .hint { font-style: italic; color: #7a5a50; }
.chip.unk { background: #d6cab5; color: #8c7a70; }
.up-row.mystery.deep { opacity: .82; }
.up-row.mystery.deep .meta { color: #8c7a70; }

.streak-line { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px; padding: 6px 12px 6px 8px; background: #fff0c8; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 3px 0 rgba(75,46,42,.3); }
.streak-line .flame svg { display: block; }
.streak-line b { display: block; font-size: 16px; }
.streak-line em { display: block; font-style: normal; font-size: 12px; color: var(--ink-soft); }
.quest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.quest-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px 8px 8px; background: #fffdf5; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 3px 0 rgba(75,46,42,.3); }
.quest-row.done { background: #eaf7e4; }
.q-ic { width: 46px; height: 46px; display: grid; place-items: center; background: #fbe9c9; border: 2.5px solid var(--ink); border-radius: 14px; }
.quest-row.done .q-ic { background: #cdeec3; }
.q-tx h3 { margin: 0; font-size: 14.5px; line-height: 1.15; }
.q-tx p { margin: 2px 0 5px; font-size: 11.5px; line-height: 1.2; color: var(--ink-soft); }
.qbar { display: block; height: 14px; border: 2.5px solid var(--ink); border-radius: 999px; background: #efe0c0; overflow: hidden; }
.qbar i { display: block; height: 100%; background: repeating-linear-gradient(-45deg, #ffd45e 0 8px, #ffc43d 8px 16px); border-right: 2.5px solid var(--ink); border-radius: 999px; transition: width .5s; }
.qbar i[style*="width:0%"] { border-right: 0; }
.quest-row.done .qbar i { background: repeating-linear-gradient(-45deg, #8fdc9c 0 8px, #6cc884 8px 16px); }
.q-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; min-width: 62px; }
.q-meta b { font-size: 14px; }
.chip.reward { background: #ffe58a; } .chip.got { background: #b9ecc0; } .chip.perk { background: #e3d8f6; text-transform: none; letter-spacing: 0; font-size: 11px; line-height: 1.2; display: block; width: 100%; text-align: center; border-radius: 10px; padding: 3px 5px 4px; margin-top: auto; }
.claim-btn { font-family: inherit; font-size: 12px; font-weight: 700; color: #fff; padding: 4px 9px 5px; cursor: pointer; background: linear-gradient(#7fd9a6, #3fb57a); border: 2.5px solid var(--ink); border-radius: 11px; text-shadow: 0 1.5px 0 var(--ink); box-shadow: 0 3px 0 var(--ink); animation: newpop 1s ease-in-out infinite; }
.claim-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

.perk-list, .secret-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.perk { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 6px 10px 6px 7px; background: #fffdf5; border: 3px solid var(--ink); border-radius: 14px; }
.perk .pi, .secret-slot .pi { width: 40px; height: 40px; display: grid; place-items: center; background: #fbe9c9; border: 2.5px solid var(--ink); border-radius: 12px; }
.perk .pi.q, .secret-slot .pi.q { background: #ddd2bd; color: #8c7a70; font-size: 22px; font-weight: 700; }
.perk .tx b { display: block; font-size: 14px; }
.perk .tx span { display: block; font-size: 12px; color: var(--ink-soft); line-height: 1.2; }
.perk.got { background: #f1ecff; } .perk.got .tx span { color: #5a4a99; font-weight: 600; }
.perk.lock { background: #efe6d4; opacity: .8; }
.perk em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.mini-btn { font-family: inherit; font-size: 12px; font-weight: 700; color: #fff; padding: 5px 11px 6px; cursor: pointer; background: linear-gradient(#ff9b8a, #ef6e60); border: 2.5px solid var(--ink); border-radius: 11px; text-shadow: 0 1.5px 0 var(--ink); box-shadow: 0 3px 0 var(--ink); }
.secret-list { grid-template-columns: repeat(3, 1fr); gap: 7px; }
.secret-slot { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 8px 4px 7px; background: #efe6d4; border: 3px solid var(--ink); border-radius: 14px; font-size: 10.5px; line-height: 1.15; color: var(--ink-soft); }
.secret-slot b { font-size: 11.5px; color: var(--ink); min-height: 26px; display: grid; place-items: center; }
.secret-slot.got { background: #fff3c8; }
.secret-slot.got span { color: #8a5a00; font-weight: 700; }

/* extras pop-ups */
.m2 .modal-icon { height: 88px; width: 88px; }
.m2 .modal-icon svg { width: 62px; height: 62px; }
.m2 h2 { margin: 2px 4px 6px; font-size: 19px; line-height: 1.2; }
.m2 .amt { margin: 4px 0 2px; font-size: 38px; font-weight: 700; line-height: 1; color: #2e9a63; text-shadow: 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink); -webkit-text-stroke: 0; }
.m2 .amt { color: #8ff0b4; }
.m2 .amt small { font-size: 16px; letter-spacing: .6px; }
.m2-note { margin: 8px 6px 12px; font-size: 11.5px; line-height: 1.25; color: var(--ink-soft); }
.m2 .modal-ribbon { background: linear-gradient(#8fd4f3, #5eb4de); }
.m2.t-lucky .modal-ribbon { background: linear-gradient(#7fd9a6, #3fb57a); }
.m2.t-secret .modal-ribbon { background: linear-gradient(#c3a7ee, #9378d6); }
.m2.t-quest .modal-ribbon { background: linear-gradient(#ffb36b, #f08a3c); }
.m2.t-fork .modal-ribbon { background: linear-gradient(#ff9b8a, #ef6e60); font-size: 17px; }
.m2.golden { background: linear-gradient(#fffbe3, #ffefb0); }
.m2.golden .modal-ribbon { background: linear-gradient(#ffd45e, #f2a81d); }
.m2.golden .amt { color: #ffe27a; }
.m2.golden::before { content: ""; position: absolute; inset: 6px; border: 3px dashed #f2b933; border-radius: 20px; pointer-events: none; }
.m2.golden .modal-icon svg { animation: goldspin 2.4s ease-in-out infinite; }
@keyframes goldspin { 50% { transform: scale(1.12) rotate(6deg); } }
.forks { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 6px 0 4px; }
.fork-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 7px 10px; cursor: pointer; font-family: inherit; color: var(--ink); background: #fffdf5; border: 3.5px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 rgba(75,46,42,.4); }
.fork-opt:nth-child(1) { background: #eaf7e4; } .fork-opt:nth-child(2) { background: #fde7e1; }
.fork-opt b { font-size: 15px; line-height: 1.1; }
.fork-opt .bl { font-size: 11.5px; line-height: 1.22; color: var(--ink-soft); margin-bottom: 4px; }
.fork-opt .fi { width: 52px; height: 52px; display: grid; place-items: center; background: #fff6e3; border: 2.5px solid var(--ink); border-radius: 14px; }
.fork-opt:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(75,46,42,.4); }
.fork-opt:focus-visible { outline: 3px solid #ffd45e; }
@media (max-height: 760px) { .m2 { max-height: calc(100dvh - 40px); overflow-y: auto; } }

/* mystery markers + secrets in the scene */
.mq { animation: mqbob 2.2s ease-in-out infinite; cursor: pointer; }
@keyframes mqbob { 50% { transform: translateY(-3px); } }
.mystery.r1 .mq { animation-delay: -1s; }
.glint { animation: glint 3.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 50%; opacity: .0; }
@keyframes glint { 0%, 70%, 100% { opacity: 0; transform: scale(.4); } 82% { opacity: .85; transform: scale(1.1) rotate(20deg); } }
.zzz { animation: zzz 2.6s ease-in-out infinite; }
@keyframes zzz { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.secret.found { animation: secretin .6s cubic-bezier(.2,1.4,.4,1); transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes secretin { from { transform: scale(.2); opacity: 0; } }
.perk-prop { animation: secretin .5s cubic-bezier(.2,1.4,.4,1); transform-box: fill-box; transform-origin: 50% 100%; }

.test-buttons.row2 { margin-top: 8px; }
.test-buttons.row2 .reset { margin-left: 0; }
