:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #ffffff;
  background: #5273df;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: #5273df;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.app-shell {
  width: 100%;
  min-height: 100dvh;
  padding: max(8px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
}

.topbar {
  display: grid;
  grid-template-columns: 58px 1fr 104px;
  align-items: center;
  width: min(100%, 860px);
  min-height: 46px;
  margin: 0 auto;
}

.topbar h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(24px, 4.5vw, 34px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-shadow: 0 3px 0 rgba(44, 58, 141, 0.38);
}

.reset-button,
.sound-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 38px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  background: #28bce9;
  color: #ffffff;
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 3px 0 #2f4aa7;
  cursor: pointer;
}

.reset-button:active,
.sound-button:active,
.hint-button:active {
  transform: translateY(2px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.sound-button {
  width: 38px;
  font-size: 19px;
}

.remaining {
  display: grid;
  place-items: center;
  min-width: 48px;
  height: 36px;
  padding: 0 11px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: #eafcff;
  box-shadow: 0 3px 0 rgba(47, 74, 167, 0.7);
}

.remaining strong {
  color: #5351ad;
  font-size: 24px;
  line-height: 1;
  text-shadow: none;
}

.progress-dots {
  display: grid;
  grid-template-columns: repeat(20, minmax(8px, 25px));
  justify-content: center;
  gap: clamp(2px, 0.55vw, 5px);
  width: min(100%, 860px);
  min-height: 27px;
  margin: 6px auto 8px;
}

.progress-dot {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 2px solid rgba(76, 76, 156, 0.52);
  border-radius: 50%;
  background: #ecebff;
  color: #8d8bb8;
  font-size: clamp(9px, 1.8vw, 16px);
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 0 rgba(45, 58, 139, 0.45);
  transition: background-color 120ms ease, transform 120ms ease;
}

.progress-dot.found {
  border-color: #ffffff;
  background: #68d624;
  color: #ffffff;
  text-shadow: 0 1px 0 #3a9d15;
}

.progress-dot.arrive {
  animation: progress-arrive 620ms ease-out;
}

.game {
  display: grid;
  gap: 3px;
  width: min(100%, 860px, calc((100dvh - 174px) * 0.75));
  margin: 0 auto;
  touch-action: manipulation;
}

.picture-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 2px solid #34406e;
  background: #e8e8e8;
}

.picture-frame.miss {
  animation: frame-shake 280ms ease-out;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.picture-effects {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.ring-pop,
.hint-pulse,
.finish-pulse,
.click-spark {
  position: absolute;
  transform: translate(-50%, -50%);
  transform-origin: center;
  pointer-events: none;
}

.local-reveal-patch {
  position: absolute;
  z-index: 1;
  display: block;
  opacity: 0;
  pointer-events: none;
  animation: local-reveal 1.87s linear both;
  contain: layout paint style;
  will-change: opacity;
}

.ring-pop {
  z-index: 3;
}

.ring-pop {
  animation: ring-pop 1s linear both;
}

.ring-image,
.objective-glow,
.objective-burst {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.click-spark {
  z-index: 4;
  contain: layout paint style;
}

.objective-glow {
  animation: objective-glow 720ms ease-out both;
}

.objective-burst {
  animation: objective-burst 720ms ease-out both;
}

.objective-star {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--particle-size);
  height: var(--particle-size);
  object-fit: contain;
  pointer-events: none;
  animation: objective-star-burst 820ms ease-out var(--particle-delay) both;
  will-change: opacity, transform;
}

.hint-pulse {
  animation: hint-pulse 1.45s ease-in-out both;
}

.finish-pulse {
  z-index: 5;
  animation: finish-pulse 1.25s ease-out both;
}

.wrong-mark {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 5px solid #ffffff;
  border-radius: 50%;
  background: #f13f58;
  color: #ffffff;
  font-size: 42px;
  font-weight: 900;
  line-height: 0.8;
  box-shadow: 0 3px 0 rgba(117, 20, 44, 0.5);
  transform: translate(-50%, -50%);
  animation: wrong-pop 600ms ease-out both;
}

.game-controls {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(100%, 860px);
  min-height: 70px;
  margin: 5px auto 0;
}

.lives {
  display: inline-flex;
  grid-column: 1;
  align-items: center;
  justify-self: start;
  gap: 9px;
  min-width: 92px;
  height: 46px;
  padding: 0 16px 0 12px;
  border-radius: 23px;
  background: rgba(51, 67, 169, 0.5);
  color: #ffffff;
  font-size: 28px;
  text-shadow: 0 2px 0 rgba(31, 42, 111, 0.66);
}

.lives .heart {
  color: #ff2d54;
  font-size: 35px;
  filter: drop-shadow(0 3px 0 #b10f36);
}

.lives.hit {
  animation: life-hit 520ms ease-out;
}

.lives.danger .heart {
  animation: heart-danger 800ms ease-in-out infinite;
}

.hint-button {
  display: grid;
  grid-column: 2;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 5px solid #ffd841;
  border-radius: 50%;
  background: #43cf3e;
  color: #ffffff;
  font-size: 33px;
  line-height: 1;
  box-shadow: 0 5px 0 #238928, 0 0 0 3px rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.hint-button:disabled {
  opacity: 0.58;
  cursor: default;
}

.flight-layer,
.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  pointer-events: none;
}

.flight-streak {
  position: fixed;
  height: 13px;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255, 238, 112, 0), #fff9b0 38%, #ffffff 75%, rgba(255, 255, 255, 0));
  filter: drop-shadow(0 0 7px #ffd93d);
  transform-origin: left center;
  animation: streak-fly 660ms ease-in both;
}

.flying-star {
  position: fixed;
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 9px #ffd43c);
  animation: star-fly 660ms ease-in both;
}

.confetti-layer {
  z-index: 25;
}

.confetti-piece {
  position: absolute;
  top: -90px;
  height: auto;
  object-fit: contain;
  animation: confetti-fall 2.8s cubic-bezier(0.18, 0.7, 0.22, 1) var(--confetti-delay) both;
}

.loading-state {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 40;
  padding: 10px 14px;
  border-radius: 6px;
  background: rgba(35, 44, 94, 0.92);
  color: #ffffff;
  font-weight: 700;
  transform: translate(-50%, -50%);
}

.loading-state[hidden] {
  display: none;
}

.start-panel {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(55, 76, 170, 0.72);
  backdrop-filter: blur(2px);
}

.start-panel[hidden] {
  display: none;
}

.start-dialog {
  text-align: center;
}

.start-dialog h2 {
  margin: 0 0 22px;
  color: #ffffff;
  font-size: 38px;
  letter-spacing: 0;
  text-shadow: 0 4px 0 rgba(38, 50, 126, 0.48);
}

.start-dialog button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 150px;
  min-height: 58px;
  padding: 0 24px;
  border: 4px solid #ffd43e;
  border-radius: 8px;
  background: #55d33a;
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 6px 0 #268b2a, 0 0 0 3px rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.start-dialog button:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #268b2a, 0 0 0 3px rgba(255, 255, 255, 0.72);
}

.complete-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28, 35, 78, 0.58);
  animation: panel-in 280ms ease-out both;
}

.complete-panel[hidden] {
  display: none;
}

.complete-dialog {
  width: min(100%, 330px);
  padding: 24px;
  border: 3px solid #ffffff;
  border-radius: 8px;
  background: #5273df;
  text-align: center;
  box-shadow: 0 12px 36px rgba(21, 28, 65, 0.38);
}

.complete-mark {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 12px;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: #65d92d;
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 28px rgba(255, 255, 255, 0.72);
}

.complete-panel.failed .complete-mark,
.complete-panel.failed .complete-dialog button {
  background: #f13f58;
}

.complete-dialog h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.complete-dialog p {
  margin: 9px 0 20px;
  color: rgba(255, 255, 255, 0.88);
}

.complete-dialog button {
  min-width: 150px;
  min-height: 44px;
  border: 2px solid #ffffff;
  border-radius: 7px;
  background: #48cd36;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 #248c4d;
}

.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;
}

@keyframes ring-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.664); }
  1.7% { opacity: 1; transform: translate(-50%, -50%) scale(0.664); }
  10% { opacity: 1; transform: translate(-50%, -50%) scale(1.07); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

@keyframes local-reveal {
  0% { opacity: 0; }
  26% { opacity: 0.95; }
  38% { opacity: 0; }
  49% { opacity: 0; }
  58% { opacity: 0.95; }
  70.5% { opacity: 0; }
  76.8% { opacity: 0; }
  88.4% { opacity: 0.95; }
  100% { opacity: 0; }
}

@keyframes objective-glow {
  0% { opacity: 0; transform: scale(0.3); }
  18% { opacity: 0.92; transform: scale(0.88); }
  62% { opacity: 0.5; transform: scale(1.18); }
  100% { opacity: 0; transform: scale(1.34); }
}

@keyframes objective-burst {
  0% { opacity: 0; transform: rotate(-14deg) scale(0.28); }
  20% { opacity: 1; transform: rotate(8deg) scale(0.82); }
  68% { opacity: 0.72; transform: rotate(34deg) scale(1.05); }
  100% { opacity: 0; transform: rotate(58deg) scale(1.14); }
}

@keyframes objective-star-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(0) scale(0.25); }
  18% { opacity: 1; }
  64% { opacity: 0.95; }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--particle-x)), calc(-50% + var(--particle-y))) rotate(var(--particle-rotation)) scale(0.62);
  }
}

@keyframes arrival-glow {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(0.86); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.42); }
}

@keyframes arrival-ring {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.22); }
  28% { opacity: 1; transform: translate(-50%, -50%) scale(1.02); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
}

@keyframes arrival-particle {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(0) scale(0.2); }
  16% { opacity: 1; }
  70% { opacity: 0.95; }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--arrival-x)), calc(-50% + var(--arrival-y))) rotate(var(--arrival-rotation)) scale(0.72);
  }
}

@keyframes arrival-trail {
  0% { opacity: 0; transform: translate(0, -50%) rotate(var(--trail-angle)) scaleX(0); }
  20% { opacity: 0.92; transform: translate(0, -50%) rotate(var(--trail-angle)) scaleX(0.3); }
  100% { opacity: 0; transform: translate(0, -50%) rotate(var(--trail-angle)) scaleX(1.25); }
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.72); }
  25%, 66% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  45%, 84% { opacity: 0.35; transform: translate(-50%, -50%) scale(0.9); }
}

@keyframes finish-pulse {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); filter: brightness(2); }
  38% { opacity: 1; transform: translate(-50%, -50%) scale(1.34); filter: brightness(2.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.72); filter: brightness(1.2); }
}

@keyframes frame-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  42% { transform: translateX(5px); }
  65% { transform: translateX(-3px); }
  82% { transform: translateX(2px); }
}

@keyframes wrong-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(-22deg); }
  36% { opacity: 1; transform: translate(-50%, -50%) scale(1.22) rotate(7deg); }
  68% { opacity: 1; transform: translate(-50%, -50%) scale(0.95) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes streak-fly {
  0% { opacity: 0; clip-path: inset(0 100% 0 0); }
  18% { opacity: 1; }
  80% { opacity: 1; clip-path: inset(0 0 0 0); }
  100% { opacity: 0; clip-path: inset(0 0 0 75%); }
}

@keyframes star-fly {
  0% { opacity: 0; transform: translate(0, 0) rotate(0) scale(0.4); }
  15% { opacity: 1; }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--flight-x), var(--flight-y)) rotate(250deg) scale(1.15); }
}

@keyframes progress-arrive {
  0% { transform: scale(0.45); filter: brightness(2.4); }
  38% { transform: scale(1.65); filter: brightness(2.2); box-shadow: 0 0 20px #ffffff; }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes life-hit {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px) rotate(-4deg); }
  55% { transform: translateX(7px) rotate(4deg); }
  78% { transform: translateX(-3px); }
}

@keyframes heart-danger {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.18); }
}

@keyframes confetti-fall {
  0% { opacity: 0; transform: translate3d(0, -80px, 0) rotate(0); }
  12% { opacity: 1; }
  100% { opacity: 1; transform: translate3d(var(--confetti-drift), calc(100dvh + 150px), 0) rotate(var(--confetti-spin)); }
}

@keyframes panel-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 420px) {
  .topbar {
    grid-template-columns: 48px 1fr 100px;
  }

  .progress-dots {
    grid-template-columns: repeat(20, minmax(7px, 15px));
    min-height: 22px;
    margin-top: 4px;
    margin-bottom: 5px;
  }

  .game {
    width: 90vw;
  }

  .game-controls {
    min-height: 62px;
  }

  .lives {
    min-width: 82px;
    height: 42px;
    padding: 0 13px 0 10px;
  }

  .lives .heart {
    font-size: 31px;
  }

  .hint-button {
    width: 58px;
    height: 58px;
    font-size: 29px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Native Greyfun UI layers reconstructed from the original Unity prefabs. */
.topbar {
  grid-template-columns: 58px 1fr 104px;
  min-height: 55px;
}

.topbar h1 {
  font-size: clamp(27px, 7vw, 36px);
  font-weight: 800;
  -webkit-text-stroke: 1px rgba(71, 70, 129, 0.34);
  text-shadow: 0 3px 0 rgba(64, 67, 146, 0.7);
}

.native-back-button {
  position: relative;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 3px 1px rgba(42, 57, 120, 0.55));
}

.native-button-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.native-back-arrow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28%;
  height: auto;
  transform: translate(-52%, -50%);
  filter: drop-shadow(0 1px 0 rgba(42, 57, 120, 0.45));
}

.native-back-button:active {
  transform: scale(0.92);
}

.topbar-actions {
  overflow: visible;
}

.sound-button[hidden] {
  display: none !important;
}

.coin-counter {
  position: relative;
  width: 101px;
  height: 48px;
  filter: drop-shadow(0 3px 1px rgba(42, 57, 120, 0.55));
}

.coin-slot {
  position: absolute;
  right: 0;
  top: 6px;
  width: 78px;
  height: 38px;
}

.coin-icon {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: 49px;
  height: 50px;
}

.coin-counter strong {
  position: absolute;
  right: 17px;
  top: 50%;
  z-index: 3;
  color: #5351ad;
  font-size: 25px;
  line-height: 1;
  transform: translateY(-48%);
  text-shadow: 0 1px 0 #ffffff;
}

.progress-dots {
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 2px;
  width: min(calc(100% - 32px), 810px);
  min-height: 23px;
  margin: 3px auto 7px;
}

.progress-dot,
.progress-dot.found {
  display: block;
  aspect-ratio: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.progress-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(45, 53, 120, 0.6));
}

.game-controls {
  min-height: 70px;
  margin-top: 4px;
}

.lives,
.lives.danger {
  position: relative;
  display: block;
  width: 110px;
  min-width: 0;
  height: 52px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  text-shadow: 0 2px 0 rgba(40, 51, 118, 0.75);
}

.life-slot {
  position: absolute;
  inset: 0;
  width: 110px;
  height: 52px;
  filter: drop-shadow(0 2px 1px rgba(43, 55, 128, 0.52));
}

.lives .heart {
  position: absolute;
  left: 7px;
  top: 7px;
  width: 43px;
  height: 38px;
  filter: drop-shadow(0 2px 0 rgba(122, 15, 46, 0.56));
}

.lives strong {
  position: absolute;
  right: 18px;
  top: 50%;
  font-size: 30px;
  line-height: 1;
  transform: translateY(-48%);
}

.hint-button,
.hint-button:disabled {
  position: relative;
  display: block;
  width: 68px;
  height: 70px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  cursor: pointer;
  filter: drop-shadow(0 4px 1px rgba(41, 64, 83, 0.5));
}

.hint-base,
.hint-lens,
.hint-video {
  position: absolute;
  object-fit: contain;
  pointer-events: none;
}

.hint-base {
  inset: 0;
  width: 68px;
  height: 70px;
}

.hint-lens {
  left: 13px;
  top: 10px;
  width: 43px;
  height: 49px;
}

.hint-video {
  right: -8px;
  top: -7px;
  width: 31px;
  height: 35px;
  transform: rotate(8deg);
}

.hint-button:active {
  transform: scale(0.92);
}

.wrong-mark {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
  filter: drop-shadow(0 2px 1px rgba(96, 15, 33, 0.46));
}

.flight-head,
.trail-particle {
  position: fixed;
  z-index: 31;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(255, 244, 154, 0.78));
  will-change: opacity, transform;
}

.flight-head {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.92));
}

.progress-arrival {
  position: fixed;
  z-index: 31;
  transform: translate(-50%, -50%);
  contain: layout paint style;
  pointer-events: none;
}

.click-spark {
  filter: drop-shadow(0 0 3px rgba(255, 248, 185, 0.76));
}

.ring-pop .ring-image {
  filter: drop-shadow(0 3px 1px rgba(26, 72, 20, 0.46));
}

.arrival-glow,
.arrival-ring,
.arrival-star,
.arrival-spark,
.arrival-trail {
  position: absolute;
  left: 50%;
  top: 50%;
  object-fit: contain;
  pointer-events: none;
  will-change: opacity, transform;
}

.arrival-glow,
.arrival-ring {
  width: 100%;
  height: 100%;
}

.arrival-glow {
  animation: arrival-glow 650ms ease-out both;
}

.arrival-ring {
  animation: arrival-ring 620ms ease-out both;
}

.arrival-star {
  width: 11%;
  height: 11%;
  animation: arrival-particle 820ms ease-out var(--arrival-delay) both;
}

.arrival-spark {
  width: 16%;
  height: 16%;
  animation: arrival-particle 860ms ease-out var(--arrival-delay) both;
}

.arrival-trail {
  width: 52%;
  height: 20%;
  transform-origin: left center;
  animation: arrival-trail 720ms ease-out var(--arrival-delay) both;
}

.start-dialog button {
  position: relative;
  min-width: 180px;
  min-height: 76px;
  border: 0;
  background: transparent url("./assets/effects/game_anniu.png") center / 100% 100% no-repeat;
  box-shadow: none;
  text-shadow: 0 2px 0 rgba(32, 88, 34, 0.7);
  filter: drop-shadow(0 4px 1px rgba(28, 63, 36, 0.4));
}

.complete-panel {
  place-items: center;
  padding: 18px;
  background: rgba(8, 18, 47, 0.79);
}

.success-result {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(94vw, 520px);
  padding-top: 76px;
}

.victory-title {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 4;
  width: min(100%, 470px);
  height: 112px;
  transform: translateX(-50%);
  filter: drop-shadow(0 5px 2px rgba(42, 16, 91, 0.5));
}

.victory-ribbon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.victory-word {
  position: absolute;
  left: 50%;
  top: 24px;
  width: 72%;
  height: auto;
  transform: translateX(-50%);
}

.success-preview {
  position: relative;
  width: 92%;
  padding: 15px 16px 42px;
  border-radius: 28px;
  background: #f2f3ff url("./assets/effects/game_tongguan_bg.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 8px 3px rgba(8, 19, 55, 0.48));
}

.success-preview canvas {
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 3px solid #ffffff;
  border-radius: 8px;
  background: #ffffff;
  cursor: default;
}

.rating-controls {
  position: absolute;
  left: 22px;
  bottom: 9px;
  width: 95px;
  height: 40px;
}

.rating-controls > img:first-child {
  position: absolute;
  inset: 0;
  width: 95px;
  height: 40px;
}

.rating-controls .thumb-up,
.rating-controls .thumb-down {
  position: absolute;
  top: 7px;
  width: 27px;
  height: 26px;
}

.rating-controls .thumb-up { left: 20px; }
.rating-controls .thumb-down { right: 15px; }

.native-result-button {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 28px;
  font-weight: 900;
  text-shadow: 0 3px 0 rgba(35, 88, 38, 0.75);
  cursor: pointer;
  isolation: isolate;
  outline: none;
}

.native-result-button > img:first-child {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.native-result-button:active {
  transform: scale(0.96);
}

.success-button {
  width: min(72%, 330px);
  height: 92px;
  margin-top: 10px;
  filter: drop-shadow(0 5px 2px rgba(22, 72, 29, 0.48));
}

.failure-result {
  display: none;
  width: min(92vw, 390px);
}

.complete-panel.failed .success-result {
  display: none;
}

.complete-panel.failed .failure-result {
  display: block;
}

.failure-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  min-height: 500px;
  padding: 100px 42px 42px;
  background: url("./assets/effects/game_tanchuang_bg.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 9px 3px rgba(6, 15, 47, 0.58));
}

.failure-title {
  position: absolute;
  left: 7%;
  right: 7%;
  top: -20px;
  display: grid;
  place-items: center;
  height: 104px;
  background: url("./assets/effects/game_anniu_purple.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 6px 2px rgba(77, 30, 132, 0.46));
}

.failure-title h2 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 0;
  -webkit-text-stroke: 1px #686195;
  text-shadow: 0 2px 0 #ffffff;
}

.failure-progress {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 105px;
  padding: 18px;
  border-radius: 24px;
  background: #e0e2f7;
  color: #7774ce;
  font-size: 19px;
  text-align: center;
}

.failure-progress strong {
  font-size: 26px;
}

.fail-continue,
.fail-retry {
  width: 100%;
  height: 92px;
}

.fail-continue {
  margin-top: 6px;
}

.fail-retry {
  text-shadow: 0 3px 0 rgba(19, 91, 143, 0.7);
}

.button-video {
  position: absolute;
  left: 18%;
  top: 50%;
  width: 40px;
  height: 45px;
  transform: translateY(-50%) rotate(-6deg);
}

@keyframes progress-glow-arrive {
  0% { opacity: 0; transform: scale(0.2) rotate(0); }
  38% { opacity: 1; transform: scale(1.3) rotate(40deg); }
  100% { opacity: 0; transform: scale(1.8) rotate(110deg); }
}

@media (max-width: 420px) {
  .topbar { grid-template-columns: 52px 1fr 101px; }
  .progress-dots { width: calc(100% - 25px); gap: 1px; }
  .game-controls { min-height: 64px; }
  .lives { width: 103px; height: 49px; }
  .life-slot { width: 103px; height: 49px; }
  .lives .heart { width: 40px; height: 35px; }
  .hint-button, .hint-button:disabled { width: 62px; height: 65px; }
  .hint-base { width: 62px; height: 65px; }
  .hint-lens { left: 12px; top: 9px; width: 40px; height: 45px; }
  .success-result { width: 100%; padding-top: 63px; }
  .victory-title { height: 92px; }
  .victory-word { top: 20px; }
  .success-button { height: 78px; }
  .failure-result { width: min(94vw, 360px); }
  .failure-card { min-height: 470px; padding: 88px 36px 34px; }
  .failure-title { height: 92px; }
  .fail-continue, .fail-retry { height: 80px; }
}


/* Difference Desk V8 responsive alignment overrides. */
.topbar {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.native-back-button {
  grid-column: 1;
  justify-self: start;
}

.topbar h1 {
  grid-column: 2;
  white-space: nowrap;
}

.topbar-actions {
  grid-column: 3;
  justify-self: end;
}

.progress-dots {
  grid-template-columns: repeat(var(--point-count, 15), minmax(0, 1fr));
  width: min(calc(100% - 32px), var(--progress-width, 600px));
}

@media (max-width: 420px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .progress-dots {
    width: min(calc(100% - 25px), var(--progress-width, 330px));
  }
}
