#screen-opening {
  background:
    repeating-linear-gradient(135deg, rgba(243, 189, 202, 0.48) 0 58px, rgba(189, 232, 207, 0.46) 58px 116px, rgba(200, 188, 229, 0.46) 116px 174px, rgba(255, 247, 199, 0.52) 174px 232px),
    linear-gradient(180deg, #fff7e7 0%, #f6dce8 52%, #ddf3ea 100%);
  user-select: none;
  -webkit-user-select: none;
}

.opening {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(8vh + env(safe-area-inset-top, 0px)) 20px 24px;
  min-height: 100dvh;
}

.opening__hint {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--paper-ink);
  margin-bottom: 12px;
  text-align: center;
}

.opening__progress {
  width: 80%;
  max-width: 280px;
  margin-bottom: 32px;
}

.opening__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.opening__stage.is-touching .box.steamer {
  transform: scale(0.985);
}

.opening__stage--disabled {
  cursor: default;
  pointer-events: none;
}

/* ── Steamer basket (vaporera) ── */
.box.steamer {
  --steam-intensity: 0;
  position: relative;
  width: 240px;
  height: 230px;
  transition: transform 0.1s;
  filter: drop-shadow(0 16px 24px rgba(111, 73, 93, 0.26));
}

.box--shake {
  animation: boxShake 0.15s ease-out;
}

.steamer--hot .steamer__knob {
  animation: knobWiggle 0.15s ease-out;
}

@keyframes boxShake {
  0% { transform: translate(0, 0) rotate(0); }
  20% { transform: translate(-5px, 2px) rotate(-2deg); }
  40% { transform: translate(4px, -2px) rotate(1.5deg); }
  60% { transform: translate(-3px, 1px) rotate(-1deg); }
  80% { transform: translate(2px, -1px) rotate(0.5deg); }
  100% { transform: translate(0, 0) rotate(0); }
}

@keyframes knobWiggle {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  50% { transform: translateX(-50%) rotate(4deg); }
}

/* Lid */
.box__lid.steamer__lid {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 112%;
  height: 72px;
  z-index: 5;
}

.steamer__knob {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 22px;
  z-index: 3;
}

.steamer__knob-loop {
  display: block;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(120, 85, 45, 0.35) 2px, rgba(120, 85, 45, 0.35) 3px),
    linear-gradient(180deg, #f5e0bc 0%, #ddb882 45%, #c49a62 100%);
  border-radius: 50%;
  box-shadow:
    0 3px 6px rgba(0, 0, 0, 0.25),
    inset 0 1px 3px rgba(255, 255, 255, 0.5);
}

.steamer__knob-loop::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 8px;
  background: rgba(130, 90, 50, 0.3);
  border-radius: 50%;
}

.steamer__weave {
  position: absolute;
  top: 14px;
  left: 0;
  width: 100%;
  height: 50px;
  background-color: #ddb882;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent 0,
      transparent 4px,
      rgba(110, 75, 40, 0.22) 4px,
      rgba(110, 75, 40, 0.22) 5px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent 0,
      transparent 4px,
      rgba(110, 75, 40, 0.22) 4px,
      rgba(110, 75, 40, 0.22) 5px
    ),
    radial-gradient(ellipse 95% 80% at 50% 15%, #f8ecd8 0%, #edd5ae 25%, #ddb882 60%, #c49a62 100%);
  border-radius: 50% 50% 12px 12px / 40% 40% 12px 12px;
  box-shadow:
    inset 0 3px 8px rgba(255, 255, 255, 0.4),
    inset 0 -4px 8px rgba(0, 0, 0, 0.12),
    0 4px 10px rgba(0, 0, 0, 0.2);
}

.steamer__lid-skirt {
  position: absolute;
  bottom: 0;
  left: 2%;
  width: 96%;
  height: 18px;
  background: linear-gradient(180deg, #c49a62, #b08850);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.steamer__lid-skirt::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: -2%;
  width: 104%;
  height: 8px;
  background: linear-gradient(180deg, #b08850, #9a7544);
  border-radius: 0 0 6px 6px;
}

.box__lid--fly {
  animation: lidFly 0.75s var(--ease-bounce) forwards;
}

@keyframes lidFly {
  0% { transform: translateX(-50%) translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-140px) rotate(-18deg); opacity: 0; }
}

/* Base */
.box__body.steamer__base {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 168px;
  border-radius: 8px 8px 22px 22px;
  overflow: visible;
}

.steamer__rim {
  position: absolute;
  top: 0;
  left: -4%;
  width: 108%;
  height: 16px;
  background: linear-gradient(180deg, #f5e0bc, #ddb882 50%, #c49a62);
  border-radius: 6px 6px 0 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  z-index: 4;
}

.steamer__rim::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(100, 70, 35, 0.45);
}

.steamer__wall {
  position: absolute;
  top: 14px;
  left: 0;
  width: 100%;
  height: calc(100% - 14px);
  border-radius: 0 0 22px 22px;
  overflow: hidden;
  background: linear-gradient(90deg, #9a7544 0%, #c49a62 12%, #ddb882 50%, #c49a62 88%, #9a7544 100%);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.35),
    inset 0 0 16px rgba(0, 0, 0, 0.1);
}

.steamer__slats {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      #edd5ae 0px,
      #edd5ae 14px,
      #c49a62 14px,
      #c49a62 16px,
      #ddb882 16px,
      #ddb882 30px,
      #b08850 30px,
      #b08850 32px
    );
  opacity: 0.92;
}

.steamer__slats::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0,
    transparent 11px,
    rgba(90, 60, 30, 0.18) 11px,
    rgba(90, 60, 30, 0.18) 13px
  );
}

.steamer__slats::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0%, transparent 15%, transparent 85%, rgba(0, 0, 0, 0.12) 100%);
}

.steamer__bottom-band {
  position: absolute;
  bottom: 0;
  left: -2%;
  width: 104%;
  height: 14px;
  background: linear-gradient(180deg, #b08850, #8a6538);
  border-radius: 0 0 22px 22px;
  z-index: 3;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.15);
}

/* Interior — mystery only, no dumpling spoiler */
.steamer__interior {
  position: absolute;
  top: 20px;
  left: 8%;
  width: 84%;
  height: calc(100% - 34px);
  background:
    repeating-linear-gradient(90deg, rgba(237, 213, 174, 0.65) 0 16px, rgba(196, 154, 98, 0.58) 16px 18px),
    linear-gradient(180deg, #e8c897 0%, #caa36b 100%);
  border-radius: 0 0 14px 14px;
  overflow: hidden;
  z-index: 2;
  --steam-intensity: 0;
}

.box__inner-glow {
  position: absolute;
  inset: 0;
  background: transparent;
  animation: innerPulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes innerPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Steam wisps — no dumpling visible */
.box__steam {
  position: absolute;
  bottom: 20%;
  width: 28px;
  height: 50px;
  background: transparent;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0;
  animation: steamRise 2.5s ease-in-out infinite;
  pointer-events: none;
}

.box__steam--1 { left: 25%; animation-delay: 0s; }
.box__steam--2 { left: 48%; animation-delay: 0.8s; width: 36px; height: 60px; }
.box__steam--3 { left: 62%; animation-delay: 1.4s; }

.box__mystery--active .box__steam {
  animation-duration: 1.2s;
  opacity: 0;
}

.box__mystery--burst .box__steam {
  animation: steamBurst 0.6s ease-out forwards;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.5), rgba(255, 215, 107, 0.18) 48%, transparent 72%);
  opacity: 0.8;
}

@keyframes steamRise {
  0% { transform: translateY(0) scale(0.8); opacity: 0.2; }
  50% { transform: translateY(-20px) scale(1.1); opacity: 0.5; }
  100% { transform: translateY(-40px) scale(0.9); opacity: 0; }
}

@keyframes steamBurst {
  0% { transform: translateY(0) scale(1); opacity: 0.7; }
  100% { transform: translateY(-80px) scale(1.5); opacity: 0; }
}

/* Particles — steam puffs */
.opening__particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: particleBurst 0.8s ease-out forwards;
}

.particle--steam {
  width: 14px;
  height: 14px;
  background: rgba(19, 242, 208, 0.28);
  filter: blur(4px);
}

@keyframes particleBurst {
  0% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  100% { transform: translate(var(--tx), var(--ty)) scale(1.8); opacity: 0; }
}

/* Reveal overlay */
.opening__reveal {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(135deg, rgba(243, 189, 202, 0.5) 0 58px, rgba(189, 232, 207, 0.46) 58px 116px, rgba(200, 188, 229, 0.46) 116px 174px, rgba(255, 247, 199, 0.54) 174px 232px),
    rgba(255, 250, 240, 0.96);
  z-index: 10;
  padding: 24px;
}

.opening__reveal:not(.hidden) {
  display: flex;
  animation: fadeIn 0.4s var(--ease-smooth);
}

.opening__flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.64), transparent 60%);
  animation: flashFade 0.8s ease-out forwards;
  pointer-events: none;
}

@keyframes flashFade {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.opening__dumpling-wrap {
  position: relative;
  z-index: 2;
  margin-bottom: 24px;
}

.opening__banner {
  text-align: center;
  margin-bottom: 24px;
  z-index: 2;
}

.opening__name {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #111111;
  margin-bottom: 8px;
}

.opening__status {
  display: block;
  font-size: 1rem;
  color: #111111;
  font-weight: 700;
}

.opening__status--new {
  color: var(--mint-green);
  font-weight: 600;
}

.opening__status--duplicate {
  color: #111111;
}

.opening__reveal--normal {
  background:
    radial-gradient(circle at 50% 42%, rgba(243, 189, 202, 0.36), transparent 34%),
    repeating-linear-gradient(135deg, rgba(243, 189, 202, 0.48) 0 58px, rgba(189, 232, 207, 0.46) 58px 116px, rgba(200, 188, 229, 0.44) 116px 174px, rgba(255, 247, 199, 0.52) 174px 232px);
}

.opening__reveal--raro {
  background:
    radial-gradient(circle at 50% 42%, rgba(19, 242, 208, 0.28), transparent 30%),
    radial-gradient(circle at 50% 48%, rgba(157, 53, 255, 0.18), transparent 45%),
    repeating-linear-gradient(135deg, rgba(243, 189, 202, 0.44) 0 58px, rgba(189, 232, 207, 0.48) 58px 116px, rgba(200, 188, 229, 0.48) 116px 174px, rgba(255, 247, 199, 0.5) 174px 232px);
}

.opening__reveal--legendario {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 215, 107, 0.42), transparent 30%),
    radial-gradient(circle at 50% 48%, rgba(157, 53, 255, 0.18), transparent 44%),
    repeating-linear-gradient(135deg, rgba(243, 189, 202, 0.44) 0 58px, rgba(189, 232, 207, 0.44) 58px 116px, rgba(200, 188, 229, 0.46) 116px 174px, rgba(255, 247, 199, 0.54) 174px 232px);
}

.opening__reveal--legendario .opening__flash {
  background: radial-gradient(circle at 50% 45%, rgba(255, 236, 168, 0.86), rgba(157, 53, 255, 0.2) 34%, transparent 64%);
}

.opening__reveal--mitico {
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 215, 107, 0.32), transparent 26%),
    radial-gradient(circle at 44% 46%, rgba(19, 242, 208, 0.3), transparent 34%),
    radial-gradient(circle at 58% 50%, rgba(157, 53, 255, 0.24), transparent 42%),
    repeating-linear-gradient(135deg, rgba(243, 189, 202, 0.44) 0 58px, rgba(189, 232, 207, 0.46) 58px 116px, rgba(200, 188, 229, 0.46) 116px 174px, rgba(255, 247, 199, 0.52) 174px 232px);
}

.opening__reveal--mitico .opening__flash {
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.92), rgba(19, 242, 208, 0.24) 28%, rgba(157, 53, 255, 0.18) 48%, transparent 66%);
}

.opening__continue {
  z-index: 2;
  min-width: 160px;
}

.opening__collection-progress {
  width: min(280px, 78vw);
  margin: 12px auto 0;
  color: var(--paper-ink);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 250, 240, 0.78);
  border: 1px solid rgba(154, 100, 61, 0.18);
  box-shadow: 0 8px 20px rgba(111, 73, 93, 0.12);
}

.opening__collection-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.opening__collection-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(154, 100, 61, 0.2);
}

/* Confetti */
.opening__confetti,
.victory__confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -10px;
  animation: confettiFall 2.5s ease-in forwards;
}

.star-piece {
  position: absolute;
  font-size: clamp(1rem, 4vw, 2rem);
  line-height: 1;
  text-shadow: 0 0 10px currentColor;
  animation: starPop 1.8s cubic-bezier(0.18, 0.8, 0.22, 1) forwards;
  transform: translate(-50%, -50%);
}

@keyframes starPop {
  0% { transform: translate(-50%, -50%) scale(0.15) rotate(0); opacity: 0; }
  18% { opacity: 1; }
  68% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--star-x)), calc(-50% + var(--star-y))) scale(1.35) rotate(220deg); opacity: 0; }
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
