/* ====================================================================
   Avatar Chat Room
   The page is a stage: the bot stands in a spotlight, the controls sit
   on solid "backstage" surfaces that stay legible on any background.
   ==================================================================== */

:root {
  /* Surfaces */
  --ink: #241733;
  --ink-raised: #32224a;
  --ink-sunken: #1b1127;
  --line: #4b3768;

  /* Text */
  --text: #fbf5ff;
  --text-soft: #cdbfdc;

  /* Signals */
  --marigold: #ffb627;
  --marigold-bright: #ffc95c;
  --on-marigold: #2b1800;
  --coral: #ff9385;
  --mint: #84e6b8;

  /* Over the bot (2147483600) but under the chat widget's controls */
  --z-logo: 2147483601;

  /* Above the chat widget's own controls (z-index 2147483640) */
  --z-panel: 2147483642;
  --z-dock: 2147483643;
  --z-pill: 2147483644;
  --z-modal: 2147483645;
  --z-toast: 2147483646;

  /* Driven by app.js */
  --avatar-scale: 0.88;
  --avatar-x: 0px;
  --avatar-y: 25px;

  /* Moves the bot out from behind the settings panel; set in the responsive section */
  --stage-x: 0px;
  --stage-y: 0px;
  --stage-fit: 1;
  --panel-width: min(420px, calc(100vw - 32px));
  --sheet-height: 58dvh;

  color-scheme: dark;
  accent-color: var(--marigold);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--ink-sunken);
  font-family: 'Anuphan', 'Segoe UI', Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
}

/* Rotated page (app.js rotateStage). A transformed body also becomes the frame for every
   fixed element inside it, so the bot, dock and panels turn with it. */
html[data-rotate] body {
  position: fixed;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

html[data-rotate="90"] body,
html[data-rotate="270"] body {
  width: 100vh;
  height: 100vw;
}

html[data-rotate="90"] body {
  transform: rotate(90deg) translateY(-100%);
}

html[data-rotate="180"] body {
  width: 100vw;
  height: 100vh;
  transform: rotate(180deg) translate(-100%, -100%);
}

html[data-rotate="270"] body {
  transform: rotate(-90deg) translateX(-100%);
}

/* The chat widget sizes its drawing from the real screen and never re-measures, so on a
   turned page it would spill past the edge. Fit it inside instead, standing on the floor. */
/* Doubled id: outranks the widget's own "#avatar-widget-container.bcw-rt-avatar-fullscreen:not(...)" rule */
html[data-rotate="90"] #avatar-widget-container#avatar-widget-container,
html[data-rotate="270"] #avatar-widget-container#avatar-widget-container,
html[data-rotate="90"] #avatar-widget-container canvas,
html[data-rotate="270"] #avatar-widget-container canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  object-position: 50% 100%;
}

button, input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--marigold-bright);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ------------------------------ Stage ------------------------------ */

.bg-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: var(--ink-sunken);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  transition: filter 0.2s ease;
  pointer-events: none;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  transition: background-color 0.3s ease;
}

/* No background chosen: a single beam of light on the bot */
.bg-container.is-default {
  background-image: linear-gradient(180deg, #33214a 0%, #241733 62%, #1b1127 100%);
}

.bg-container.is-default::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 340px 54px at 50% 91%, rgba(255, 214, 140, 0.5), transparent 72%),
    conic-gradient(from 160deg at 50% -14%,
      transparent 0deg,
      rgba(255, 214, 140, 0.26) 9deg,
      rgba(255, 224, 165, 0.36) 20deg,
      rgba(255, 214, 140, 0.26) 31deg,
      transparent 40deg);
  animation: lights-up 1.4s ease-out both;
}

@keyframes lights-up {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* The size and position controls move only the bot, not the page UI.
   The doubled ID out-ranks the widget's own !important fullscreen rule. */
#avatar-widget-container#avatar-widget-container.bcw-rt-avatar-fullscreen,
#avatar-widget-container#avatar-widget-container {
  transform:
    translate(calc(var(--avatar-x) + var(--stage-x)), calc(var(--avatar-y) + var(--stage-y)))
    scale(calc(var(--avatar-scale) * var(--stage-fit))) !important;
  transform-origin: bottom center !important;
  transition: transform 0.22s ease-out;
}

/* ------------------------------ Logo ------------------------------- */

.site-logo {
  position: fixed;
  z-index: var(--z-logo);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  cursor: grab;
}

.site-logo.dragging {
  cursor: grabbing;
}

.site-logo.is-locked {
  pointer-events: none;
}

.site-logo[data-corner="custom"] {
  left: var(--logo-x, 0);
  top: var(--logo-y, 0);
}

.site-logo[data-corner^="top"] { top: calc(var(--logo-edge, 20px) + var(--logo-push, 0px)); }
.site-logo[data-corner^="bottom"] { bottom: calc(var(--logo-edge, 20px) + var(--logo-push, 0px)); }
.site-logo[data-corner$="left"] { left: var(--logo-edge, 20px); }
.site-logo[data-corner$="right"] { right: calc(var(--logo-edge, 20px) + var(--logo-shift, 0px)); }

/* ------------------------------ Dock ------------------------------- */

.floating-actions {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: var(--z-dock);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(20, 8, 36, 0.45);
  user-select: none;
  touch-action: none;
  cursor: grab;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.floating-actions.dragging {
  cursor: grabbing;
}

.floating-actions.hidden {
  opacity: 0;
  visibility: hidden;
}

.floating-action-btn {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 1.05rem;
  color: var(--text);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.floating-action-btn:hover {
  background: var(--ink-raised);
}

.floating-action-btn[aria-expanded="true"] {
  background: var(--marigold);
  color: var(--on-marigold);
}

.floating-action-btn.voice-btn.listening {
  background: var(--coral);
  color: #3a0f0a;
  animation: voice-pulse 1.4s infinite ease-in-out;
}

@keyframes voice-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 147, 133, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(255, 147, 133, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 147, 133, 0); }
}

.bot-chip {
  height: 44px;
  max-width: 190px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 0 12px;
  background: var(--ink-raised);
  border: 0;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.bot-chip:hover {
  background: var(--line);
}

.bot-chip-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--mint);
}

.status-dot[data-state="loading"] {
  background: var(--marigold);
  animation: dot-blink 1s infinite ease-in-out;
}

.status-dot[data-state="error"] {
  background: var(--coral);
}

@keyframes dot-blink {
  50% { opacity: 0.3; }
}

/* ---------------------------- Voice pill --------------------------- */

.voice-live-pill {
  position: fixed;
  top: 80px;
  left: 16px;
  z-index: var(--z-pill);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 10px 12px 10px 18px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 10px 28px rgba(20, 8, 36, 0.45);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.voice-live-pill.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
}

.voice-soundwave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.voice-soundwave span {
  width: 3px;
  height: 6px;
  background: var(--marigold);
  border-radius: 99px;
}

.voice-live-pill.active .voice-soundwave span {
  background: var(--coral);
  animation: soundwave 1s infinite ease-in-out;
}

.voice-soundwave span:nth-child(1) { animation-delay: 0.1s; }
.voice-soundwave span:nth-child(2) { animation-delay: 0.3s; }
.voice-soundwave span:nth-child(3) { animation-delay: 0.2s; }
.voice-soundwave span:nth-child(4) { animation-delay: 0.4s; }
.voice-soundwave span:nth-child(5) { animation-delay: 0.15s; }

@keyframes soundwave {
  0%, 100% { height: 6px; }
  50% { height: 20px; }
}

.voice-text-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.voice-status-label {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.voice-transcript {
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-pill-btn {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--text-soft);
}

.voice-pill-btn:hover {
  background: var(--ink-raised);
  color: var(--text);
}

/* ---------------------------- Voice guide -------------------------- */

.voice-guide-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 8, 36, 0.72);
  transition: opacity 0.2s ease, visibility 0.2s;
}

.voice-guide-modal.hidden {
  opacity: 0;
  visibility: hidden;
}

.voice-guide-card {
  width: min(540px, 100%);
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(20, 8, 36, 0.6);
  overflow: hidden;
}

.voice-guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px 24px;
  border-bottom: 1px solid var(--line);
}

.voice-guide-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.voice-guide-hint {
  font-size: 0.875rem;
  color: var(--text-soft);
}

.voice-guide-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 24px 24px;
  overflow-y: auto;
}

.voice-guide-section h3 {
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.voice-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.v-tag {
  min-height: 36px;
  padding: 4px 12px;
  background: var(--ink-raised);
  border: 0;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.v-tag:hover {
  background: var(--marigold);
  color: var(--on-marigold);
}

/* ------------------------------ Panel ------------------------------ */

.settings-panel {
  position: fixed;
  top: 80px;
  left: 16px;
  z-index: var(--z-panel);
  width: var(--panel-width);
  max-height: calc(100dvh - 96px);
  display: flex;
  flex-direction: column;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(20, 8, 36, 0.55);
  /* The whole panel scrolls, so the Widget ID moves away and short screens keep room for controls */
  overflow: hidden auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  transform-origin: top left;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, visibility 0.25s;
}

.settings-panel.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 6px 20px;
}

.panel-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.header-actions {
  display: flex;
}

.icon-btn {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--text-soft);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--ink-raised);
  color: var(--text);
}

/* Active bot */
.bot-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 20px 16px;
}

.field-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-soft);
}

.field-row {
  display: flex;
  gap: 8px;
}

.text-field {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  background: var(--ink-sunken);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.95rem;
  transition: border-color 0.15s ease;
}

.text-field::placeholder {
  color: #a795bb;
}

.text-field:focus {
  outline: none;
  border-color: var(--marigold);
}

.text-field[aria-invalid="true"] {
  border-color: var(--coral);
}

.widget-id-field {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.bot-status-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 21px;
}

.bot-status {
  font-size: 0.875rem;
  color: var(--text-soft);
}

.bot-status[data-state="ok"] { color: var(--mint); }
.bot-status[data-state="error"] { color: var(--coral); }

/* Show or hide the floating All demo button */
.demo-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  margin-top: 6px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink-sunken);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.demo-toggle-text {
  flex: 1;
  min-width: 0;
}

.switch {
  appearance: none;
  flex: none;
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.switch::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s ease;
}

.switch:checked {
  background: var(--marigold);
}

.switch:checked::before {
  transform: translateX(18px);
  background: #fff;
}

.switch:focus-visible {
  outline: 2px solid var(--marigold-bright);
  outline-offset: 2px;
}

/* Floating All demo button, bottom-left: the logo starts top-right and the chat controls sit bottom-right */
.demo-cta {
  position: fixed;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  /* Over the chat widget, under the settings panel */
  z-index: 2147483641;
}

.demo-cta-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px 6px 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd884 0%, #ffb627 100%);
  box-shadow:
    0 12px 26px rgba(255, 150, 30, 0.38),
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -3px 0 rgba(190, 105, 0, 0.28);
  color: var(--on-marigold);
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.demo-cta-link:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 30px rgba(255, 150, 30, 0.45),
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -3px 0 rgba(190, 105, 0, 0.28);
}

.demo-cta-link:active {
  transform: translateY(1px);
}

.demo-cta-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* Glossy round play badge */
.demo-cta-icon {
  position: relative;
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff 0 30%, #ffeccc 100%);
  box-shadow: 0 3px 8px rgba(190, 105, 0, 0.3);
  color: #f08a00;
  font-size: 0.95rem;
}

.demo-cta-icon i {
  margin-left: 3px;
}

/* A soft ring every few seconds invites a tap */
.demo-cta-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  animation: demo-ring 2.6s ease-out infinite;
}

@keyframes demo-ring {
  0% { transform: scale(1); opacity: 0.9; }
  60%, 100% { transform: scale(1.55); opacity: 0; }
}

.demo-cta-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--ink);
  color: var(--text);
  font-size: 0.75rem;
  cursor: pointer;
}

/* Bigger target than it looks */
.demo-cta-close::before {
  content: '';
  position: absolute;
  inset: -10px;
}

.demo-cta-close:hover {
  background: var(--ink-raised);
}

.demo-cta-close:focus-visible {
  outline: 2px solid var(--marigold-bright);
  outline-offset: 2px;
}

/* The settings sheet covers the bottom on phones */
body.panel-open .demo-cta,
body.ui-hidden .demo-cta {
  visibility: hidden;
}

.link-btn {
  flex: none;
  background: none;
  border: 0;
  font-size: 0.875rem;
  color: var(--marigold-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-primary {
  flex: none;
  height: 44px;
  padding: 0 18px;
  background: var(--marigold);
  border: 0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--on-marigold);
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.btn-primary:hover {
  background: var(--marigold-bright);
}

.btn-primary:disabled {
  background: var(--ink-raised);
  color: var(--text-soft);
  cursor: progress;
}

.btn-secondary {
  min-height: 44px;
  padding: 0 14px;
  background: var(--ink-raised);
  border: 0;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.btn-secondary:hover {
  background: var(--line);
}

.full-width {
  width: 100%;
}

/* Tabs */
.tabs-nav {
  position: sticky;
  top: 0;
  z-index: 2;
  flex: none;
  display: flex;
  gap: 4px;
  padding: 0 20px;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}

.tab-btn {
  position: relative;
  flex: 1;
  height: 44px;
  background: transparent;
  border: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-soft);
  transition: color 0.15s ease;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--text);
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 3px;
  background: var(--marigold);
  border-radius: 3px 3px 0 0;
}

.tab-panels {
  flex: none;
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 20px;
  padding: 18px 20px 20px;
}

.tab-content.active {
  display: flex;
}

.section-group,
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-group {
  gap: 14px;
}

.section-label {
  font-size: 0.95rem;
  font-weight: 600;
}

/* Color: the point under the cursor is exactly the color you get */
.color-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.color-pad {
  position: relative;
  height: clamp(110px, 22dvh, 170px);
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, hsl(var(--pad-hue, 222) 100% 50%));
  border-radius: 12px;
  cursor: crosshair;
  touch-action: none;
}

.color-pad-cursor {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hue-slider {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.hue-slider::-webkit-slider-runnable-track {
  height: 14px;
  background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
  border-radius: 99px;
}

.hue-slider::-moz-range-track {
  height: 14px;
  background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
  border-radius: 99px;
}

.hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -5px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.hue-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.color-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-preview-box {
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.color-inputs {
  flex: 1;
  min-width: 0;
}

.input-with-button {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px 0 12px;
  background: var(--ink-sunken);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.input-with-button:focus-within {
  border-color: var(--marigold);
}

#color-hex-input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.native-picker-trigger {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text-soft);
  cursor: pointer;
}

.native-picker-trigger:hover {
  background: var(--ink-raised);
  color: var(--text);
}

/* Sliders */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.slider-value {
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.slider-desc {
  font-size: 0.85rem;
  color: var(--text-soft);
}

input[type="range"] {
  width: 100%;
  height: 24px;
  cursor: pointer;
}

/* Swatches */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.preset-chip {
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  transition: transform 0.12s ease;
}

.preset-chip:hover {
  transform: scale(1.08);
}

.preset-chip.active,
.wallpaper-chip.active {
  outline: 2px solid var(--marigold);
  outline-offset: 2px;
}

/* Image */
.upload-dropzone {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 20px 16px;
  background: var(--ink-sunken);
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--marigold);
  background: var(--ink-raised);
}

.upload-icon {
  margin-bottom: 6px;
  font-size: 1.5rem;
  color: var(--marigold);
}

.dropzone-text {
  font-size: 0.95rem;
  font-weight: 500;
}

.dropzone-hint {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.wallpaper-chip {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background-color: var(--ink-raised);
  background-size: cover;
  background-position: center;
  border: 0;
  border-radius: 10px;
}

.wallpaper-chip span {
  position: absolute;
  inset: auto 0 0;
  padding: 12px 6px 3px;
  background: linear-gradient(transparent, rgba(20, 8, 36, 0.9));
  font-size: 0.78rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Logo: a small screen to drag on, beside four corner shortcuts */
.logo-place {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--ink-sunken);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  touch-action: none;
}

.logo-stage.has-logo {
  cursor: move;
}

.logo-stage-thumb {
  position: absolute;
  height: auto;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.corner-buttons {
  flex: none;
  display: grid;
  grid-template-columns: 48px 48px;
  gap: 6px;
  border: 0;
}

.corner-btn {
  position: relative;
  height: 48px;
  cursor: pointer;
}

/* The tile is drawn as a little screen with a block in the chosen corner */
.corner-icon {
  position: absolute;
  inset: 0;
  background: var(--ink-sunken);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.corner-icon::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 10px;
  width: 26px;
  height: 18px;
  border: 2px solid var(--text-soft);
  border-radius: 4px;
}

.corner-icon::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 6px;
  background: var(--text-soft);
  border-radius: 1px;
}

.corner-icon[data-corner^="top"]::after { top: 18px; }
.corner-icon[data-corner^="bottom"]::after { top: 22px; }
.corner-icon[data-corner$="left"]::after { left: 14px; }
.corner-icon[data-corner$="right"]::after { left: 24px; }

.corner-btn:hover .corner-icon {
  border-color: var(--text-soft);
  background: var(--ink-raised);
}

.corner-btn input:checked + .corner-icon {
  background: var(--marigold);
  border-color: var(--marigold);
}

.corner-btn input:checked + .corner-icon::before {
  border-color: var(--on-marigold);
}

.corner-btn input:checked + .corner-icon::after {
  background: var(--on-marigold);
}

.corner-btn input:focus-visible + .corner-icon {
  outline: 2px solid var(--marigold-bright);
  outline-offset: 2px;
}

/* Layout */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.92rem;
}

.segmented-control {
  display: flex;
  padding: 3px;
  background: var(--ink-sunken);
  border-radius: 10px;
}

.segment-btn {
  min-height: 36px;
  padding: 0 12px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-soft);
}

.segment-btn.active {
  background: var(--ink-raised);
  color: var(--text);
  font-weight: 600;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Saved background */
.panel-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--ink-sunken);
  border-top: 1px solid var(--line);
}

.bg-saved-thumb {
  width: 48px;
  height: 34px;
  flex: none;
  background-color: var(--ink-raised);
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.bg-saved-status {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  line-height: 1.35;
  color: var(--text-soft);
}

.bg-saved-status[data-state="error"] {
  color: var(--coral);
}

.btn-remove {
  flex: none;
  min-height: 40px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--coral);
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--coral);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-remove:hover:not(:disabled) {
  background: var(--coral);
  color: #3a0f0a;
}

.btn-remove:disabled {
  border-color: var(--line);
  color: #a795bb;
  cursor: not-allowed;
}

/* ------------------------------ Toast ------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: var(--z-toast);
  max-width: calc(100vw - 32px);
  padding: 10px 20px;
  background: var(--text);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(20, 8, 36, 0.5);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%);
}

/* ---------------------------- Responsive --------------------------- */

/* Laptops and landscape tablets: the bot steps aside into the free space */
@media (max-width: 1180px) {
  :root {
    --panel-width: min(400px, 46vw);
  }

  body.panel-open {
    --stage-x: calc(var(--panel-width) / 2 + 8px);
    --stage-fit: 0.85;
  }
}

@media (max-width: 600px) {
  .floating-actions {
    top: 10px;
    left: 10px;
  }

  .voice-live-pill {
    top: 74px;
    left: 10px;
    max-width: calc(100vw - 20px);
  }
}

/* Phones and upright tablets: the panel is a sheet, the bot stands on top of it */
@media (max-width: 600px), (max-width: 1023px) and (orientation: portrait) {
  :root {
    --panel-width: 100%;
  }

  body.panel-open {
    --stage-x: 0px;
    --stage-y: calc(var(--sheet-height) * -1);
    --stage-fit: 0.45;
  }

  .settings-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--sheet-height);
    max-height: none;
    border-width: 1px 0 0;
    border-radius: 20px 20px 0 0;
  }

  .settings-panel.hidden {
    transform: translateY(100%);
  }

  .panel-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 360px) {
  .tabs-nav {
    gap: 0;
    padding: 0 8px;
  }

  .tab-btn {
    font-size: 0.875rem;
  }
}

/* Phones on their side: panel on the left, bot on the right */
@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --panel-width: min(420px, 56vw);
  }

  body.panel-open {
    --stage-x: calc(var(--panel-width) / 2 + 8px);
    --stage-y: 0px;
    --stage-fit: 0.9;
  }

  .settings-panel {
    top: 8px;
    left: 8px;
    right: auto;
    bottom: 8px;
    height: auto;
    max-height: none;
    border-width: 1px;
    border-radius: 16px;
  }

  .settings-panel.hidden {
    transform: translateX(-16px);
  }

  .floating-actions {
    top: 8px;
    left: auto;
    right: 8px;
  }
}

/* ====================================================================
   Animated scenes: every piece is placed by app.js through
   --x, --y, --s (size in px, unitless), --d (duration) and --sway
   ==================================================================== */
.bg-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* Keeps the scene's repaints from touching the rest of the page */
  contain: strict;
}

.bg-scene > * {
  position: absolute;
  display: block;
}

/* Sky of clouds */
.scene-clouds {
  background: linear-gradient(180deg, #ffd3e6 0%, #ffe4ef 28%, #d9edff 66%, #cfe7ff 100%);
}

.scene-clouds .sun,
.scene-beach .sun {
  top: 7vh;
  right: 12vw;
  width: clamp(90px, 14vw, 170px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6cf 0 52%, rgba(255, 238, 170, 0.55) 53% 66%, transparent 67%);
  box-shadow: 0 0 60px 20px rgba(255, 236, 170, 0.45);
  animation: sun-breathe 6s ease-in-out infinite;
}

.scene-clouds .cloud,
.scene-balloons .cloud,
.scene-beach .cloud {
  top: var(--y);
  left: -32vw;
  width: calc(var(--s) * 1px);
  height: calc(var(--s) * 0.34px);
  border-radius: 999px;
  background: #fff;
  opacity: var(--o);
  filter: drop-shadow(0 8px 10px rgba(150, 170, 225, 0.28));
  animation: cloud-drift var(--d) linear infinite;
}

.scene-clouds .cloud::before,
.scene-balloons .cloud::before,
.scene-beach .cloud::before,
.scene-clouds .cloud::after,
.scene-balloons .cloud::after,
.scene-beach .cloud::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.scene-clouds .cloud::before,
.scene-balloons .cloud::before,
.scene-beach .cloud::before {
  width: 52%;
  aspect-ratio: 1;
  left: 14%;
  bottom: 30%;
}

.scene-clouds .cloud::after,
.scene-balloons .cloud::after,
.scene-beach .cloud::after {
  width: 36%;
  aspect-ratio: 1;
  right: 16%;
  bottom: 38%;
}

.sparkle,
.glint {
  left: var(--x);
  top: var(--y);
  width: calc(var(--s) * 1px);
  aspect-ratio: 1;
  background: #fff;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  animation: twinkle var(--d) ease-in-out infinite;
}

.scene-clouds .sparkle,
.scene-sakura .sparkle,
.scene-balloons .sparkle,
.scene-beach .sparkle {
  background: #fff8d6;
}

.hill {
  bottom: 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transform-origin: 50% 100%;
}

.scene-clouds .hill-back {
  left: 10vw;
  width: 80vw;
  height: 22vh;
  background: #c9e9f7;
}

.scene-clouds .hill-left {
  left: -18vw;
  width: 70vw;
  height: 26vh;
  background: #bfe8d4;
  animation: hill-sway 8s ease-in-out infinite;
}

.scene-clouds .hill-right {
  right: -20vw;
  width: 72vw;
  height: 20vh;
  background: #ffd0e1;
  animation: hill-sway 9s ease-in-out -3s infinite;
}

/* Soap bubbles */
.scene-bubbles {
  background: linear-gradient(160deg, #e2d6ff 0%, #f6dcff 38%, #ffdcef 68%, #ffe8d6 100%);
}

.scene-bubbles .blob {
  width: 46vmax;
  aspect-ratio: 1;
  opacity: 0.55;
  border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%;
  animation: blob-morph 14s ease-in-out infinite;
}

.scene-bubbles .blob:nth-child(1) {
  left: -16vmax;
  top: -14vmax;
  background: #cdb8ff;
}

.scene-bubbles .blob:nth-child(2) {
  right: -18vmax;
  bottom: -20vmax;
  background: #ffbfdc;
  animation-duration: 17s;
  animation-direction: reverse;
}

.scene-bubbles .blob:nth-child(3) {
  left: -12vmax;
  bottom: -24vmax;
  width: 34vmax;
  background: #b8e6ff;
  animation-duration: 20s;
}

.scene-bubbles .bubble,
.scene-ocean .bubble {
  left: var(--x);
  bottom: -18vh;
  width: calc(var(--s) * 1px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95) 0 9%, rgba(255, 255, 255, 0) 10%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0 55%, rgba(255, 255, 255, 0.28) 100%);
  box-shadow:
    inset -6px -8px 14px rgba(170, 140, 255, 0.28),
    inset 5px 4px 12px rgba(255, 180, 215, 0.32);
  animation: bubble-rise var(--d) linear infinite;
}

/* Starry night */
.scene-night {
  background: linear-gradient(180deg, #4f4392 0%, #7a63b8 38%, #b893d8 70%, #ffc2d6 100%);
}

.scene-night .star,
.scene-space .star {
  left: var(--x);
  top: var(--y);
  width: calc(var(--s) * 1px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.8);
  animation: twinkle var(--d) ease-in-out infinite;
}

.scene-night .moon {
  top: 9vh;
  right: 13vw;
  width: clamp(70px, 11vw, 130px);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: calc(clamp(70px, 11vw, 130px) * 0.22) calc(clamp(70px, 11vw, 130px) * 0.06) 0 0 #fff0b3;
  filter: drop-shadow(0 0 18px rgba(255, 240, 180, 0.7));
  animation: moon-float 7s ease-in-out infinite;
}

.scene-night .shooting-star,
.scene-space .shooting-star {
  top: var(--y);
  left: var(--x);
  width: 120px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff);
  opacity: 0;
  animation: shooting-star var(--d) ease-in infinite;
}

.scene-night .heart {
  left: var(--x);
  bottom: -8vh;
  width: calc(var(--s) * 1px);
  aspect-ratio: 1;
  /* On the wrapper: a clipped shape would cut off its own glow */
  filter: drop-shadow(0 0 6px rgba(255, 170, 205, 0.8));
  animation: heart-float var(--d) linear infinite;
}

/* A 24px heart, scaled to the piece's size */
.scene-night .heart::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  background: #ff9ec4;
  clip-path: path('M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z');
  transform: scale(calc(var(--s) / 24));
  transform-origin: 0 0;
}

.scene-night .hill-night-back {
  left: -10vw;
  width: 75vw;
  height: 20vh;
  background: #9a83cf;
}

.scene-night .hill-night-front {
  right: -12vw;
  width: 80vw;
  height: 15vh;
  background: #826cbf;
  animation: hill-sway 10s ease-in-out infinite;
}

/* Soft 3D: a lit top edge on rounded ground */
.scene-sakura .hill,
.scene-ocean .hill {
  box-shadow: inset 0 14px 24px rgba(255, 255, 255, 0.65);
}

/* Falling sakura */
.scene-sakura {
  background: linear-gradient(180deg, #ffdcea 0%, #ffeef4 40%, #fff6f0 70%, #e4f3ff 100%);
}

.scene-sakura .hill-sakura-back {
  left: -12vw;
  width: 72vw;
  height: 22vh;
  background: radial-gradient(ellipse at 50% 0%, #e8f9ef, #bfe6cf);
}

.scene-sakura .hill-sakura-front {
  right: -16vw;
  width: 78vw;
  height: 16vh;
  background: radial-gradient(ellipse at 45% 0%, #fff0f5, #ffc6da);
  animation: hill-sway 9s ease-in-out infinite;
}

/* A puffy blossom cluster reaching in from a top corner */
.scene-sakura .blossom {
  top: -16vmax;
  left: -14vmax;
  width: 44vmax;
  aspect-ratio: 1;
  background:
    radial-gradient(circle 7vmax at 70% 58%, #fff6fa 0, #ffc9dd 45%, #f6a2c3 96%, transparent),
    radial-gradient(circle 6vmax at 50% 74%, #fff6fa 0, #ffd0e2 45%, #f8abc9 96%, transparent),
    radial-gradient(circle 5.5vmax at 82% 78%, #fff6fa 0, #ffc2d8 45%, #f39abd 96%, transparent),
    radial-gradient(circle 8vmax at 56% 50%, #fff6fa 0, #ffd6e6 45%, #f8b2ce 96%, transparent);
  filter: drop-shadow(0 10px 16px rgba(240, 140, 180, 0.3));
  transform-origin: 0 0;
  animation: blossom-sway 8s ease-in-out infinite;
}

.scene-sakura .blossom:nth-child(4) {
  left: auto;
  right: -14vmax;
  top: -18vmax;
  scale: -1 1;
  /* Flipping around the right edge would throw it off screen */
  transform-origin: 50% 0;
  animation-duration: 10s;
}

.scene-sakura .petal {
  left: var(--x);
  top: -8vh;
  width: calc(var(--s) * 1px);
  height: calc(var(--s) * 0.8px);
  border-radius: 0 100% 0 100%;
  background: linear-gradient(135deg, #fff 0%, #ffd3e3 40%, #ff9fc4 100%);
  box-shadow: 0 4px 8px rgba(240, 140, 180, 0.25);
  animation: petal-fall var(--d) linear infinite;
}

/* Balloons */
.scene-balloons {
  background: linear-gradient(180deg, #c9e6ff 0%, #dff0ff 40%, #f3f0ff 72%, #ffeede 100%);
}

.scene-balloons .balloon {
  left: var(--x);
  bottom: -30vh;
  width: calc(var(--s) * 1px);
  height: calc(var(--s) * 1.2px);
  border-radius: 50% 50% 47% 53% / 58% 58% 42% 42%;
  background: var(--c);
  background: radial-gradient(circle at 34% 28%, #fff 0 7%, color-mix(in srgb, var(--c) 45%, #fff) 16%, var(--c) 50%, color-mix(in srgb, var(--c) 74%, #7a6aa8) 100%);
  box-shadow: inset -6px -8px 16px rgba(120, 100, 170, 0.16), 0 10px 18px rgba(120, 110, 170, 0.14);
  animation: balloon-rise var(--d) linear infinite;
}

/* Knot */
.scene-balloons .balloon::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 8px;
  translate: -50% 0;
  background: color-mix(in srgb, var(--c) 74%, #7a6aa8);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

/* String */
.scene-balloons .balloon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  width: 1.5px;
  height: calc(var(--s) * 1.1px);
  background: linear-gradient(rgba(130, 115, 170, 0.55), rgba(130, 115, 170, 0));
}

/* Under the sea */
.scene-ocean {
  background: linear-gradient(180deg, #c6f3ec 0%, #a7e2ef 40%, #a9cdf2 75%, #b9bff2 100%);
}

.scene-ocean .ray {
  top: -10vh;
  left: var(--x);
  width: 9vw;
  height: 95vh;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
  transform: skewX(-14deg);
  transform-origin: 0 0;
  filter: blur(6px);
  opacity: 0.5;
  animation: ray-glow var(--d) ease-in-out infinite;
}

.scene-ocean .hill-sand {
  left: -10vw;
  width: 120vw;
  height: 15vh;
  background: radial-gradient(ellipse at 50% 0%, #fff3e3, #ffd8b6);
}

.scene-ocean .seaweed {
  left: var(--x);
  bottom: 5vh;
  width: 16px;
  height: calc(var(--s) * 1vh);
  border-radius: 999px;
  background: linear-gradient(90deg, #8fdcbc, #c4f4dd 45%, #7ccfae);
  transform-origin: 50% 100%;
  animation: seaweed-sway var(--d) ease-in-out infinite;
}

.scene-ocean .jelly {
  left: var(--x);
  bottom: -25vh;
  width: calc(var(--s) * 1px);
  height: calc(var(--s) * 0.72px);
  border-radius: 50% 50% 22% 22% / 80% 80% 20% 20%;
  background: var(--c);
  background: radial-gradient(circle at 36% 30%, #fff 0 8%, color-mix(in srgb, var(--c) 40%, #fff) 20%, var(--c) 58%, color-mix(in srgb, var(--c) 70%, #9b7fd0) 100%);
  box-shadow: inset 0 -6px 12px rgba(150, 110, 200, 0.18), 0 0 18px rgba(255, 255, 255, 0.5);
  animation: jelly-swim var(--d) linear infinite, jelly-pulse 1.8s ease-in-out infinite;
}

/* Two little eyes */
.scene-ocean .jelly::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 34%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6b5a8e;
  box-shadow: calc(var(--s) * 0.26px) 0 0 #6b5a8e;
}

/* Tentacles */
.scene-ocean .jelly::after {
  content: '';
  position: absolute;
  top: 84%;
  left: 16%;
  width: 68%;
  height: calc(var(--s) * 0.85px);
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--c) 80%, #fff) 0 3px, transparent 3px 10px);
  -webkit-mask-image: linear-gradient(#000 30%, transparent);
  mask-image: linear-gradient(#000 30%, transparent);
  transform-origin: 50% 0;
  animation: tentacle-wave 1.8s ease-in-out infinite;
}

@keyframes blossom-sway {
  50% { transform: rotate(3deg); }
}

@keyframes petal-fall {
  0% { transform: translate(0, 0) rotate(0deg) rotateX(0deg); opacity: 0; }
  6% { opacity: 1; }
  50% { transform: translate(calc(var(--sway) * 1px), 55vh) rotate(200deg) rotateX(180deg); }
  94% { opacity: 1; }
  100% { transform: translate(calc(var(--sway) * -0.4px), 115vh) rotate(400deg) rotateX(360deg); opacity: 0; }
}

@keyframes balloon-rise {
  0% { transform: translate(0, 0) rotate(-4deg); }
  25% { transform: translate(calc(var(--sway) * 1px), -35vh) rotate(4deg); }
  50% { transform: translate(calc(var(--sway) * -1px), -70vh) rotate(-4deg); }
  75% { transform: translate(calc(var(--sway) * 1px), -105vh) rotate(3deg); }
  100% { transform: translate(0, -140vh) rotate(-3deg); }
}

@keyframes ray-glow {
  50% { opacity: 0.15; }
}

@keyframes seaweed-sway {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(7deg); }
}

@keyframes jelly-swim {
  0% { translate: 0 0; }
  25% { translate: calc(var(--sway) * 1px) -35vh; }
  50% { translate: calc(var(--sway) * -1px) -70vh; }
  75% { translate: calc(var(--sway) * 1px) -105vh; }
  100% { translate: 0 -140vh; }
}

@keyframes jelly-pulse {
  0%, 100% { scale: 1 1; }
  50% { scale: 1.08 0.9; }
}

@keyframes tentacle-wave {
  50% { transform: scaleY(0.85) skewX(5deg); }
}

/* Mushroom forest */
.scene-forest {
  background: linear-gradient(180deg, #d4f1e4 0%, #e8f8ee 50%, #fff4e0 100%);
}

.scene-forest .hill {
  box-shadow: inset 0 14px 24px rgba(255, 255, 255, 0.55);
}

.scene-forest .hill-forest-back {
  left: -10vw;
  width: 120vw;
  height: 30vh;
  background: radial-gradient(ellipse at 50% 0%, #dcf6e4, #b5e4c6);
}

.scene-forest .hill-forest-front {
  left: -10vw;
  width: 120vw;
  height: 16vh;
  background: radial-gradient(ellipse at 50% 0%, #c8eed4, #9fdcb4);
}

/* Round lollipop tree: the crown is the piece, the trunk hangs below it */
.scene-forest .tree {
  left: var(--x);
  bottom: 14vh;
  width: calc(var(--s) * 1px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.7) 0 6%, color-mix(in srgb, var(--c) 55%, #fff) 20%, var(--c) 55%, color-mix(in srgb, var(--c) 78%, #3f7a62) 100%);
  transform-origin: 50% 150%;
  animation: tree-sway var(--d) ease-in-out infinite;
}

.scene-forest .tree::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 94%;
  width: 14%;
  height: 45%;
  translate: -50% 0;
  border-radius: 6px;
  background: linear-gradient(90deg, #d9a77f, #f0c9a2 50%, #c99570);
}

.scene-forest .mushroom {
  left: var(--x);
  bottom: calc(3vh + var(--s) * 0.3px);
  width: calc(var(--s) * 1px);
  height: calc(var(--s) * 0.62px);
  border-radius: 50% 50% 14% 14% / 90% 90% 10% 10%;
  background:
    radial-gradient(circle at 30% 40%, #fff 0 9%, transparent 10%),
    radial-gradient(circle at 64% 30%, #fff 0 7%, transparent 8%),
    radial-gradient(circle at 80% 64%, #fff 0 6%, transparent 7%),
    linear-gradient(180deg, #ffb6c5, #ff8fa6);
  transform-origin: 50% 150%;
  animation: mushroom-squish var(--d) ease-in-out infinite;
}

.scene-forest .mushroom::after {
  content: '';
  position: absolute;
  left: 32%;
  top: 88%;
  width: 36%;
  height: 60%;
  border-radius: 0 0 40% 40%;
  background: linear-gradient(90deg, #fff3e2, #ffe4c7);
}

.scene-forest .firefly {
  left: var(--x);
  top: var(--y);
  width: calc(var(--s) * 1px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbe0 0 25%, rgba(255, 240, 150, 0.55) 45%, transparent 70%);
  animation: firefly var(--d) ease-in-out infinite;
}

.scene-forest .leaf {
  left: var(--x);
  top: -8vh;
  width: calc(var(--s) * 1px);
  height: calc(var(--s) * 0.6px);
  border-radius: 0 100% 0 100%;
  background: linear-gradient(135deg, #efffe0, #a8e39a 50%, #7fcf8d);
  animation: petal-fall var(--d) linear infinite;
}

/* Clear sea with a little boat */
.scene-beach {
  background: linear-gradient(180deg, #bfe6ff 0%, #dff1ff 45%, #fff1e8 62%);
}

/* Scalloped top edge, solid below; slides one scallop and repeats */
.scene-beach .wave {
  left: -60px;
  bottom: 0;
  width: calc(100vw + 180px);
  background:
    radial-gradient(circle 32px at 30px 36px, var(--wc) 96%, transparent 100%) 0 0 / 60px 36px repeat-x,
    linear-gradient(var(--wc), var(--wc)) 0 30px / 100% 100% no-repeat;
  animation: wave-slide var(--wd) linear infinite, wave-bob 4s ease-in-out infinite;
}

.scene-beach .wave-back {
  height: 38vh;
  --wc: #b3eaf3;
  --wd: 9s;
}

.scene-beach .wave-mid {
  height: 27vh;
  --wc: #93daec;
  --wd: 7s;
  animation-direction: reverse, normal;
  animation-delay: 0s, -1.5s;
}

.scene-beach .wave-front {
  height: 15vh;
  --wc: #7ac8e2;
  --wd: 5s;
  animation-delay: 0s, -3s;
}

.scene-beach .boat {
  left: 20vw;
  bottom: 25vh;
  width: 96px;
  height: 90px;
  transform-origin: 50% 100%;
  animation: boat-bob 3.6s ease-in-out infinite;
}

.scene-beach .boat::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 30%;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: linear-gradient(180deg, #ffb8cb, #ff8fb1);
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.5);
}

.scene-beach .boat::after {
  content: '';
  position: absolute;
  left: 30%;
  bottom: 32%;
  width: 52%;
  height: 68%;
  background: linear-gradient(90deg, #fff, #fff1d6);
  clip-path: polygon(0 100%, 0 0, 100% 100%);
}

/* Pastel space */
.scene-space {
  background:
    radial-gradient(ellipse 50% 35% at 20% 70%, rgba(255, 170, 210, 0.35), transparent),
    radial-gradient(ellipse 45% 30% at 80% 20%, rgba(140, 220, 255, 0.25), transparent),
    linear-gradient(160deg, #2f3a7a 0%, #5b4fa8 45%, #9d7fd6 80%, #f6b6d6 100%);
}

.scene-space .planet {
  aspect-ratio: 1;
  border-radius: 50%;
  animation: planet-float 9s ease-in-out infinite;
}

.scene-space .planet-big {
  top: 9vh;
  right: 8vw;
  width: clamp(110px, 20vw, 220px);
  background: radial-gradient(circle at 34% 30%, #fff3e6 0 6%, #ffd9bd 22%, #ffb89a 60%, #e98f8f 100%);
  box-shadow: inset -10px -12px 24px rgba(120, 60, 120, 0.25);
}

/* Ring */
.scene-space .planet-big::after {
  content: '';
  position: absolute;
  left: -30%;
  top: 38%;
  width: 160%;
  height: 24%;
  border: 5px solid rgba(255, 240, 250, 0.8);
  border-top-color: rgba(255, 240, 250, 0.3);
  border-radius: 50%;
  transform: rotate(-16deg);
}

.scene-space .planet-small {
  left: 7vw;
  bottom: 20vh;
  width: clamp(56px, 9vw, 100px);
  background: radial-gradient(circle at 34% 30%, #f3fff9 0 6%, #c4f2de 25%, #8fd9c0 70%, #6dbfae 100%);
  box-shadow: inset -6px -8px 14px rgba(40, 90, 110, 0.25);
  animation-duration: 11s;
  animation-direction: reverse;
}

.scene-space .ufo {
  top: 20vh;
  left: 16vw;
  width: 120px;
  height: 38px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 22% 62%, #fff59c 0 5%, transparent 6%),
    radial-gradient(circle at 50% 70%, #fff59c 0 5%, transparent 6%),
    radial-gradient(circle at 78% 62%, #fff59c 0 5%, transparent 6%),
    linear-gradient(180deg, #f2eaff, #c9b8f5 60%, #a996e6);
  box-shadow: inset 0 -6px 10px rgba(90, 60, 160, 0.25);
  animation: ufo-hover 8s ease-in-out infinite;
}

/* Glass dome */
.scene-space .ufo::before {
  content: '';
  position: absolute;
  left: 28%;
  bottom: 58%;
  width: 44%;
  height: 80%;
  border-radius: 50% 50% 10% 10% / 100% 100% 0 0;
  background: radial-gradient(circle at 35% 35%, #fff 0 12%, rgba(190, 240, 255, 0.85) 30%, rgba(140, 210, 255, 0.7));
}

/* Light beam */
.scene-space .ufo::after {
  content: '';
  position: absolute;
  left: 20%;
  top: 85%;
  width: 60%;
  height: 110px;
  background: linear-gradient(180deg, rgba(255, 250, 200, 0.6), rgba(255, 250, 200, 0));
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
  animation: beam-pulse 2s ease-in-out infinite;
}

.scene-space .rocket {
  left: -12vw;
  top: 72vh;
  width: 64px;
  height: 26px;
  border-radius: 12px 50% 50% 12px / 50%;
  background:
    radial-gradient(circle at 62% 50%, #8fe3ff 0 14%, #fff 15% 20%, transparent 21%),
    linear-gradient(90deg, #ff9fc4 0 16%, #fff 16%);
  animation: rocket-fly 16s linear infinite;
}

/* Fins, top and bottom */
.scene-space .rocket::before {
  content: '';
  position: absolute;
  left: 4%;
  top: -30%;
  width: 26%;
  height: 160%;
  background: #ff9fc4;
  clip-path: polygon(0 0, 100% 30%, 0 30%, 0 70%, 100% 70%, 0 100%);
}

.scene-space .rocket::after {
  content: '';
  position: absolute;
  right: 100%;
  top: 25%;
  width: 26px;
  height: 50%;
  border-radius: 50% 0 0 50%;
  background: linear-gradient(90deg, rgba(255, 211, 110, 0), #ffd36e 50%, #ff9f6e);
  transform-origin: 100% 50%;
  animation: flame 0.3s ease-in-out infinite alternate;
}

/* Robot lab */
.scene-robots {
  background: linear-gradient(180deg, #d9e8ff 0%, #e6e2ff 55%, #ffe3f0 100%);
}

/* Grid floor in perspective; only the grid inside it moves */
.scene-robots .floor {
  left: -50vw;
  bottom: 0;
  width: 200vw;
  height: 52vh;
  overflow: hidden;
  background: linear-gradient(180deg, #ece6ff, #f8eaff);
  transform: perspective(420px) rotateX(58deg);
  transform-origin: 50% 100%;
}

.scene-robots .floor::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -60px;
  bottom: 0;
  background:
    repeating-linear-gradient(90deg, rgba(160, 150, 230, 0.55) 0 2px, transparent 2px 60px),
    repeating-linear-gradient(0deg, rgba(160, 150, 230, 0.55) 0 2px, transparent 2px 60px);
  animation: floor-scroll 3s linear infinite;
}

.scene-robots .gear {
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #e7e3ff 0 15%, var(--gc) 16% 58%, transparent 59%),
    repeating-conic-gradient(var(--gc) 0 12deg, transparent 12deg 24deg);
  -webkit-mask-image: radial-gradient(circle, #000 0 70%, transparent 71%);
  mask-image: radial-gradient(circle, #000 0 70%, transparent 71%);
  animation: gear-spin var(--gd) linear infinite;
}

.scene-robots .gear-a {
  left: -7vmax;
  top: -7vmax;
  width: 26vmax;
  --gc: #c9c0f5;
  --gd: 24s;
}

.scene-robots .gear-b {
  left: 15vmax;
  top: -4vmax;
  width: 13vmax;
  --gc: #ffc7dd;
  --gd: 12s;
  animation-direction: reverse;
}

.scene-robots .gear-c {
  right: -8vmax;
  top: 10vh;
  width: 22vmax;
  --gc: #bfe6f5;
  --gd: 20s;
  animation-direction: reverse;
}

/* Little robot: antenna on the piece, head and screen on ::before, eyes on ::after */
.scene-robots .bot {
  left: var(--x);
  top: var(--y);
  width: calc(var(--s) * 1px);
  height: calc(var(--s) * 1.15px);
  background:
    radial-gradient(circle calc(var(--s) * 0.07px) at 50% calc(var(--s) * 0.08px), #ff9fc4 96%, transparent),
    linear-gradient(#b7b9d9, #b7b9d9) 50% calc(var(--s) * 0.12px) / 3px calc(var(--s) * 0.16px) no-repeat;
  animation: bot-float var(--d) ease-in-out infinite;
}

.scene-robots .bot::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 76%;
  border-radius: 30%;
  background:
    linear-gradient(#41456f, #41456f) 50% 52% / 70% 54% no-repeat,
    linear-gradient(180deg, #fff, var(--c));
  box-shadow: inset 0 -6px 10px rgba(110, 100, 170, 0.22), 0 8px 14px rgba(110, 100, 170, 0.18);
}

.scene-robots .bot::after {
  content: '';
  position: absolute;
  left: 22%;
  right: 22%;
  top: calc(63.5% - var(--s) * 0.08px);
  height: calc(var(--s) * 0.16px);
  background:
    radial-gradient(circle calc(var(--s) * 0.06px) at 25% 50%, #8ff5ff 96%, transparent),
    radial-gradient(circle calc(var(--s) * 0.06px) at 75% 50%, #8ff5ff 96%, transparent);
  animation: blink 4s ease-in-out infinite;
}

.scene-robots .sparkle {
  background: #a8f0ff;
}

/* World Expo picture, brought to life */
.scene-expo-live {
  background: #ffe9f0;
}

.scene-expo-live .expo-photo {
  inset: 0;
  /* Cropped from the logo's corner, so narrow phones still show the logo */
  background: url('backgrounds/world-expo.webp') 0 0 / cover no-repeat;
  /* Zoom from the same corner so the logo stays in view */
  transform-origin: 0 0;
  animation: ken-burns 18s ease-in-out infinite alternate;
}

.scene-expo-live .shine {
  top: -20%;
  left: -60%;
  width: 40%;
  height: 140%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
  animation: shine-sweep 9s ease-in-out infinite;
}

/* Four-point star and floating dot, shared by both expo scenes */
.star4 {
  left: var(--x);
  top: var(--y);
  width: calc(var(--s) * 1px);
  aspect-ratio: 1;
  background: var(--c);
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  animation: star4-twinkle var(--d) ease-in-out infinite;
}

.dot {
  left: var(--x);
  bottom: -4vh;
  width: calc(var(--s) * 1px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset -2px -3px 4px rgba(230, 120, 160, 0.25);
  animation: heart-float var(--d) linear infinite;
}

/* Pastel pop: the same tone, no logo */
.scene-pastel-pop {
  background: linear-gradient(135deg, #ffe3ec 0%, #fff5ef 50%, #f3fbe9 100%);
}

/* Glossy rounded shapes with a white rim, like the expo artwork */
.scene-pastel-pop .pop-blob {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.7);
  animation: pop-float 12s ease-in-out infinite;
}

.scene-pastel-pop .pop-a {
  left: -18vmax;
  top: -24vmax;
  width: 58vmax;
  background: radial-gradient(circle at 62% 72%, #ffd3e2, #ff94b8 55%, #f2628f);
}

.scene-pastel-pop .pop-b {
  left: -12vmax;
  bottom: -26vmax;
  width: 46vmax;
  background: radial-gradient(circle at 60% 30%, #f6ffec, #cdeeb8 50%, #a3da93);
  animation-duration: 14s;
  animation-direction: reverse;
}

.scene-pastel-pop .pop-c {
  right: -20vmax;
  bottom: -18vmax;
  width: 52vmax;
  background: radial-gradient(circle at 35% 30%, #fff1e6, #ffd2bb 55%, #ffb99a);
  animation-duration: 16s;
}

.scene-pastel-pop .pop-d {
  right: -9vmax;
  bottom: -14vmax;
  width: 28vmax;
  background: radial-gradient(circle at 35% 30%, #ffe6f1, #ffb6d2);
  animation-duration: 11s;
  animation-direction: reverse;
}

.scene-pastel-pop .pop-e {
  right: -10vmax;
  top: -15vmax;
  width: 26vmax;
  background: radial-gradient(circle at 35% 70%, #e4fbe8, #a5e3b6);
  animation-duration: 13s;
}

/* White stage the bot stands on */
.scene-pastel-pop .stage {
  left: -10vw;
  bottom: -7vh;
  width: 120vw;
  height: 17vh;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: linear-gradient(180deg, #fff, #ffe8f0);
  box-shadow: 0 -3px 0 rgba(255, 255, 255, 0.9), inset 0 8px 16px rgba(255, 190, 210, 0.45);
}

/* Three "pop" marks fanning out top-right */
.scene-pastel-pop .burst {
  top: 9vh;
  right: 10vw;
  width: 3.4vmin;
  height: 10vmin;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff8fb3, #f2628f);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.45);
  transform-origin: 50% 160%;
  animation: burst-pop 2.4s ease-in-out infinite;
}

.scene-pastel-pop .burst-1 {
  rotate: -28deg;
}

.scene-pastel-pop .burst-2 {
  rotate: 6deg;
  background: linear-gradient(180deg, #fff, #ffeef4);
  animation-delay: 0.15s;
}

.scene-pastel-pop .burst-3 {
  rotate: 40deg;
  animation-delay: 0.3s;
}

.scene-pastel-pop .star4,
.scene-expo-live .star4 {
  filter: drop-shadow(0 2px 4px rgba(240, 120, 160, 0.35));
}

@keyframes ken-burns {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

@keyframes shine-sweep {
  0% { transform: translateX(0) rotate(20deg); }
  45%, 100% { transform: translateX(460%) rotate(20deg); }
}

@keyframes star4-twinkle {
  0%, 100% { transform: scale(0.5) rotate(0deg); opacity: 0.35; }
  50% { transform: scale(1) rotate(45deg); opacity: 1; }
}

@keyframes pop-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(1.5vmax, 1vmax) scale(1.04); }
}

@keyframes burst-pop {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.14) translateY(-6px); }
}

@keyframes tree-sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

@keyframes mushroom-squish {
  50% { transform: scale(1.06, 0.94); }
}

@keyframes firefly {
  0%, 100% { transform: translate(0, 0); opacity: 0.2; }
  25% { transform: translate(calc(var(--sway) * 1px), -20px); opacity: 1; }
  50% { transform: translate(calc(var(--sway) * 0.4px), -46px); opacity: 0.4; }
  75% { transform: translate(calc(var(--sway) * -0.6px), -18px); opacity: 1; }
}

@keyframes wave-slide {
  to { transform: translateX(60px); }
}

@keyframes wave-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 8px; }
}

@keyframes boat-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}

@keyframes planet-float {
  50% { transform: translateY(-14px); }
}

@keyframes ufo-hover {
  0%, 100% { transform: translate(0, 0) rotate(-3deg); }
  25% { transform: translate(14vw, -3vh) rotate(3deg); }
  50% { transform: translate(26vw, 1vh) rotate(-2deg); }
  75% { transform: translate(10vw, 3vh) rotate(2deg); }
}

@keyframes beam-pulse {
  50% { opacity: 0.35; }
}

@keyframes rocket-fly {
  0% { transform: translate(0, 0) rotate(-18deg); }
  60%, 100% { transform: translate(128vw, -46vh) rotate(-18deg); }
}

@keyframes flame {
  from { transform: scaleX(0.7); }
  to { transform: scaleX(1.1); }
}

@keyframes floor-scroll {
  to { transform: translateY(60px); }
}

@keyframes gear-spin {
  to { transform: rotate(360deg); }
}

@keyframes bot-float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14px) rotate(4deg); }
}

@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

@keyframes cloud-drift {
  from { transform: translateX(0); }
  to { transform: translateX(170vw); }
}

@keyframes sun-breathe {
  50% { transform: scale(1.06); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes hill-sway {
  50% { transform: scaleY(1.06) translateY(1vh); }
}

@keyframes blob-morph {
  33% { border-radius: 58% 42% 38% 62% / 52% 60% 40% 48%; transform: rotate(12deg); }
  66% { border-radius: 40% 60% 54% 46% / 60% 44% 56% 40%; transform: rotate(-8deg); }
}

@keyframes bubble-rise {
  0% { transform: translate(0, 0) scale(0.7); opacity: 0; }
  8% { opacity: 1; }
  25% { transform: translate(calc(var(--sway) * 1px), -32vh) scale(0.85); }
  50% { transform: translate(calc(var(--sway) * -1px), -64vh) scale(0.95); }
  75% { transform: translate(calc(var(--sway) * 1px), -96vh) scale(1); }
  92% { opacity: 1; }
  100% { transform: translate(0, -130vh) scale(1.05); opacity: 0; }
}

@keyframes moon-float {
  50% { transform: translateY(-10px); }
}

@keyframes shooting-star {
  0%, 82% { opacity: 0; transform: translate(0, 0) rotate(-24deg); }
  86% { opacity: 1; }
  100% { opacity: 0; transform: translate(-36vw, 16vw) rotate(-24deg); }
}

@keyframes heart-float {
  0% { transform: translate(0, 0) rotate(-8deg); opacity: 0; }
  10% { opacity: 0.85; }
  50% { transform: translate(calc(var(--sway) * 1px), -55vh) rotate(8deg); }
  90% { opacity: 0.85; }
  100% { transform: translate(0, -110vh) rotate(-8deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }

  /* Still scenes: put the travelling pieces where they can be seen */
  .scene-clouds .cloud { left: calc(var(--y) * 1.6); }
  .scene-bubbles .bubble { bottom: calc(var(--s) * 0.6vh); }
  .scene-night .heart { bottom: calc(var(--s) * 1.2vh); opacity: 0.8; }
  .scene-sakura .petal { top: calc(var(--s) * 3vh); }
  .scene-balloons .balloon { bottom: calc(var(--s) * 0.6vh); }
  .scene-balloons .cloud { left: calc(var(--y) * 1.6); }
  .scene-ocean .jelly { bottom: calc(var(--s) * 0.5vh); }
  .scene-ocean .bubble { bottom: calc(var(--s) * 1.5vh); }
  .scene-forest .leaf { top: calc(var(--s) * 3vh); }
  .bg-scene .dot { bottom: calc(var(--s) * 4vh); }
  .scene-expo-live .shine { display: none; }
  .scene-beach .cloud { left: calc(var(--y) * 2); }
  .scene-space .rocket { left: 60vw; top: 64vh; transform: rotate(-18deg); }
}
