/* Bonus purchase: frost closes in, cracks radiate from 20, eight shards open. */
@property --frost-gap {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 80%;
}

.bonus-transition-overlay.ice-entry {
  padding: 0;
  overflow: hidden;
  background: transparent;
  transition: none;
  pointer-events: auto;
}
.ice-entry .bonus-transition-text { display: none; }
.ice-entry-scene, .ice-sheet, .ice-shard, .ice-cracks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ice-entry-scene { overflow: hidden; }
.ice-sheet {
  --frost-gap: 80%;
  mask-image: radial-gradient(ellipse at center, transparent var(--frost-gap), #000 calc(var(--frost-gap) + 14%));
  -webkit-mask-image: radial-gradient(ellipse at center, transparent var(--frost-gap), #000 calc(var(--frost-gap) + 14%));
  animation: ice-freeze-in 650ms cubic-bezier(.2,.7,.2,1) both;
}
.ice-shard {
  background: #8dbbd0 url('assets/ui/bonus-frost.png') center / 100% 100% no-repeat;
  opacity: .91;
  animation: ice-shard-break 450ms cubic-bezier(.3,0,.7,.4) 1350ms both;
  will-change: transform, opacity;
}
.ice-cracks { overflow: visible; animation: ice-cracks-away 180ms ease 1370ms both; }
.ice-crack-lines {
  fill: none;
  stroke: #eefcff;
  stroke-width: .22;
  stroke-linejoin: bevel;
  stroke-linecap: round;
}
.ice-crack-lines path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: ice-crack-grow 360ms ease-out 900ms both;
}
.ice-title {
  position: absolute;
  left: 50%;
  top: 48%;
  width: min(88vw, 620px);
  transform: translate(-50%, -50%);
  color: #e9fbff;
  font-family: Impact, 'Arial Narrow Bold', 'Franklin Gothic Bold', sans-serif;
  line-height: .95;
  animation: ice-title-reveal 1800ms linear both;
}
.ice-title strong {
  display: block;
  font-size: clamp(120px, min(30vw, 34vh), 300px);
  font-weight: 900;
  background: linear-gradient(155deg, #fff 10%, #c6eeff 28%, #6eb1d2 46%, #f5ffff 51%, #a9dff3 70%, #548dad);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1.5px #dcf7ff;
  filter: drop-shadow(0 5px 0 #275873) drop-shadow(0 9px 14px #082e5277);
}
.ice-title span {
  display: block;
  margin-top: 14px;
  font-size: clamp(24px, min(6.8vw, 8vh), 58px);
  letter-spacing: .08em;
  text-shadow: 0 3px 0 #28556e, 0 5px 14px #12364f;
}
@keyframes ice-freeze-in {
  from { --frost-gap: 80%; }
  to { --frost-gap: -15%; }
}
@keyframes ice-crack-grow { to { stroke-dashoffset: 0; } }
@keyframes ice-cracks-away { to { opacity: 0; } }
@keyframes ice-shard-break {
  0% { transform: translate(0, 0) rotate(0); opacity: .91; }
  100% { transform: translate(var(--shard-x), var(--shard-y)) rotate(var(--shard-turn)); opacity: 0; }
}
@keyframes ice-title-reveal {
  0%, 12% { opacity: 0; transform: translate(-50%, -50%) scale(.92); }
  34%, 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  90%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .ice-sheet { animation: none; mask-image: none; -webkit-mask-image: none; }
  .ice-shard { animation: none; will-change: auto; }
  .ice-cracks { display: none; }
  .ice-title { animation: none; }
}
