.game-scratch-voucher {
  --scratch-red: #e62129;
  --scratch-red-dark: #9f111b;
  --scratch-gold: #ffd45a;
  --scratch-gold-dark: #a96a00;
  --scratch-ink: #231f2c;
  --scratch-stage-art: none;
  --scratch-progress: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.portal-page.is-game-focus .mini-game-card:has(.game-scratch-voucher) {
  --game-card-play-min-height: 450px;
  --game-stage-play-min-height: 300px;
}

.game-scratch-voucher .game-hud {
  gap: 6px;
  padding: 8px;
  border-bottom: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.18), transparent 58%),
    linear-gradient(180deg, #fe4650 0%, #d61b27 56%, #9f111b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -4px 0 rgba(80, 6, 12, 0.18),
    0 6px 0 rgba(159, 17, 27, 0.12);
}

.game-scratch-voucher .game-hud-item {
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.18), transparent 62%),
    rgba(67, 8, 13, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 3px 0 rgba(73, 6, 11, 0.16);
}

.game-scratch-voucher .game-hud-label {
  color: #fff3a0;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.24);
}

.game-scratch-voucher .game-hud-value {
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.22),
    0 0 14px rgba(255, 212, 90, 0.24);
}

.game-scratch-voucher .game-stage {
  min-height: 292px;
  display: grid;
  place-items: center;
  padding: 22px 14px 26px;
  border-top: 1px solid rgba(230, 33, 41, 0.12);
  background-color: #fff8ef;
  background-image:
    radial-gradient(ellipse at 50% 46%, rgba(255, 255, 255, 0.2), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 244, 220, 0.06) 58%, rgba(230, 33, 41, 0.12) 100%),
    var(--scratch-stage-art),
    linear-gradient(180deg, #ffffff 0%, #fffaf0 58%, #fff0e8 100%);
  background-size: cover, cover, cover, cover, cover;
  background-position: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -28px 42px rgba(230, 33, 41, 0.07);
}

.game-scratch-voucher .game-stage::before {
  z-index: 0;
  inset: auto 42px 54px;
  height: 40px;
  background: rgba(80, 6, 12, 0.16);
  filter: blur(24px);
}

.game-scratch-voucher .game-stage::after {
  z-index: 1;
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 212, 90, 0.18) 48%, transparent 100%) 50% 22% / 82% 1px no-repeat,
    linear-gradient(180deg, transparent 0%, transparent 76%, rgba(230, 33, 41, 0.05) 100%);
}

.portal-page.is-game-focus .game-scratch-voucher .game-stage {
  height: clamp(292px, calc(100svh - 330px), 390px);
  min-height: 292px;
}

@supports (height: 100dvh) {
  .portal-page.is-game-focus .game-scratch-voucher .game-stage {
    height: clamp(292px, calc(100dvh - 330px), 390px);
  }
}

.portal-page.is-game-focus .game-scratch-voucher.is-countdown .game-stage,
.portal-page.is-game-focus .game-scratch-voucher.is-playing .game-stage,
.portal-page.is-game-focus .game-scratch-voucher.is-completing .game-stage {
  height: clamp(326px, calc(100svh - 236px), 560px);
  min-height: var(--game-stage-play-min-height);
}

@supports (height: 100dvh) {
  .portal-page.is-game-focus .game-scratch-voucher.is-countdown .game-stage,
  .portal-page.is-game-focus .game-scratch-voucher.is-playing .game-stage,
  .portal-page.is-game-focus .game-scratch-voucher.is-completing .game-stage {
    height: clamp(326px, calc(100dvh - 236px), 560px);
  }
}

@supports selector(:has(*)) {
  .portal-page.is-game-focus .game-scratch-voucher.is-countdown .game-stage,
  .portal-page.is-game-focus .game-scratch-voucher.is-playing .game-stage,
  .portal-page.is-game-focus .game-scratch-voucher.is-completing .game-stage {
    height: clamp(326px, calc(100dvh - 236px), 560px);
    min-height: var(--game-stage-play-min-height);
  }
}

.game-scratch-voucher.is-playing .scratch-pad {
  touch-action: none;
}

.game-scratch-voucher.is-finished .game-stage {
  height: auto;
  min-height: 0;
  padding: 0;
  touch-action: auto;
  background: #ffffff;
}

.game-scratch-voucher.is-finished .scratch-stage-sheen,
.game-scratch-voucher.is-finished .scratch-ticket {
  display: none;
}

.game-scratch-voucher.is-finished .game-overlay {
  position: static;
  display: block;
  padding: 12px 16px;
  background: #ffffff;
  backdrop-filter: none;
}

.game-scratch-voucher.is-finished .game-overlay-panel {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.game-scratch-voucher.is-finished .game-overlay-panel h2 {
  margin: 0;
  color: var(--color-primary);
  font-size: 14px;
  line-height: 1.2;
}

.scratch-stage-sheen {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  pointer-events: none;
  background:
    linear-gradient(116deg, transparent 0 38%, rgba(255, 212, 90, 0.16) 46%, transparent 56%),
    radial-gradient(circle at 72% 26%, rgba(255, 212, 90, 0.12), transparent 20%);
  mix-blend-mode: screen;
}

.scratch-ticket {
  position: relative;
  z-index: 2;
  width: min(340px, 100%);
  padding: 18px 18px 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-bottom-color: rgba(255, 255, 255, 0.56);
  border-radius: 22px;
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 24%),
    linear-gradient(180deg, #f23842 0%, #c81724 46%, #8f111a 100%);
  box-shadow:
    0 36px 58px rgba(55, 7, 15, 0.26),
    0 12px 26px rgba(230, 33, 41, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -40px 64px rgba(43, 4, 9, 0.34);
  overflow: visible;
}

.scratch-ticket::before,
.scratch-ticket::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.scratch-ticket::before {
  display: none;
}

.scratch-ticket::after {
  inset: 12px;
  z-index: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 17px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.scratch-ticket-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -18px -18px 12px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(255, 212, 90, 0.74);
  background: rgba(96, 7, 14, 0.34);
  box-shadow: none;
}

.scratch-ticket-brand,
.scratch-ticket-stamp,
.scratch-ticket-kicker {
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.scratch-ticket-brand {
  color: #fff3a0;
  text-shadow: none;
}

.scratch-ticket-stamp {
  display: inline-flex;
  min-height: 20px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 7px;
  color: #6e4200;
  background: #ffd45a;
  box-shadow: none;
}

.scratch-ticket-copy {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  padding: 8px 10px 4px;
  border: 0;
  background: transparent;
  text-align: center;
}

.scratch-ticket-kicker {
  display: block;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 13px;
  font-weight: 750;
  text-shadow: none;
}

.scratch-ticket-copy strong {
  display: block;
  color: #f2c85f;
  font-size: clamp(27px, 8vw, 39px);
  line-height: 1;
  font-weight: 950;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(80, 6, 12, 0.24);
}

.scratch-pad {
  position: relative;
  z-index: 1;
  min-height: 154px;
  border: 2px solid rgba(242, 200, 95, 0.94);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(83, 7, 14, 0.3);
  box-shadow:
    0 12px 26px rgba(55, 7, 15, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.scratch-prize {
  position: absolute;
  inset: 14px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 13px;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(242, 200, 95, 0.12), transparent 34%),
    linear-gradient(180deg, #b91420 0%, #780d15 100%);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.scratch-coin {
  display: none;
  width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
  border: 4px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  color: #8c5200;
  background: linear-gradient(135deg, #fff7aa, #ffd45a 58%, #d98d00);
  font-size: 24px;
  font-weight: 950;
  text-shadow: none;
  box-shadow:
    inset -5px -7px 0 rgba(112, 72, 0, 0.16),
    0 8px 16px rgba(0, 0, 0, 0.12);
}

.scratch-prize strong {
  display: block;
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
}

.scratch-prize small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 850;
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  opacity: 1;
}

.game-scratch-voucher.is-playing .scratch-canvas {
  cursor: crosshair;
}

.scratch-ticket-foot {
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
  display: none;
}

.scratch-ticket-foot span {
  width: 38px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 212, 90, 0.48);
}

.game-scratch-voucher .game-overlay {
  z-index: 6;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 212, 90, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.3);
  backdrop-filter: none;
}

.game-scratch-voucher .game-overlay-panel {
  width: min(284px, 100%);
  padding: 16px 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 230, 0.88)),
    rgba(255, 255, 255, 0.88);
  box-shadow:
    0 14px 28px rgba(159, 17, 27, 0.16),
    0 0 0 6px rgba(255, 255, 255, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  text-align: center;
}

.game-scratch-voucher .game-overlay-panel h2 {
  margin: 6px 0 6px;
  color: var(--color-text);
  font-size: 25px;
  line-height: 1.05;
  font-weight: 950;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.72);
}

.game-scratch-voucher .game-overlay-panel p {
  margin: 0 0 12px;
  color: var(--color-muted-strong);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

.scratch-ready-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(180deg, #ff4450, #bc1620);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow:
    0 5px 0 rgba(188, 22, 32, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.scratch-ready-ticket {
  position: relative;
  width: 112px;
  height: 62px;
  margin: 10px auto 2px;
  border-radius: 15px;
  background:
    linear-gradient(90deg, transparent 0 10px, rgba(255, 255, 255, 0.72) 10px 16px, transparent 16px),
    linear-gradient(135deg, #ffe886, #ffb43d 46%, #e62129);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.48),
    0 10px 18px rgba(159, 17, 27, 0.16);
  transform: rotate(-3deg);
}

.scratch-ready-ticket::before,
.scratch-ready-ticket::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  transform: translateY(-50%);
}

.scratch-ready-ticket::before {
  left: -9px;
}

.scratch-ready-ticket::after {
  right: -9px;
}

.scratch-ready-coin {
  position: absolute;
  top: 13px;
  left: 17px;
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  background: linear-gradient(135deg, #fff7aa, #ffd45a 58%, #d98d00);
}

.scratch-ready-lines {
  position: absolute;
  top: 19px;
  right: 17px;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background:
    linear-gradient(#ffffff, #ffffff) 0 0 / 38px 6px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.76)) 0 14px / 28px 5px no-repeat;
}

.game-scratch-voucher:not(.is-playing):not(.is-countdown):not(.is-finished) .game-overlay {
  place-items: center;
  padding-top: 18px;
  padding-bottom: 28px;
}

.game-scratch-voucher [data-start] {
  min-width: 118px;
}

.game-scratch-voucher .countdown-value {
  color: #bc1620;
  text-shadow:
    0 3px 0 #ffd45a,
    0 7px 0 rgba(111, 11, 18, 0.18),
    0 0 22px rgba(255, 255, 255, 0.86);
}

.game-scratch-voucher:not(.is-playing) .scratch-stage-sheen,
.game-scratch-voucher:not(.is-playing) .scratch-ticket {
  display: none;
}

@media (max-width: 374px) {
  .portal-page.is-game-focus .mini-game-card:has(.game-scratch-voucher) {
    --game-card-play-min-height: 430px;
    --game-stage-play-min-height: 276px;
  }

  .game-scratch-voucher .game-stage {
    min-height: 268px;
    padding: 14px 12px 18px;
  }

  .portal-page.is-game-focus .game-scratch-voucher .game-stage {
    height: clamp(302px, calc(100svh - 292px), 348px);
    min-height: 302px;
  }

  @supports (height: 100dvh) {
    .portal-page.is-game-focus .game-scratch-voucher .game-stage {
      height: clamp(302px, calc(100dvh - 292px), 348px);
    }
  }

  .scratch-ticket {
    padding: 12px;
    border-radius: 18px;
  }

  .scratch-ticket-copy strong {
    font-size: 22px;
  }

  .scratch-pad {
    min-height: 134px;
  }

  .scratch-prize strong {
    font-size: 20px;
  }

  .scratch-coin {
    width: 44px;
    height: 44px;
    font-size: 21px;
  }

  .game-scratch-voucher .game-overlay-panel {
    width: min(264px, 100%);
    padding: 12px 14px 14px;
  }

  .game-scratch-voucher .game-overlay-panel h2 {
    margin: 4px 0 6px;
    font-size: 22px;
  }

  .game-scratch-voucher .game-overlay-panel p {
    margin-bottom: 10px;
    font-size: 12px;
  }

  .scratch-ready-ticket {
    width: 96px;
    height: 54px;
    margin-top: 8px;
  }

  .game-scratch-voucher [data-start] {
    min-width: 110px;
    min-height: 50px;
  }
}
