/* Shared floating content: the scene supplies the blur, never an opaque card. */
#session-dialogs {
  position: fixed; inset: 0; margin: auto; z-index: 300;
  width: var(--menu-area-width); height: var(--menu-area-height);
  font-size: 16px; pointer-events: none;
  /* Geometry follows the session width, independently of each label's type. */
  --dialog-button-height: max(40px, calc(var(--work-area-width) * 3.65 / 22));
  --dialog-button-cap: calc(var(--dialog-button-height) * 120 / 195);
  --dialog-button-rim: calc(var(--dialog-button-height) * 32 / 195);
}
#session-dialogs > .game-overlay, #session-dialogs > .infinite-overlay,
#session-dialogs > .tutorial-toast { pointer-events: auto; }
.game-overlay:not(#win-overlay):not(#lives-overlay).show { display: flex; align-items: center; justify-content: center; animation: none; }
.overlay-scrim { background: rgba(5, 18, 35, .62); backdrop-filter: blur(.65em) saturate(.9); -webkit-backdrop-filter: blur(.65em) saturate(.9); }
.game-overlay .overlay-card:not(.result-card), .tutorial-toast .overlay-card, .infinite-panel {
  position: relative; inset: auto; transform: none; width: 78%; max-width: 19em; max-height: 94%;
  padding: .6em 0; display: flex; flex-direction: column; gap: clamp(.5em, 1.4dvh, .85em);
  background: none; border: 0; border-radius: 0; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none; font: inherit; text-align: center;
}
.overlay-title, .infinite-panel h2, .snail-announce-name {
  margin: 0; font-family: 'Arial Black', var(--font-ui); font-weight: 900; font-style: italic;
  font-size: 1.65em; line-height: 1.1; letter-spacing: .025em; color: #fff;
  -webkit-text-stroke: .025em #173b69; paint-order: stroke fill;
  text-shadow: 0 .08em 0 #173b69, 0 .15em .22em #07172699;
}
.overlay-sub, .lives-copy, .story-body, .infinite-panel .best-row {
  margin: .25em 0 .5em; color: #f4f8ff; font-family: var(--font-ui);
  font-size: .78em; font-weight: 700; line-height: 1.45; letter-spacing: .015em;
  text-shadow: 0 .08em .15em #071726;
}
.overlay-sub { font-size: .63em; }
.story-emoji, .lives-icon { margin: 0 0 .1em; font-size: 3em; line-height: 1.1; filter: drop-shadow(0 .12em .12em #07172666); }
.overlay-btn, .infinite-panel button {
  position: relative; display: flex; align-items: center; justify-content: center; gap: .25em;
  width: 100%; min-width: 0; height: var(--dialog-button-height); min-height: var(--dialog-button-height);
  flex-shrink: 0; margin: 0; padding: .5em calc(var(--dialog-button-height) * .3); isolation: isolate;
  border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  background: none;
  color: white; font-family: 'Arial Black', var(--font-ui); font-size: .85em; font-weight: 900;
  font-style: italic; line-height: 1.15; letter-spacing: .025em; text-align: center;
  text-shadow: 0 .08em 0 #143b70; cursor: pointer; overflow: visible;
}
/* One native silhouette for every colour. Nine-slicing preserves the corner
   radius, rim thickness and slant when a control occupies only half a row. */
#session-dialogs .overlay-btn::before, #session-dialogs .infinite-panel button::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-style: solid; border-color: transparent;
  border-width: var(--dialog-button-rim) var(--dialog-button-cap);
  border-image: url('screens/button-green.webp') 32 120 fill / 1 / 0 stretch;
  filter: hue-rotate(115deg) saturate(1.4) brightness(.65);
}
.overlay-btn.primary, .infinite-panel button:not(.secondary) {
  font-size: 1em;
  border: 0; box-shadow: none;
  background: none;
  text-shadow: 0 .08em 0 #15510a;
}
#session-dialogs .overlay-btn.primary::before, #session-dialogs .infinite-panel button:not(.secondary)::before { filter: none; }
.overlay-btn.primary::after { display: none; }
.overlay-btn.danger { background: none; border: 0; box-shadow: none; color: white; isolation: isolate; }
#session-dialogs .overlay-btn.danger::before { filter: hue-rotate(-100deg) saturate(1.25); }
.overlay-btn-row { width: 100%; gap: .35em; align-items: stretch; }
.overlay-btn-row > .overlay-btn { font-size: .72em; }
.overlay-btn-row > .overlay-btn.primary { font-size: .82em; }
.overlay-btn:focus-visible, .infinite-panel button:focus-visible { outline: none; filter: drop-shadow(0 0 .14em #fff1a7); }
.infinite-overlay { position: absolute; background: rgba(5,18,35,.62); backdrop-filter: blur(.65em) saturate(.9); -webkit-backdrop-filter: blur(.65em) saturate(.9); }
.infinite-panel .score-row { font-size: 1.3em; font-weight: 900; margin: .3em 0; text-shadow: 0 .08em .15em #071726; }
.infinite-panel button.secondary { background: none; text-shadow: 0 .08em 0 #143b70; box-shadow: none; }
#pause-overlay #main-reset-btn { position: relative; inset: auto; width: 100%; height: var(--dialog-button-height); font-family: 'Arial Black', var(--font-ui); font-size: .85em; font-weight: 900; color: white; background: none; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
#pause-overlay .menu-pill { background: none; border: 0; box-shadow: none; color: white; }
.snail-announce-card { gap: .3em !important; }
.snail-announce-stage { width: 11em; max-width: 78%; margin: 0 auto; }
.snail-announce-rays, .snail-announce-halo { display: none; }
.snail-announce-eyebrow { background: none; color: #ffe9a8; font-style: italic; letter-spacing: .12em; text-shadow: 0 .08em .12em #173b69; }
.snail-announce-codename, .snail-announce-speed { color: #eaf4ff; letter-spacing: .08em; text-shadow: 0 .08em .12em #173b69; }
/* Victory/defeat keep the artist's complete panels and value plates from screens.css.
   Their backdrop blurs the live game and the scenic surround at full height. */
/* Nonblocking notices blur only their small text area, leaving play readable. */
.booster-hint, .wave-banner, .deadlock-notice {
  background: none; border: 0; border-radius: 0; box-shadow: none;
  backdrop-filter: blur(.4em); -webkit-backdrop-filter: blur(.4em);
  color: #fff; text-shadow: 0 .08em .12em #12375f, 0 .15em .2em #071726;
}
.booster-hint { animation: floating-hint-in .18s ease-out; }
@keyframes floating-hint-in { from { opacity: 0; } to { opacity: 1; } }
.tutorial-toast { inset: 0; z-index: 125; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.tutorial-toast.show { display: flex; align-items: center; justify-content: center; gap: 0; animation: none; }
.tutorial-toast-icon { align-self: center; font-size: 1em; line-height: 0; }
.tutorial-toast-icon img { display: block; width: 14em; height: clamp(9em, 24dvh, 12em); max-width: 100%; object-fit: contain; filter: drop-shadow(0 .12em .15em #07172655); }
.tutorial-toast-text { flex: initial; font-size: .86em; font-weight: 800; line-height: 1.4; text-align: center; text-shadow: 0 .08em .15em #071726; }
.tutorial-toast-close:hover { filter: brightness(1.08); }
.wave-banner { font-family: 'Arial Black', var(--font-ui); font-style: italic; }
.deadlock-notice { top: 8em; width: max-content; max-width: 88%; white-space: normal; font-size: .7em; line-height: 1.3; padding: .5em; text-align: center; }
/* HUD: a large bare level number centred between the left status and controls. */
#hud-top { min-height: 4.5em; }
#hud-row-1 { min-height: 2.5em; }
#hud-row-1 .hud-pill.level { position: absolute; top: -.08em; left: 50%; transform: translateX(-50%); background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; font-family: 'Arial Black', var(--font-ui); font-size: 2em; font-style: italic; line-height: 1.15; text-shadow: 0 .055em 0 #143b70, 0 .1em .15em #07172677; }
#hud-row-2 { position: absolute; top: .25em; left: 0; width: 46%; max-width: 46%; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: .3em; }
/* Each resource has its own line, so full balances can grow without squeezing
   the art or the inset between the content and the slanted frame. */
#hud-row-2 .hud-pill { position: relative; isolation: isolate; flex: none; font-size: .78em; padding: .25em .85em; gap: .28em; background: none; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; text-shadow: 0 .08em .14em #071726; }
#hud-row-2 .hud-pill::before { content: ''; position: absolute; inset: 0; z-index: -1; background: url('hud/status-blue.svg') center / 100% 100% no-repeat; filter: drop-shadow(0 .1em .1em #061b36aa); pointer-events: none; }
#hud-row-2 .hud-pill.stars { color: #fff0b8; text-shadow: 0 .08em .1em #2b1908; }
#apples-bank { font-family: var(--font-mono); letter-spacing: 0; font-variant-numeric: tabular-nums; }
#hud-row-2 .hud-pill.stars::before { background-image: url('hud/status-gold.svg'); }
#hud-row-2 .hud-pill.lives { gap: .12em; font-size: .82em; }
#hud-row-2 .hud-pill.score { font-size: .6em; opacity: .9; }
.hud-actions { margin-left: auto; gap: .12em; }
.hud-icon-btn { width: 2.6em; height: 2.18em; background: url('screens/button-red.webp') center / 100% 100% no-repeat; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.hud-icon-btn svg { width: 1.05em; height: 1.05em; transform: translate(-.04em,-.04em); filter: drop-shadow(0 .05em 0 #861224); }
.booster { width: 8em; height: 2.75em; padding: .2em .7em .3em; background: url('screens/garage-nameplate.webp') center / 100% 100% no-repeat; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.booster.active { background: url('screens/garage-nameplate.webp') center / 100% 100% no-repeat; border: 0; box-shadow: none; filter: drop-shadow(0 0 .2em #fff2a5); }
.booster.rescue { border: 0; box-shadow: none; animation: hud-rescue-pulse 1.3s ease-in-out infinite; }
@keyframes hud-rescue-pulse { 0%, 100% { filter: drop-shadow(0 0 .1em #ffd06f); } 50% { filter: drop-shadow(0 0 .35em #ffe6a0); } }
.booster.disabled { opacity: .55; }
@media (prefers-reduced-motion: reduce) { .game-overlay.show, .tutorial-toast.show { animation: none; } }

/* Large, colour-matched resource and ability art; result artwork stays native. */
#lives-pill .heart { display: inline-block; flex: none; width: 1.6em; height: 1.6em; font-size: 1em; color: transparent; text-shadow: none; background: url('hud/heart.webp') center / contain no-repeat; filter: drop-shadow(0 .06em .07em #6f102555); }
#lives-pill .heart.lost { color: transparent; opacity: .25; filter: grayscale(1); }
#hud-top .coin { width: 1.8em; height: 1.8em; flex: none; background-image: url('hud/coin.webp'); }
.booster-cost .coin, .apple-float .coin { background-image: url('hud/coin.webp'); }
.booster .booster-icon { flex: 0 0 2.25em; width: 2.25em; height: 2.25em; font-size: 1em; filter: drop-shadow(0 .08em .08em #08244388); }
.booster .booster-icon img { width: 100%; height: 100%; object-fit: contain; }
.booster-info { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .15em; }
.booster-label { font: italic 900 .53em/1.1 'Arial Black', var(--font-ui); color: white; letter-spacing: .02em; text-shadow: 0 .1em 0 #123b70; }
