:root {
  --rose: #7a3e52;
  --mint: #7fd8c0;
  --peach: #ffb3b8;
  --cream: #fff7ec;
  --butter: #ffe08a;
  --font: "Arial Rounded MT Bold", "Nunito", "Trebuchet MS", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #fde7ec; touch-action: none; user-select: none; -webkit-user-select: none; }
#app { position: fixed; inset: 0; overflow: hidden; font-family: var(--font); font-weight: 900; color: #fff; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

.outline { paint-order: stroke fill; -webkit-text-stroke: 5px var(--rose); text-shadow: 0 3px 0 var(--rose); }

/* HUD */
#hud { position: absolute; left: 0; right: 0; top: 0; padding: calc(10px + env(safe-area-inset-top)) 64px 0 10px; pointer-events: none; }
.hud-row { display: flex; gap: 6px; align-items: center; }
.pill { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 10px 0 6px; border-radius: 20px;
  background: rgba(255, 247, 236, 0.92); box-shadow: 0 3px 0 rgba(122, 62, 82, 0.35), inset 0 -3px 0 rgba(255, 179, 184, 0.6); }
.pill .ico { font-size: 20px; line-height: 1; }
.pill .ico-img { width: 26px; height: 26px; object-fit: contain; }
.pill .num { font-size: 20px; color: var(--rose); min-width: 26px; text-align: left; }
#hud-time.warn { background: #ffd2d2; animation: pulse 0.5s infinite alternate; }
#hud-time.warn .num { color: #d23a52; }
.chips { margin-top: 6px; gap: 5px; }
.chip { display: flex; align-items: center; gap: 2px; height: 34px; padding: 0 8px 0 5px; border-radius: 17px; background: rgba(255,255,255,0.85);
  box-shadow: 0 2px 0 rgba(122,62,82,0.3); transition: transform .2s, opacity .3s; }
.chip .e { font-size: 18px; }
.chip .n { font-size: 17px; color: var(--rose); }
.chip.done { opacity: 0.55; }
.chip.done .n::after { content: " ✓"; color: #3aa88a; }
.chip.bump { transform: scale(1.25); }
.combo { position: absolute; left: 50%; top: calc(108px + env(safe-area-inset-top)); transform: translateX(-50%) scale(0); font-size: 26px; color: var(--butter);
  paint-order: stroke fill; -webkit-text-stroke: 6px var(--rose); text-shadow: 0 3px 0 var(--rose); white-space: nowrap; transition: transform .18s cubic-bezier(.3,1.8,.5,1); }
.combo.show { transform: translateX(-50%) scale(1); }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.08); } }

/* floating texts */
#fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.float { position: absolute; transform: translate(-50%, -50%); font-size: 22px; white-space: nowrap; paint-order: stroke fill; -webkit-text-stroke: 5px var(--rose); text-shadow: 0 2px 0 var(--rose); }
.float.bad { color: #ffd0d0; font-size: 18px; }
.float.gold { color: var(--butter); }

/* Title */
#title { position: absolute; inset: 0; cursor: pointer; }
#title-bg { position: absolute; inset: 0; background: url(../assets/cover-bg.webp) center / cover no-repeat, #fde7ec; animation: bgzoom 14s ease-in-out infinite alternate; }
@keyframes bgzoom { from { transform: scale(1.02); } to { transform: scale(1.08); } }
#title-logo { position: absolute; left: 50%; top: 9%; width: 82%; max-height: 30%; object-fit: contain; transform: translateX(-50%); filter: drop-shadow(0 6px 0 rgba(122,62,82,0.25));
  animation: logoIn .7s cubic-bezier(.3,1.6,.5,1) both, float 3s 0.7s ease-in-out infinite alternate; }
@keyframes logoIn { from { transform: translateX(-50%) translateY(-60px) scale(.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
@keyframes float { from { transform: translateX(-50%) translateY(0); } to { transform: translateX(-50%) translateY(-8px); } }
#title-prompt { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); font-size: 22px; white-space: nowrap; padding: 10px 22px; border-radius: 30px;
  background: rgba(122, 62, 82, 0.35); paint-order: stroke fill; -webkit-text-stroke: 5px var(--rose); text-shadow: 0 3px 0 var(--rose); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); } 50% { opacity: .75; transform: translateX(-50%) scale(.96); } }
.corner-btn { all: unset; position: absolute; top: calc(12px + env(safe-area-inset-top)); width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: rgba(255, 247, 236, 0.7); box-shadow: 0 3px 0 rgba(122,62,82,0.35); cursor: pointer; transition: transform .12s; }
.corner-btn:active { transform: scale(0.9); }
.corner-btn img { width: 34px; height: 34px; object-fit: contain; }
#btn-trophy { right: calc(12px + env(safe-area-inset-right)); }
.corner-col { position: absolute; left: calc(12px + env(safe-area-inset-left)); top: 0; }
.corner-col .corner-btn { position: relative; left: 0; display: flex; margin-top: 12px; top: env(safe-area-inset-top); }

/* Banner */
#banner { position: absolute; left: 0; right: 0; top: 36%; text-align: center; pointer-events: none; }
#banner .b-main { font-size: clamp(28px, 10vw, 46px); padding: 0 12px; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 8px var(--rose); text-shadow: 0 5px 0 var(--rose); animation: slam .45s cubic-bezier(.3,1.7,.5,1) both; }
#banner .b-sub { margin-top: 8px; font-size: 22px; color: var(--butter); paint-order: stroke fill; -webkit-text-stroke: 5px var(--rose); text-shadow: 0 3px 0 var(--rose); animation: slam .45s .12s cubic-bezier(.3,1.7,.5,1) both; padding: 0 16px; }
@keyframes slam { from { transform: scale(2.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Panels */
#panel-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(122, 62, 82, 0.35); }
.panel { position: relative; width: min(88%, 380px); padding: 34px 26px 26px; border-style: solid; border-width: 40px; border-image: url(../assets/ui-panel.webp) 120 fill / 40px stretch;
  color: var(--rose); text-align: center; animation: pop .28s cubic-bezier(.3,1.6,.5,1) both; }
.panel.noimg { border: 6px solid var(--peach); border-radius: 30px; background: var(--cream); }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.panel h2 { margin: -20px 0 10px; font-size: 34px; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 7px var(--rose); text-shadow: 0 4px 0 var(--rose); }
.panel .sub { font-size: 16px; margin: 4px 0 10px; color: var(--rose); }
.stars { font-size: 46px; letter-spacing: 6px; margin: 2px 0 6px; }
.stars span { display: inline-block; color: #e6d6d9; paint-order: stroke fill; -webkit-text-stroke: 4px var(--rose); }
.stars span.on { color: var(--butter); animation: starPop .4s cubic-bezier(.3,1.8,.5,1) both; }
@keyframes starPop { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }
.rows { margin: 6px 0 12px; font-size: 17px; }
.rows .r { display: flex; justify-content: space-between; padding: 5px 4px; border-bottom: 2px dashed rgba(122,62,82,0.18); }
.rows .r b { color: #e0708a; }
.rows .r img { width: 22px; height: 22px; vertical-align: -5px; margin-right: 3px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.btn { all: unset; box-sizing: border-box; min-width: 110px; min-height: 52px; padding: 6px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font); font-weight: 900; font-size: 19px; color: #fff; cursor: pointer; text-align: center;
  border-radius: 28px; background: linear-gradient(180deg, #b3f1df 0%, #7fd8c0 55%, #64c7ab 100%);
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.7), inset 0 -4px 0 rgba(47,127,107,0.35), 0 4px 0 #3e9f86, 0 6px 10px rgba(122,62,82,0.2);
  paint-order: stroke fill; -webkit-text-stroke: 4px #2f7f6b; text-shadow: 0 2px 0 #2f7f6b; transition: transform .12s, filter .12s; }
.btn.alt { filter: hue-rotate(150deg) saturate(1.1); }
.btn.grey { filter: grayscale(0.9) brightness(1.05); }
.btn:active, .btn.pressed { transform: scale(0.92); }
.btn.focus { transform: scale(1.07); filter: brightness(1.12) drop-shadow(0 0 6px #fff); }
.btn.alt.focus { filter: hue-rotate(150deg) brightness(1.12) drop-shadow(0 0 6px #fff); }
.btn.disabled { filter: grayscale(1) opacity(0.6); pointer-events: none; }
.btn.small { min-width: 90px; min-height: 46px; font-size: 17px; }
.btn img { width: 24px; height: 24px; object-fit: contain; }
.btn.icon { min-width: 52px; padding: 6px 6px; font-size: 24px; }
.help { text-align: left; font-size: 16px; line-height: 1.45; margin: 4px 0 12px; }
.help p { margin: 6px 0; }

/* Intro */
#intro { position: absolute; inset: 0; background: #fde7ec url(../assets/cover-bg.webp) center / cover no-repeat; }
#intro video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#intro-skip { position: absolute; right: 18px; bottom: calc(26px + env(safe-area-inset-bottom)); z-index: 2; }

/* controls hint under the HUD */
#hint { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 104px); transform: translateX(-50%); z-index: 6; height: auto; min-height: 30px;
  font-size: 14px; color: var(--rose); white-space: nowrap; padding: 5px 14px; pointer-events: none; max-width: 94%; overflow: hidden; text-overflow: ellipsis; }
/* "pick an item below first": a small pulsing line between the box and the tray */
#pick-hint { position: absolute; z-index: 6; transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap;
  font: 900 15px/1 var(--font); color: #fff; padding: 5px 14px; border-radius: 999px;
  background: rgba(122, 62, 82, 0.78); box-shadow: 0 2px 0 rgba(122, 62, 82, 0.35);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); animation: pickPulse 1.4s ease-in-out infinite; }
@keyframes pickPulse { 0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } }

/* phone d-pad (bottom-left, touch only, during play) */
#dpad { position: absolute; left: calc(12px + env(safe-area-inset-left, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 7;
  width: 180px; height: 180px; display: grid; grid-template-columns: 60px 60px 60px; grid-template-rows: 60px 60px 60px;
  grid-template-areas: ". u ." "l . r" ". d ."; touch-action: none; user-select: none; -webkit-user-select: none; transition: opacity 0.2s; }
#dpad.hidden { display: none; }
#dpad::before { content: ""; grid-area: 2 / 2; margin: 6px; border-radius: 50%; background: rgba(255, 247, 236, 0.75); box-shadow: inset 0 2px 4px rgba(122, 62, 82, 0.2); }
#dpad.off .dp-btn { opacity: 0.45; filter: saturate(0.5); }
.dp-btn { all: unset; box-sizing: border-box; margin: 2px; border-radius: 18px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: linear-gradient(180deg, #b7f5e0 0%, #5fd3b4 100%); border: 3px solid #fff7ec; touch-action: none;
  box-shadow: 0 4px 0 #3f9e86, 0 6px 10px rgba(122, 62, 82, 0.25); transition: transform 0.08s, box-shadow 0.08s; }
.dp-btn img { width: 34px; height: 34px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(63, 158, 134, 0.6)); }
.dp-btn.txt { color: #fff; font-size: 26px; text-shadow: 0 2px 0 #3f9e86; }
.dp-btn.pressed { transform: translateY(3px) scale(0.94); box-shadow: 0 1px 0 #3f9e86, 0 2px 4px rgba(122, 62, 82, 0.25); }
#actpad { position: absolute; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 7;
  display: grid; grid-template-columns: 70px 70px; grid-template-rows: 70px 70px; gap: 8px; touch-action: none; user-select: none; -webkit-user-select: none; }
#actpad.hidden { display: none; }
#actpad.off .ap-btn { opacity: 0.45; filter: saturate(0.5); }
.ap-btn { all: unset; box-sizing: border-box; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer;
  background: linear-gradient(180deg, #b7f5e0 0%, #5fd3b4 100%); border: 3px solid #fff7ec; touch-action: none;
  box-shadow: 0 4px 0 #3f9e86, 0 6px 10px rgba(122, 62, 82, 0.25); transition: transform 0.08s, box-shadow 0.08s; }
.ap-btn img { width: 30px; height: 30px; object-fit: contain; pointer-events: none; }
.ap-btn .alt, .ap-btn.txt { color: #fff; font-size: 24px; line-height: 28px; text-shadow: 0 2px 0 #3f9e86; }
.ap-label { font-family: var(--font); font-size: 12px; font-weight: 900; color: #fff; line-height: 1; white-space: nowrap; pointer-events: none;
  text-shadow: -1px -1px 0 #3f9e86, 1px -1px 0 #3f9e86, -1px 1px 0 #3f9e86, 1px 1px 0 #3f9e86, 0 2px 0 #3f9e86; }
.ap-grab { background: linear-gradient(180deg, #ffd0d8 0%, #ff8fa8 100%); box-shadow: 0 4px 0 #c45a78, 0 6px 10px rgba(122, 62, 82, 0.25); }
.ap-grab .ap-label { text-shadow: -1px -1px 0 #c45a78, 1px -1px 0 #c45a78, -1px 1px 0 #c45a78, 1px 1px 0 #c45a78, 0 2px 0 #c45a78; }
.ap-dash { background: linear-gradient(180deg, #fff7ec 0%, #e8d6c8 100%); box-shadow: 0 4px 0 #b49a8a, 0 6px 10px rgba(122, 62, 82, 0.25); }
.ap-dash.txt, .ap-dash .ap-label { color: #7a3e52; text-shadow: none; }
.ap-btn.pressed { transform: translateY(3px) scale(0.94); box-shadow: 0 1px 0 #3f9e86, 0 2px 4px rgba(122, 62, 82, 0.25); }
.dp-up { grid-area: u; } .dp-down { grid-area: d; } .dp-left { grid-area: l; } .dp-right { grid-area: r; }

/* Level list */
#levels { position: absolute; inset: 0; isolation: isolate; display: flex; flex-direction: column; padding: calc(12px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)); }
#levels-bg { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(255, 244, 247, 0.72), rgba(255, 236, 242, 0.88)), url(../assets/cover-bg.webp) center / cover no-repeat, #fde7ec; }
.lv-top { position: relative; display: flex; align-items: center; justify-content: space-between; height: 52px; flex: 0 0 auto; }
.lv-top .corner-btn { position: relative; top: 0; left: 0; font-size: 20px; color: var(--rose); }
.lv-title { position: absolute; left: 60px; right: 60px; text-align: center; pointer-events: none; margin: 0; font-size: 28px; white-space: nowrap; color: #fff;
  paint-order: stroke fill; -webkit-text-stroke: 7px var(--rose); text-shadow: 0 4px 0 var(--rose); animation: slam .4s cubic-bezier(.3,1.7,.5,1) both; }
#lv-gold { all: unset; display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 8px 0 6px; border-radius: 22px; cursor: pointer;
  background: rgba(255, 247, 236, 0.95); box-shadow: 0 3px 0 rgba(122, 62, 82, 0.35), inset 0 -3px 0 rgba(255, 179, 184, 0.6); }
#lv-gold:active, #lv-gold.pressed { transform: scale(0.92); }
#lv-gold .plus { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(180deg, #b3f1df, #64c7ab); color: #fff; font-size: 20px; line-height: 23px; text-align: center;
  -webkit-text-stroke: 3px #2f7f6b; paint-order: stroke fill; }
/* the level list: a 2-column grid of room cards (scrolls when it does not fit) */
#lv-cards { flex: 1 1 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: safe center; gap: 14px 12px;
  padding: 10px 6px 12px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; touch-action: pan-y; }
#lv-cards::-webkit-scrollbar { display: none; }
@media (min-aspect-ratio: 4/5) { #lv-cards { grid-template-columns: repeat(4, minmax(0, 210px)); justify-content: center; } }
.float.name { font-size: 18px; color: #fff; }
.lv-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 8px 8px; border-radius: 26px; cursor: pointer; min-width: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fff7ec 55%, color-mix(in srgb, var(--box, #ffb3b8) 28%, #fff7ec) 100%); color: var(--rose);
  border: 4px solid var(--box, #ffb3b8);
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.9), 0 5px 0 rgba(122, 62, 82, 0.3), 0 8px 14px rgba(122, 62, 82, 0.15);
  animation: cardIn .35s cubic-bezier(.3,1.6,.5,1) both; transition: transform .12s, filter .12s; }
@keyframes cardIn { from { transform: translateY(30px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.lv-card.focus { transform: scale(1.04); box-shadow: inset 0 3px 0 rgba(255,255,255,0.9), 0 0 0 4px #7fd8c0, 0 5px 0 4px rgba(62, 159, 134, 0.6), 0 10px 16px rgba(122, 62, 82, 0.2); }
.lv-card.pressed { transform: scale(0.95); }
.lv-card.locked { cursor: default; background: linear-gradient(180deg, #f6f0f1, #ebe2e4); border-color: #d9c9cd; }
.lv-card.locked .lv-art img { filter: grayscale(1) brightness(0.72) contrast(0.85); opacity: 0.75; }
.lv-card.locked .lv-name, .lv-card.locked .lv-meta { color: #a8939a; }
.lv-card.shake { animation: shakeX .35s; }
@keyframes shakeX { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }
.lv-num { position: absolute; left: 6px; top: 6px; z-index: 2; width: 40px; height: 40px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff;
  paint-order: stroke fill; -webkit-text-stroke: 5px var(--rose); text-shadow: 0 3px 0 var(--rose);
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.7), inset 0 -4px 0 rgba(0,0,0,0.12), 0 3px 0 rgba(122,62,82,0.3); }
.lv-card.locked .lv-num { filter: grayscale(1); }
.lv-art { position: relative; width: 100%; aspect-ratio: 1 / 0.82; display: flex; align-items: center; justify-content: center; font-size: 56px; }
.lv-art img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 6px 4px rgba(122, 62, 82, 0.22)); transition: transform .2s; }
.lv-card.focus:not(.locked) .lv-art img { transform: translateY(-3px) scale(1.04); }
.lv-lock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 32px; background: rgba(255, 247, 236, 0.92); box-shadow: 0 4px 0 rgba(122, 62, 82, 0.3); }
.lv-name { max-width: 100%; font-size: 15px; line-height: 1.2; color: var(--rose); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.lv-meta { max-width: 100%; font-size: 12px; color: #b0677d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.lv-stars { font-size: 22px; line-height: 1; letter-spacing: 1px; white-space: nowrap; }
.lv-stars span { color: #eadde0; paint-order: stroke fill; -webkit-text-stroke: 3px var(--rose); }
.lv-stars span.on { color: var(--butter); }
.lv-card .lv-trophy { position: absolute; right: 4px; top: 4px; z-index: 2; }
.lv-trophy { all: unset; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer;
  background: rgba(255, 224, 138, 0.75); box-shadow: 0 2px 0 rgba(122,62,82,0.3); transition: transform .12s; }
.lv-trophy.pressed { transform: scale(0.88); }
#lv-hint { flex: 0 0 auto; text-align: center; font-size: 14px; color: var(--rose); padding: 6px 8px; border-radius: 16px; background: rgba(255, 247, 236, 0.85); align-self: center; }

/* the all-clear celebration */
#ending { position: absolute; inset: 0; z-index: 30; opacity: 0; transition: opacity .3s; }
#ending.on { opacity: 1; }
#ending.out { opacity: 0; }
#ending .end-bg { position: absolute; inset: 0; background: #fde7ec url(../assets/ending-bg.webp) center / cover no-repeat; }
#ending.on .end-bg { animation: endZoom 9s ease-out both; }
@keyframes endZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
#ending .end-cv { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#ending .end-text { position: absolute; left: 0; right: 0; top: calc(9% + env(safe-area-inset-top)); text-align: center; padding: 0 14px; pointer-events: none; }
#ending .end-title { font-size: clamp(30px, 10.5vw, 50px); line-height: 1.15; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 9px var(--rose); text-shadow: 0 6px 0 var(--rose);
  transform: rotate(-4deg); }
#ending.on .end-title { animation: slam .5s cubic-bezier(.3,1.7,.5,1) both, endFloat 2.4s 0.6s ease-in-out infinite; }
#ending .end-sub { margin-top: 12px; font-size: clamp(17px, 5vw, 24px); color: var(--butter); paint-order: stroke fill; -webkit-text-stroke: 6px var(--rose); text-shadow: 0 3px 0 var(--rose); }
#ending.on .end-sub { animation: slam .5s .2s cubic-bezier(.3,1.7,.5,1) both; }
@keyframes endFloat { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(-4deg) translateY(-6px); } }
#ending .end-go { position: absolute; left: 50%; bottom: calc(5% + env(safe-area-inset-bottom)); transform: translateX(-50%); min-width: 180px; min-height: 60px; font-size: 22px; }
#ending.on .end-go { animation: endGo .5s .6s cubic-bezier(.3,1.7,.5,1) both; }
#ending .end-go:active, #ending .end-go.pressed { transform: translateX(-50%) scale(0.92); }
@keyframes endGo { from { transform: translateX(-50%) scale(0); } to { transform: translateX(-50%) scale(1); } }

#fade { position: absolute; inset: 0; background: #fff4f2; opacity: 0; pointer-events: none; transition: opacity .35s; }
#fade.on { opacity: 1; }
