:root {
  color-scheme: light;
  --berry: #68223d;
  --berry-soft: #a3466d;
  --pink: #ff8fb4;
  --pink-deep: #f55078;
  --blush: #ffd6e3;
  --cream: #fffaf5;
  --mint: #62d2bd;
  --mint-deep: #219f91;
  --yellow: #ffd451;
  --blue: #5dbfea;
  --green: #79c95b;
  --ink: #382a34;
  --shadow: 0 12px 28px rgba(104, 34, 61, .18);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #fff0f6;
  color: var(--ink);
  overscroll-behavior: none;
  touch-action: manipulation;
  user-select: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 4px solid rgba(33, 159, 145, .35);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.scene-sky {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(#aee7f4 0 56%, #dff4dc 56% 72%, #8bcf7a 72% 100%);
  z-index: -2;
}

.scene-sky::before {
  content: "";
  position: absolute;
  inset: 56% 0 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 88px, rgba(255,255,255,.34) 88px 94px),
    linear-gradient(180deg, #fff6d7 0 22%, #ffb4c9 22% 29%, #69c7ae 29% 100%);
  border-top: 8px solid rgba(104, 34, 61, .12);
}

.scene-sky::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7%;
  background: repeating-linear-gradient(90deg, #f7d86a 0 70px, #fff3b8 70px 140px);
  border-top: 7px solid #68223d;
  opacity: .95;
}

.cloud {
  position: absolute;
  width: 130px;
  height: 42px;
  border-radius: 50px;
  background: rgba(255,255,255,.86);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: inherit;
}

.cloud::before { width: 58px; height: 58px; left: 18px; }
.cloud::after { width: 76px; height: 76px; right: 12px; }
.cloud-a { left: 6%; top: 15%; transform: scale(.8); }
.cloud-b { right: 7%; top: 22%; transform: scale(.58); opacity: .8; }

.confetti {
  position: absolute;
  width: 13px;
  height: 31px;
  border-radius: 8px;
  background: var(--yellow);
  opacity: .7;
}

.confetti-a { left: 9%; top: 34%; transform: rotate(38deg); }
.confetti-b { right: 12%; top: 12%; background: var(--pink-deep); transform: rotate(-31deg); }
.confetti-c { right: 22%; top: 42%; background: var(--mint-deep); transform: rotate(22deg); }

.opening-gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 30px;
  background: rgba(255, 250, 245, .5);
  backdrop-filter: blur(9px);
  z-index: 20;
}

.opening-brand {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--berry);
}

.opening-brand img {
  width: 126px;
  height: 126px;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.opening-brand p,
.opening-brand h1 {
  margin: 0;
}

.opening-brand p {
  font-size: 28px;
  font-weight: 800;
}

.opening-brand h1 {
  margin-top: 3px;
  font-size: 48px;
  line-height: 1.05;
}

.open-business-button {
  min-width: 300px;
  height: 78px;
  border-radius: 8px;
  background: var(--berry);
  color: white;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 9px 0 #421528, 0 18px 28px rgba(104,34,61,.2);
}

.open-business-button:active {
  transform: translateY(6px);
  box-shadow: 0 3px 0 #421528;
}

.gate-status {
  min-height: 24px;
  margin: 0;
  color: var(--berry-soft);
  font-weight: 700;
}

.gate-status.error { color: #bd2949; }

.app-shell {
  height: min(100dvh, 100svh);
  min-height: 0;
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr);
  padding: max(10px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 5;
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px;
  background: transparent;
  color: var(--berry);
  text-align: left;
}

.brand-button img {
  width: 56px;
  height: 56px;
  border: 4px solid white;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(104,34,61,.15);
}

.brand-button span {
  display: grid;
}

.brand-button small {
  font-size: 14px;
  font-weight: 800;
}

.brand-button strong {
  font-size: 26px;
  line-height: 1.1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection-status {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 19px;
  background: rgba(255,255,255,.78);
  color: var(--berry);
  font-size: 13px;
  font-weight: 800;
}

.connection-status i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(121,201,91,.18);
}

.connection-status.offline i { background: #e04e5e; box-shadow: 0 0 0 4px rgba(224,78,94,.18); }

.round-tool {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 4px solid white;
  border-radius: 50%;
  background: var(--berry);
  color: white;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(104,34,61,.18);
}

.sound-button span { font-size: 22px; transform: translateY(-1px); }
.sound-button.muted { background: #82767d; }

.play-area {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 30vw, 380px);
  gap: clamp(12px, 2vw, 28px);
  align-items: stretch;
}

.machine-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: end center;
  position: relative;
}

.machine {
  position: relative;
  height: min(100%, 760px, calc(100svh - 100px));
  aspect-ratio: 840 / 940;
  max-width: 100%;
  transform-origin: 50% 82%;
}

.machine-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.hopper-balls {
  position: absolute;
  z-index: 3;
  left: 18.5%;
  top: 27%;
  width: 63%;
  height: 37%;
  overflow: hidden;
  border-radius: 20% 20% 15% 15%;
  pointer-events: none;
}

.hopper-balls i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: clamp(38px, 5.2vw, 62px);
  aspect-ratio: 1;
  border: 4px solid var(--berry);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 25%, rgba(255,255,255,.82) 0 9%, transparent 10%),
    linear-gradient(180deg, hsl(var(--h) 82% 67%) 0 48%, var(--yellow) 49% 57%, var(--cream) 58% 100%);
  box-shadow: inset 0 -5px 0 rgba(104,34,61,.1), 0 4px 5px rgba(104,34,61,.16);
  transform: rotate(var(--r));
}

.hopper-balls i:nth-child(1) { --x: 7%; --y: 65%; --h: 0deg; --r: -15deg; }
.hopper-balls i:nth-child(2) { --x: 19%; --y: 72%; --h: 55deg; --r: 12deg; }
.hopper-balls i:nth-child(3) { --x: 32%; --y: 60%; --h: 110deg; --r: -6deg; }
.hopper-balls i:nth-child(4) { --x: 46%; --y: 71%; --h: 165deg; --r: 18deg; }
.hopper-balls i:nth-child(5) { --x: 59%; --y: 58%; --h: 220deg; --r: -18deg; }
.hopper-balls i:nth-child(6) { --x: 72%; --y: 70%; --h: 280deg; --r: 9deg; }
.hopper-balls i:nth-child(7) { --x: 84%; --y: 60%; --h: 330deg; --r: -8deg; }
.hopper-balls i:nth-child(8) { --x: 24%; --y: 48%; --h: 300deg; --r: 5deg; }
.hopper-balls i:nth-child(9) { --x: 53%; --y: 45%; --h: 75deg; --r: -11deg; }
.hopper-balls i:nth-child(10) { --x: 75%; --y: 43%; --h: 190deg; --r: 15deg; }

.machine.shaking {
  animation: machine-shake 2.55s ease-in-out;
}

.machine.shaking .hopper-balls i {
  animation: ball-mix .56s ease-in-out infinite alternate;
  animation-delay: calc(var(--x) * -8ms);
}

.crank {
  position: absolute;
  z-index: 6;
  top: 49%;
  right: -5.5%;
  width: 130px;
  height: 170px;
  padding: 0;
  background: transparent;
  transform-origin: 64px 112px;
}

.crank:disabled {
  cursor: default;
  filter: grayscale(.5);
  opacity: .74;
}

.crank.ready {
  animation: ready-pulse 1.25s ease-in-out infinite;
}

.crank.turning {
  animation: crank-turn 2.2s cubic-bezier(.32,.04,.21,1) forwards;
}

.crank-knob {
  position: absolute;
  top: 0;
  left: 40px;
  width: 50px;
  height: 50px;
  border: 7px solid var(--berry);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: inset 0 7px 0 rgba(255,255,255,.48), 0 5px 0 rgba(104,34,61,.18);
}

.crank-arm {
  position: absolute;
  top: 41px;
  left: 57px;
  width: 17px;
  height: 76px;
  border: 5px solid var(--berry);
  border-radius: 9px;
  background: var(--yellow);
}

.crank-hub {
  position: absolute;
  top: 90px;
  left: 39px;
  width: 52px;
  height: 52px;
  border: 8px solid var(--berry);
  border-radius: 50%;
  background: var(--cream);
  box-shadow: inset 0 0 0 8px var(--pink-deep);
}

.drop-zone {
  position: absolute;
  z-index: 8;
  left: 23%;
  right: 23%;
  bottom: 1.5%;
  height: 26%;
  display: flex;
  flex-wrap: wrap-reverse;
  align-content: flex-start;
  align-items: end;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
}

.drop-item {
  width: clamp(54px, 6.1vw, 78px);
  min-width: 44px;
  display: grid;
  justify-items: center;
  position: relative;
  opacity: 0;
  transform: translateY(-220px) rotate(-26deg) scale(.8);
  animation: egg-drop .66s cubic-bezier(.2,.78,.29,1.18) forwards;
  animation-delay: var(--delay);
}

.drop-index-0 { --delay: 0ms; --hue: 19deg; }
.drop-index-1 { --delay: 210ms; --hue: 66deg; }
.drop-index-2 { --delay: 420ms; --hue: 113deg; }
.drop-index-3 { --delay: 630ms; --hue: 160deg; }
.drop-index-4 { --delay: 840ms; --hue: 207deg; }
.drop-index-5 { --delay: 1050ms; --hue: 254deg; }
.drop-index-6 { --delay: 1260ms; --hue: 301deg; }
.drop-index-7 { --delay: 1470ms; --hue: 348deg; }
.drop-index-8 { --delay: 1680ms; --hue: 75deg; }
.drop-index-9 { --delay: 1890ms; --hue: 122deg; }
.drop-index-10 { --delay: 2100ms; --hue: 169deg; }
.drop-index-11 { --delay: 2310ms; --hue: 216deg; }
.drop-tier-5 { --tier-filter: saturate(1.05); }
.drop-tier-10 { --tier-filter: saturate(1.16); }

.drop-zone.dense .drop-item { width: clamp(40px, 4.7vw, 58px); }

.drop-item img {
  width: 100%;
  aspect-ratio: 1;
  filter: hue-rotate(var(--hue)) var(--tier-filter, saturate(1));
}

.drop-label {
  width: max-content;
  max-width: 132px;
  min-width: 76px;
  margin-top: -8px;
  padding: 4px 7px;
  border: 3px solid var(--berry);
  border-radius: 6px;
  background: white;
  color: var(--berry);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
  opacity: 0;
  transform: translateY(5px);
  animation: label-in .28s ease-out forwards;
  animation-delay: calc(var(--delay) + 520ms);
}

.control-zone {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 20px;
  padding: clamp(22px, 3vh, 34px);
  border: 8px solid var(--berry);
  border-radius: 8px;
  background: rgba(255,250,245,.93);
  box-shadow: var(--shadow);
  position: relative;
}

.control-zone::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 3px dashed rgba(104,34,61,.2);
  pointer-events: none;
}

.selected-display {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: var(--berry);
  position: relative;
}

.selected-display span { font-size: 15px; font-weight: 800; }
.selected-display strong { min-height: 57px; font-size: 45px; line-height: 1.1; }

.tier-buttons {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 9px;
  position: relative;
}

.tier-button {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 6px solid var(--berry);
  border-radius: 8px;
  color: var(--berry);
  box-shadow: 0 7px 0 var(--berry);
  transition: transform .16s ease, filter .16s ease;
}

.tier-button strong { font-size: 52px; line-height: 1; }
.tier-button span { font-size: 18px; font-weight: 900; }
.tier-10 { gap: 0; }
.tier-10 strong { font-size: 46px; }
.tier-3 { background: #9ddd74; }
.tier-5 { background: #72c9eb; }
.tier-10 { background: #ffd35a; }

.tier-button:active,
.tier-button.selected {
  transform: translateY(6px);
  box-shadow: 0 1px 0 var(--berry);
}

.tier-button.selected { filter: saturate(1.18) brightness(1.04); }
.tier-button:disabled { filter: grayscale(.7); opacity: .6; cursor: default; }

.rabbit-cheer {
  align-self: end;
  display: grid;
  justify-items: center;
  gap: 8px;
  position: relative;
}

.rabbit-cheer img {
  width: min(150px, 70%);
  border-radius: 28px;
  transform: rotate(-3deg);
  box-shadow: 0 8px 16px rgba(104,34,61,.16);
}

.rabbit-cheer span {
  padding: 7px 13px;
  border-radius: 6px;
  background: var(--blush);
  color: var(--berry);
  font-weight: 900;
}

.app-shell.idle .rabbit-cheer img {
  animation: mascot-idle 2.8s ease-in-out infinite;
}

.result-backdrop {
  position: fixed;
  z-index: 14;
  inset: 0;
  background: rgba(56, 22, 40, .42);
  backdrop-filter: blur(4px);
}

.result-panel {
  position: fixed;
  z-index: 15;
  top: 50%;
  left: 50%;
  width: min(470px, calc(100vw - 40px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  gap: 14px;
  padding: 24px;
  border: 7px solid var(--berry);
  border-radius: 8px;
  background: rgba(255,250,245,.97);
  box-shadow: 0 18px 48px rgba(67,21,40,.3);
  transform: translate(-50%, -50%);
  animation: result-pop .4s cubic-bezier(.2,.78,.29,1.12);
}

.result-title { display: grid; justify-items: center; gap: 5px; color: var(--berry); text-align: center; }
.result-title span { width: fit-content; padding: 4px 8px; border-radius: 5px; background: var(--yellow); font-size: 13px; font-weight: 900; }
.result-title strong { font-size: 25px; }

.result-summary {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.result-chip {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 4px solid var(--berry);
  border-radius: 6px;
  background: white;
  color: var(--berry);
  font-size: 20px;
  font-weight: 900;
  justify-content: center;
}

.result-chip b { color: var(--pink-deep); }

.result-actions { display: flex; justify-content: center; gap: 10px; }
.result-actions .primary-action,
.result-actions .secondary-action {
  width: auto;
  min-width: 96px;
  height: 42px;
  padding: 0 15px;
  font-size: 15px;
}
.primary-action,
.secondary-action,
.danger-action {
  min-width: 112px;
  height: 54px;
  padding: 0 20px;
  border-radius: 7px;
  font-size: 18px;
  font-weight: 900;
}

.primary-action { background: var(--berry); color: white; box-shadow: 0 5px 0 #3f1326; }
.secondary-action { background: #efe7eb; color: var(--berry); border: 3px solid var(--berry); }
.danger-action { background: #d94158; color: white; }
.wide-action { width: 100%; }

.sheet-dialog {
  width: min(620px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 7px solid var(--berry);
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(55,18,34,.42);
}

.sheet-dialog::backdrop {
  background: rgba(77,25,48,.56);
  backdrop-filter: blur(6px);
}

.sheet-dialog > form,
.sheet-dialog > section {
  position: relative;
  padding: 30px;
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #efe5e9;
  color: var(--berry);
  font-size: 30px;
  line-height: 1;
}

.pin-dialog { width: min(440px, calc(100vw - 40px)); }
.pin-dialog form { display: grid; justify-items: center; gap: 18px; }
.pin-dialog img { width: 92px; border-radius: 22px; }
.pin-dialog h2 { margin: 0; color: var(--berry); }

.pin-fields {
  width: 100%;
  height: 68px;
  position: relative;
}

.pin-fields input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  opacity: .02;
}

.pin-fields > div {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.pin-fields i {
  display: grid;
  place-items: center;
  border: 4px solid #d5bdc7;
  border-radius: 8px;
  background: white;
}

.pin-fields i.filled::after {
  content: "";
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--berry);
}

.form-error { min-height: 20px; margin: -6px 0 0; color: #c2354f; font-weight: 800; }

.prize-dialog { width: min(850px, calc(100vw - 50px)); }
.prize-dialog section { max-height: calc(100dvh - 54px); overflow: auto; }
.prize-dialog header span { color: var(--pink-deep); font-size: 12px; font-weight: 900; }
.prize-dialog h2 { margin: 2px 0 20px; color: var(--berry); font-size: 32px; }

.prize-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.prize-group h3 {
  margin: 0 0 10px;
  padding-bottom: 7px;
  border-bottom: 4px solid var(--mint);
  color: var(--berry);
  font-size: 18px;
}

.prize-group ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  list-style: none;
}

.prize-group li {
  padding: 8px 10px;
  border-radius: 5px;
  background: #f6eaf0;
  color: var(--berry);
  font-size: 14px;
  font-weight: 800;
}

.odds-strip {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.odds-strip span {
  flex: 1;
  padding: 13px;
  border: 3px solid var(--berry);
  border-radius: 6px;
  background: var(--yellow);
  text-align: center;
  color: var(--berry);
  font-weight: 900;
}

.odds-strip b { font-size: 24px; }

.cancel-dialog { width: min(500px, calc(100vw - 40px)); }
.cancel-dialog h2 { margin: 0 0 22px; color: var(--berry); }
.reason-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.reason-options input { position: absolute; opacity: 0; }
.reason-options span { height: 54px; display: grid; place-items: center; border: 3px solid #d9c3cc; border-radius: 7px; background: white; color: var(--berry); font-weight: 800; }
.reason-options input:checked + span { border-color: var(--berry); background: var(--blush); }

.choose-three-dialog { width: min(760px, calc(100vw - 40px)); }
.choose-three-dialog form { display: grid; gap: 18px; }
.choose-three-dialog header { display: flex; align-items: end; gap: 12px; padding-right: 42px; }
.choose-three-dialog header span { position: absolute; top: 15px; left: 30px; color: var(--pink-deep); font-size: 11px; font-weight: 900; }
.choose-three-dialog h2 { flex: 1; margin: 6px 0 0; color: var(--berry); }
.choose-three-dialog header b { color: var(--mint-deep); }
.choose-three-grid {
  max-height: min(380px, 48dvh);
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.choose-product {
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px;
  border: 3px solid #d9c3cc;
  border-radius: 7px;
  background: white;
  color: var(--berry);
}
.choose-product strong { font-size: 15px; }
.choose-product small { color: #7d6872; }
.choose-product.selected { border-color: var(--berry); background: var(--blush); box-shadow: inset 0 0 0 2px white; }
.choose-three-dialog .primary-action:disabled { opacity: .45; box-shadow: none; cursor: default; }

.rotate-guard {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--cream);
  color: var(--berry);
}

.rotate-guard img { width: 150px; border-radius: 32px; }
.rotate-guard strong { font-size: 30px; }

.celebrating::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  background-image:
    radial-gradient(circle, #ffd451 0 5px, transparent 6px),
    radial-gradient(circle, #f55078 0 4px, transparent 5px),
    radial-gradient(circle, #62d2bd 0 5px, transparent 6px),
    radial-gradient(circle, #5dbfea 0 4px, transparent 5px);
  background-size: 110px 140px, 130px 100px, 160px 120px, 90px 150px;
  animation: confetti-fall 2s linear forwards;
}

@keyframes machine-shake {
  0%,100% { transform: rotate(0); }
  12% { transform: rotate(-2.4deg) translateX(-4px); }
  24% { transform: rotate(2.5deg) translateX(5px); }
  38% { transform: rotate(-1.8deg) translateX(-3px); }
  52% { transform: rotate(1.7deg) translateX(3px); }
  70% { transform: rotate(-.9deg); }
}

@keyframes ball-mix {
  from { translate: -8px -18px; rotate: -18deg; }
  to { translate: 10px 16px; rotate: 20deg; }
}

@keyframes ready-pulse {
  0%,100% { scale: 1; filter: drop-shadow(0 0 0 rgba(255,212,81,0)); }
  50% { scale: 1.05; filter: drop-shadow(0 0 12px rgba(255,212,81,.95)); }
}

@keyframes crank-turn {
  0% { transform: rotate(0); }
  65% { transform: rotate(370deg); }
  100% { transform: rotate(360deg); }
}

@keyframes egg-drop {
  0% { opacity: 0; transform: translateY(-220px) rotate(-26deg) scale(.8); }
  64% { opacity: 1; transform: translateY(8px) rotate(19deg) scale(1); }
  82% { transform: translateY(-12px) rotate(-9deg); }
  100% { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes label-in {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes mascot-idle {
  0%,100% { transform: rotate(-3deg) translateY(0); }
  48% { transform: rotate(2deg) translateY(-7px); }
}

@keyframes result-pop {
  from { opacity: 0; transform: translate(-50%, -45%) scale(.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes confetti-fall {
  from { opacity: 0; background-position: 0 -150px, 20px -100px, 40px -180px, 60px -80px; }
  12% { opacity: 1; }
  to { opacity: 0; background-position: 20px 100vh, -20px 90vh, 70px 110vh, 0 95vh; }
}

@media (max-width: 980px) and (orientation: landscape) {
  .app-shell { grid-template-rows: 64px minmax(0,1fr); padding: 8px 12px 10px; }
  .brand-button img { width: 48px; height: 48px; }
  .brand-button strong { font-size: 21px; }
  .play-area { grid-template-columns: minmax(0, 1fr) 250px; gap: 10px; }
  .control-zone { padding: 18px; gap: 12px; }
  .tier-button { min-height: 64px; border-width: 5px; }
  .tier-button strong { font-size: 42px; }
  .tier-10 strong { font-size: 37px; }
  .drop-label { max-width: 105px; font-size: 12px; }
  .rabbit-cheer img { width: 110px; }
  .choose-three-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-height: 620px) and (orientation: landscape) {
  .app-shell { grid-template-rows: 52px minmax(0, 1fr); padding: 4px 8px 6px; }
  .brand-button { gap: 7px; padding: 2px; }
  .brand-button img { width: 40px; height: 40px; border-width: 3px; border-radius: 12px; }
  .brand-button small { font-size: 11px; }
  .brand-button strong { font-size: 17px; }
  .top-actions { gap: 6px; }
  .connection-status { height: 30px; padding: 0 9px; font-size: 11px; }
  .round-tool { width: 36px; height: 36px; border-width: 3px; font-size: 14px; }
  .sound-button span { font-size: 18px; }
  .play-area { grid-template-columns: minmax(0, 1fr) minmax(190px, 29vw); gap: 8px; }
  .control-zone { padding: 10px 12px; gap: 8px; border-width: 6px; }
  .control-zone::before { inset: 6px; border-width: 2px; }
  .selected-display strong { min-height: 38px; font-size: 30px; }
  .selected-display span { font-size: 12px; }
  .tier-buttons { gap: 6px; }
  .tier-button { min-height: 50px; border-width: 4px; box-shadow: 0 4px 0 var(--berry); }
  .tier-button strong { font-size: 31px; }
  .tier-10 strong { font-size: 28px; }
  .tier-button span { font-size: 14px; }
  .rabbit-cheer { gap: 4px; }
  .rabbit-cheer img { width: 70px; border-radius: 18px; }
  .rabbit-cheer span { padding: 4px 8px; font-size: 11px; }
  .crank { scale: .76; transform-origin: 64px 112px; }
  .machine { height: min(100%, calc(100svh - 70px)); }
  .drop-label { min-width: 54px; max-width: 82px; margin-top: -5px; padding: 2px 4px; border-width: 2px; font-size: 10px; }
  .result-panel { width: min(380px, calc(100vw - 28px)); max-height: calc(100dvh - 20px); gap: 9px; padding: 14px; border-width: 5px; }
  .result-title strong { font-size: 21px; }
  .result-chip { min-height: 40px; padding: 6px 8px; border-width: 2px; font-size: 15px; }
  .result-actions { gap: 8px; }
  .result-actions .primary-action,
  .result-actions .secondary-action { min-width: 78px; height: 36px; padding: 0 11px; font-size: 13px; }
  .primary-action, .secondary-action, .danger-action { height: 42px; min-width: 0; font-size: 15px; }
}

@media (orientation: portrait) {
  .rotate-guard { display: grid !important; }
  .opening-gate,
  .app-shell { visibility: hidden; }
}

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