:root {
  color-scheme: light;
  --orange: #f47b20;
  --orange-dark: #d85e0a;
  --ink: #171717;
  --muted: #77736f;
  --paper: #f5f4f2;
  --line: #e1ddd8;
  --blue: #063b70;
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: #dedbd7; }
body { margin: 0; color: var(--ink); background: #dedbd7; }
button { font: inherit; touch-action: manipulation; }
button:focus-visible { outline: 3px solid #0b74c9; outline-offset: 3px; }
[hidden] { display: none !important; }
.modal-open { overflow: hidden; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.landing-active { min-height: 100vh; min-height: 100dvh; background: #dcdcdc; }
body.landing-active .game-shell { display: none; }
.landing-page {
  position: relative;
  width: min(100%, 520px);
  margin: 0 auto;
  overflow: hidden;
  background: #dcdcdc;
  box-shadow: 0 0 40px rgba(38, 32, 27, .13);
}
.landing-artwork { display: block; width: 100%; height: auto; }
/* Correct the embedded badge without changing the client's 2160 x 3840 artwork.
   The foreground slice preserves the quality badge overlapping its right edge. */
.landing-speed-badge {
  position: absolute;
  left: 23.15%;
  top: 53.72%;
  width: 8.1%;
  height: 4.51%;
  border-radius: 50%;
  transform: rotate(-18deg);
  pointer-events: none;
}
.landing-badge-foreground {
  position: absolute;
  inset: 0;
  width: 100%;
  height: auto;
  clip-path: ellipse(4.12% 2.32% at 33.05% 55.94%);
  pointer-events: none;
}
.landing-hotspot {
  position: absolute;
  z-index: 3;
  border: 0;
  padding: 0;
  color: transparent;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.landing-hotspot:focus-visible { outline: 4px solid #0b74c9; outline-offset: 2px; border-radius: 999px; }
.landing-sound-hotspot { top: 3%; left: 75.4%; width: 8%; height: 4.5%; border-radius: 50%; }
.landing-guide-hotspot { top: 3%; left: 85.8%; width: 8%; height: 4.5%; border-radius: 50%; }
.landing-start-hotspot { top: 87.8%; left: 21.5%; width: 57.5%; height: 9%; border-radius: 999px; }

.game-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 40px rgba(38, 32, 27, .16);
}

.topbar {
  min-height: 74px;
  padding: max(18px, env(safe-area-inset-top)) 22px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  border: 0;
  padding: 0;
  color: #ed7100;
  background: transparent;
  font: italic 900 clamp(25px, 7vw, 38px)/1 Arial, sans-serif;
  letter-spacing: -1.5px;
  cursor: pointer;
}
.brand:focus-visible { outline: 2px solid rgba(244, 123, 32, .42); outline-offset: 5px; border-radius: 4px; }
.top-actions { display: flex; gap: 10px; }
.records-action {
  min-width: 84px;
  height: 48px;
  border: 0;
  padding: 0 12px;
  border-radius: 99px;
  color: #fff;
  background: var(--orange);
  font-size: 11px;
  font-weight: 900;
}
.round-action {
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--orange);
  border-radius: 50%;
  color: var(--orange-dark);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.task-copy {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 14px;
  padding: 18px 22px 10px;
}
.eyebrow { margin: 0 0 7px; color: var(--orange-dark); font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.task-copy h1 { margin: 0; max-width: 350px; font-size: clamp(24px, 6.7vw, 34px); line-height: 1.28; letter-spacing: -.04em; }
.task-copy .drag-tip { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.task-copy .series-tip { margin: 4px 0 0; color: var(--orange-dark); font-size: 12px; font-weight: 800; line-height: 1.35; }
.timer {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border-radius: 22px 0 0 22px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-top: 15px;
  color: #fff;
  background: var(--orange);
  box-shadow: 0 9px 22px rgba(244, 123, 32, .26);
}
.timer strong { font: 900 35px/1 Arial, sans-serif; }
.timer span { margin-left: 2px; font-size: 11px; font-weight: 700; }
.timer.is-urgent { background: #d83127; animation: urgentPulse .8s ease-in-out infinite alternate; }

.progress-panel { padding: 10px 22px 2px; }
.progress-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 700; }
.progress-copy strong { color: var(--ink); }
.progress-copy b { color: var(--orange-dark); font-size: 17px; }
.progress-track { height: 5px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: #dedbd7; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--orange); transition: width .35s ease; }

.cabinet-board { position: relative; width: 100%; aspect-ratio: 943 / 1677; margin-top: 2px; }
.cabinet-background { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cabinet-slots { position: absolute; inset: 0; }
.cabinet-slot {
  position: absolute;
  width: 18.7%;
  height: 8.25%;
  overflow: hidden;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.cabinet-slot.is-active { border-color: var(--orange); box-shadow: 0 0 0 5px rgba(244, 123, 32, .17); animation: slotPulse 1s ease-in-out infinite alternate; }
.cabinet-slot.is-drop-hover { border-color: #28a465; background: rgba(255, 255, 255, .92); box-shadow: 0 0 0 7px rgba(40, 164, 101, .24); transform: scale(1.08); animation: none; }
.cabinet-slot.is-complete { border-color: #28a465; background: rgba(255, 255, 255, .93); }
.cabinet-slot img { width: 100%; height: 100%; display: block; object-fit: contain; border-radius: 8px; background: #fff; }
.slot-1 { left: 26.8%; top: 22.1%; }
.slot-2 { left: 57.3%; top: 29.1%; }
.slot-3 { left: 26.8%; top: 36.3%; }
.slot-4 { left: 57.3%; top: 43.4%; }
.slot-5 { left: 26.8%; top: 50.2%; }
.slot-6 { left: 57.3%; top: 57.4%; }
.slot-7 { left: 26.8%; top: 64.3%; }

.product-dock {
  position: relative;
  z-index: 2;
  margin-top: -66px;
  padding: 22px 0 calc(26px + env(safe-area-inset-bottom));
  border: 1.5px solid var(--orange);
  border-width: 1.5px 0 0;
  border-radius: 28px 28px 0 0;
  background: #fff;
  box-shadow: 0 -16px 34px rgba(77, 54, 35, .12);
}
.dock-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 0 22px 14px; }
.dock-heading h2 { margin: 0; font-size: 23px; }
.dock-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.dock-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.hint-button, .shuffle-button { min-height: 44px; border: 0; padding: 8px 10px; border-radius: 10px; font-size: 11px; font-weight: 800; }
.hint-button { color: #fff; background: var(--orange); box-shadow: 0 5px 12px rgba(244, 123, 32, .22); }
.hint-button:disabled { color: #aaa39c; background: #ece9e5; box-shadow: none; }
.shuffle-button { border: 0; padding: 8px 10px; color: var(--orange-dark); background: #fff0e5; border-radius: 10px; font-size: 11px; font-weight: 800; }
.product-tray { display: flex; gap: 12px; overflow-x: auto; padding: 0 22px 12px; scrollbar-width: none; }
.product-tray::-webkit-scrollbar { display: none; }
.product-card {
  width: 148px;
  min-width: 148px;
  min-height: 166px;
  padding: 8px 8px 11px;
  overflow: hidden;
  border: 2px solid var(--orange);
  border-radius: 20px;
  color: #fff;
  background: var(--orange);
  box-shadow: 0 10px 20px rgba(221, 96, 14, .2);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-drag: none;
}
.product-card:active { cursor: grabbing; }
.product-card.is-dragging { opacity: .45; }
.product-card img { pointer-events: none; -webkit-user-drag: none; }
.product-drag-ghost {
  position: fixed;
  z-index: 80;
  margin: 0;
  pointer-events: none;
  opacity: .94;
  transform: scale(.88) rotate(-2deg);
  transform-origin: center;
  box-shadow: 0 16px 30px rgba(108, 52, 12, .3);
}
body.is-product-dragging { user-select: none; }
.product-card.is-wrong { animation: wrongShake .35s ease; }
.product-card.is-hinted { border-color: #ff3e4d; box-shadow: 0 0 0 4px rgba(255, 62, 77, .2), 0 10px 20px rgba(221, 96, 14, .2); animation: hintPulse .75s ease-in-out 3 alternate; }
.product-image { height: 113px; display: block; padding: 6px; border-radius: 13px; background: #fff; }
.product-image img { width: 100%; height: 100%; object-fit: contain; }
.product-card strong { display: block; margin-top: 9px; overflow: hidden; font-size: 12px; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }

.overlay { position: fixed; z-index: 50; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.overlay-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(18, 15, 13, .68); }
.sheet, .claw-sheet {
  position: relative;
  width: min(100%, 520px);
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 30px 24px calc(28px + env(safe-area-inset-bottom));
  border-radius: 30px 30px 0 0;
  background: #fff;
  box-shadow: 0 -22px 60px rgba(0, 0, 0, .22);
  animation: sheetIn .32s ease both;
}
.sheet h2, .claw-sheet h2 { margin: 0; font-size: 29px; line-height: 1.16; }
.sheet ol { list-style: none; margin: 24px 0; padding: 0; display: grid; gap: 18px; }
.sheet li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; color: #514d49; font-size: 14px; line-height: 1.6; }
.sheet li b { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--orange); }
.primary-button { width: 100%; min-height: 54px; border: 0; border-radius: 15px; color: #fff; background: var(--orange); font-weight: 900; }
.compact-sheet { text-align: center; }
.compact-sheet > p:not(.eyebrow) { color: var(--muted); }
.wechat-gate-overlay { z-index: 100; }
.wechat-gate-sheet { padding-top: 34px; }
.wechat-mark {
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #fff;
  background: #19a45b;
  box-shadow: 0 12px 28px rgba(25, 164, 91, .24);
  font-size: 29px;
  font-weight: 900;
}
.wechat-gate-sheet > p:not(.eyebrow) { margin: 14px 0 24px; line-height: 1.7; }

.claw-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.claw-heading > div { min-width: 0; }
.claw-sheet .claw-heading h2 { font-size: clamp(20px, 6.2vw, 27px); line-height: 1.1; letter-spacing: -.035em; white-space: nowrap; }
.unlocked { flex: 0 0 auto; padding: 8px 10px; border-radius: 99px; color: var(--orange-dark); background: #fff0e5; font-size: 11px; font-weight: 900; }
.unlocked b { font-size: 18px; }
.machine-frame { position: relative; margin: 16px auto 10px; border: 2px solid var(--orange); border-radius: 24px; background: #f8f8f6; }
.real-machine { width: min(100%, 430px); max-height: 54dvh; aspect-ratio: 1122 / 1402; overflow: hidden; touch-action: none; }
.machine-background { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.machine-target { position: absolute; z-index: 2; left: 50%; top: 56%; height: auto; transform: translate(-50%, -50%); filter: drop-shadow(0 5px 5px rgba(116, 56, 15, .24)); transition: opacity .2s, transform .35s; will-change: left, top; }
.machine-target.is-caught { opacity: 0; transform: translate(-50%, -50%) scale(.55); }
.target-ball { width: 13.5%; }
.target-pet { width: 24%; }
.claw-unit { position: absolute; z-index: 4; left: 50%; top: -10%; width: 25%; aspect-ratio: 887 / 1774; transform: translateX(-50%); transition: left .85s cubic-bezier(.22,.74,.24,1), top .9s cubic-bezier(.35,.05,.2,1); will-change: left, top; }
.claw-unit.is-free { transition: none; }
.claw-sprite { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 5px 4px rgba(66, 34, 14, .28)); }
.carried-prize { position: absolute; z-index: -1; left: 50%; top: 68%; width: 58%; height: auto; transform: translateX(-50%); filter: drop-shadow(0 5px 5px rgba(72, 38, 14, .3)); }
.carried-prize.is-pet { width: 82%; }
.position-slider-label { display: block; color: var(--muted); text-align: center; font-size: 11px; font-weight: 700; }
.position-slider { width: 100%; height: 30px; margin: 2px 0 0; accent-color: var(--orange); cursor: ew-resize; }
.position-slider:disabled { opacity: .48; }
.claw-tip { margin: 12px 0; color: var(--muted); text-align: center; font-size: 13px; }
.claw-controls { display: grid; grid-template-columns: 1fr 1.45fr 1fr; gap: 9px; }
.claw-controls button { min-height: 50px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #f5f4f2; font-weight: 800; touch-action: none; user-select: none; }
.claw-controls .grab-button { border-color: var(--orange); color: #fff; background: var(--orange); }
.claw-controls button:disabled { opacity: .6; }
.text-button { width: 100%; margin-top: 12px; border: 0; color: var(--muted); background: transparent; font-size: 12px; }
.result-sheet { text-align: center; }
.result-sheet img { width: min(58%, 250px); max-height: 35dvh; display: block; margin: -6px auto 14px; object-fit: contain; }
.result-sheet > p:not(.eyebrow) { color: var(--muted); }
.lead-sheet { max-height: 96vh; max-height: 96dvh; }
.lead-sheet h2 { font-size: clamp(24px, 7vw, 30px); }
.lead-intro { margin: 12px 0 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.lead-intro strong { color: var(--orange-dark); }
#leadForm { display: grid; gap: 12px; }
.lead-field { display: grid; gap: 6px; color: #514d49; font-size: 13px; font-weight: 800; }
.lead-field input {
  width: 100%;
  height: 48px;
  border: 1px solid #d8d2cc;
  border-radius: 12px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  font: 400 16px/1.2 inherit;
}
.lead-field input:focus { border-color: var(--orange); outline: 3px solid rgba(244, 123, 32, .15); }
.lead-field input[readonly] { color: #6e6862; background: #f4f1ee; cursor: not-allowed; }
.lead-field input[aria-invalid="true"] { border-color: #d83127; }
.lead-identity-note { color: #8a8179; font-size: 11px; font-weight: 600; line-height: 1.45; }
.field-error { min-height: 0; color: #c82d25; font-size: 11px; font-weight: 600; }
.field-error:empty { display: none; }
.consent-row { display: flex; align-items: flex-start; gap: 9px; color: #514d49; font-size: 12px; line-height: 1.5; }
.consent-row input { width: 19px; height: 19px; flex: 0 0 auto; margin: 0; accent-color: var(--orange); }
.privacy-link { justify-self: start; margin: -7px 0 0 28px; padding: 0; border: 0; color: var(--orange-dark); background: transparent; font-size: 11px; font-weight: 800; text-decoration: underline; }
.consent-error { margin-top: -8px; }
.lead-privacy { margin: -3px 0 0; color: #96908a; font-size: 11px; }
.lead-status { min-height: 0; margin: 0; color: #c82d25; font-size: 12px; font-weight: 700; text-align: center; }
.lead-status:empty { display: none; }
.lead-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.lead-sheet .primary-button:disabled { opacity: .62; }
.lead-sheet .text-button { min-height: 36px; margin-top: -4px; }
.records-sheet { max-height: 92vh; max-height: 92dvh; }
.records-note { margin: 10px 0 18px; color: var(--muted); font-size: 13px; }
.prize-records { display: grid; gap: 10px; margin-bottom: 18px; }
.prize-record {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #ebe5df;
  border-radius: 15px;
  background: #faf9f7;
}
.prize-record img { width: 72px; height: 72px; display: block; object-fit: contain; border-radius: 12px; background: #fff; }
.prize-record h3 { margin: 0 0 5px; overflow: hidden; font-size: 15px; white-space: nowrap; text-overflow: ellipsis; }
.prize-record p { margin: 2px 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.record-register-button { margin-top: 7px; padding: 6px 9px; border: 0; border-radius: 8px; color: #fff; background: var(--orange); font: inherit; font-size: 11px; font-weight: 800; }
.record-status { align-self: start; padding: 5px 8px; border-radius: 99px; color: #a94a09; background: #fff0e5; font-size: 10px; font-weight: 900; white-space: nowrap; }
.record-status.is-redeemed { color: #147347; background: #e3f5eb; }
.records-empty { padding: 38px 18px; border-radius: 15px; color: var(--muted); background: #f7f5f2; text-align: center; font-size: 13px; line-height: 1.7; }
.records-error { color: #c82d25; }
.records-sheet .text-button { min-height: 36px; }
.privacy-copy { margin: 18px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.privacy-copy p { margin: 0 0 12px; }

.toast {
  position: fixed;
  z-index: 80;
  top: var(--toast-anchor-y, 50%);
  left: 50%;
  max-width: min(88vw, 430px);
  padding: 12px 17px;
  border-radius: 13px;
  color: #fff;
  background: #252321;
  box-shadow: 0 10px 28px rgba(0,0,0,.23);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, calc(-100% + 10px));
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast[data-type="success"] { background: #168754; }
.toast[data-type="error"] { background: #c6372d; }
.toast.is-visible { opacity: 1; transform: translate(-50%, calc(-100% - 12px)); }

@keyframes slotPulse { to { box-shadow: 0 0 0 8px rgba(244, 123, 32, .24); } }
@keyframes urgentPulse { to { transform: scale(1.05); } }
@keyframes wrongShake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@keyframes hintPulse { to { transform: translateY(-5px); } }
@keyframes sheetIn { from { transform: translateY(22px); opacity: 0; } }

@media (min-width: 800px) {
  body { padding: 26px 0; }
  body.landing-active { padding: 0; }
  .game-shell { border-radius: 28px; }
  .product-dock { border-radius: 28px; }
}

@media (orientation: landscape) and (max-height: 600px) {
  .landing-page { width: min(100%, 338px); }
}

@media (max-width: 359px) {
  .topbar { min-height: 68px; padding-right: 16px; padding-left: 16px; }
  .brand { font-size: 20px; letter-spacing: -1px; }
  .top-actions { gap: 4px; }
  .records-action { min-width: 60px; height: 38px; padding: 0 7px; font-size: 9px; }
  .round-action { width: 38px; height: 38px; font-size: 10px; }

  .task-copy {
    grid-template-columns: minmax(0, 1fr) 62px;
    gap: 8px;
    padding-right: 16px;
    padding-left: 16px;
  }
  .task-copy h1 { font-size: 22px; line-height: 1.24; }
  .task-copy .drag-tip,
  .task-copy .series-tip { font-size: 12px; }
  .timer { width: 62px; height: 62px; padding-top: 13px; border-radius: 18px 0 0 18px; }
  .timer strong { font-size: 30px; }
  .progress-panel { padding-right: 16px; padding-left: 16px; }

  .dock-heading { gap: 8px; padding-right: 16px; padding-left: 16px; }
  .dock-heading h2 { font-size: 21px; }
  .dock-heading p { font-size: 12px; }
  .dock-actions { gap: 5px; }
  .hint-button, .shuffle-button { padding: 8px; }
  .product-tray { gap: 10px; padding-right: 16px; padding-left: 16px; }
  .product-card { width: 136px; min-width: 136px; min-height: 156px; }
  .product-image { height: 104px; }
}

@media (max-height: 650px) and (orientation: portrait) {
  .claw-sheet {
    max-height: 100vh;
    max-height: 100dvh;
    padding: 18px 18px calc(16px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }
  .claw-sheet h2 { font-size: 25px; }
  .real-machine { width: auto; height: 44vh; height: 44dvh; max-width: 100%; max-height: none; margin: 10px auto 6px; }
  .claw-tip { margin: 7px 0; font-size: 12px; }
  .claw-controls { gap: 7px; }
  .claw-controls button { min-height: 46px; font-size: 13px; }
  .text-button { margin-top: 7px; }
}

@media (orientation: landscape) and (max-height: 600px) {
  .overlay { align-items: center; }
  .claw-sheet {
    width: min(94vw, 760px);
    max-height: 100vh;
    max-height: 100dvh;
    padding: max(12px, 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));
    display: grid;
    grid-template-columns: minmax(220px, .88fr) minmax(280px, 1.12fr);
    grid-template-rows: auto auto auto auto auto auto;
    column-gap: 20px;
    align-items: center;
    border-radius: 24px;
  }
  .claw-heading { grid-column: 2; grid-row: 1; align-self: end; }
  .claw-sheet .claw-heading h2 { font-size: 21px; }
  .claw-sheet h2 { font-size: 25px; }
  .real-machine {
    grid-column: 1;
    grid-row: 1 / 7;
    width: auto;
    height: calc(100vh - 28px);
    height: calc(100dvh - 28px);
    max-width: 100%;
    max-height: 430px;
    margin: 0 auto;
  }
  .position-slider-label { grid-column: 2; grid-row: 2; margin-top: 4px; }
  .position-slider { grid-column: 2; grid-row: 3; }
  .claw-tip { grid-column: 2; grid-row: 4; margin: 5px 0 8px; font-size: 12px; }
  .claw-controls { grid-column: 2; grid-row: 5; width: 100%; gap: 7px; }
  .claw-controls button { min-height: 46px; font-size: 13px; }
  .text-button { grid-column: 2; grid-row: 6; margin-top: 5px; }
}

@media (max-width: 600px) and (orientation: portrait) {
  body.landing-active { overflow: hidden; }

  .game-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .topbar {
    min-height: 0;
    flex: 0 0 auto;
    padding: max(8px, env(safe-area-inset-top)) 16px 4px;
  }
  .brand { font-size: 22px; letter-spacing: -1px; }
  .top-actions { gap: 6px; }
  .records-action { min-width: 70px; height: 44px; padding: 0 9px; font-size: 10px; }
  .round-action { width: 44px; height: 44px; font-size: 11px; }

  .task-copy {
    flex: 0 0 auto;
    grid-template-columns: minmax(0, 1fr) 52px;
    align-items: center;
    gap: 8px;
    padding: 5px 16px 3px;
  }
  .task-copy .eyebrow { display: none; }
  .task-copy h1 { max-width: none; font-size: clamp(18px, 5.2vw, 22px); line-height: 1.18; letter-spacing: -.035em; }
  .task-copy .drag-tip { margin-top: 4px; font-size: 10px; line-height: 1.2; }
  .task-copy .series-tip { margin-top: 1px; font-size: 10px; line-height: 1.2; }
  .timer { width: 52px; height: 52px; padding-top: 11px; border-radius: 16px 0 0 16px; }
  .timer strong { font-size: 28px; }
  .timer span { font-size: 9px; }

  .progress-panel { flex: 0 0 auto; padding: 3px 16px 0; }
  .progress-copy { font-size: 10px; }
  .progress-copy b { font-size: 14px; }
  .progress-track { height: 4px; margin-top: 3px; }

  .cabinet-board {
    width: auto;
    max-width: 100%;
    min-height: 0;
    flex: 1 1 0;
    align-self: center;
    margin-top: 0;
  }

  .product-dock {
    flex: 0 0 auto;
    margin-top: -32px;
    padding: 10px 0 calc(8px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 24px rgba(77, 54, 35, .12);
  }
  .dock-heading { align-items: center; gap: 7px; padding: 0 16px 7px; }
  .dock-heading h2 { font-size: 18px; line-height: 1.1; }
  .dock-heading p { margin-top: 2px; font-size: 10px; line-height: 1.25; }
  .dock-actions { gap: 5px; }
  .hint-button, .shuffle-button { min-height: 40px; padding: 7px 8px; font-size: 10px; }
  .product-tray { gap: 8px; padding: 0 16px 3px; }
  .product-card {
    width: 112px;
    min-width: 112px;
    min-height: 114px;
    padding: 6px 6px 8px;
    border-radius: 15px;
    box-shadow: 0 6px 13px rgba(221, 96, 14, .18);
  }
  .product-image { height: 70px; padding: 4px; border-radius: 10px; }
  .product-card strong { margin-top: 6px; font-size: 10px; }
}

@media (max-width: 600px) and (max-height: 650px) and (orientation: portrait) {
  .topbar { padding-bottom: 2px; }
  .brand { font-size: 21px; }
  .records-action { min-width: 62px; height: 40px; padding: 0 7px; font-size: 9px; }
  .round-action { width: 40px; height: 40px; }
  .task-copy { grid-template-columns: minmax(0, 1fr) 48px; padding-top: 3px; padding-bottom: 2px; }
  .task-copy h1 { font-size: 17px; }
  .timer { width: 48px; height: 48px; padding-top: 10px; }
  .timer strong { font-size: 26px; }
  .product-dock { margin-top: -24px; padding-top: 7px; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .dock-heading { padding-bottom: 5px; }
  .dock-heading h2 { font-size: 17px; }
  .hint-button, .shuffle-button { min-height: 36px; padding: 6px 7px; }
  .product-card { width: 98px; min-width: 98px; min-height: 100px; padding: 5px 5px 6px; border-radius: 13px; }
  .product-image { height: 61px; padding: 3px; border-radius: 8px; }
  .product-card strong { margin-top: 4px; font-size: 9px; }
}

@media (orientation: landscape) and (max-height: 600px) {
  body { padding: 0; }
  .game-shell {
    width: min(100%, 960px);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(210px, .78fr) minmax(360px, 1.22fr);
    grid-template-rows: auto auto auto 1fr;
    overflow: hidden;
    border-radius: 0;
  }
  .topbar { grid-column: 2; grid-row: 1; min-height: 53px; padding: max(7px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 3px 14px; }
  .brand { padding-top: 3px; font-size: 21px; line-height: 1.2; }
  .records-action { min-width: 64px; height: 40px; padding: 0 8px; font-size: 9px; }
  .round-action { width: 40px; height: 40px; }
  .task-copy { grid-column: 2; grid-row: 2; grid-template-columns: 1fr 50px; padding: 3px max(16px, env(safe-area-inset-right)) 2px 14px; }
  .task-copy .eyebrow,
  .task-copy .drag-tip,
  .task-copy .series-tip { display: none; }
  .task-copy h1 { font-size: 18px; line-height: 1.16; }
  .timer { width: 50px; height: 50px; padding-top: 10px; border-radius: 15px 0 0 15px; }
  .timer strong { font-size: 27px; }
  .progress-panel { grid-column: 2; grid-row: 3; padding: 3px max(16px, env(safe-area-inset-right)) 0 14px; }
  .progress-track { margin-top: 3px; }
  .cabinet-board { grid-column: 1; grid-row: 1 / 5; width: auto; height: 100vh; height: 100dvh; max-width: 100%; margin: 0 auto; }
  .product-dock { grid-column: 2; grid-row: 4; min-height: 0; margin: 0; padding: 9px 0 max(7px, env(safe-area-inset-bottom)); border-radius: 20px 0 0 0; overflow: hidden; }
  .dock-heading { align-items: center; padding: 0 max(16px, env(safe-area-inset-right)) 7px 14px; }
  .dock-heading h2 { font-size: 18px; }
  .dock-heading p { margin-top: 2px; font-size: 10px; }
  .hint-button, .shuffle-button { min-height: 38px; padding: 7px 9px; }
  .product-tray { gap: 8px; padding: 0 max(16px, env(safe-area-inset-right)) 3px 14px; }
  .product-card { width: 112px; min-width: 112px; min-height: 120px; padding: 6px; border-radius: 15px; }
  .product-image { height: 77px; }
  .product-card strong { margin-top: 5px; font-size: 10px; }
}

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

/* Game page v2: the supplied artwork is the visual source of truth. */
body:not(.landing-active) {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  background: #dedede;
}

.game-shell {
  position: relative;
  width: min(100%, 520px);
  height: auto;
  min-height: 0;
  aspect-ratio: 9 / 16;
  display: block;
  overflow: hidden;
  border-radius: 0;
  background: #dedede;
}

.game-artwork {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.game-shell .topbar {
  position: absolute;
  z-index: 8;
  inset: 0 0 auto;
  height: 10%;
  min-height: 0;
  padding: 0;
  display: block;
  pointer-events: none;
}

.game-shell .brand {
  position: absolute;
  top: 1.4%;
  left: 0;
  width: 35.8%;
  height: 7.2%;
  padding: 0;
  border: 0;
  color: transparent;
  background: transparent;
  font-size: 0;
  pointer-events: auto;
}

.game-shell .top-actions {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.game-shell .records-action {
  position: absolute;
  top: 1.55%;
  left: 43.5%;
  width: 25.5%;
  min-width: 0;
  height: max(44px, 5.2%);
  padding: 0 8px;
  border: 1px solid rgba(237, 113, 0, .55);
  border-radius: 999px;
  color: #d85e0a;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 4px 12px rgba(107, 69, 35, .09);
  font-size: clamp(9px, 2.35vw, 12px);
  font-weight: 800;
  pointer-events: auto;
}

.game-shell .round-action {
  position: absolute;
  top: 1.1%;
  width: max(44px, 10.5%);
  height: max(44px, 6.2%);
  padding: 0;
  border: 0;
  color: transparent;
  background: transparent;
  box-shadow: none;
  font-size: 0;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.game-shell #soundButton { left: 73.2%; }
.game-shell #rulesButton { left: 84.6%; }

.game-shell .task-copy {
  position: absolute;
  z-index: 7;
  inset: 0;
  display: block;
  padding: 0;
  pointer-events: none;
}

.game-shell .task-copy > div:first-child,
.game-shell .progress-panel {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.game-shell .timer {
  position: absolute;
  top: 10.65%;
  right: -1.4%;
  width: 23.4%;
  height: 8.2%;
  padding: 0 1.5% 0 0;
  border-radius: 999px 0 0 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(140deg, #ff9d1f 10%, #ff7917 88%);
  box-shadow: 0 7px 17px rgba(197, 94, 0, .22);
  font-variant-numeric: tabular-nums;
}

.game-shell .timer strong { font: 900 clamp(38px, 10.5vw, 55px)/1 Arial, sans-serif; }
.game-shell .timer span { margin-left: 3px; font-size: clamp(9px, 2.5vw, 13px); font-weight: 800; }

.game-shell .cabinet-board {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  aspect-ratio: auto;
}

.game-shell .cabinet-background { display: none; }
.game-shell .cabinet-slots { position: absolute; inset: 0; }
.game-shell .cabinet-slot {
  width: 15.8%;
  height: 6.65%;
  min-width: 0;
  min-height: 0;
  padding: 2px;
  border: 2px solid transparent;
  border-radius: clamp(7px, 2.4vw, 13px);
  background: transparent;
}

.game-shell .cabinet-slot.is-active {
  border-color: #ff7c18;
  box-shadow: 0 0 0 5px rgba(255, 124, 24, .18), 0 7px 18px rgba(222, 104, 10, .22);
}

.game-shell .cabinet-slot.is-drop-hover {
  border-color: #28a465;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 0 0 6px rgba(40, 164, 101, .22);
  transform: scale(1.06);
}

.game-shell .cabinet-slot.is-complete {
  border-color: #28a465;
  background: #fff;
}

.game-shell .cabinet-slot img { padding: 1px; border-radius: inherit; }
.game-shell .slot-1 { left: 30.25%; top: 29.35%; }
.game-shell .slot-2 { left: 55.75%; top: 35.05%; }
.game-shell .slot-3 { left: 30.25%; top: 40.75%; }
.game-shell .slot-4 { left: 55.75%; top: 46.35%; }
.game-shell .slot-5 { left: 30.25%; top: 51.8%; }
.game-shell .slot-6 { left: 55.75%; top: 57.35%; }
.game-shell .slot-7 { left: 30.25%; top: 62.35%; }

.game-shell .product-dock {
  position: absolute;
  z-index: 9;
  left: 2.35%;
  right: 2.35%;
  bottom: 1.85%;
  width: auto;
  height: 23.15%;
  min-height: 0;
  margin: 0;
  padding: 2.2% 0 1.4%;
  overflow: hidden;
  border: 1.5px solid #ed7100;
  border-radius: clamp(20px, 5.7vw, 30px);
  background: #fff;
  box-shadow: none;
}

.game-shell .dock-heading {
  height: 31%;
  min-height: 0;
  padding: 0 4.8% 1.2%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-shell .dock-heading > div:first-child { min-width: 0; }
.game-shell .dock-heading h2 { margin: 0; font-size: clamp(19px, 5vw, 27px); line-height: 1.06; }
.game-shell .dock-heading p {
  margin: 4px 0 0;
  overflow: hidden;
  color: #807c79;
  font-size: clamp(10px, 2.8vw, 14px);
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.game-shell .dock-actions { display: flex; flex: 0 0 auto; gap: 6px; margin-left: auto; }
.game-shell .hint-button,
.game-shell .shuffle-button {
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0 9px;
  border-radius: 12px;
  font-size: clamp(9px, 2.4vw, 12px);
  line-height: 1;
}

.game-shell .product-tray {
  position: absolute;
  inset: auto 0 2.6%;
  height: 63%;
  gap: 2.3%;
  padding: 0 4.8% 0;
  overscroll-behavior-x: contain;
}

.game-shell .product-card {
  width: 28%;
  min-width: 28%;
  min-height: 0;
  height: 100%;
  padding: 1.7% 1.7% 2.3%;
  border: 1.5px solid #f47b20;
  border-radius: clamp(13px, 4vw, 21px);
  background: linear-gradient(155deg, #ff961d, #ff641b);
  box-shadow: 0 7px 15px rgba(221, 96, 14, .2);
}

.game-shell .product-image {
  height: 70%;
  padding: 3%;
  border-radius: clamp(9px, 2.7vw, 14px);
}

.game-shell .product-card strong {
  margin-top: 5px;
  font-size: clamp(9px, 2.55vw, 13px);
  line-height: 1.2;
}

@media (max-width: 350px) and (orientation: portrait) {
  .game-shell .records-action { left: 41.5%; width: 27.5%; padding: 0 5px; font-size: 8px; }
  .game-shell .dock-heading { padding-right: 3.5%; padding-left: 3.5%; }
  .game-shell .hint-button, .game-shell .shuffle-button { min-height: 40px; height: 40px; padding: 0 7px; }
  .game-shell .product-tray { padding-right: 3.5%; padding-left: 3.5%; }
}

@media (orientation: landscape) and (max-height: 600px) {
  body:not(.landing-active) { overflow: auto; }
  .game-shell {
    width: min(100%, 520px);
    height: auto;
    min-height: 0;
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-shell .cabinet-slot.is-active { animation: none !important; }
}

/* Client feedback: shared controls, readable instructions and prize states. */
body.landing-active .game-shell { display: contents; }
body.landing-active .game-shell > :not(.overlay):not(.toast) { display: none; }
.campaign-actions,
.game-shell .top-actions {
  position: absolute;
  inset: 2.5% 3% auto auto;
  width: 57%;
  height: 5.5%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  background: #dcdcdc;
  pointer-events: auto;
}
.game-shell .topbar { height: 10%; }
.game-shell .brand { top: 14%; height: 72%; }
.game-shell .top-actions { top: 25%; height: 55%; }
.campaign-actions .records-action,
.game-shell .records-action {
  position: static;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 44px;
  padding: 0 7px;
  border: 0;
  box-shadow: none;
  color: #fff;
  background: var(--orange);
  font-size: clamp(9px, 2.5vw, 12px);
}
.campaign-actions .round-action,
.game-shell .round-action {
  position: static;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--orange);
  color: var(--orange-dark);
  background: #fff;
  font-size: 12px;
  box-shadow: none;
}
.landing-rules-copy {
  position: absolute;
  top: 76%;
  left: 6.8%;
  width: 86.4%;
  height: 11.5%;
  padding-top: 0;
  color: #7c7c7c;
  background: #fff;
}
.landing-rules-copy h2 { margin: 0 0 1.5%; text-align: center; font-size: clamp(12px, 3.3vw, 18px); color: #666; }
.landing-rules-copy ol { margin: 0; padding-left: 1.25em; font-size: clamp(9px, 2.5vw, 13px); line-height: 1.2; }
.landing-rules-copy li::marker { color: #ef8100; font-weight: 900; }
.game-shell .task-copy::before {
  content: '';
  position: absolute;
  top: 9.3%;
  left: 0;
  width: 100%;
  height: 11.3%;
  background: #dcdcdc;
}
.game-shell .task-copy > div:first-child {
  top: 9.5%;
  left: 7.3%;
  width: 85.4%;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}
.game-shell .task-copy .eyebrow { display: none; }
.game-shell .task-copy h1 { margin: 0 0 5px; font-size: clamp(14px, 4.3vw, 22px); line-height: 1.2; letter-spacing: -.03em; }
.game-shell .task-copy .drag-tip,
.game-shell .task-copy .series-tip { display: block; margin: 2px 0 0; font-size: clamp(9px, 2.5vw, 12px); line-height: 1.2; }
.game-shell .progress-panel {
  top: 19%;
  left: 7.3%;
  width: 85.4%;
  height: auto;
  margin: 0;
  padding: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  z-index: 7;
}
.game-shell .progress-copy { font-size: 9px; line-height: 1; }
.game-shell .progress-copy strong { font-size: 10px; }
.game-shell .progress-copy b { font-size: 12px; }
.game-shell .progress-track { height: 3px; margin-top: 4px; }
.game-shell .timer { top: 12.3%; height: 6%; width: 20%; }
.game-shell .timer strong { font-size: clamp(29px, 8.5vw, 43px); }
.target-ball, .carried-prize:not(.is-pet), .result-sheet img.is-badge { border-radius: 50%; }
.claw-sheet .claw-heading h2 { font-size: clamp(16px, 4.5vw, 24px); }
.unlocked { padding: 7px 8px; font-size: 10px; white-space: nowrap; }
.unlocked b { font-size: 17px; }
.collection-record { grid-template-columns: minmax(0, 1fr) auto; }
.badge-gallery { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: space-around; }
.badge-gallery figure { flex: 1; min-width: 0; margin: 0; text-align: center; }
.prize-record .badge-gallery img { width: min(100%, 82px); height: auto; aspect-ratio: 1; margin: 0 auto 6px; border-radius: 50%; }
.badge-gallery figcaption { font-size: 10px; line-height: 1.5; color: #9b4506; }
.badge-gallery figcaption span { display: block; }
.badge-gallery .is-uncollected img { filter: grayscale(1); opacity: .28; }
.badge-gallery .is-uncollected figcaption { color: #777; }
.lead-defer-note { margin: 0; color: #77736f; font-size: 12px; line-height: 1.6; }
.redemption-code { margin: 20px 0; padding: 18px 12px; border: 1px solid #f3d8c4; border-radius: 12px; background: #fff8f2; }
.redemption-code p { margin: 0 0 10px; font-size: 12px; color: #77736f; line-height: 1.5; }
.redemption-code strong { display: block; margin-bottom: 12px; color: #bd5100; font-size: clamp(16px, 4.8vw, 23px); overflow-wrap: anywhere; user-select: all; }
.copy-code-button { min-height: 44px; padding: 0 20px; border: 1px solid var(--orange); border-radius: 10px; color: #b34d00; background: #fff; font-size: 14px; font-weight: 700; }
.redemption-code #copyCodeStatus { margin: 12px 0 0; }
.prize-record p { overflow-wrap: anywhere; }
.game-shell::after { content: ''; position: absolute; z-index: 8; left: 0; right: 0; bottom: 0; height: 25.3%; background: #dcdcdc; pointer-events: none; }
body.landing-active .game-shell::after { display: none; }
