/* Monster Melody Isles v3 — chunky candy-toy UI over a persistent 3D stage.
   Rule: no native scrollbars anywhere; content pages with big arrows (ui/kit/pager.js). */
:root {
  --ink: #2a1838;
  --ink-soft: #5d4a73;
  --paper: #fffaf3;
  --paper-2: #f4ecff;
  --purple: #7b4dff;
  --purple-dk: #5330c9;
  --purple-lt: #a88bff;
  --pink: #ff5c9a;
  --pink-dk: #d63a78;
  --yellow: #ffd23f;
  --yellow-dk: #d9a514;
  --green: #34c46a;
  --green-dk: #208f4a;
  --blue: #3fa9f5;
  --blue-dk: #1f7fc4;
  --red: #ff5a5f;
  --red-dk: #cc3338;
  --glass: rgba(34, 18, 70, 0.42);
  --font: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Varela Round', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1d1240; color: var(--ink); font-family: var(--font); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button { font-family: inherit; }
input, textarea { font-family: inherit; user-select: text; -webkit-user-select: text; }
.stage3d { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; z-index: 0; touch-action: none; outline: none; }
#app { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
#app button, #app input, #app .interactive, #app .panel, #app .pager, #app .card-hit { pointer-events: auto; }
.screen { position: absolute; inset: 0; animation: screen-in .35s ease both; }
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }
.hidden { display: none !important; }

/* ── icons ─────────────────────────────────────────────────────────────── */
.ico { display: block; flex: none; }

/* ── buttons ───────────────────────────────────────────────────────────── */
.gbtn {
  --c1: #9a72ff; --c2: var(--purple); --lip: var(--purple-dk); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px 12px; min-height: 50px; border: 0; border-radius: 999px; cursor: pointer;
  font-size: 18px; font-weight: 800; letter-spacing: .2px; color: var(--fg);
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: inset 0 3px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.08), 0 6px 0 var(--lip), 0 10px 18px rgba(30,5,80,.28);
  transition: transform .08s, box-shadow .08s, filter .15s; text-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.gbtn:hover { filter: brightness(1.06); }
.gbtn:active { transform: translateY(4px); box-shadow: inset 0 3px 0 rgba(255,255,255,.35), 0 2px 0 var(--lip), 0 4px 8px rgba(30,5,80,.25); }
.gbtn:disabled { filter: grayscale(.8) opacity(.55); pointer-events: none; }
.gbtn.big { font-size: 22px; padding: 14px 28px 15px; min-height: 62px; }
.gbtn.small { font-size: 15px; padding: 7px 14px 8px; min-height: 40px; box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 4px 0 var(--lip), 0 6px 10px rgba(30,5,80,.22); }
.gbtn.green { --c1: #5de08c; --c2: var(--green); --lip: var(--green-dk); }
.gbtn.pink { --c1: #ff86b5; --c2: var(--pink); --lip: var(--pink-dk); }
.gbtn.yellow, .gbtn.primary.yellow { --c1: #ffe474; --c2: var(--yellow); --lip: var(--yellow-dk); --fg: var(--ink); text-shadow: none; }
.gbtn.blue { --c1: #74c4ff; --c2: var(--blue); --lip: var(--blue-dk); }
.gbtn.danger { --c1: #ff8a8d; --c2: var(--red); --lip: var(--red-dk); }
.gbtn.ghost { --c1: #ffffff; --c2: #f3ecff; --lip: #cbbbe8; --fg: var(--purple-dk); text-shadow: none; }
.gbtn.wide { width: 100%; }

.gicon {
  --bg: #fff; --fg: var(--purple-dk); --lip: #c7b6ee;
  position: relative; display: inline-grid; place-items: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  color: var(--fg); background: radial-gradient(circle at 50% 30%, #fff, var(--bg) 70%);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.05), 0 5px 0 var(--lip), 0 8px 16px rgba(30,5,80,.3); transition: transform .08s, box-shadow .08s;
}
.gicon:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--lip), 0 3px 6px rgba(30,5,80,.25); }
.gicon.sm { width: 42px; height: 42px; }
.gicon.lg { width: 78px; height: 78px; }
.gicon.on, .gicon.purple { --bg: var(--purple); --fg: #fff; --lip: var(--purple-dk); background: linear-gradient(180deg, #9a72ff, var(--purple)); }
.gicon.yellow { --bg: var(--yellow); --fg: var(--ink); --lip: var(--yellow-dk); background: linear-gradient(180deg, #ffe474, var(--yellow)); }
.gicon.green { --bg: var(--green); --fg: #fff; --lip: var(--green-dk); background: linear-gradient(180deg, #5de08c, var(--green)); }
.gicon.pink { --bg: var(--pink); --fg: #fff; --lip: var(--pink-dk); background: linear-gradient(180deg, #ff86b5, var(--pink)); }
.gicon.red { --bg: var(--red); --fg: #fff; --lip: var(--red-dk); background: linear-gradient(180deg, #ff8a8d, var(--red)); }
.gicon:disabled { filter: grayscale(.9) opacity(.5); pointer-events: none; }
.gicon-label { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.gicon.rec.on { animation: rec-pulse 1s infinite; }
@keyframes rec-pulse { 50% { filter: brightness(1.25); } }

/* ── sheets (overlay pop-ups) ──────────────────────────────────────────── */
.sheet-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: max(12px, var(--safe-t)) 12px max(12px, var(--safe-b));
  background: radial-gradient(circle at 50% 40%, rgba(60,25,120,.35), rgba(15,5,40,.62)); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: fade-in .2s ease both; }
.sheet-overlay.closing { animation: fade-out .2s ease both; }
.sheet-overlay.closing .sheet { animation: sheet-out .2s ease both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.sheet { position: relative; display: flex; flex-direction: column; width: min(94vw, 560px); max-height: min(92vh, 900px); border-radius: 34px; background: var(--paper);
  border: 5px solid #fff; box-shadow: 0 12px 0 rgba(70,30,140,.35), 0 30px 70px rgba(10,0,40,.55); overflow: hidden; animation: sheet-in .42s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes sheet-in { from { transform: scale(.7) translateY(30px); opacity: 0; } }
@keyframes sheet-out { to { transform: scale(.85) translateY(20px); opacity: 0; } }
.sheet-sm { width: min(94vw, 440px); }
.sheet-lg { width: min(96vw, 1000px); height: min(90vh, 760px); }
.sheet-full { width: 96vw; height: 92vh; max-height: none; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 20px; color: #fff;
  background: linear-gradient(180deg, #9a72ff, var(--purple)); box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); }
.tone-pink .sheet-head { background: linear-gradient(180deg, #ff86b5, var(--pink)); }
.tone-green .sheet-head { background: linear-gradient(180deg, #5de08c, var(--green)); }
.tone-blue .sheet-head { background: linear-gradient(180deg, #74c4ff, var(--blue)); }
.tone-yellow .sheet-head { background: linear-gradient(180deg, #ffe474, var(--yellow)); color: var(--ink); }
.sheet-badge { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: var(--yellow); color: var(--ink); box-shadow: 0 4px 0 var(--yellow-dk); flex: none; }
.sheet-title { flex: 1; margin: 0; font-size: 26px; font-weight: 900; letter-spacing: .3px; text-shadow: 0 2px 0 rgba(0,0,0,.12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.close-x { --bg: var(--red); --fg: #fff; --lip: var(--red-dk); width: 52px; height: 52px; background: linear-gradient(180deg, #ff8a8d, var(--red)); flex: none; }
.sheet-body { flex: 1; min-height: 0; padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.sheet-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; padding: 4px 18px 22px; }
.sheet-text { margin: 4px 6px; font-size: 20px; line-height: 1.45; text-align: center; color: var(--ink-soft); font-weight: 700; }
.text-input { width: 100%; padding: 12px 16px; font-size: 20px; font-weight: 800; color: var(--ink); background: #fff; border: 4px solid #e4d9f7; border-radius: 20px; outline: none; }
.text-input:focus { border-color: var(--purple-lt); }
.text-input.big { font-size: 24px; text-align: center; }

/* ── pager ─────────────────────────────────────────────────────────────── */
.pager { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr auto; align-items: center; gap: 6px 10px; outline: none; }
.pager-viewport { grid-column: 2; grid-row: 1; height: 100%; min-height: 0; overflow: hidden; touch-action: pan-y; }
.pager-track { display: flex; height: 100%; will-change: transform; }
.pager-page { flex: 0 0 100%; height: 100%; display: grid; justify-content: center; align-content: center; padding: 6px; }
.pager-page.empty { display: grid; place-items: center; text-align: center; font-size: 20px; font-weight: 800; color: var(--ink-soft); }
.pager-arrow { grid-row: 1; width: 66px; height: 66px; display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer; color: var(--ink);
  background: linear-gradient(180deg, #ffe474, var(--yellow)); box-shadow: inset 0 3px 0 rgba(255,255,255,.5), 0 6px 0 var(--yellow-dk), 0 9px 16px rgba(40,10,80,.3); transition: transform .08s, opacity .2s; }
.pager-arrow:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--yellow-dk); }
.pager-arrow:disabled { opacity: .28; pointer-events: none; filter: grayscale(.6); }
.pager-arrow.prev { grid-column: 1; }
.pager-arrow.next { grid-column: 3; }
.pager.single .pager-arrow { visibility: hidden; width: 0; }
.pager-dots { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: center; gap: 8px; min-height: 14px; }
.pager-dot { width: 14px; height: 14px; padding: 0; border: 0; border-radius: 8px; background: #d8cbee; cursor: pointer; transition: width .25s, background .25s; }
.pager-dot.on { width: 34px; background: var(--purple); }
.pager.dragging { cursor: grabbing; }
.pager.dark .pager-dot { background: rgba(255,255,255,.35); }
.pager.dark .pager-dot.on { background: var(--yellow); }

/* ── tabs ──────────────────────────────────────────────────────────────── */
.gtabs { display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: #ece3fb; align-self: center; flex-wrap: wrap; justify-content: center; }
.gtab { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 6px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--purple-dk); font-size: 17px; font-weight: 800; cursor: pointer; }
.gtab.on { background: #fff; color: var(--purple); box-shadow: 0 4px 0 #cdbdf0; }
.gtab-emoji { font-size: 20px; }

/* ── monster cards ─────────────────────────────────────────────────────── */
.mcard { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; padding: 6px 6px 8px; border: 0; border-radius: 24px; cursor: pointer;
  background: linear-gradient(180deg, var(--tint, #efe6ff) 0%, #fff 62%); box-shadow: inset 0 0 0 3px rgba(255,255,255,.9), 0 6px 0 #d9ccef, 0 10px 18px rgba(60,20,120,.16); transition: transform .12s; color: var(--ink); }
.mcard:hover { transform: translateY(-3px) rotate(-1deg); }
.mcard:active { transform: translateY(3px); box-shadow: inset 0 0 0 3px #fff, 0 2px 0 #d9ccef; }
.mcard .thumb { width: 100%; flex: 1; min-height: 0; object-fit: contain; filter: drop-shadow(0 6px 4px rgba(40,10,80,.18)); }
.mcard-name { font-size: 15px; font-weight: 900; line-height: 1.1; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard-meta { display: flex; gap: 4px; font-size: 13px; margin-top: 2px; }
.mcard.locked .thumb { filter: brightness(0) opacity(.28); }
.mcard.locked .mcard-name { color: #9b8db0; }
.mcard-badge { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: var(--green); box-shadow: 0 3px 0 var(--green-dk); }
.mcard-badge.lock { background: #9b8db0; box-shadow: 0 3px 0 #7a6d8f; }
.mcard.selected { box-shadow: inset 0 0 0 4px var(--yellow), 0 6px 0 var(--yellow-dk), 0 0 0 4px rgba(255,210,63,.35); }
.thumb.loading { border-radius: 50%; background: radial-gradient(circle, rgba(155,108,255,.18), transparent 65%); animation: shimmer 1.2s infinite; }
@keyframes shimmer { 50% { opacity: .45; } }
.role-pill { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 99px; background: rgba(123,77,255,.12); font-weight: 800; font-size: 12px; }

/* ── HUD ───────────────────────────────────────────────────────────────── */
.hud-top { position: absolute; top: calc(10px + var(--safe-t)); left: 12px; right: 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hud-cluster { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hud-title { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; font-weight: 900; font-size: 20px; box-shadow: 0 6px 18px rgba(10,0,40,.25); }
.hud-title .world-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.92); font-size: 26px; }
.hud-pill { pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 6px 18px rgba(10,0,40,.25); }
.hud-value { min-width: 46px; text-align: center; color: #fff; font-weight: 900; font-size: 18px; }
.hud-bottom { position: absolute; left: 12px; right: 12px; bottom: calc(14px + var(--safe-b)); display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hud-bottom .center { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); }
.add-btn { font-size: 24px; min-height: 70px; padding: 14px 30px; }
.add-btn .ico { width: 32px; height: 32px; }
.loop-progress { position: absolute; left: 0; right: 0; top: 0; height: 6px; background: rgba(255,255,255,.18); }
.loop-progress > div { height: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--yellow), var(--pink)); }
.section-tag { position: absolute; top: calc(84px + var(--safe-t)); left: 50%; transform: translateX(-50%); padding: 6px 16px; border-radius: 99px; color: #fff; font-weight: 900; background: var(--glass); }
.hint-bubble { position: absolute; left: 50%; bottom: calc(110px + var(--safe-b)); transform: translateX(-50%); padding: 12px 22px; border-radius: 26px; background: #fff; color: var(--ink); font-weight: 900; font-size: 20px; box-shadow: 0 6px 0 #d9ccef, 0 10px 24px rgba(20,0,60,.3); animation: bob 1.6s ease-in-out infinite; white-space: nowrap; }
@keyframes bob { 50% { transform: translate(-50%, -8px); } }
.loading-veil { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, rgba(40,15,90,.55), rgba(20,5,50,.85)); color: #fff; z-index: 5; pointer-events: auto; transition: opacity .5s; }
.loading-veil.out { opacity: 0; pointer-events: none; }
.loading-card { display: flex; flex-direction: column; align-items: center; gap: 16px; font-size: 24px; font-weight: 900; }
.loading-bar { width: min(70vw, 360px); height: 22px; border-radius: 99px; background: rgba(255,255,255,.2); overflow: hidden; box-shadow: inset 0 3px 6px rgba(0,0,0,.25); }
.loading-bar > div { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--yellow), var(--pink)); transition: width .2s; }
.bouncy-egg { width: 90px; height: 110px; border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%; background: radial-gradient(circle at 35% 30%, #fff, #ffd6f0 40%, #c9a7ff); box-shadow: 0 10px 0 rgba(0,0,0,.15); animation: egg-bounce .8s ease-in-out infinite; }
@keyframes egg-bounce { 0%, 100% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-26px) scale(.95, 1.05); } 60% { transform: translateY(0) scale(1.08, .92); } }

/* monster bubble menu */
.bubble-menu { position: absolute; z-index: 20; width: 300px; padding: 14px; border-radius: 28px; background: var(--paper); border: 4px solid #fff;
  box-shadow: 0 8px 0 #d6c8ef, 0 20px 40px rgba(20,0,60,.35); pointer-events: auto; animation: pop-in .3s cubic-bezier(.2,1.5,.4,1) both; }
.bubble-menu::after { content: ''; position: absolute; left: var(--tail, 50%); bottom: -16px; width: 28px; height: 28px; background: var(--paper); transform: translateX(-50%) rotate(45deg); border-right: 4px solid #fff; border-bottom: 4px solid #fff; border-radius: 0 0 8px 0; }
.bubble-menu.below::after { top: -16px; bottom: auto; transform: translateX(-50%) rotate(225deg); }
@keyframes pop-in { from { transform: scale(.5); opacity: 0; } }
.bm-head { display: flex; align-items: center; gap: 10px; }
.bm-head .thumb { width: 64px; height: 64px; }
.bm-name { font-size: 22px; font-weight: 900; line-height: 1.05; }
.bm-sub { font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.bm-blurb { margin: 8px 2px; font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.bm-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; justify-items: center; }
.bm-row .gicon { width: 58px; height: 58px; }
.bm-cap { font-size: 12px; font-weight: 900; text-align: center; color: var(--ink-soft); margin-top: 4px; }
.vol-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.vol-meter { flex: 1; height: 16px; border-radius: 99px; background: #ece3fb; overflow: hidden; }
.vol-meter > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--yellow)); }

/* placement bar */
.place-bar { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 10px; border-radius: 999px;
  background: rgba(255,250,243,.95); box-shadow: 0 8px 0 #d6c8ef, 0 16px 30px rgba(20,0,60,.35); pointer-events: auto; animation: pop-in .3s both; }
.place-bar .thumb { width: 64px; height: 64px; }
.place-bar-text { font-size: 19px; font-weight: 900; max-width: 260px; }

/* ── title ─────────────────────────────────────────────────────────────── */
.title-screen { display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: calc(4vh + var(--safe-t)) 16px calc(5vh + var(--safe-b)); }
.logo { text-align: center; pointer-events: none; animation: logo-in .9s cubic-bezier(.2,1.4,.4,1) both; }
.logo-line { display: block; font-size: clamp(40px, 8.5vw, 92px); font-weight: 900; line-height: .95; letter-spacing: 1px; color: #fff;
  -webkit-text-stroke: 3px rgba(60,20,120,.0); text-shadow: 0 4px 0 #b78cff, 0 8px 0 #7b4dff, 0 12px 0 #4f2bbf, 0 18px 30px rgba(20,0,60,.55); }
.logo-line.small { font-size: clamp(30px, 5.5vw, 62px); color: var(--yellow); text-shadow: 0 4px 0 #ffb52e, 0 8px 0 #e0891a, 0 14px 24px rgba(20,0,60,.5); }
.logo-line .bounce { display: inline-block; animation: letter 2.4s ease-in-out infinite; }
@keyframes letter { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-14px) rotate(-4deg); } 90% { transform: translateY(2px); } }
@keyframes logo-in { from { transform: scale(.5) translateY(-40px); opacity: 0; } }
.title-buttons { display: flex; flex-direction: column; align-items: center; gap: 16px; width: min(92vw, 420px); }
.title-buttons .gbtn { width: 100%; }
.title-row { display: flex; gap: 14px; justify-content: center; }
.title-foot { color: rgba(255,255,255,.75); font-weight: 800; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }

/* ── map (world chooser) ───────────────────────────────────────────────── */
.map-screen .hud-top { align-items: center; }
.map-dock { position: absolute; left: 0; right: 0; bottom: calc(10px + var(--safe-b)); height: min(300px, 40vh); padding: 0 12px; display: flex; flex-direction: column; }
.map-dock .pager { flex: 1; }
.world-card { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding: 10px; border: 0; border-radius: 28px; cursor: pointer; overflow: hidden; color: #fff; text-align: left;
  background: linear-gradient(180deg, var(--w1), var(--w2)); box-shadow: inset 0 0 0 4px rgba(255,255,255,.75), 0 7px 0 rgba(30,10,70,.45), 0 12px 24px rgba(10,0,40,.35); transition: transform .15s; }
.world-card:hover { transform: translateY(-4px) rotate(-1deg); }
.world-card.selected { box-shadow: inset 0 0 0 5px var(--yellow), 0 7px 0 var(--yellow-dk), 0 0 0 6px rgba(255,210,63,.4), 0 14px 26px rgba(10,0,40,.4); transform: translateY(-6px) scale(1.03); }
.world-card .w-icon { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); font-size: 54px; filter: drop-shadow(0 6px 4px rgba(0,0,0,.25)); }
.world-card .w-name { font-size: 18px; font-weight: 900; line-height: 1.05; text-shadow: 0 2px 4px rgba(0,0,0,.45); }
.world-card .w-meta { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 800; opacity: .95; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.world-card .w-band { position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 99px; background: rgba(0,0,0,.35); font-weight: 900; font-size: 13px; }
.map-info { position: absolute; top: calc(86px + var(--safe-t)); left: 50%; transform: translateX(-50%); text-align: center; color: #fff; pointer-events: none; width: 90vw; }
.map-info h1 { margin: 0; font-size: clamp(30px, 5vw, 54px); font-weight: 900; text-shadow: 0 4px 0 rgba(60,20,120,.6), 0 8px 24px rgba(0,0,0,.4); }
.map-info p { margin: 6px 0 0; font-size: 19px; font-weight: 800; text-shadow: 0 2px 6px rgba(0,0,0,.55); }
.map-go { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(min(300px, 40vh) + 26px + var(--safe-b)); }

/* ── lab ───────────────────────────────────────────────────────────────── */
.lab-wrap { position: absolute; inset: calc(84px + var(--safe-t)) 12px calc(12px + var(--safe-b)); display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.lab-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 12px; border-radius: 30px; background: rgba(255,250,243,.93); box-shadow: 0 8px 0 rgba(70,30,140,.35), 0 20px 40px rgba(10,0,40,.35); pointer-events: auto; }
.lab-col h3 { margin: 2px 0 0; text-align: center; font-size: 20px; font-weight: 900; color: var(--purple-dk); }
.lab-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-width: 200px; }
.lab-slot { width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.9); box-shadow: inset 0 6px 14px rgba(60,20,120,.2), 0 6px 0 rgba(70,30,140,.3); }
.lab-slot .thumb { width: 140px; height: 140px; }
.lab-plus { font-size: 40px; font-weight: 900; color: #fff; text-shadow: 0 3px 0 var(--purple-dk); }
.egg-stage { position: relative; width: 240px; height: 260px; display: grid; place-items: center; }
.big-egg { width: 170px; height: 210px; border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%; background: radial-gradient(circle at 35% 30%, #fff, #ffe3f3 35%, #d7b8ff 75%, #a27bff); box-shadow: inset -10px -14px 0 rgba(90,40,160,.18), 0 14px 0 rgba(60,20,120,.3); position: relative; }
.big-egg::before, .big-egg::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.55); }
.big-egg::before { width: 34px; height: 22px; left: 30px; top: 40px; }
.big-egg::after { width: 18px; height: 18px; right: 40px; top: 90px; background: #ffb3dd; }
.big-egg.wobble { animation: egg-wobble .5s ease-in-out infinite; }
.big-egg.crack { animation: egg-crack .35s ease-in-out 3; }
@keyframes egg-wobble { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes egg-crack { 50% { transform: scale(1.12, .9); } }
.hatch-burst { position: absolute; inset: -40px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,220,.95), rgba(255,210,63,.4) 45%, transparent 70%); animation: burst .9s ease-out both; pointer-events: none; }
@keyframes burst { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.hatch-reveal { width: 230px; height: 230px; animation: reveal .7s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes reveal { from { transform: scale(.1) rotate(-30deg); } }

/* ── pedia / detail ────────────────────────────────────────────────────── */
.detail { display: grid; grid-template-columns: minmax(180px, 300px) 1fr; gap: 18px; align-items: center; min-height: 0; }
.detail .thumb { width: 100%; height: auto; aspect-ratio: 1; }
.detail h3 { margin: 0; font-size: 30px; font-weight: 900; }
.detail p { margin: 8px 0; font-size: 18px; font-weight: 700; color: var(--ink-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: #ece3fb; font-weight: 800; font-size: 15px; }

/* ── lists in sheets (songs, slots, library) ───────────────────────────── */
.row-card { width: 100%; height: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 24px; background: #fff; box-shadow: inset 0 0 0 3px #f1e9ff, 0 5px 0 #ddd0f1; }
.row-card .r-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: #f2ebff; font-size: 30px; flex: none; overflow: hidden; }
.row-card .r-icon .thumb { width: 56px; height: 56px; }
.row-card .r-main { flex: 1; min-width: 0; }
.row-card .r-title { font-size: 19px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-card .r-sub { font-size: 14px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-card .r-actions { display: flex; gap: 8px; flex: none; }
.row-card.current { box-shadow: inset 0 0 0 4px var(--yellow), 0 5px 0 var(--yellow-dk); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 22px; background: #fff; box-shadow: 0 4px 0 #e3d7f5; font-size: 19px; font-weight: 900; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .hud-value { color: var(--ink); }
.toggle { position: relative; width: 74px; height: 42px; border: 0; border-radius: 99px; background: #d8cbee; cursor: pointer; transition: background .2s; }
.toggle::after { content: ''; position: absolute; top: 5px; left: 5px; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.15); transition: transform .2s; }
.toggle.on { background: var(--green); }
.toggle.on::after { transform: translateX(32px); }

/* arranger */
.arr-grid { display: grid; gap: 6px; align-content: start; }
.arr-name { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 15px; overflow: hidden; }
.arr-name .thumb { width: 40px; height: 40px; flex: none; }
.arr-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arr-col { text-align: center; font-weight: 900; color: var(--ink-soft); border-radius: 12px; padding: 4px 0; }
.arr-col.now, .arr-cell.now { box-shadow: 0 0 0 3px var(--yellow); }
.arr-cell { height: 44px; border: 0; border-radius: 14px; cursor: pointer; background: #eee6fa; box-shadow: inset 0 -3px 0 rgba(0,0,0,.06); }
.arr-cell.on { background: var(--c, var(--purple)); box-shadow: inset 0 3px 0 rgba(255,255,255,.35), 0 3px 0 rgba(0,0,0,.18); }
.arr-off .arr-cell { opacity: .45; }
.sheet-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }

/* maker */
.maker-wrap { position: absolute; inset: calc(84px + var(--safe-t)) 12px calc(12px + var(--safe-b)); display: grid; grid-template-columns: minmax(260px, 42%) 1fr; gap: 14px; }
.maker-preview { position: relative; border-radius: 30px; background: radial-gradient(circle at 50% 40%, #fff, #efe4ff 70%); box-shadow: 0 8px 0 rgba(70,30,140,.35), 0 20px 40px rgba(10,0,40,.35); overflow: hidden; pointer-events: auto; display: flex; flex-direction: column; }
.maker-preview canvas { flex: 1; min-height: 0; width: 100%; display: block; }
.maker-name { display: flex; gap: 8px; padding: 10px; }
.maker-panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 12px; border-radius: 30px; background: rgba(255,250,243,.95); box-shadow: 0 8px 0 rgba(70,30,140,.35), 0 20px 40px rgba(10,0,40,.35); pointer-events: auto; }
.opt { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; border: 0; border-radius: 22px; cursor: pointer; background: #fff; color: var(--ink);
  box-shadow: inset 0 0 0 3px #f1e9ff, 0 5px 0 #ddd0f1; font-weight: 900; font-size: 14px; }
.opt.on { box-shadow: inset 0 0 0 4px var(--purple), 0 5px 0 var(--purple-dk); color: var(--purple-dk); }
.opt .thumb { width: 100%; flex: 1; min-height: 0; object-fit: contain; }
.opt .swatch { width: 70%; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 -6px 0 rgba(0,0,0,.15), 0 3px 0 rgba(0,0,0,.12); }
.opt .emoji { font-size: 34px; }
.note-grid { display: grid; gap: 3px; flex: 1; min-height: 0; }
.note-cell { border: 0; border-radius: 8px; background: #efe7fb; cursor: pointer; padding: 0; }
.note-cell.beat { background: #e5dbf7; }
.note-cell.on { background: var(--c, var(--purple)); box-shadow: inset 0 2px 0 rgba(255,255,255,.4); }
.note-cell.now { outline: 3px solid var(--yellow); }

/* toasts */
.toast-host { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 20px 10px 10px; border-radius: 99px; background: #fff; color: var(--ink); font-weight: 900; font-size: 18px;
  box-shadow: 0 6px 0 #d6c8ef, 0 12px 26px rgba(20,0,60,.3); animation: toast-in .4s cubic-bezier(.2,1.5,.4,1) both; max-width: 92vw; }
.toast.out { animation: toast-out .3s ease both; }
.toast-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--yellow); color: var(--ink); flex: none; }
.toast-emoji { font-size: 20px; }
@keyframes toast-in { from { transform: translateY(-30px) scale(.7); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-20px); opacity: 0; } }

.no-gl { position: fixed; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; color: #fff; font-size: 22px; font-weight: 800; background: linear-gradient(#3b2a78, #1d1240); }

@media (max-width: 720px) {
  .lab-wrap, .maker-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .lab-mid { flex-direction: row; min-width: 0; }
  .lab-slot { width: 110px; height: 110px; }
  .lab-slot .thumb { width: 90px; height: 90px; }
  .detail { grid-template-columns: 1fr; }
  .pager-arrow { width: 52px; height: 52px; }
  .gicon { width: 50px; height: 50px; }
  .hud-title { font-size: 16px; }
  .sheet-title { font-size: 21px; }
}
@media (max-height: 520px) {
  .map-dock { height: 44vh; }
  .gbtn.big { min-height: 52px; font-size: 19px; }
}
.del { position: absolute; top: -8px; right: -8px; }
.maker-stage-gap { min-height: 0; }
.world-screen .hud-bottom .center .gbtn.hidden { display: none; }
/* lab: narrow layout = bench on top, one panel below with a switch */
.lab-narrow-panel { display: none; }
.lab-screen.narrow .lab-wrap { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
.lab-screen.narrow .lab-mid { grid-row: 1; flex-direction: row; flex-wrap: wrap; min-width: 0; gap: 10px; }
.lab-screen.narrow .lab-slot { width: 120px; height: 120px; }
.lab-screen.narrow .lab-slot .thumb { width: 100px; height: 100px; }
.lab-screen.narrow .egg-stage { width: 150px; height: 170px; }
.lab-screen.narrow .big-egg { width: 120px; height: 150px; }
.lab-screen.narrow .lab-narrow-panel { display: flex; justify-content: center; grid-row: 2; pointer-events: auto; }
.lab-screen.narrow .lab-col { grid-row: 3; min-height: 0; }
.lab-col .gtabs { gap: 2px; padding: 4px; }
.lab-col .gtab { min-height: 38px; padding: 4px 10px; font-size: 15px; }
.lab-switch { background: rgba(255,255,255,.85); }
.world-card::after { content: ''; position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(180deg, transparent, rgba(30,10,70,.72)); pointer-events: none; }
.world-card .w-name, .world-card .w-meta { position: relative; z-index: 1; }
.world-card .w-icon { z-index: 1; }
