*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  position: relative;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background: linear-gradient(
    168deg,
    #030818 0%,
    #071233 18%,
    #0c1f55 42%,
    #0a2a6e 58%,
    #061a48 78%,
    #020510 100%
  );
  color: #f0f4ff;
}

/* —— Magical lottery-style backdrop —— */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-scene__glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 85% 55% at 50% -5%, rgba(120, 200, 255, 0.45), transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 100%, rgba(180, 80, 255, 0.22), transparent 50%),
    radial-gradient(ellipse 50% 40% at 10% 90%, rgba(255, 100, 180, 0.12), transparent 45%);
  opacity: 0.95;
}

.bg-scene__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  mix-blend-mode: screen;
  opacity: 0.55;
  animation: bg-orb-drift 14s ease-in-out infinite alternate;
}

.bg-scene__orb--1 {
  width: min(72vw, 420px);
  height: min(72vw, 420px);
  top: -8%;
  left: -12%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.75), rgba(100, 200, 255, 0.35) 40%, transparent 70%);
}

.bg-scene__orb--2 {
  width: min(55vw, 320px);
  height: min(55vw, 320px);
  bottom: 5%;
  right: -10%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 220, 140, 0.55), rgba(255, 120, 80, 0.25) 45%, transparent 68%);
  animation-delay: -4s;
  animation-duration: 18s;
}

.bg-scene__orb--3 {
  width: min(40vw, 240px);
  height: min(40vw, 240px);
  top: 38%;
  right: 8%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.5), rgba(180, 100, 255, 0.3) 50%, transparent 65%);
  opacity: 0.4;
  animation-delay: -7s;
  animation-duration: 20s;
}

.bg-scene__particles {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image:
    radial-gradient(2px 2px at 8% 15%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(2px 2px at 22% 42%, rgba(255, 240, 200, 0.85), transparent),
    radial-gradient(1.5px 1.5px at 38% 8%, rgba(200, 230, 255, 0.95), transparent),
    radial-gradient(2px 2px at 55% 28%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1.5px 1.5px at 72% 18%, rgba(255, 200, 255, 0.9), transparent),
    radial-gradient(2px 2px at 88% 35%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 12% 62%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(2px 2px at 45% 78%, rgba(255, 220, 160, 0.85), transparent),
    radial-gradient(1.5px 1.5px at 68% 88%, rgba(200, 255, 255, 0.75), transparent),
    radial-gradient(2px 2px at 92% 72%, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1.5px 1.5px at 30% 92%, rgba(255, 180, 220, 0.8), transparent),
    radial-gradient(2px 2px at 58% 52%, rgba(255, 255, 255, 0.5), transparent);
  animation: bg-sparkle 6s ease-in-out infinite alternate;
}

.bg-scene__stars {
  position: absolute;
  inset: 0;
  opacity: 0.9;
  background-image:
    radial-gradient(1px 1px at 5% 10%, #fff, transparent),
    radial-gradient(1px 1px at 15% 25%, #fff, transparent),
    radial-gradient(1px 1px at 25% 12%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1.2px 1.2px at 35% 38%, #fff, transparent),
    radial-gradient(1px 1px at 48% 6%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1px 1px at 62% 22%, #fff, transparent),
    radial-gradient(1px 1px at 78% 14%, rgba(255, 250, 220, 0.95), transparent),
    radial-gradient(1.2px 1.2px at 92% 28%, #fff, transparent),
    radial-gradient(1px 1px at 10% 48%, #fff, transparent),
    radial-gradient(1px 1px at 28% 55%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 42% 68%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 58% 48%, rgba(200, 235, 255, 0.9), transparent),
    radial-gradient(1px 1px at 72% 58%, #fff, transparent),
    radial-gradient(1px 1px at 88% 52%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1px 1px at 18% 78%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 52% 82%, rgba(255, 220, 180, 0.9), transparent),
    radial-gradient(1px 1px at 82% 88%, #fff, transparent),
    radial-gradient(1px 1px at 95% 65%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 3% 55%, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1.2px 1.2px at 65% 92%, #fff, transparent);
  animation: bg-twinkle 4.5s ease-in-out infinite alternate;
}

.bg-scene__texture {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: repeating-linear-gradient(
    -18deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.12) 2px,
    rgba(255, 255, 255, 0.12) 3px
  );
  mix-blend-mode: overlay;
}

.bg-scene__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 75% 70% at 50% 45%, transparent 35%, rgba(0, 4, 24, 0.5) 100%);
  box-shadow: inset 0 0 80px rgba(0, 0, 30, 0.65);
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  gap: clamp(6px, 1.5vh, 14px);
}

.app.game-ended .scratch-canvas {
  pointer-events: none;
  cursor: default;
}

.app.game-ended .cards {
  opacity: 0.9;
}

.header {
  text-align: center;
  flex-shrink: 0;
  width: 100%;
  max-width: min(920px, 96vw);
}

.branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.2vh, 12px);
  margin-bottom: 2px;
  transform: perspective(520px) rotateX(2deg);
  transform-style: preserve-3d;
}

.title {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.title--hero {
  position: relative;
  display: inline-block;
  line-height: 1.05;
  transform: rotate(-1.4deg) scale(1.03) perspective(480px) rotateX(4deg);
  transform-style: preserve-3d;
  filter:
    drop-shadow(0 3px 0 rgba(70, 0, 0, 0.65))
    drop-shadow(0 6px 0 rgba(50, 0, 0, 0.45))
    drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}

.title--hero::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  top: -22%;
  height: 62%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 28%,
    rgba(255, 255, 255, 0.65) 46%,
    rgba(255, 255, 255, 0.25) 54%,
    transparent 65%
  );
  border-radius: 45%;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.92;
  z-index: 2;
}

.title--hero::after {
  content: "";
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: -8%;
  height: 28%;
  background: radial-gradient(ellipse 80% 100% at 50% 0%, rgba(0, 0, 0, 0.22), transparent 72%);
  pointer-events: none;
  z-index: -1;
  filter: blur(2px);
}

.title__text {
  position: relative;
  z-index: 0;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0.02em;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transform-origin: center bottom;
  animation: title-arc-bounce 2.75s ease-in-out infinite;
}

.title__char {
  display: inline-block;
  position: relative;
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.55rem, 5.2vw + 0.32rem, 2.75rem);
  line-height: 1;
  transform: rotate(var(--title-char-rot, 0deg)) translateY(var(--title-char-y, 0px));
  transform-origin: 50% 85%;
  background: linear-gradient(
    188deg,
    #fffef8 0%,
    #fff4a8 14%,
    #ffe24a 36%,
    #ffb32a 58%,
    #ff8c22 78%,
    #ff6a12 100%
  );
  background-attachment: fixed;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 3px #a80812;
  paint-order: stroke fill;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55),
    0 2px 0 rgba(255, 220, 160, 0.35),
    0 2px 0 #b01018,
    0 3px 0 #8c0c14,
    0 4px 0 #6a0810,
    0 5px 0 #4c060c,
    0 6px 0 #340408,
    0 7px 0 #220204,
    0 8px 12px rgba(0, 0, 0, 0.55),
    0 0 18px rgba(255, 140, 40, 0.35);
}

@keyframes title-arc-bounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.045);
  }
}

.title-ribbon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  padding: 0.42em 1.35em 0.48em;
  transform: rotate(-0.6deg) perspective(320px) rotateX(8deg);
  filter: drop-shadow(0 5px 0 rgba(60, 0, 0, 0.35)) drop-shadow(0 10px 16px rgba(0, 0, 0, 0.45));
  background: linear-gradient(180deg, #ff5c5c 0%, #e01020 38%, #9a0610 100%);
  border-radius: 5px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    inset 0 -3px 0 rgba(0, 0, 0, 0.2);
  clip-path: polygon(0.65em 0, calc(100% - 0.65em) 0, 100% 50%, calc(100% - 0.65em) 100%, 0.65em 100%, 0 50%);
}

.title-ribbon__text {
  position: relative;
  z-index: 1;
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(0.62rem, 2.1vw + 0.28rem, 0.88rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.45),
    0 2px 4px rgba(0, 0, 0, 0.35);
  text-align: center;
  line-height: 1.2;
  max-width: min(92vw, 22rem);
}

@keyframes bg-orb-drift {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.45;
  }
  100% {
    transform: translate(14px, -10px) scale(1.06);
    opacity: 0.62;
  }
}

@keyframes bg-twinkle {
  0% {
    opacity: 0.55;
  }
  100% {
    opacity: 0.98;
  }
}

@keyframes bg-sparkle {
  0% {
    opacity: 0.38;
    transform: translateY(0);
  }
  100% {
    opacity: 0.62;
    transform: translateY(-5px);
  }
}

.subtitle {
  margin: 0.35em 0 0;
  font-size: clamp(0.75rem, 1.4vw + 0.42rem, 0.98rem);
  font-weight: 600;
  color: #e8f0ff;
  text-shadow:
    0 0 12px rgba(120, 200, 255, 0.45),
    0 1px 2px rgba(0, 0, 0, 0.6);
  opacity: 0.96;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: clamp(6px, 1.2vw, 12px);
  width: 100%;
  max-width: min(920px, 96vw);
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(72vh, 640px);
  align-content: stretch;
}

.scratch-card {
  --card-radius: clamp(12px, 2.4vw, 17px);
  position: relative;
  min-width: 0;
  min-height: 0;
  border-radius: var(--card-radius);
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(168deg, #1a2132 0%, #121722 55%, #0d1018 100%);
  border: 1px solid rgba(22, 38, 72, 0.95);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.06) inset,
    0 8px 22px rgba(0, 0, 0, 0.55),
    0 3px 8px rgba(0, 20, 50, 0.45),
    0 0 0 1px rgba(15, 25, 48, 0.9),
    0 0 24px rgba(70, 130, 220, 0.14);
  clip-path: polygon(
    0.4% 5%,
    2% 0.6%,
    18% 0%,
    42% 0.9%,
    62% 0%,
    82% 0.5%,
    98% 1.2%,
    100% 6%,
    99.6% 38%,
    100% 72%,
    98.5% 94%,
    88% 100%,
    50% 99.2%,
    14% 100%,
    2% 97%,
    0% 88%,
    0.6% 48%
  );
}

.scratch-card::before {
  content: "";
  position: absolute;
  inset: -5px;
  z-index: 0;
  pointer-events: none;
  border-radius: calc(var(--card-radius) + 3px);
  opacity: 0.55;
  background: radial-gradient(ellipse 70% 55% at 50% 120%, rgba(0, 0, 0, 0.5), transparent 55%);
  filter: blur(4px);
}

.scratch-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -18px 28px rgba(0, 0, 0, 0.28),
    inset 3px 3px 12px rgba(0, 0, 0, 0.12);
  background-image: repeating-linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.02) 0 1px,
    transparent 1px 4px
  );
  mix-blend-mode: soft-light;
}

.prize-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(4px, 1vw, 10px);
  font-size: clamp(0.62rem, 1.1vw + 0.35rem, 0.88rem);
  font-weight: 600;
  line-height: 1.25;
  color: #d8e2f0;
  background: radial-gradient(ellipse at 50% 30%, #2a3344 0%, #1c2230 70%);
  border-radius: inherit;
  z-index: 0;
}

.prize-layer__stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(3px, 0.8vw, 6px);
  max-width: 94%;
  max-height: 94%;
  min-height: 0;
}

.prize-layer__img {
  max-width: 96%;
  max-height: clamp(60px, 18vw, 130px);
  width: auto;
  height: auto;
  flex: 0 1 auto;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
}

.prize-layer__caption {
  flex: 0 0 auto;
  max-width: 100%;
  font-size: clamp(0.52rem, 1.6vw + 0.26rem, 0.76rem);
  font-weight: 600;
  line-height: 1.2;
  color: #c5d4ea;
  text-align: center;
  word-break: break-word;
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  z-index: 1;
  border-radius: inherit;
}

.scratch-canvas:active {
  cursor: grabbing;
}

.hint {
  margin: 0;
  font-size: clamp(0.7rem, 1vw + 0.4rem, 0.88rem);
  font-weight: 600;
  color: #dbe8ff;
  text-shadow: 0 0 14px rgba(100, 180, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.5);
  opacity: 0.92;
  text-align: center;
  flex-shrink: 0;
}

.footer {
  flex-shrink: 0;
  padding-bottom: 2px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 10px 24px;
  font-size: clamp(0.85rem, 1.2vw + 0.4rem, 1rem);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-restart {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(180, 210, 255, 0.12) 100%);
  color: #fff;
  border: 1px solid rgba(255, 220, 140, 0.45);
  box-shadow:
    0 4px 16px rgba(0, 40, 120, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-restart:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(200, 220, 255, 0.2) 100%);
  border-color: rgba(255, 230, 160, 0.65);
}

.btn-primary {
  background: linear-gradient(180deg, #5ad98a 0%, #3db86a 100%);
  color: #0d1f14;
  box-shadow: 0 4px 16px rgba(61, 184, 106, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(61, 184, 106, 0.45);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.modal__panel {
  position: relative;
  max-width: 400px;
  width: 100%;
  padding: clamp(24px, 5vw, 36px);
  border-radius: 16px;
  background: #2a3142;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.modal__heading {
  margin: 0 0 10px;
  font-size: clamp(1.15rem, 2.5vw + 0.5rem, 1.5rem);
  color: #fff;
}

.modal__lead {
  margin: 0 0 14px;
  font-size: clamp(0.9rem, 1.5vw + 0.45rem, 1.05rem);
  line-height: 1.45;
  opacity: 0.92;
}

.modal__prize-name {
  margin: 0 0 10px;
  font-size: clamp(1.05rem, 2vw + 0.5rem, 1.35rem);
  font-weight: 700;
  line-height: 1.4;
  color: #a8e6a8;
  min-height: 1em;
}

.modal__prize-name .modal__prize-img {
  max-width: 100%;
  max-height: min(200px, 38vh);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
}

.modal__prize-caption {
  margin: 10px 0 0;
  font-size: clamp(0.95rem, 1.6vw + 0.45rem, 1.15rem);
  font-weight: 700;
  line-height: 1.35;
  color: #a8e6a8;
}

.modal__prize-details {
  margin: 0 0 22px;
  font-size: clamp(0.88rem, 1.4vw + 0.4rem, 1rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
}

.modal__prize-details[hidden] {
  display: none;
}

.error-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: #5c2a2a;
  color: #ffc9c9;
  text-align: center;
  font-size: 0.9rem;
  z-index: 200;
}

.error-banner code {
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
}

@media (orientation: portrait) and (max-height: 720px) {
  .branding {
    transform: perspective(480px) rotateX(1deg);
  }

  .title__char {
    font-size: clamp(1.38rem, 4.8vw + 0.28rem, 2.15rem);
  }

  .cards {
    max-height: min(62vh, 520px);
  }

  .prize-layer {
    font-size: clamp(0.58rem, 2.2vw + 0.25rem, 0.8rem);
  }

  .prize-layer__img {
    max-height: clamp(50px, 15vw, 105px);
  }

  .prize-layer__caption {
    font-size: clamp(0.46rem, 2vw + 0.2rem, 0.7rem);
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .app {
    gap: 4px;
  }

  .branding {
    gap: 4px;
    transform: perspective(400px) rotateX(0deg);
  }

  .title--hero {
    transform: rotate(-0.8deg) scale(0.98) perspective(400px) rotateX(3deg);
  }

  .title__char {
    font-size: clamp(1.12rem, 3.2vw + 0.2rem, 1.65rem);
  }

  .title-ribbon {
    padding: 0.32em 1em 0.38em;
    transform: rotate(-0.4deg) perspective(260px) rotateX(4deg);
  }

  .title-ribbon__text {
    font-size: clamp(0.55rem, 1.8vw + 0.22rem, 0.72rem);
  }

  .cards {
    max-height: min(68vh, 380px);
    gap: 5px;
  }

  .prize-layer {
    font-size: clamp(0.55rem, 1vw + 0.3rem, 0.75rem);
    padding: 3px;
  }

  .prize-layer__img {
    max-height: clamp(42px, 13vw, 85px);
  }

  .prize-layer__stack {
    gap: 2px;
  }
}

/* 43" / kiosk-style displays: larger touch targets, bigger grid, readable from distance */
@media (min-width: 1920px) and (min-height: 900px) {
  .app {
    gap: clamp(16px, 2.2vh, 32px);
    padding: max(16px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right))
      max(20px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
  }

  .header {
    max-width: min(1480px, 92vw);
  }

  .branding {
    gap: clamp(12px, 1.8vh, 22px);
  }

  .title__char {
    font-size: clamp(2.35rem, 2.4vw + 0.6rem, 4.4rem);
    -webkit-text-stroke: 3.5px #a80812;
  }

  .title-ribbon {
    padding: 0.5em 1.85em 0.55em;
  }

  .title-ribbon__text {
    font-size: clamp(0.95rem, 1.1vw + 0.45rem, 1.35rem);
    max-width: min(88vw, 38rem);
  }

  .subtitle {
    font-size: clamp(1.05rem, 1.1vw + 0.55rem, 1.45rem);
    margin-top: 0.45em;
  }

  .cards {
    max-width: min(1280px, 88vw);
    max-height: min(78vh, 1020px);
    gap: clamp(14px, 1.4vw, 24px);
  }

  .scratch-card {
    --card-radius: clamp(16px, 1.1vw, 24px);
  }

  .prize-layer {
    font-size: clamp(0.78rem, 0.9vw + 0.35rem, 1.05rem);
    padding: clamp(8px, 1vw, 14px);
  }

  .prize-layer__img {
    max-height: clamp(80px, 18vh, 230px);
  }

  .prize-layer__caption {
    font-size: clamp(0.62rem, 0.85vw + 0.28rem, 0.92rem);
  }

  .hint {
    font-size: clamp(0.95rem, 0.95vw + 0.45rem, 1.2rem);
  }

  .btn {
    border-radius: 14px;
    padding: 16px 40px;
    font-size: clamp(1.05rem, 1vw + 0.5rem, 1.35rem);
  }

  .modal {
    padding: 32px;
  }

  .modal__panel {
    max-width: min(560px, 92vw);
    padding: clamp(32px, 4vw, 48px);
    border-radius: 20px;
  }

  .modal__heading {
    font-size: clamp(1.45rem, 2.2vw + 0.6rem, 2rem);
  }

  .modal__lead {
    font-size: clamp(1.05rem, 1.3vw + 0.45rem, 1.25rem);
  }

  .modal__prize-name .modal__prize-img {
    max-height: min(280px, 42vh);
  }

  .modal__prize-caption {
    font-size: clamp(1.05rem, 1.2vw + 0.45rem, 1.3rem);
  }

  .btn-primary {
    padding: 16px 36px;
    font-size: clamp(1.05rem, 1vw + 0.5rem, 1.25rem);
  }
}
