:root {
  --theme: #FF8A3D;
  --theme-deep: #D9480F;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: #860803;
  color: #3b1509;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  height: 100vh;
  height: 100dvh;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  outline: none;
}

/* ---------- 背景 ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(92% 56% at 50% 6%, var(--theme) 0%, #ec4c23 22%, #c81d11 55%, #8a0904 100%);
}

.bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 220, 150, 0.1) 1px, transparent 1.2px);
  background-size: 26px 26px;
  opacity: 0.65;
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(62% 34% at 50% 102%, rgba(255, 186, 92, 0.3), transparent 70%),
    radial-gradient(40% 26% at 8% 88%, rgba(255, 154, 76, 0.24), transparent 70%),
    radial-gradient(40% 26% at 94% 82%, rgba(255, 154, 76, 0.2), transparent 70%);
}

.bg-glow {
  position: absolute;
  left: 50%;
  top: 12%;
  width: 130%;
  height: 70%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 190, 110, 0.18), transparent 72%);
  animation: glowPulse 7s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  from { opacity: 0.55; transform: translateX(-50%) scale(0.96); }
  to { opacity: 1; transform: translateX(-50%) scale(1.04); }
}

/* 灯笼 */
.lantern {
  position: absolute;
  top: -46px;
  width: 116px;
  height: 210px;
  opacity: 0.92;
  filter: drop-shadow(0 12px 18px rgba(70, 0, 0, 0.36));
  transform-origin: 50% 0;
  animation: sway 6s ease-in-out infinite alternate;
}

.lantern-l { left: -40px; }
.lantern-r { right: -40px; animation-delay: -3s; }

@keyframes sway {
  from { transform: rotate(-2.4deg); }
  to { transform: rotate(2.4deg); }
}

.lantern-cap {
  position: absolute;
  top: 8px;
  left: 39px;
  width: 38px;
  height: 13px;
  border-radius: 4px;
  background: linear-gradient(#ffe8a6, #e0a62d 60%, #b87813);
  box-shadow: 0 2px 0 rgba(120, 60, 0, 0.3);
}

.lantern-body {
  position: absolute;
  top: 18px;
  left: 13px;
  width: 90px;
  height: 112px;
  border-radius: 50% 50% 47% 47% / 43% 43% 57% 57%;
  background:
    radial-gradient(circle at 33% 28%, #ff8d62 0%, #ec3a23 38%, #cd1a10 68%, #8f0b06 100%);
  border: 2px solid rgba(255, 208, 118, 0.55);
  box-shadow: inset 0 -14px 24px rgba(90, 0, 0, 0.35), inset 0 8px 15px rgba(255, 160, 110, 0.35);
}

.lantern-body::before,
.lantern-body::after {
  content: "";
  position: absolute;
  top: 6%;
  bottom: 6%;
  width: 26px;
  border-radius: 50%;
  border-left: 2px solid rgba(255, 176, 120, 0.28);
  border-right: 2px solid rgba(120, 8, 4, 0.22);
}

.lantern-body::before { left: 17px; }
.lantern-body::after { right: 17px; }

.lantern-body i {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 38px;
  color: #ffe1a0;
  text-shadow: 0 2px 0 rgba(120, 10, 4, 0.5);
  opacity: 0.92;
}

.lantern-tassel {
  position: absolute;
  top: 126px;
  left: 52px;
  width: 10px;
  height: 58px;
  border-radius: 5px;
  background: linear-gradient(#ffd970, #e0a62d 60%, #b87813);
  transform-origin: 50% 0;
  animation: tasselSway 4.4s ease-in-out infinite alternate;
}

.lantern-tassel::after {
  content: "";
  position: absolute;
  bottom: -16px;
  left: -5px;
  width: 20px;
  height: 24px;
  border-radius: 48% 48% 60% 60%;
  background: linear-gradient(#f6c34f, #c9871b);
}

@keyframes tasselSway {
  from { transform: rotate(-5deg); }
  to { transform: rotate(5deg); }
}

/* 云与铜钱 */
.cloud {
  position: absolute;
  width: 260px;
  height: 100px;
  border-radius: 60% 60% 30% 30% / 90% 90% 30% 30%;
  background: rgba(255, 214, 146, 0.13);
  filter: blur(1px);
}

.cloud-l { left: -90px; bottom: -40px; }
.cloud-r { right: -90px; bottom: -30px; }

.coin {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff0b4, #f4c04a 45%, #cf8a19 100%);
  border: 2px solid rgba(160, 96, 10, 0.5);
  box-shadow: 0 4px 8px rgba(90, 20, 0, 0.25);
  opacity: 0.5;
  animation: coinFloat 5.6s ease-in-out infinite alternate;
}

.coin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%) rotate(12deg);
  background: #b3120d;
  border-radius: 1px;
  box-shadow: inset 0 1px 1px rgba(80, 0, 0, 0.5);
}

.coin-1 { left: 4%; bottom: 10%; }
.coin-2 { right: 5%; bottom: 17%; width: 24px; height: 24px; animation-delay: -2s; }
.coin-3 { left: 13%; bottom: 22%; width: 19px; height: 19px; animation-delay: -3.4s; }

@keyframes coinFloat {
  from { transform: translateY(-7px) rotate(-5deg); }
  to { transform: translateY(9px) rotate(7deg); }
}

.sparkles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 18%, rgba(255, 235, 178, 0.85) 0 1.5px, transparent 2px),
    radial-gradient(circle at 83% 26%, rgba(255, 235, 178, 0.7) 0 1px, transparent 1.8px),
    radial-gradient(circle at 72% 62%, rgba(255, 235, 178, 0.65) 0 1.4px, transparent 2px),
    radial-gradient(circle at 26% 78%, rgba(255, 235, 178, 0.55) 0 1px, transparent 1.8px),
    radial-gradient(circle at 46% 8%, rgba(255, 235, 178, 0.6) 0 1px, transparent 1.8px);
  animation: twinkle 4.5s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.35; }
  to { opacity: 0.9; }
}

/* ---------- 主体 ---------- */
#app {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 700px) {
  #app {
    box-shadow: 0 0 90px rgba(60, 0, 0, 0.55);
  }
}

/* ---------- 分数卷轴 ---------- */
.hud {
  flex: 0 0 auto;
  position: relative;
  z-index: 20;
  padding: calc(10px + env(safe-area-inset-top)) 18px 0;
}

.score-scroll {
  position: relative;
  max-width: 306px;
  margin: 0 auto;
  filter: drop-shadow(0 5px 0 rgba(96, 16, 3, 0.3)) drop-shadow(0 12px 16px rgba(60, 0, 0, 0.28));
}

.scroll-inner {
  position: relative;
  display: flex;
  align-items: center;
  height: 58px;
  padding: 0 56px 0 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff9e6 0%, #fbe7bb 62%, #f2d094 100%);
  border: 2px solid #e2a440;
  box-shadow:
    inset 0 2px 0 #fffdf2,
    inset 0 -4px 0 rgba(176, 108, 28, 0.16),
    inset 0 0 20px rgba(255, 196, 92, 0.25);
}

.scroll-inner::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 11px;
  border: 1px solid rgba(196, 132, 46, 0.35);
  pointer-events: none;
}

.scroll-knob {
  position: absolute;
  top: 50%;
  width: 30px;
  height: 40px;
  transform: translateY(-50%);
  border-radius: 8px;
  background: linear-gradient(180deg, #ff6c4c 0%, #db2a17 45%, #a50e07 100%);
  border: 2px solid #f2bc5b;
  box-shadow: inset 0 3px 0 rgba(255, 190, 140, 0.45), 0 3px 6px rgba(80, 0, 0, 0.25);
}

.scroll-knob::before,
.scroll-knob::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 20px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 4px;
  background: linear-gradient(#ffe6a0, #d99b2b);
}

.scroll-knob::before { top: -6px; }
.scroll-knob::after { bottom: -6px; }

.knob-l { left: -15px; }
.knob-r { right: -15px; }

.redpack-ico {
  flex: 0 0 auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 40px;
  margin-right: 9px;
  border-radius: 7px;
  background: linear-gradient(160deg, #ff5d3d 0%, #dd2314 52%, #ae0f08 100%);
  border: 1.5px solid #f7c258;
  box-shadow: 0 2px 0 rgba(120, 20, 4, 0.35), inset 0 1px 0 rgba(255, 190, 150, 0.5);
}

.redpack-ico::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 21px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 0 0 10px 10px;
  background: linear-gradient(#ff9a6e, #f2b53b);
  box-shadow: 0 1px 0 rgba(140, 60, 0, 0.2);
}

.redpack-ico b {
  position: relative;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe9a1, #f2b23a);
  color: #a4140a;
  font-size: 13px;
  font-weight: 900;
  border: 1px solid rgba(150, 84, 10, 0.45);
}

.score-label {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #8f3d13;
  margin-right: 7px;
}

.score-num {
  display: inline-block;
  min-width: 44px;
  font-size: 27px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #c4170c;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 #fff2cf;
  transform-origin: 50% 60%;
}

.score-num.bump {
  animation: scoreBump 0.32s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes scoreBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.28); color: #ef7a13; }
  100% { transform: scale(1); }
}

.pause-btn {
  position: absolute;
  right: 7px;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff8e0, #f3d79f);
  border: 2px solid #e0a440;
  box-shadow: 0 3px 0 rgba(160, 100, 20, 0.3), inset 0 1px 0 #fff;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.pause-btn .mp-icon {
  width: 22px;
  height: 22px;
  background-color: #c0190d;
}

.pause-btn:active {
  transform: translateY(-50%) scale(0.9);
  box-shadow: 0 1px 0 rgba(160, 100, 20, 0.3);
}

/* ---------- 游戏画布 ---------- */
.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  touch-action: none;
}

#game {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.toast {
  position: absolute;
  left: 50%;
  top: 47%;
  z-index: 5;
  transform: translate(-50%, -50%) scale(0.88);
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(96, 14, 4, 0.8);
  border: 1px solid rgba(255, 216, 144, 0.55);
  box-shadow: 0 8px 20px rgba(50, 0, 0, 0.35);
  color: #ffe7b2;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.combo {
  position: absolute;
  left: 50%;
  top: 20%;
  z-index: 5;
  transform: translate(-50%, -50%) scale(0.6) rotate(-4deg);
  color: #ffe06a;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-shadow:
    0 2px 0 #a3140a,
    0 4px 0 rgba(120, 20, 4, 0.5),
    0 8px 18px rgba(90, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
}

.combo.show {
  animation: comboPop 0.72s cubic-bezier(0.2, 1.5, 0.4, 1);
}

@keyframes comboPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotate(-6deg); }
  28% { opacity: 1; transform: translate(-50%, -50%) scale(1.16) rotate(-2deg); }
  62% { opacity: 1; transform: translate(-50%, -58%) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -84%) scale(0.92) rotate(2deg); }
}

/* ---------- 开始页 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.overlay[hidden] {
  display: none !important;
}

.start-screen {
  background: #7c0803;
  overflow: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.start-screen.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-art {
  position: absolute;
  inset: 0;
}

.start-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.04);
  animation: heroDrift 18s ease-in-out infinite alternate;
}

@keyframes heroDrift {
  from { transform: scale(1.04) translateY(0); }
  to { transform: scale(1.1) translateY(-1.2%); }
}

.start-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(72, 2, 0, 0.48) 0%, rgba(92, 4, 2, 0.04) 20%, rgba(92, 4, 2, 0.02) 34%, rgba(108, 6, 2, 0.68) 58%, #7c0803 92%),
    radial-gradient(70% 50% at 50% 42%, transparent 40%, rgba(70, 0, 0, 0.25) 100%);
}

.start-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(30px + env(safe-area-inset-bottom));
  z-index: 2;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 0 26px;
  text-align: center;
}

.start-kicker {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.38em;
  color: #ffdd94;
  opacity: 0.88;
  text-indent: 0.38em;
}

.start-content h1 {
  margin: 0 0 10px;
  font-family: "STKaiti", "KaiTi", "Songti SC", "PingFang SC", serif;
  font-size: clamp(34px, 9vw, 48px);
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.15;
  color: #ffe7a3;
  background: linear-gradient(180deg, #fff9dc 4%, #ffe291 42%, #f4b23d 76%, #e08f16 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 rgba(112, 10, 4, 0.55)) drop-shadow(0 10px 22px rgba(80, 0, 0, 0.55));
}

.start-sub {
  margin: 0 auto;
  font-size: 14px;
  line-height: 1.72;
  letter-spacing: 0.04em;
  color: #ffe9c4;
  text-shadow: 0 2px 6px rgba(90, 10, 0, 0.55);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 330px;
  height: 58px;
  margin: 22px auto 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe389 0%, #ffc94e 44%, #f3a51f 74%, #e08c0f 100%);
  border: 2px solid #fff0b8;
  box-shadow:
    0 6px 0 #b4520a,
    0 12px 22px rgba(90, 16, 0, 0.42),
    0 0 26px rgba(255, 138, 61, 0.28),
    inset 0 2px 0 rgba(255, 255, 255, 0.65);
  color: #8f1c05;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 #b4520a,
    0 6px 12px rgba(90, 16, 0, 0.36),
    inset 0 2px 0 rgba(255, 255, 255, 0.55);
}

.start-tip {
  margin: 15px 0 0;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(255, 232, 196, 0.72);
}

/* ---------- 弹窗 ---------- */
.dialog {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(60, 3, 1, 0.7);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.dialog-card {
  position: relative;
  width: min(340px, 100%);
  padding: 34px 24px 26px;
  border-radius: 26px;
  background: linear-gradient(180deg, #fffaef 0%, #fdf0d4 55%, #f8e2b6 100%);
  border: 3px solid #efb45a;
  box-shadow:
    0 24px 60px rgba(30, 0, 0, 0.55),
    inset 0 2px 0 #fffdf4,
    inset 0 -5px 0 rgba(184, 116, 32, 0.12);
  text-align: center;
  animation: cardIn 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin: -64px auto 12px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff4cf, #f3cd7c);
  border: 3px solid #e3a63f;
  box-shadow: 0 7px 14px rgba(100, 40, 0, 0.28), inset 0 2px 0 #fffdf2;
}

.dialog-badge .mp-icon {
  width: 28px;
  height: 28px;
  background-color: #c01b0e;
}

.dialog-badge.red {
  background: linear-gradient(180deg, #ff6a4a, #d92716 60%, #a80f08);
  border-color: #f6c45c;
}

.dialog-badge.red span {
  color: #ffe7a0;
  font-size: 28px;
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(110, 10, 0, 0.5);
}

.dialog-card h2 {
  margin: 0 0 6px;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #8e2508;
}

.dialog-text {
  margin: 0 0 20px;
  font-size: 13px;
  color: #a17443;
}

.over-label {
  margin: 12px 0 0;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #a17443;
}

.over-score {
  margin: 2px 0 4px;
  font-size: 46px;
  line-height: 1.1;
  font-weight: 900;
  color: #c8190d;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 #ffe9b8, 0 5px 0 rgba(170, 105, 30, 0.18);
}

.over-note {
  margin: 4px 0 20px;
  font-size: 13px;
  color: #a17443;
}

.dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dialog-actions .btn-primary {
  margin: 0 auto;
  height: 54px;
}

.btn-ghost {
  width: 100%;
  max-width: 330px;
  height: 48px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid #e2b46c;
  color: #9b5a20;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  transition: transform 0.08s ease, background 0.15s ease;
}

.btn-ghost:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.85);
}

@media (max-height: 700px) {
  .scroll-inner { height: 52px; }
  .score-num { font-size: 24px; }
  .start-content h1 { font-size: 34px; }
  .start-sub { font-size: 13px; }
  .btn-primary { height: 54px; margin-top: 16px; }
  .start-tip { margin-top: 11px; }
  .start-content { bottom: calc(20px + env(safe-area-inset-bottom)); }
}


/* ---------- 激励视频：结算分数翻倍 ---------- */
.btn-reward {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  margin-top: 16px;
  padding: 12px 18px;
  overflow: hidden;
  border: 2px solid #ffd89a;
  border-radius: 17px;
  background: linear-gradient(180deg, #ffad61 0%, var(--theme) 48%, #e95b20 100%);
  box-shadow: 0 5px 0 #b33a12, 0 10px 20px rgba(143, 48, 10, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.42);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 1px rgba(132, 44, 8, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.2s ease;
  touch-action: manipulation;
}

.btn-reward::after {
  content: "";
  position: absolute;
  top: -70%;
  left: -35%;
  width: 30%;
  height: 240%;
  transform: rotate(24deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  animation: rewardShine 3.4s ease-in-out infinite;
  pointer-events: none;
}

.btn-reward .mp-icon {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  color: #fff;
  background-color: currentColor;
}

.btn-reward:active:not(:disabled) {
  transform: translateY(3px) scale(0.985);
  box-shadow: 0 2px 0 #b33a12, 0 5px 10px rgba(143, 48, 10, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.btn-reward:focus-visible {
  outline: 3px solid rgba(255, 213, 139, 0.9);
  outline-offset: 3px;
}

.btn-reward:disabled {
  cursor: default;
}

.btn-reward.is-loading {
  filter: saturate(0.75);
}

.btn-reward.is-loading .mp-icon {
  animation: adIconPulse 0.9s ease-in-out infinite alternate;
}

.btn-reward.is-rewarded,
.btn-reward:disabled:not(.is-loading) {
  border-color: #f3d99b;
  background: linear-gradient(180deg, #d7b879, #b79252);
  box-shadow: 0 3px 0 #876936, inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: #fff9e9;
  opacity: 1;
}

.btn-reward.is-rewarded::after,
.btn-reward:disabled::after {
  animation: none;
}

.dialog-actions .btn-reward + .btn-ghost {
  margin-top: 13px;
}

.over-score.reward-bump {
  animation: rewardScoreBump 0.65s cubic-bezier(0.2, 1.55, 0.4, 1);
}

@keyframes rewardShine {
  0%, 56% { left: -35%; opacity: 0; }
  64% { opacity: 1; }
  86%, 100% { left: 120%; opacity: 0; }
}

@keyframes adIconPulse {
  from { transform: scale(0.86); opacity: 0.58; }
  to { transform: scale(1.08); opacity: 1; }
}

@keyframes rewardScoreBump {
  0% { transform: scale(1); color: inherit; }
  38% { transform: scale(1.28) rotate(-2deg); color: #ef8b23; }
  68% { transform: scale(0.96) rotate(1deg); }
  100% { transform: scale(1); color: inherit; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .dialog .over-card {
    width: min(430px, calc(100vw - 40px));
    padding: 13px 24px 17px;
    border-radius: 23px;
  }

  .over-card .dialog-badge {
    width: 43px;
    height: 43px;
    margin-top: -31px;
    margin-bottom: 5px;
  }

  .over-card h2 {
    margin: 3px 0 5px;
    font-size: 21px;
  }

  .over-card .over-label {
    margin: 3px 0 0;
    font-size: 12px;
  }

  .over-card .over-score {
    margin: 2px 0;
    font-size: 38px;
    line-height: 1.08;
  }

  .over-card .over-note {
    margin: 4px 0 10px;
    font-size: 12px;
    line-height: 1.4;
  }

  .over-card .dialog-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 11px;
    margin-top: 0;
  }

  .over-card .btn-reward,
  .over-card .dialog-actions .btn-reward + .btn-ghost {
    min-width: 0;
    min-height: 45px;
    height: 45px;
    margin: 0;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 14px;
  }

  .over-card .btn-reward {
    gap: 6px;
    box-shadow: 0 4px 0 #b33a12, 0 7px 14px rgba(143, 48, 10, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  }

  .over-card .btn-reward .mp-icon {
    width: 21px;
    height: 21px;
  }
}

@media (max-height: 390px) and (orientation: landscape) {
  .dialog .over-card {
    padding-top: 10px;
    padding-bottom: 12px;
  }

  .over-card .dialog-badge {
    display: none;
  }

  .over-card h2 {
    margin-top: 0;
    font-size: 19px;
  }

  .over-card .over-score {
    font-size: 32px;
  }

  .over-card .over-note {
    margin-bottom: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-reward::after,
  .btn-reward.is-loading .mp-icon,
  .over-score.reward-bump {
    animation: none;
  }
}
