/* =============================================================================
   RLabs Demo — three acts: (1) a Telegram phone mockup showing the request,
   (2) a terminal mockup showing the OpenClaw agent building + deploying on
   the VPS, (3) the shipped result — a canvas flock of birds on real flight
   curves, a CSS-built photographer (Ryan) who chases them and keeps missing,
   synthesized camera-click/whoosh SFX via Web Audio, and a spoken sign-off
   via SpeechSynthesis at the very end. Same engine family as Theresa's
   Sleep Study, reskinned as daytime sky.
   ============================================================================= */

:root {
  --rb-sky-top: #6ec3ff;
  --rb-sky-bot: #cdeeff;
  --rb-sun: #ffe27a;
  --rb-grass-1: #6fb35c;
  --rb-grass-2: #4f9a45;
  --rb-ink: #16202b;
  --rb-panel: rgba(16, 24, 34, 0.78);
  --rb-accent: #ff8a3d;
  --rb-accent-2: #2fb8a3;
  --rb-white: #fffdf8;
  --rb-skin: #e8b78d;
  --rb-skin-shadow: #cf9c6d;
  --rb-hair: #3a2a1c;
  --rb-shirt: #d1483c;
  --rb-shirt-2: #a8362d;
  --rb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --rb-mono: "SFMono-Regular", "Courier New", monospace;
  --rb-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --rb-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100vh; min-height: 100dvh; }

body {
  font-family: var(--rb-font);
  background: var(--rb-sky-top);
  color: var(--rb-ink);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  touch-action: manipulation;
}

.rb-home-btn {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(16, 24, 34, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--rb-white);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  transition: background 0.2s var(--rb-ease), transform 0.2s var(--rb-ease);
}
.rb-home-btn:hover { background: rgba(16, 24, 34, 0.75); transform: translateX(-2px); }
.rb-home-btn svg { width: 1rem; height: 1rem; flex: none; }

/* =============================================================================
   Intro screen
   ============================================================================= */
.rb-intro {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.25rem;
  background: linear-gradient(180deg, #4fa6ef, #bfe6ff 70%, #e8f7ff);
  transition: opacity 0.5s var(--rb-ease), transform 0.5s var(--rb-ease);
}
.rb-intro.is-hidden {
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
  position: absolute;
  inset: 0;
}
.rb-intro-glow {
  position: absolute;
  z-index: 0;
  top: 4%;
  left: 50%;
  width: 34rem;
  height: 34rem;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 226, 122, 0.45), transparent 65%);
  pointer-events: none;
}
.rb-intro-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(16, 24, 34, 0.25);
  background: rgba(255, 255, 255, 0.55);
  color: #b5541f;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.rb-intro-badge .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--rb-accent);
  animation: rb-blink 1.1s ease-in-out infinite;
}
@keyframes rb-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
.rb-intro-icon {
  position: relative;
  z-index: 1;
  font-size: 3.6rem;
  margin-bottom: 0.6rem;
  display: inline-block;
  animation: rb-icon-fly 3s ease-in-out infinite;
}
@keyframes rb-icon-fly {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}
.rb-intro-eyebrow {
  position: relative;
  z-index: 1;
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1c6e63;
  font-family: var(--rb-mono);
}
.rb-intro-title {
  position: relative;
  z-index: 1;
  font-size: clamp(1.9rem, 6vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
  color: #133046;
}
.rb-intro-sub {
  position: relative;
  z-index: 1;
  margin: 0 0 2.2rem;
  font-size: 0.98rem;
  color: #245069;
  font-weight: 600;
  max-width: 26rem;
}
.rb-start-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 2rem;
  background: linear-gradient(100deg, var(--rb-accent), #d9631f);
  color: var(--rb-white);
  font-weight: 700;
  font-size: 1.05rem;
  font-family: var(--rb-font);
  cursor: pointer;
  box-shadow: 0 16px 34px -16px rgba(217, 99, 31, 0.6);
  transition: transform 0.2s var(--rb-ease), box-shadow 0.2s var(--rb-ease);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.rb-start-btn:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -16px rgba(217, 99, 31, 0.65); }
.rb-start-btn:active { transform: translateY(0); }
.rb-intro-note {
  position: relative;
  z-index: 1;
  margin: 1.1rem 0 0;
  font-size: 0.82rem;
  color: #2d5b74;
}

/* =============================================================================
   Acts 1 & 2 — Telegram request + terminal build
   ============================================================================= */
.rb-act {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: 2rem 1.25rem;
  background: linear-gradient(180deg, #101826, #1b2536 60%, #0d1420);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 0.5s var(--rb-ease), transform 0.5s var(--rb-ease);
}
.rb-act.is-active { opacity: 1; pointer-events: auto; transform: scale(1); }

.rb-act-label {
  margin: 0;
  font-family: var(--rb-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

/* --- Act 1: phone --- */
.rb-phone {
  width: min(22rem, 88vw);
  background: #0c1118;
  border-radius: 2.2rem;
  border: 6px solid #05070b;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.65);
  overflow: hidden;
  position: relative;
}
.rb-phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 1.1rem;
  background: #05070b;
  border-radius: 0 0 0.8rem 0.8rem;
  z-index: 3;
}
.rb-phone-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1.6rem 1.1rem 0.8rem;
  background: #17212b;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rb-phone-avatar {
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: #2a3a4d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex: none;
}
.rb-phone-title {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.rb-phone-title strong {
  color: var(--rb-white);
  font-size: 0.92rem;
  font-weight: 700;
}
.rb-phone-title em {
  font-style: normal;
  font-size: 0.72rem;
  color: #6fcf97;
}
.rb-phone-body {
  min-height: 14rem;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.03), transparent 40%),
    #131c26;
}
.rb-msg {
  max-width: 82%;
  padding: 0.6rem 0.85rem;
  border-radius: 1rem;
  font-size: 0.86rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s var(--rb-ease), transform 0.35s var(--rb-ease);
}
.rb-msg.is-visible { opacity: 1; transform: translateY(0); }
.rb-msg-in {
  align-self: flex-start;
  background: #263647;
  color: var(--rb-white);
  border-bottom-left-radius: 0.3rem;
}
.rb-msg-out {
  align-self: flex-end;
  background: linear-gradient(120deg, #3a7bd5, #2fb8a3);
  color: var(--rb-white);
  border-bottom-right-radius: 0.3rem;
}
.rb-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--rb-white);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: rb-caret-blink 0.9s step-end infinite;
}
@keyframes rb-caret-blink { 50% { opacity: 0; } }
.rb-msg-typing {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.7rem 0.9rem;
}
.rb-typing-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  animation: rb-typing-bounce 1.1s ease-in-out infinite;
}
.rb-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.rb-typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes rb-typing-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* --- Act 2: terminal --- */
.rb-terminal {
  width: min(30rem, 90vw);
  background: #0b0f14;
  border-radius: 0.8rem;
  overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.08);
}
.rb-terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.8rem;
  background: #161c24;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.rb-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; }
.rb-dot-r { background: #ff5f57; }
.rb-dot-y { background: #febc2e; }
.rb-dot-g { background: #28c840; }
.rb-terminal-title {
  margin-left: 0.6rem;
  font-family: var(--rb-mono);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
}
.rb-terminal-body {
  margin: 0;
  padding: 1rem 1.1rem 1.3rem;
  min-height: 9.5rem;
  font-family: var(--rb-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: #7ee787;
  white-space: pre-wrap;
  word-break: break-word;
}
.rb-terminal-body { max-height: 13.5rem; overflow-y: auto; }
.rb-terminal-body .rb-line-dim { color: rgba(255,255,255,0.4); }
.rb-terminal-body .rb-line-ok { color: #6fcf97; font-weight: 700; }
.rb-terminal-body .rb-line-diff { color: #7ee787; }
.rb-terminal-body .rb-cursor-row { display: block; height: 1.6em; }
.rb-terminal-body .rb-cursor {
  display: inline-block;
  width: 0.5rem;
  height: 1em;
  background: #7ee787;
  vertical-align: text-bottom;
  animation: rb-caret-blink 0.9s step-end infinite;
}
.rb-build-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 30rem;
}
.rb-step {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-family: var(--rb-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.15);
  transition: color 0.3s var(--rb-ease), border-color 0.3s var(--rb-ease), background 0.3s var(--rb-ease);
}
.rb-step.is-done {
  color: #0d1420;
  background: #6fcf97;
  border-color: #6fcf97;
}

/* =============================================================================
   Stage
   ============================================================================= */
.rb-stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--rb-ease);
  touch-action: manipulation;
}
.rb-stage.is-active { opacity: 1; pointer-events: auto; }

.rb-act3-label {
  position: absolute;
  top: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  color: rgba(22, 32, 43, 0.55);
  background: rgba(255, 255, 255, 0.5);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.rb-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, var(--rb-sky-top) 0%, var(--rb-sky-bot) 78%);
}
.rb-sun {
  position: absolute;
  top: 6%;
  right: 10%;
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, var(--rb-sun), rgba(255, 226, 122, 0));
  box-shadow: 0 0 90px 30px rgba(255, 226, 122, 0.55);
  animation: rb-sun-pulse 5s ease-in-out infinite;
}
@keyframes rb-sun-pulse { 0%, 100% { opacity: 0.85; } 50% { opacity: 1; } }

#rb-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

.rb-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  z-index: 2;
  background: linear-gradient(180deg, var(--rb-grass-1), var(--rb-grass-2));
  border-top: 4px solid rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.rb-hill {
  position: absolute;
  bottom: -20%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.rb-hill-1 { width: 16rem; height: 16rem; left: -4rem; }
.rb-hill-2 { width: 20rem; height: 20rem; right: -6rem; background: rgba(255, 255, 255, 0.08); }

/* =============================================================================
   Ron
   ============================================================================= */
.rb-ron {
  position: absolute;
  bottom: 14%;
  left: -6rem;
  z-index: 4;
  width: 5.5rem;
  height: 8rem;
  transition: left 1.4s var(--rb-ease);
}
.rb-ron.walk-in { left: 42%; }
.rb-ron.chase-left { left: 20%; }
.rb-ron.chase-right { left: 62%; }
.rb-ron.chase-center { left: 42%; }

.rb-ron-label {
  position: absolute;
  top: -1.6rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--rb-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(19, 48, 70, 0.65);
  background: rgba(255, 255, 255, 0.55);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.rb-ron-head {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--rb-skin), var(--rb-skin-shadow));
  box-shadow: inset -3px -4px 7px rgba(0,0,0,0.15);
  z-index: 3;
  transition: transform 0.4s var(--rb-ease-bounce);
}
.rb-ron.looking-up .rb-ron-head { transform: translateX(-50%) rotate(-14deg) translateY(-2px); }
.rb-ron-hair {
  position: absolute;
  top: -32%;
  left: -10%;
  right: -6%;
  height: 55%;
  border-radius: 50% 50% 40% 40%;
  background: linear-gradient(160deg, #241a10, var(--rb-hair));
}
.rb-ron-eye {
  position: absolute;
  top: 42%;
  width: 20%;
  height: 20%;
  background: var(--rb-white);
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}
.rb-ron-eye::after {
  content: "";
  position: absolute;
  inset: 25%;
  border-radius: 50%;
  background: #23150c;
}
.rb-ron-eye-l { left: 16%; }
.rb-ron-eye-r { right: 16%; }
.rb-ron-brow {
  position: absolute;
  top: 34%;
  width: 22%;
  height: 6%;
  background: var(--rb-hair);
  border-radius: 3px;
  transition: transform 0.2s var(--rb-ease);
}
.rb-ron-brow-l { left: 14%; transform: rotate(-6deg); }
.rb-ron-brow-r { right: 14%; transform: rotate(6deg); }
.rb-ron.excited .rb-ron-brow-l { transform: rotate(-16deg) translateY(-2px); }
.rb-ron.excited .rb-ron-brow-r { transform: rotate(16deg) translateY(-2px); }
.rb-ron-mouth {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translateX(-50%);
  width: 26%;
  height: 8%;
  background: #a83b58;
  border-radius: 0 0 8px 8px;
  transition: all 0.25s var(--rb-ease);
}
.rb-ron.missed .rb-ron-mouth {
  height: 14%;
  width: 20%;
  border-radius: 50%;
  top: 66%;
  background: #7a2c40;
}
.rb-ron.excited .rb-ron-mouth {
  width: 34%;
  height: 12%;
  border-radius: 0 0 14px 14px;
  top: 60%;
  background: #7a2230;
}

.rb-ron-body {
  position: absolute;
  top: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2.6rem;
  height: 3.1rem;
  border-radius: 12px 12px 8px 8px;
  background: linear-gradient(160deg, var(--rb-shirt), var(--rb-shirt-2));
  z-index: 2;
}
.rb-ron-strap {
  position: absolute;
  top: -0.2rem;
  left: 8%;
  width: 22%;
  height: 120%;
  background: rgba(60, 40, 20, 0.65);
  transform: rotate(18deg);
  border-radius: 4px;
}

.rb-ron-leg {
  position: absolute;
  bottom: 0;
  width: 0.9rem;
  height: 2.4rem;
  background: #3c3a52;
  border-radius: 0 0 4px 4px;
  transform-origin: top center;
  transition: transform 0.15s ease-in-out;
}
.rb-ron-leg-l { left: 38%; }
.rb-ron-leg-r { right: 38%; }
.rb-ron.is-walking .rb-ron-leg-l { animation: rb-leg-l 0.42s ease-in-out infinite; }
.rb-ron.is-walking .rb-ron-leg-r { animation: rb-leg-r 0.42s ease-in-out infinite; }
@keyframes rb-leg-l { 0%, 100% { transform: rotate(24deg); } 50% { transform: rotate(-24deg); } }
@keyframes rb-leg-r { 0%, 100% { transform: rotate(-24deg); } 50% { transform: rotate(24deg); } }

.rb-ron-arm {
  position: absolute;
  top: 2.7rem;
  right: -0.4rem;
  width: 1.6rem;
  height: 2.6rem;
  z-index: 3;
  transform-origin: top center;
  transition: transform 0.35s var(--rb-ease-bounce);
}
.rb-ron.raising .rb-ron-arm,
.rb-ron.snap .rb-ron-arm {
  transform: rotate(-118deg) translate(0.3rem, -0.2rem);
}
.rb-camera {
  position: absolute;
  bottom: -0.4rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2.1rem;
  height: 1.5rem;
  background: #1c1f26;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.35);
}
.rb-camera-lens {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #6ec3ff, #16202b 70%);
  border: 2px solid #0d0f13;
}
.rb-camera-flashbulb {
  position: absolute;
  top: -0.35rem;
  left: 0.25rem;
  width: 0.5rem;
  height: 0.4rem;
  background: #e8e8e8;
  border-radius: 2px 2px 0 0;
}

.rb-ron-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px) scale(0.85);
  margin-bottom: 0.5rem;
  max-width: 11rem;
  min-width: 6rem;
  padding: 0.5rem 0.8rem;
  background: var(--rb-white);
  color: var(--rb-ink);
  border: 2px solid #16202b;
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s var(--rb-ease), transform 0.25s var(--rb-ease-bounce);
  z-index: 6;
  white-space: nowrap;
}
.rb-ron-bubble::after {
  content: "";
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 0.8rem;
  height: 0.8rem;
  background: var(--rb-white);
  border-right: 2px solid #16202b;
  border-bottom: 2px solid #16202b;
}
.rb-ron-bubble.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* =============================================================================
   Flash + polaroid payoff
   ============================================================================= */
.rb-flash {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.rb-flash.is-flashing { animation: rb-flash-pop 0.35s ease-out; }
@keyframes rb-flash-pop {
  0% { opacity: 0; }
  15% { opacity: 0.92; }
  100% { opacity: 0; }
}

.rb-polaroid {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 25;
  width: 13rem;
  padding: 0.7rem 0.7rem 1.2rem;
  background: var(--rb-white);
  border-radius: 6px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translate(-50%, -40%) rotate(-8deg) scale(0.6);
  pointer-events: none;
  transition: opacity 0.5s var(--rb-ease-bounce), transform 0.5s var(--rb-ease-bounce);
}
.rb-polaroid.is-visible {
  opacity: 1;
  transform: translate(-50%, -55%) rotate(-4deg) scale(1);
  pointer-events: auto;
}
.rb-polaroid.is-visible .rb-replay-btn { pointer-events: auto; }
.rb-polaroid-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 2px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--rb-sky-top), var(--rb-sky-bot));
  margin-top: 0.6rem;
}
.rb-polaroid-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rb-polaroid-caption {
  margin: 0.6rem 0 0;
  text-align: center;
  font-family: var(--rb-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: #3a3226;
}

/* =============================================================================
   Caption bar
   ============================================================================= */
.rb-caption {
  position: absolute;
  left: 50%;
  bottom: 3.2rem;
  transform: translateX(-50%) translateY(10px);
  z-index: 15;
  max-width: 28rem;
  width: 90%;
  text-align: center;
  padding: 0.75rem 1.2rem;
  background: var(--rb-panel);
  color: var(--rb-white);
  border-radius: 12px;
  font-family: var(--rb-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0;
  transition: opacity 0.4s var(--rb-ease), transform 0.4s var(--rb-ease-bounce);
}
.rb-caption.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =============================================================================
   End card
   ============================================================================= */
.rb-endcard {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(9, 14, 20, 0.88);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--rb-ease);
}
.rb-endcard.is-visible { opacity: 1; pointer-events: auto; }
.rb-endcard-text {
  max-width: 34rem;
  text-align: center;
  font-size: clamp(1.3rem, 4.4vw, 2rem);
  font-weight: 800;
  line-height: 1.4;
  color: var(--rb-white);
  margin: 0;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--rb-ease), transform 0.6s var(--rb-ease-bounce);
}
.rb-endcard-text.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Replay + toast ---------------------------------------------------- */
.rb-replay-btn {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 50;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: rgba(16, 24, 34, 0.55);
  color: var(--rb-white);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--rb-font);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(8px);
  transition: opacity 0.4s var(--rb-ease), background 0.2s var(--rb-ease), transform 0.2s var(--rb-ease);
}
.rb-replay-btn.is-visible { opacity: 1; pointer-events: auto; }
.rb-replay-btn:hover { background: rgba(16, 24, 34, 0.8); transform: translateY(-2px); }

.rb-toast {
  position: fixed;
  top: 1.4rem;
  left: 50%;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--rb-ink);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateX(-50%) translateY(-12px);
  pointer-events: none;
  transition: opacity 0.3s var(--rb-ease), transform 0.3s var(--rb-ease-bounce);
}
.rb-toast svg { flex: none; color: var(--rb-accent); }
.rb-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 30rem) {
  .rb-toast { font-size: 0.76rem; padding: 0.6rem 0.9rem; white-space: normal; max-width: 88vw; text-align: left; }
  .rb-caption { font-size: 0.78rem; padding: 0.65rem 0.9rem; bottom: 2.6rem; }
  .rb-polaroid { width: 10.5rem; }
  .rb-ron { width: 4.6rem; height: 6.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rb-intro-icon,
  .rb-sun,
  .rb-ron.is-walking .rb-ron-leg-l,
  .rb-ron.is-walking .rb-ron-leg-r,
  .rb-flash.is-flashing {
    animation: none !important;
  }
}

