:root {
  --ink: #151515;
  --paper: #fffefa;
  --red: #e51d2a;
  --orange: #f58218;
  --green: #149447;
  --silver: #e7eaeb;
}

* { box-sizing: border-box; }

html,
body {
  min-width: 300px;
  margin: 0;
  background: transparent;
}

button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.game {
  position: relative;
  overflow: hidden;
  width: min(100%, 620px);
  min-height: 500px;
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  border: 2px solid #e5e5e2;
  border-radius: 15px;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 40%, #fff 0 38%, #f8f8f4 76%, #ecece8 100%);
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.05);
  font-family: "Trebuchet MS", "Avenir Next", sans-serif;
  user-select: none;
  isolation: isolate;
}

.game::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.14;
  background-image: repeating-linear-gradient(0deg, transparent 0 4px, rgba(0, 0, 0, 0.045) 5px);
}

.hud {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 10.5%;
  padding: 0 4%;
  border-bottom: 2px solid var(--ink);
  background: rgba(255, 254, 250, 0.95);
  z-index: 10;
}

.hud-side span {
  display: block;
  color: #75716b;
  font-size: clamp(0.5rem, 1.7vw, 0.66rem);
  font-weight: 900;
  letter-spacing: 0.15em;
}

.hud-side strong {
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  letter-spacing: 0.05em;
}

.status-pill {
  min-width: 122px;
  padding: 7px 13px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: white;
  text-align: center;
  background: var(--ink);
  font-size: clamp(0.55rem, 1.8vw, 0.72rem);
  font-weight: 900;
  letter-spacing: 0.1em;
}

.reset-button {
  justify-self: end;
  min-height: 32px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: white;
  font-size: clamp(0.55rem, 1.8vw, 0.7rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.stage {
  position: absolute;
  inset: 10.5% 0 0;
  overflow: hidden;
  touch-action: manipulation;
}

.targets {
  position: absolute;
  top: 5%;
  left: 4.5%;
  display: flex;
  gap: clamp(4px, 1vw, 7px);
  z-index: 5;
}

.target-can {
  position: relative;
  display: grid;
  width: clamp(30px, 8vw, 47px);
  height: clamp(54px, 14vw, 80px);
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 7px 7px 9px 9px;
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.18);
}

.target-can::before,
.target-can::after {
  position: absolute;
  right: 3px;
  left: 3px;
  height: 3px;
  border-radius: 50%;
  content: "";
  background: #ddd;
}

.target-can::before { top: 2px; }
.target-can::after { bottom: 2px; }

.target-can span {
  color: white;
  font-family: Georgia, serif;
  font-size: clamp(0.38rem, 1.4vw, 0.58rem);
  font-style: italic;
  font-weight: 900;
  transform: rotate(-7deg);
}

.target-cola { background: var(--red); }
.target-fanta { background: var(--orange); }
.target-sprite { background: var(--green); }

.can-row {
  position: absolute;
  top: 30%;
  left: 50%;
  display: flex;
  gap: clamp(9px, 3vw, 20px);
  align-items: flex-end;
  transform: translateX(-50%);
  z-index: 3;
}

.can {
  position: relative;
  width: clamp(85px, 22vw, 132px);
  height: clamp(155px, 40vw, 238px);
  filter: drop-shadow(5px 8px 2px rgba(0, 0, 0, 0.18));
}

.can-body {
  position: absolute;
  inset: 8% 2% 5%;
  overflow: hidden;
  border: 3px solid #596168;
  border-radius: 11% 11% 16% 16% / 5% 5% 7% 7%;
  background: linear-gradient(90deg, #c8cdcf 0%, #f9fbfb 16%, #d5dadd 45%, #fff 72%, #bfc5c7 100%);
}

.paint-stack {
  position: absolute;
  inset: 0;
}

.paint-layer {
  position: absolute;
  inset: 0;
  animation: paint-swipe 330ms cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

.paint-red { background: linear-gradient(100deg, #b70717, var(--red) 42%, #f0444d 70%, #a90612); }
.paint-orange { background: linear-gradient(100deg, #c85505, var(--orange) 42%, #ffb02c 70%, #b34700); }
.paint-green { background: linear-gradient(100deg, #087934, var(--green) 42%, #2ec566 70%, #076c2d); }

.can-label {
  position: absolute;
  top: 35%;
  right: -5%;
  left: -5%;
  display: grid;
  height: 32%;
  place-items: center;
  border-top: 3px solid rgba(255, 255, 255, 0.85);
  border-bottom: 3px solid rgba(255, 255, 255, 0.85);
  color: #5e6466;
  background: rgba(255, 255, 255, 0.38);
  transform: rotate(-6deg);
}

.can-label span {
  font-family: Georgia, serif;
  font-size: clamp(1rem, 4.3vw, 1.75rem);
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.can.has-paint .can-label { color: white; }
.can.has-paint .can-label { background: rgba(255, 255, 255, 0.08); }

.can-shine {
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 15%;
  width: 9%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.can-top {
  position: absolute;
  top: 0;
  left: 5%;
  width: 90%;
  height: 14%;
  border: 3px solid #596168;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, #c9cdce 0 50%, #f9fbfb 51% 68%, #8c9497 69% 100%);
  z-index: 4;
}

.can-top i {
  position: absolute;
  top: 23%;
  left: 42%;
  width: 29%;
  height: 36%;
  border: 2px solid #687073;
  border-radius: 50% 45% 50% 45%;
  transform: rotate(-12deg);
}

.can-bottom {
  position: absolute;
  bottom: 0;
  left: 6%;
  width: 88%;
  height: 10%;
  border: 3px solid #596168;
  border-radius: 50%;
  background: linear-gradient(#e9edee, #aeb5b7);
  z-index: 4;
}

.roller {
  position: absolute;
  display: block;
  padding: 0;
  border: 0;
  color: var(--roller-color);
  background: transparent;
  cursor: pointer;
  z-index: 7;
  transition: transform 110ms ease, opacity 160ms ease;
}

.roller:hover,
.roller:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--roller-color) 55%, transparent));
}

.roller:active { transform: scale(0.92); }
.roller:disabled { opacity: 0.24; pointer-events: none; filter: grayscale(0.7); }

.roller-red {
  --roller-color: var(--red);
  bottom: 4%;
  left: 15%;
  width: clamp(196px, 46vw, 285px);
  height: clamp(66px, 16vw, 96px);
}

.roller-orange {
  --roller-color: var(--orange);
  top: 8%;
  left: 50%;
  width: clamp(92px, 23vw, 140px);
  height: clamp(72px, 18vw, 108px);
  transform: translateX(-50%);
}

.roller-green {
  --roller-color: var(--green);
  top: 31%;
  right: 1.8%;
  width: clamp(70px, 18vw, 108px);
  height: clamp(194px, 50vw, 302px);
}

.roller-orange:active { transform: translateX(-50%) scale(0.92); }

.roller-head {
  position: absolute;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--roller-color);
  box-shadow: inset 5px 0 rgba(255,255,255,.25), 3px 4px rgba(0,0,0,.14);
}

.roller-arm {
  position: absolute;
  border-color: #4c555b;
  border-style: solid;
}

.roller-grip {
  position: absolute;
  border: 3px solid var(--ink);
  border-radius: 5px;
  background: var(--roller-color);
}

.roller-red .roller-head {
  top: 0;
  left: 0;
  width: 100%;
  height: 30%;
}

.roller-red .roller-arm {
  top: 26%;
  left: 39%;
  width: 31%;
  height: 42%;
  border-width: 0 4px 4px 0;
  border-radius: 0 0 7px 0;
}

.roller-red .roller-grip {
  right: 15%;
  bottom: 0;
  width: 24%;
  height: 35%;
}

.roller-orange .roller-head {
  top: 30%;
  left: 0;
  width: 70%;
  height: 27%;
}

.roller-orange .roller-arm {
  top: 0;
  left: 50%;
  width: 35%;
  height: 32%;
  border-width: 4px 4px 0 0;
  border-radius: 0 7px 0 0;
}

.roller-orange .roller-grip {
  top: 0;
  right: 5%;
  width: 27%;
  height: 30%;
}

.roller-green .roller-head {
  top: 0;
  left: 0;
  width: 33%;
  height: 72%;
}

.roller-green .roller-arm {
  top: 39%;
  left: 31%;
  width: 40%;
  height: 35%;
  border-width: 4px 4px 0 0;
  border-radius: 0 7px 0 0;
}

.roller-green .roller-grip {
  right: 0;
  bottom: 8%;
  width: 34%;
  height: 26%;
}

.roller b {
  position: absolute;
  right: 0;
  bottom: -1%;
  color: var(--ink);
  font-size: clamp(0.48rem, 1.5vw, 0.62rem);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.roller-red b {
  right: auto;
  bottom: -1%;
  left: 0;
}

.order-strip {
  position: absolute;
  bottom: 1.2%;
  left: 50%;
  max-width: 49%;
  min-width: 126px;
  padding: 8px 12px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: white;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--ink);
  font-size: clamp(0.52rem, 1.8vw, 0.7rem);
  font-weight: 900;
  letter-spacing: 0.07em;
  transform: translateX(-18%);
  z-index: 8;
}

.feedback {
  position: absolute;
  top: 24%;
  left: 50%;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(1.2rem, 5vw, 2rem);
  letter-spacing: 0.06em;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  z-index: 9;
}

.feedback.is-visible { animation: feedback-pop 780ms ease both; }

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 6%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 229, 70, .23) 0 24%, transparent 25%),
    rgba(10, 16, 25, .86);
  backdrop-filter: blur(7px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 210ms ease;
  z-index: 20;
}

.overlay.is-visible { opacity: 1; pointer-events: auto; }

.overlay::before,
.overlay::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 135%;
  aspect-ratio: 1;
  content: "";
  pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.08) 0deg 7deg, transparent 7deg 18deg);
  transform: translate(-50%, -50%);
  animation: result-rays 20s linear infinite;
}

.overlay::after {
  width: 78%;
  border: 3px dashed rgba(255,255,255,.2);
  border-radius: 50%;
  background: none;
  animation-direction: reverse;
  animation-duration: 13s;
}

.result-card {
  position: relative;
  width: min(100%, 430px);
  padding: clamp(54px, 11vw, 70px) clamp(20px, 5vw, 30px) clamp(21px, 5vw, 29px);
  border: 4px solid var(--ink);
  border-radius: 28px 16px 30px 18px;
  text-align: center;
  background:
    linear-gradient(165deg, rgba(255,255,255,.23), transparent 32%),
    #ffd92f;
  box-shadow: 10px 12px 0 var(--ink), 0 22px 70px rgba(0,0,0,.4);
  transform: rotate(-1deg) scale(.86);
  transition: background 180ms ease;
  z-index: 3;
}

.overlay.is-visible .result-card {
  animation: result-card-in 520ms cubic-bezier(.18,.9,.23,1.35) forwards;
}

.result-card.is-loss {
  color: white;
  background:
    linear-gradient(165deg, rgba(255,255,255,.14), transparent 32%),
    #e44135;
}

.result-card::before {
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(21,21,21,.27);
  border-radius: 20px 10px 22px 12px;
  content: "";
  pointer-events: none;
}

.result-card.is-loss::before {
  border-color: rgba(255,255,255,.38);
}

.result-ribbon {
  position: absolute;
  top: 13px;
  left: 50%;
  min-width: 154px;
  padding: 8px 18px;
  border: 3px solid var(--ink);
  color: white;
  background: var(--green);
  box-shadow: 3px 4px 0 var(--ink);
  font-size: clamp(.62rem, 2vw, .75rem);
  font-weight: 900;
  letter-spacing: .15em;
  transform: translateX(-50%) rotate(1.5deg);
  z-index: 3;
}

.is-loss .result-ribbon {
  color: var(--ink);
  background: white;
}

.result-icon {
  position: absolute;
  top: 58px;
  right: -23px;
  display: grid;
  width: clamp(58px, 14vw, 72px);
  height: clamp(58px, 14vw, 72px);
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50% 44% 51% 46%;
  color: var(--ink);
  background: white;
  box-shadow: 4px 5px 0 var(--ink);
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  font-weight: 900;
  transform: rotate(10deg);
  z-index: 4;
}

.result-kicker {
  margin: 0 0 7px;
  font-size: clamp(.62rem, 2vw, .76rem);
  font-weight: 900;
  letter-spacing: .18em;
}

.result-card h1 {
  margin: 0;
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(2.8rem, 12vw, 4.8rem);
  line-height: .83;
  letter-spacing: .015em;
  text-shadow: 3px 3px 0 rgba(255,255,255,.56);
  transform: skewY(-2deg);
}

.is-loss h1 {
  text-shadow: 3px 3px 0 rgba(21,21,21,.55);
}

.result-copy {
  margin: 12px auto 9px;
  font-size: clamp(.76rem, 2.4vw, .9rem);
  font-weight: 800;
}

.result-cans {
  display: flex;
  gap: clamp(8px, 2.4vw, 14px);
  align-items: flex-end;
  justify-content: center;
  min-height: 94px;
  margin: 9px 0 10px;
}

.result-can {
  position: relative;
  display: grid;
  width: clamp(45px, 12vw, 61px);
  height: clamp(75px, 20vw, 98px);
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 10px 10px 13px 13px;
  color: white;
  background: #bbb;
  box-shadow: inset 8px 0 rgba(0,0,0,.14), inset -7px 0 rgba(255,255,255,.18), 4px 5px 0 var(--ink);
  font-family: Georgia, serif;
  font-size: clamp(.48rem, 1.8vw, .67rem);
  font-style: normal;
  font-weight: 900;
  transition: background 160ms ease;
}

.result-can::before,
.result-can::after {
  position: absolute;
  right: 3px;
  left: 3px;
  height: 5px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  content: "";
  background: #d9dddd;
}

.result-can::before { top: -3px; }
.result-can::after { bottom: -3px; }

.result-can b {
  position: absolute;
  top: 34%;
  right: -2px;
  left: -2px;
  height: 31%;
  border-top: 2px solid white;
  border-bottom: 2px solid white;
  background: rgba(255,255,255,.09);
}

.result-can span {
  position: relative;
  padding: 2px;
  transform: rotate(-6deg);
  z-index: 2;
}

.result-can.red { background: var(--red); }
.result-can.orange { background: var(--orange); }
.result-can.green { background: var(--green); }

.result-order {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 31px;
  margin-bottom: 14px;
}

.order-chip {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: white;
  box-shadow: 2px 2px 0 var(--ink);
  font-size: .62rem;
  font-weight: 900;
}

.order-arrow {
  font-weight: 900;
}

.is-loss .order-arrow { color: white; }
.order-chip.red { background: var(--red); }
.order-chip.orange { background: var(--orange); }
.order-chip.green { background: var(--green); }

.play-again {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 54px;
  padding: 0 12px 0 21px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  color: white;
  background: var(--ink);
  box-shadow: 4px 5px 0 var(--ink);
  font-weight: 900;
  cursor: pointer;
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.play-again:active {
  transform: translate(3px, 4px);
  box-shadow: 1px 1px 0 var(--ink);
}

.play-again b {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: white;
}

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.overlay.is-loss .confetti {
  display: none;
}

.overlay.is-loss::before {
  background: repeating-conic-gradient(from 0deg, rgba(229,29,42,.17) 0deg 7deg, transparent 7deg 18deg);
}

.confetti i {
  position: absolute;
  top: -12%;
  left: calc(var(--x, 50) * 1%);
  width: 9px;
  height: 20px;
  border: 2px solid var(--ink);
  background: var(--confetti, #ffd92f);
  opacity: 0;
  transform: rotate(var(--r, 15deg));
}

.is-visible .confetti i { animation: confetti-fall 1.9s ease-out forwards; }
.confetti i:nth-child(1) { --x: 7; --r: 20deg; --confetti: #ed1c24; animation-delay: .05s; }
.confetti i:nth-child(2) { --x: 15; --r: -40deg; --confetti: #149447; animation-delay: .28s; }
.confetti i:nth-child(3) { --x: 24; --r: 70deg; --confetti: #f58218; animation-delay: .12s; }
.confetti i:nth-child(4) { --x: 34; --r: -15deg; --confetti: #fff; animation-delay: .4s; }
.confetti i:nth-child(5) { --x: 43; --r: 33deg; --confetti: #ed1c24; animation-delay: .2s; }
.confetti i:nth-child(6) { --x: 52; --r: -62deg; --confetti: #149447; animation-delay: .5s; }
.confetti i:nth-child(7) { --x: 61; --r: 10deg; --confetti: #f58218; animation-delay: .08s; }
.confetti i:nth-child(8) { --x: 69; --r: 48deg; --confetti: #fff; animation-delay: .35s; }
.confetti i:nth-child(9) { --x: 76; --r: -28deg; --confetti: #ed1c24; animation-delay: .18s; }
.confetti i:nth-child(10) { --x: 83; --r: 66deg; --confetti: #149447; animation-delay: .45s; }
.confetti i:nth-child(11) { --x: 90; --r: -12deg; --confetti: #f58218; animation-delay: .1s; }
.confetti i:nth-child(12) { --x: 96; --r: 37deg; --confetti: #fff; animation-delay: .31s; }

/* Compact casual-game result state */
.result-card {
  width: min(88%, 350px);
  padding: clamp(49px, 12vw, 64px) clamp(20px, 5vw, 27px) clamp(20px, 5vw, 26px);
  border-radius: 25px;
  background: linear-gradient(160deg, #fff173 0 18%, #ffd52d 19% 100%);
  box-shadow: 8px 10px 0 var(--ink), 0 20px 60px rgba(0,0,0,.42);
}

.result-card::before {
  inset: 9px;
  border-radius: 17px;
}

.result-card.is-loss {
  width: min(74%, 285px);
  padding: 44px 17px 18px;
  color: var(--ink);
  background: linear-gradient(#fff, #edf2f8);
  box-shadow: 7px 8px 0 var(--ink), 0 18px 55px rgba(0,0,0,.42);
}

.result-card.is-loss::before {
  border-color: rgba(21,21,21,.18);
  border-style: solid;
}

.result-icon {
  top: -35px;
  right: auto;
  left: 50%;
  width: clamp(64px, 17vw, 78px);
  height: clamp(64px, 17vw, 78px);
  color: white;
  background: var(--green);
  transform: translateX(-50%) rotate(7deg);
}

.is-loss .result-icon {
  top: -29px;
  width: 60px;
  height: 60px;
  color: white;
  background: var(--red);
  font-size: 2rem;
}

.result-card h1 {
  font-size: clamp(3.1rem, 13vw, 4.7rem);
  line-height: .88;
  text-shadow: 3px 3px 0 rgba(255,255,255,.68);
  transform: none;
}

.result-card.is-loss h1 {
  font-size: clamp(2.15rem, 9vw, 3rem);
  color: #34435d;
  text-shadow: none;
}

.result-cans {
  min-height: 89px;
  margin: 14px 0 18px;
}

.is-loss .result-cans {
  min-height: 65px;
  margin: 10px 0 13px;
}

.is-loss .result-can {
  width: clamp(35px, 9vw, 43px);
  height: clamp(58px, 15vw, 70px);
  border-width: 2px;
  border-radius: 7px 7px 9px 9px;
  box-shadow: inset 6px 0 rgba(0,0,0,.14), inset -5px 0 rgba(255,255,255,.18), 3px 3px 0 var(--ink);
  font-size: .48rem;
}

.play-again {
  min-height: 50px;
  padding-left: 22px;
  letter-spacing: .07em;
}

.is-win .play-again {
  background: var(--green);
}

.is-loss .play-again {
  min-height: 46px;
  padding-left: 18px;
  background: var(--red);
  box-shadow: 3px 4px 0 var(--ink);
  font-size: .78rem;
}

.is-loss .play-again b {
  width: 27px;
  height: 27px;
}

.overlay.is-loss {
  background: rgba(14, 20, 31, .75);
}

.sr-only {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

@keyframes paint-swipe {
  from { opacity: 0; transform: translateY(20%) scaleY(.8); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}

@keyframes feedback-pop {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); }
  24%, 70% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -12px) scale(1.06); }
}

@keyframes result-card-in {
  0% { opacity: 0; transform: translateY(35px) rotate(-4deg) scale(.72); }
  70% { opacity: 1; transform: translateY(-5px) rotate(1deg) scale(1.03); }
  100% { opacity: 1; transform: translateY(0) rotate(-1deg) scale(1); }
}

@keyframes result-rays {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes confetti-fall {
  0% { opacity: 0; transform: translateY(-10px) rotate(var(--r)); }
  12% { opacity: 1; }
  100% { opacity: .9; transform: translateY(700px) rotate(calc(var(--r) + 480deg)); }
}

@media (max-width: 420px) {
  .game { min-height: 460px; border-radius: 10px; }
  .status-pill { min-width: 98px; padding-inline: 8px; }
  .can-row { top: 32%; gap: 7px; }
  .roller-red { left: 10%; }
  .roller-green { right: 0; }

}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Iframe sizing: preserve the game ratio while respecting short and narrow frames. */
html,
body {
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  background: #f1f1ed;
}

.ambient-scene-copy {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  z-index: 0 !important;
  margin: 0 !important;
  border-color: transparent !important;
  box-shadow: none !important;
  filter: blur(12px) saturate(.9) brightness(.94);
  opacity: .38;
  pointer-events: none !important;
  transform-origin: center;
  user-select: none;
}

.ambient-scene-copy--left { left: 12% !important; transform: translate(-50%, -50%) scale(1.12) rotate(-3deg); }
.ambient-scene-copy--right { left: 88% !important; transform: translate(-50%, -50%) scale(1.12) rotate(3deg); }

.ambient-scene-copy *,
.ambient-scene-copy *::before,
.ambient-scene-copy *::after { animation-play-state: paused !important; }

@media (max-width: 700px) {
  .ambient-scene-copy--left { left: 50% !important; transform: translate(-50%, -50%) scale(1.9); }
  .ambient-scene-copy--right { display: none !important; }
}

.game {
  z-index: 1;
  width: min(100vw, 620px, 80vh);
  height: auto;
  min-height: 0;
  max-height: 100vh;
  margin: 0;
}

@supports (height: 100dvh) {
  .game {
    width: min(100vw, 620px, 80dvh);
    max-height: 100dvh;
  }
}
