.game-open-the-locker {
  --locker-stage-art: none;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.portal-page.is-game-focus .mini-game-card:has(.game-open-the-locker) {
  --game-card-play-min-height: 452px;
  --game-card-play-max-height: 780px;
  --game-stage-play-min-height: 300px;
}

.game-open-the-locker .game-stage {
  min-height: 280px;
  border-top: 1px solid rgba(255, 255, 255, 0.72);
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 214, 94, 0.22), transparent 23%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(30, 22, 36, 0.1) 48%, rgba(30, 22, 36, 0.26)),
    var(--locker-stage-art) center / cover no-repeat,
    linear-gradient(180deg, #fff3e1, #24182a);
  box-shadow:
    inset 0 10px 18px rgba(255, 255, 255, 0.2),
    inset 0 -18px 28px rgba(30, 22, 36, 0.28);
}

.game-open-the-locker .game-stage::before {
  z-index: 0;
  inset: auto 12% 24px;
  height: 28px;
  border-radius: 999px;
  background: rgba(23, 11, 26, 0.38);
  filter: blur(18px);
}

.game-open-the-locker .game-stage::after {
  z-index: 1;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 214, 94, 0.22), transparent 17%),
    radial-gradient(circle at 84% 14%, rgba(255, 255, 255, 0.22), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 58%, rgba(23, 11, 26, 0.16));
}

.portal-page.is-game-focus .game-open-the-locker .game-stage {
  height: clamp(292px, calc(100svh - 330px), 380px);
  min-height: 292px;
}

@supports (height: 100dvh) {
  .portal-page.is-game-focus .game-open-the-locker .game-stage {
    height: clamp(292px, calc(100dvh - 330px), 380px);
  }
}

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

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

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

.game-open-the-locker.is-finished .game-stage {
  height: auto;
  min-height: 0;
  background: #ffffff;
}

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

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

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

.locker-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(86%, 410px);
  padding: 18px;
  border: 2px solid rgba(255, 214, 94, 0.72);
  border-radius: 26px;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(180deg, #fa3d47 0%, #cd111d 38%, #5a0710 100%);
  box-shadow:
    0 28px 42px rgba(23, 11, 26, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -14px 22px rgba(23, 4, 8, 0.32);
  transform: translate(-50%, -50%);
}

.locker-panel::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 20px;
  background: linear-gradient(120deg, transparent 0 42%, rgba(255, 255, 255, 0.12) 48%, transparent 56%);
  pointer-events: none;
}

.locker-display {
  min-height: 104px;
  padding: 14px 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.16)),
    #2a1520;
  text-align: center;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.22);
}

.locker-display span,
.locker-display small {
  display: block;
  color: #ffe58f;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.locker-display strong {
  display: block;
  margin: 10px 0 6px;
  color: #ffffff;
  font-size: clamp(26px, 8vw, 42px);
  line-height: 1;
  font-weight: 950;
  word-spacing: 4px;
  text-shadow: 0 0 18px rgba(255, 214, 94, 0.22);
}

.locker-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.locker-keypad button {
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 36%),
    linear-gradient(180deg, #ff4a55, #ba101b);
  font-size: 24px;
  font-weight: 950;
  box-shadow:
    0 4px 0 #7c0c14,
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  touch-action: manipulation;
}

.locker-keypad button:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 #7c0c14,
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.locker-light {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffd65e;
  box-shadow: 0 0 20px rgba(255, 214, 94, 0.72);
}

.game-open-the-locker.is-unlocked .locker-light {
  background: #31d184;
  box-shadow: 0 0 22px rgba(49, 209, 132, 0.72);
}

.game-open-the-locker.is-unlocked .locker-panel {
  box-shadow:
    0 28px 42px rgba(23, 11, 26, 0.36),
    0 0 30px rgba(49, 209, 132, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -14px 22px rgba(23, 4, 8, 0.32);
}

.game-open-the-locker.is-error .locker-light {
  background: #ffffff;
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.72);
}

.game-open-the-locker .game-overlay {
  z-index: 6;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.58), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(23, 11, 26, 0.2));
  backdrop-filter: none;
}

.game-open-the-locker .game-overlay-panel {
  width: min(284px, 100%);
  padding: 16px 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 248, 230, 0.86)),
    rgba(255, 255, 255, 0.9);
  box-shadow:
    0 14px 28px rgba(23, 11, 26, 0.2),
    0 0 0 6px rgba(255, 255, 255, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.locker-ready-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 11px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(180deg, #ff4450, #bc1620);
  font-size: 11px;
  font-weight: 900;
}

.locker-ready-art {
  position: relative;
  width: 118px;
  height: 82px;
  margin: 9px auto 3px;
  border: 2px solid #ffd65e;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 16%, #fff3ae 0 5px, #d79610 6px 8px, transparent 9px),
    radial-gradient(circle at 12% 16%, #d9edf7 0 2px, #426476 3px 4px, transparent 5px),
    radial-gradient(circle at 12% 84%, #d9edf7 0 2px, #426476 3px 4px, transparent 5px),
    radial-gradient(circle at 68% 16%, #d9edf7 0 2px, #426476 3px 4px, transparent 5px),
    radial-gradient(circle at 68% 84%, #d9edf7 0 2px, #426476 3px 4px, transparent 5px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 8%, transparent 8% 72%, rgba(18, 39, 51, 0.38) 72% 100%),
    linear-gradient(180deg, #5f8da2 0%, #2d6077 54%, #173647 100%);
  box-shadow:
    0 14px 22px rgba(23, 11, 26, 0.18),
    inset 0 2px 0 rgba(255, 255, 255, 0.34),
    inset 0 -12px 18px rgba(10, 26, 36, 0.28);
}

.locker-ready-art::before {
  position: absolute;
  top: 13px;
  left: 16px;
  width: 54px;
  height: 54px;
  border: 2px solid rgba(255, 214, 94, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle, #ffd65e 0 6px, #8b5209 7px 9px, transparent 10px),
    conic-gradient(from 22deg, transparent 0 8%, rgba(255, 214, 94, 0.96) 8% 14%, transparent 14% 25%, rgba(255, 214, 94, 0.96) 25% 31%, transparent 31% 42%, rgba(255, 214, 94, 0.96) 42% 48%, transparent 48% 59%, rgba(255, 214, 94, 0.96) 59% 65%, transparent 65% 76%, rgba(255, 214, 94, 0.96) 76% 82%, transparent 82% 100%),
    radial-gradient(circle, #9fc1d2 0 47%, #365d70 48% 62%, #132c3a 63% 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.38),
    0 7px 12px rgba(10, 26, 36, 0.22);
  content: "";
}

.locker-ready-art::after {
  position: absolute;
  top: 24px;
  right: 12px;
  width: 28px;
  height: 38px;
  border: 1px solid rgba(255, 214, 94, 0.56);
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 24%, #ffe58f 0 2px, transparent 3px),
    radial-gradient(circle at 70% 24%, #ffe58f 0 2px, transparent 3px),
    radial-gradient(circle at 30% 50%, #ffe58f 0 2px, transparent 3px),
    radial-gradient(circle at 70% 50%, #ffe58f 0 2px, transparent 3px),
    radial-gradient(circle at 30% 76%, #ffe58f 0 2px, transparent 3px),
    radial-gradient(circle at 70% 76%, #31d184 0 2px, transparent 3px),
    linear-gradient(180deg, rgba(15, 32, 42, 0.48), rgba(9, 19, 26, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    -6px 0 0 rgba(11, 28, 39, 0.18);
  content: "";
}

@media (max-width: 340px), (max-height: 620px) {
  .locker-panel {
    width: min(90%, 360px);
    padding: 14px;
    border-radius: 22px;
  }

  .locker-display {
    min-height: 82px;
    padding: 10px;
    border-radius: 15px;
  }

  .locker-display strong {
    margin: 7px 0 4px;
    font-size: 24px;
  }

  .locker-keypad {
    gap: 8px;
    margin-top: 10px;
  }

  .locker-keypad button {
    min-height: 44px;
    border-radius: 12px;
    font-size: 21px;
  }
}
