.game-shell .image-stage {
  /* 票面内部的移动端字号和标记尺寸以票面宽度为准，不再跟随浏览器 vw。 */
  container-type: inline-size;
  opacity: 1;
  transition: opacity .14s ease-out;
}
/* 顶栏已经为自身保留了高度，玩法舞台无需再叠加顶部留白。 */
.game-shell { padding-top: 0 !important; }
.game-shell .ticket-wrap { padding-top: 0 !important; }
/* 结算由中央奖励动画和票面本身承载，刮奖页不再保留底部操作说明区域。 */
.game-shell .controls { display: none !important; }
.game-shell:not(.scratch-ready) .image-stage {
  opacity: 0;
  pointer-events: none;
}
.game-shell:not(.scratch-ready) .scratch-grid,
.game-shell:not(.scratch-ready) .prize-grid,
.game-shell:not(.scratch-ready) .scratch-canvas {
  visibility: hidden;
}
/* 手机横屏以可用高度约束整张票；舞台内的百分比图层、canvas和蒙版会同步缩放。 */
@media (orientation: landscape) and (max-height: 600px) {
  .game-shell { width: 100% !important; padding: 0 8px 6px !important; }
  .game-shell .ticket-wrap { padding: 0 !important; }
  .game-shell .image-stage {
    width: auto !important;
    height: calc(var(--scratch-viewport-height, 100dvh) - 8px - env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 16px);
    max-height: calc(var(--scratch-viewport-height, 100dvh) - 8px - env(safe-area-inset-bottom, 0px));
    margin-inline: auto;
  }
}
.reward-overlay[hidden] { display: none; }
.reward-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  padding: 24px;
  display: grid;
  place-items: center;
  opacity: 0;
  color: #171a20;
  background: rgba(1,4,9,.76);
  backdrop-filter: blur(7px);
  transition: opacity .16s ease;
}
.reward-overlay.is-visible { opacity: 1; }
.reward-panel,
.reward-tips { grid-area: 1 / 1; }
.reward-panel {
  position: relative;
  width: min(630px, 92vw);
  min-height: 286px;
  padding: 34px 34px 24px;
  overflow: visible;
  border: 2px solid rgba(91,91,101,.42);
  border-radius: 20px;
  opacity: 0;
  background:
    linear-gradient(135deg,rgba(125,130,145,.08) 25%,transparent 25%) 0 0 / 42px 42px,
    linear-gradient(315deg,rgba(125,130,145,.06) 25%,transparent 25%) 0 0 / 42px 42px,
    linear-gradient(155deg,#f4f4f3,#e4e4e5);
  box-shadow: 0 32px 90px rgba(0,0,0,.62),inset 0 0 0 5px rgba(255,255,255,.42);
  text-align: center;
  transform: scale(.12,.06);
  transform-origin: center;
}
.reward-overlay.is-visible .reward-panel {
  animation: reward-panel-pull .46s .28s cubic-bezier(.2,.85,.22,1.08) forwards;
}
.reward-panel::before,
.reward-panel::after {
  content: "";
  position: absolute;
  top: 13px;
  width: 10px;
  height: 10px;
  border: 2px solid #c4c5c8;
  border-radius: 50%;
}
.reward-panel::before { left: 14px; }
.reward-panel::after { right: 14px; }
.reward-content { opacity: 0; transform: translateY(8px); }
.reward-overlay.is-visible .reward-content {
  animation: reward-content-in .22s .62s ease-out forwards;
}
.reward-tips {
  z-index: 3;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 4px solid #fff;
  border-radius: 50%;
  color: #fff;
  opacity: 0;
  background: linear-gradient(145deg,#ff5969,#bf162f);
  box-shadow: 0 0 0 3px #ef3148,0 5px 14px rgba(0,0,0,.28);
  transform: translateY(0) scale(.72);
}
.reward-overlay.is-visible .reward-tips {
  animation: reward-tips-lift .68s cubic-bezier(.22,.78,.22,1) forwards;
}
.reward-tips span {
  position: absolute;
  top: -12px;
  padding: 1px 5px;
  border-radius: 5px;
  color: #111;
  background: #fff;
  font-size: 9px;
  font-weight: 1000;
}
.reward-tips b { font-size: 27px; }
.reward-close {
  position: absolute;
  right: 13px;
  top: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: #777b83;
  background: rgba(120,124,132,.12);
  font: inherit;
  font-size: 21px;
  cursor: pointer;
}
.reward-panel h2 { margin: 0; font-size: 18px; line-height: 1.2; }
.reward-divider {
  height: 22px;
  margin: 10px 0 20px;
  border-radius: 999px;
  background: linear-gradient(90deg,rgba(155,157,162,.15),rgba(155,157,162,.34),rgba(155,157,162,.15));
}
.reward-items { display: flex; align-items: center; justify-content: center; gap: 16px; }
.reward-item {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 2px solid #6c4bda;
  border-radius: 12px;
  background: radial-gradient(circle at 48% 35%,#383654,#171923 72%);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.08),0 8px 18px rgba(0,0,0,.23);
}
.reward-item[hidden] { display: none; }
.reward-item img {
  width: 92%;
  height: 72%;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px rgba(0,0,0,.36));
}
.reward-currency img { transform: rotate(-5deg); }
.reward-publication img { width: 96%; height: 88%; }
.reward-item strong {
  position: absolute;
  right: 7px;
  bottom: 4px;
  color: #fff;
  font-size: 16px;
  text-shadow: 0 2px 2px #000;
}
.reward-content > p { margin: 18px 0 0; color: #575c65; font-size: 12px; font-weight: 800; }
body.reward-open .game-shell { filter: blur(5px) brightness(.45); }

.system-notice-overlay {
  position: fixed;
  inset: 0;
  z-index: 14000;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #eefcff;
  background: rgba(2,8,15,.72);
  backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity .18s ease;
}
.system-notice-overlay.is-visible { opacity: 1; }
.system-notice-panel {
  position: relative;
  width: min(520px,92vw);
  padding: 34px 32px 28px;
  border: 1px solid rgba(109,238,226,.45);
  border-radius: 24px;
  background: linear-gradient(145deg,#182936,#0b151f 72%);
  box-shadow: 0 28px 90px rgba(0,0,0,.62),inset 0 0 42px rgba(65,214,202,.07);
  text-align: center;
}
.system-notice-badge {
  position: absolute;
  left: 50%;
  top: -25px;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 3px solid #07131b;
  border-radius: 50%;
  color: #07131b;
  background: #78eee0;
  font-size: 30px;
  font-weight: 1000;
  transform: translateX(-50%);
}
.system-notice-panel h2 { margin: 0 0 16px; font-size: 23px; }
.system-notice-panel p {
  margin: 0;
  color: #c8d9df;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-line;
}
.system-notice-panel button {
  min-width: 150px;
  margin-top: 24px;
  padding: 11px 24px;
  border: 1px solid #65dacc;
  border-radius: 999px;
  color: #061219;
  background: #78eee0;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

@keyframes reward-tips-lift {
  0% { opacity: 0; transform: translateY(0) scale(.72); }
  18% { opacity: 1; transform: translateY(0) scale(1.12); }
  38% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 1; transform: translateY(-166px) scale(.94); }
}
@keyframes reward-panel-pull {
  0% { opacity: 0; transform: scale(.12,.06); }
  48% { opacity: 1; transform: scale(1.03,.34); }
  78% { opacity: 1; transform: scale(.99,1.035); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes reward-content-in {
  to { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .reward-overlay { padding: 14px; }
  .reward-panel { width: min(430px, 84vw); min-height: 220px; padding: 27px 18px 18px; }
  .reward-divider { height: 16px; margin: 8px 0 14px; }
  .reward-items { gap: 11px; }
  .reward-item { width: 80px; height: 80px; }
  .reward-item strong { font-size: 13px; }
  .reward-content > p { margin-top: 12px; }
  .reward-tips { width: 50px; height: 50px; }
  .reward-overlay.is-visible .reward-tips { animation-name: reward-tips-lift-mobile; }
  @keyframes reward-tips-lift-mobile {
    0% { opacity: 0; transform: translateY(0) scale(.72); }
    18% { opacity: 1; transform: translateY(0) scale(1.12); }
    38% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 1; transform: translateY(-128px) scale(.9); }
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  .reward-overlay { padding: 10px; }
  .reward-panel { width: min(460px, 72vw); min-height: 190px; padding: 24px 18px 15px; }
  .reward-panel h2 { font-size: 15px; }
  .reward-divider { height: 13px; margin: 7px 0 11px; }
  .reward-items { gap: 10px; }
  .reward-item { width: 72px; height: 72px; border-radius: 9px; }
  .reward-item strong { font-size: 12px; }
  .reward-content > p { margin-top: 9px; font-size: 10px; }
  .reward-tips { width: 46px; height: 46px; }
  .reward-tips b { font-size: 21px; }
  .reward-overlay.is-visible .reward-tips { animation-name: reward-tips-lift-landscape; }
  @keyframes reward-tips-lift-landscape {
    0% { opacity: 0; transform: translateY(0) scale(.72); }
    18% { opacity: 1; transform: translateY(0) scale(1.08); }
    38% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 1; transform: translateY(-110px) scale(.88); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .reward-overlay, body.reward-open .game-shell { transition: none; }
  .reward-overlay.is-visible .reward-panel,
  .reward-overlay.is-visible .reward-content,
  .reward-overlay.is-visible .reward-tips { animation-duration: .01ms; animation-delay: 0s; }
}
