:root {
  color-scheme: dark;
  font: 16px/1.5 system-ui, sans-serif;
  color: #fff7dd;
  background: #122e33;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid #ffe680; outline-offset: 4px; }
.bar, main { width: min(100% - 32px, 920px); margin-inline: auto; }
.bar { display: flex; justify-content: space-between; align-items: center; padding-block: 16px; }
.sound, #repeat { border: 1px solid #91b6b2; border-radius: 999px; background: #143b40; color: inherit; min-height: 48px; padding: 8px 12px; }
main { position: relative; padding-bottom: 32px; }
h1 { margin: 0 0 16px; max-width: 680px; color: #fff4d1; font-size: clamp(2.25rem, 8vw, 4.5rem); line-height: 1; letter-spacing: -.06em; text-wrap: balance; }
.eyebrow { margin: 0 0 8px; color: #c1e3cc; font-weight: 650; }
.scene {
  position: relative;
  min-height: clamp(340px, 53vw, 520px);
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #84afb0;
  border-radius: 24px;
  background: #397f78 url(scene.jpg) center / cover no-repeat;
}
.rain { position: absolute; inset: 0; pointer-events: none; }
.scene[data-stage="start"] .rain { border-bottom: 8px solid #a1e2d769; }
.controls { position: absolute; inset: auto 16px 16px; display: grid; justify-items: center; }
.primary, .choices button {
  background: #fff4ca; color: #162e2c; border: 2px solid #3c4929; border-radius: 16px;
  box-shadow: 0 5px 0 #1b3832; min-height: 64px; padding: 8px 16px; font-size: 1.125rem; font-weight: 750;
}
.primary span { margin-right: 4px; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: min(100%, 440px); }
.choices button { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 112px; padding-inline: 8px; }
.choices button span:last-child { font-size: 1rem; text-wrap: balance; }
.water-icon, .bin-icon { display: grid; align-content: center; justify-items: center; width: 52px; height: 48px; }
.water-icon i { width: 42px; height: 8px; border-bottom: 4px solid #215e91; border-radius: 50%; }
.bin-icon { width: 38px; height: 44px; border: 4px solid #234f38; background: #a4d784; border-radius: 5px 5px 11px 11px; }
.bin-icon i { width: 18px; height: 7px; background: #234f38; border-radius: 3px; align-self: start; margin-top: 6px; }
.bottle {
  position: absolute; top: 43%; left: 48%; width: 25px; height: 69px; border: 3px solid #285359;
  border-radius: 11px 11px 8px 8px; background: #b6f2de; box-shadow: 0 5px 0 #263f4373;
  transform: rotate(30deg); transition: transform 650ms cubic-bezier(.22,1,.36,1), opacity 400ms;
}
.bottle::before { content: ''; position: absolute; top: -9px; left: 4px; width: 11px; height: 8px; background: #feae54; border: 2px solid #365252; border-radius: 3px; }
.bottle i { position: absolute; inset: 24px 0 14px; background: #3a837b; }
.scene[data-story="can"] .bottle {
  width: 52px; height: 66px; background: #e7b35c; border-color: #514325; border-radius: 12px; transform: rotate(12deg);
}
.scene[data-story="can"] .bottle::before {
  top: -4px; left: 3px; width: 38px; height: 15px; border-radius: 50%; background: #e4e6d9;
}
.scene[data-story="can"] .bottle i { inset: 28px 0 10px; background: #f7dd9a; }
.scene[data-story="bag"] .bottle {
  width: 68px; height: 60px; background: #a4d784; border-color: #2e593f; border-radius: 5px 5px 12px 12px; transform: rotate(-10deg);
}
.scene[data-story="bag"] .bottle::before {
  top: -25px; left: 14px; width: 28px; height: 25px; border: 4px solid #2e593f; border-bottom: 0;
  border-radius: 14px 14px 0 0; background: transparent;
}
.scene[data-story="bag"] .bottle i { inset: 32px 5px 6px; background: #6ea96d; }
.scene[data-story="can"] .water-icon { width: 38px; height: 40px; background: #ffe3b2; border: 3px solid #5d4426; border-radius: 4px; }
.scene[data-story="can"] .water-icon i { width: 24px; height: 5px; border-color: #795b32; border-radius: 0; }
.scene[data-story="can"] .bin-icon { border-radius: 10px; border-color: #514325; background: #e7b35c; }
.scene[data-story="can"] .bin-icon i { margin-top: 16px; background: #f7dd9a; }
.scene[data-story="bag"] .water-icon { width: 36px; height: 40px; border: 4px solid #344d4a; border-radius: 4px 4px 8px 8px; background: #bed7cd; }
.scene[data-story="bag"] .water-icon i { width: 20px; height: 5px; border-color: #344d4a; border-radius: 0; }
.scene[data-story="bag"] .bin-icon { position: relative; width: 42px; height: 32px; margin-top: 16px; border-radius: 4px 4px 9px 9px; }
.scene[data-story="bag"] .bin-icon i { position: absolute; top: -20px; left: 7px; width: 20px; height: 16px; background: none; border: 3px solid #234f38; border-radius: 8px 8px 0 0; border-bottom: 0; margin: 0; }
.scene[data-stage="retry"] .bottle { transform: translate(-45px, 14px) rotate(60deg); }
.scene[data-stage="success"] .bottle, .scene[data-stage="bonus"] .bottle { transform: translate(60px,-30px) scale(.5); opacity: 0; }
.reward-art {
  position: absolute; inset: 26% 0 auto; text-align: center; font-size: clamp(64px, 18vw, 144px);
  opacity: 0; transform: scale(.65); transition: opacity 400ms, transform 500ms cubic-bezier(.22,1,.36,1); pointer-events: none;
}
.scene[data-stage="success"] .reward-art, .scene[data-stage="bonus"] .reward-art { opacity: 1; transform: scale(1); }
.caption { display: flex; align-items: center; gap: 12px; justify-content: space-between; min-height: 64px; }
.caption p { text-wrap: pretty; }
#repeat { flex: 0 0 auto; }
.collection { display: inline-flex; gap: 8px; border-radius: 999px; color: #122e33; background: #b5e7d0; padding: 4px 12px; margin: 0; font-weight: 750; }
.adult { display: inline-block; margin-left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 540px) { #repeat span { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before { transition: none !important; } }
