/* Chill Dude scatter-save — glass shatter + slow 3rd scatter reveal (Pragmatic-style) */

.screen-break-shake-active {
  will-change: transform, filter;
  filter: saturate(1.12) contrast(1.08);
}

.chill-glass-break {
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  animation: chill-glass-fade-in 0.35s ease-out forwards;
}

.chill-glass-break--out {
  animation: chill-glass-fade-out 0.52s ease-in forwards;
}

.chill-glass-break__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, transparent 28%, rgba(4, 8, 18, 0.35) 62%, rgba(0, 0, 0, 0.72) 100%),
    radial-gradient(circle at 50% 50%, rgba(255, 60, 60, 0.08), transparent 55%);
  opacity: 0;
}

.chill-glass-break--armed .chill-glass-break__vignette {
  animation: chill-vignette-pulse 5s ease-in-out forwards;
}

.chill-glass-break__flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 48% 42%, rgba(255, 255, 255, 0.95), rgba(255, 220, 120, 0.35) 28%, transparent 62%);
  opacity: 0;
  mix-blend-mode: screen;
}

.chill-glass-break--impact .chill-glass-break__flash {
  animation: chill-impact-flash 0.85s ease-out forwards;
}

.chill-glass-break__glass-pane {
  position: absolute;
  inset: -2%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 40%),
    linear-gradient(180deg, rgba(180, 220, 255, 0.08), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(1px) brightness(1.05);
  opacity: 0.85;
  transform: scale(1);
}

.chill-glass-break--impact .chill-glass-break__glass-pane {
  animation: chill-glass-pane-shatter 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.chill-glass-break__crack {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.45));
}

.chill-glass-break__crack path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.chill-glass-break__crack-main {
  stroke-width: 4.5;
}

.chill-glass-break__crack-fork-a,
.chill-glass-break__crack-fork-b,
.chill-glass-break__crack-fork-c {
  stroke-width: 2.8;
  opacity: 0.88;
}

.chill-glass-break--crack .chill-glass-break__crack-main {
  animation: chill-crack-draw 2.1s cubic-bezier(0.25, 0.8, 0.35, 1) forwards;
}

.chill-glass-break--crack .chill-glass-break__crack-fork-a {
  animation: chill-crack-draw 1.4s 0.55s cubic-bezier(0.25, 0.8, 0.35, 1) forwards;
}

.chill-glass-break--crack .chill-glass-break__crack-fork-b {
  animation: chill-crack-draw 1.5s 0.75s cubic-bezier(0.25, 0.8, 0.35, 1) forwards;
}

.chill-glass-break--crack .chill-glass-break__crack-fork-c {
  animation: chill-crack-draw 1.2s 0.95s cubic-bezier(0.25, 0.8, 0.35, 1) forwards;
}

.chill-glass-break__shards {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.chill-glass-break__shard {
  position: absolute;
  width: 28px;
  height: 36px;
  left: calc(10% + (var(--i) * 6.3%));
  top: calc(18% + (var(--i) * 3.5%));
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.55), rgba(180, 210, 255, 0.15));
  clip-path: polygon(20% 0%, 100% 10%, 80% 100%, 0% 80%);
  opacity: 0;
  transform: translate3d(0, 0, 0) rotate(0deg);
}

.chill-glass-break--impact .chill-glass-break__shard {
  animation: chill-shard-fly 1.35s calc(var(--i) * 40ms) cubic-bezier(0.15, 0.85, 0.25, 1) forwards;
}

.chill-glass-break__impact-burst {
  position: absolute;
  left: 46%;
  top: 38%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 180, 0.85), rgba(255, 120, 60, 0.2) 45%, transparent 70%);
  opacity: 0;
  transform: scale(0.2);
}

.chill-glass-break--impact .chill-glass-break__impact-burst {
  animation: chill-impact-burst 0.95s ease-out forwards;
}

.chill-glass-break__rays {
  position: absolute;
  inset: 0;
  background: conic-gradient(
    from 210deg at 50% 45%,
    transparent 0deg,
    rgba(255, 215, 90, 0.14) 18deg,
    transparent 36deg,
    rgba(255, 140, 60, 0.1) 54deg,
    transparent 72deg,
    rgba(255, 230, 140, 0.12) 92deg,
    transparent 120deg
  );
  opacity: 0;
  mix-blend-mode: screen;
}

.chill-glass-break--scatter .chill-glass-break__rays {
  animation: chill-rays-spin 3.2s linear forwards;
}

.chill-glass-break__scatter-portal {
  position: absolute;
  transform: translate(-50%, -50%) scale(0.35);
  opacity: 0;
  z-index: 3;
}

.chill-glass-break__scatter-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 210, 80, 0.75);
  box-shadow: 0 0 24px rgba(255, 180, 40, 0.45);
}

.chill-glass-break__scatter-ring--outer {
  width: 168px;
  height: 168px;
}

.chill-glass-break__scatter-ring--inner {
  width: 118px;
  height: 118px;
  border-color: rgba(255, 255, 255, 0.65);
}

.chill-glass-break__scatter-core {
  position: relative;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  left: 50%;
  top: 50%;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #ffe082 0%, #ff9800 42%, #e65100 100%);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.35) inset,
    0 0 40px rgba(255, 170, 40, 0.75),
    0 12px 28px rgba(0, 0, 0, 0.45);
}

.chill-glass-break__scatter-label {
  position: relative;
  z-index: 1;
  font: 900 0.72rem/1 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.14em;
  color: #2a1400;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.chill-glass-break__scatter-glow {
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 180, 0.55), transparent 68%);
  animation: chill-scatter-glow 1.8s ease-in-out infinite;
}

.chill-glass-break--scatter .chill-glass-break__scatter-portal {
  animation: chill-scatter-portal-reveal 2.95s cubic-bezier(0.16, 0.84, 0.22, 1) forwards;
}

.chill-glass-break--scatter .chill-glass-break__scatter-ring--outer {
  animation: chill-scatter-ring-pulse 2.4s ease-out forwards;
}

.chill-glass-break--scatter-locked .chill-glass-break__scatter-core {
  animation: chill-scatter-lock-pop 0.55s cubic-bezier(0.22, 1.2, 0.32, 1) forwards;
}

.chill-glass-break__message {
  position: absolute;
  left: 50%;
  bottom: 8%;
  transform: translate(-50%, 24px);
  width: min(92%, 640px);
  padding: 1.1rem 1.4rem 1.25rem;
  border-radius: 16px;
  text-align: center;
  opacity: 0;
  background: linear-gradient(180deg, rgba(18, 28, 52, 0.94), rgba(8, 12, 24, 0.98));
  border: 2px solid rgba(255, 196, 86, 0.55);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 42px rgba(255, 170, 40, 0.22);
}

.chill-glass-break__message-kicker {
  margin: 0 0 0.35rem;
  font: 700 0.72rem/1.2 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.22em;
  color: #ffb74d;
}

.chill-glass-break__message-title {
  margin: 0;
  font: 900 clamp(1.35rem, 3.2vw, 2rem)/1.1 'Segoe UI', system-ui, sans-serif;
  color: #fff8e7;
  text-shadow: 0 2px 18px rgba(255, 170, 40, 0.35);
}

.chill-glass-break__message-sub {
  margin: 0.55rem 0 0;
  font: 500 0.92rem/1.35 'Segoe UI', system-ui, sans-serif;
  color: rgba(226, 232, 240, 0.82);
}

.chill-glass-break--message .chill-glass-break__message {
  animation: chill-message-rise 0.75s cubic-bezier(0.22, 1.15, 0.32, 1) forwards;
}

@keyframes chill-glass-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes chill-glass-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes chill-vignette-pulse {
  0% { opacity: 0; }
  12% { opacity: 1; }
  100% { opacity: 0.92; }
}

@keyframes chill-impact-flash {
  0% { opacity: 0; transform: scale(0.85); }
  8% { opacity: 0.95; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.15); }
}

@keyframes chill-glass-pane-shatter {
  0% { opacity: 0.85; transform: scale(1); filter: blur(0); }
  35% { opacity: 0.65; transform: scale(1.01); filter: blur(0.5px); }
  100% { opacity: 0.08; transform: scale(1.03); filter: blur(2px); }
}

@keyframes chill-crack-draw {
  from { stroke-dashoffset: 1; opacity: 0.2; }
  20% { opacity: 1; }
  to { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes chill-shard-fly {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg) scale(0.6); }
  15% { opacity: 0.95; }
  100% {
    opacity: 0;
    transform: translate3d(calc(-30px + var(--i) * 8px), calc(120px + var(--i) * 14px), 0)
      rotate(calc(-40deg + var(--i) * 11deg)) scale(1);
  }
}

@keyframes chill-impact-burst {
  0% { opacity: 0; transform: scale(0.2); }
  18% { opacity: 1; transform: scale(1.35); }
  100% { opacity: 0; transform: scale(2.4); }
}

@keyframes chill-rays-spin {
  0% { opacity: 0; transform: rotate(0deg) scale(0.9); }
  20% { opacity: 0.75; }
  100% { opacity: 0.35; transform: rotate(28deg) scale(1.05); }
}

@keyframes chill-scatter-portal-reveal {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.35); filter: blur(6px); }
  18% { opacity: 0.35; transform: translate(-50%, -50%) scale(0.55); }
  55% { opacity: 0.92; transform: translate(-50%, -50%) scale(0.92); filter: blur(0); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes chill-scatter-ring-pulse {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  40% { opacity: 0.85; }
  100% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.15; }
}

@keyframes chill-scatter-glow {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.08); }
}

@keyframes chill-scatter-lock-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes chill-message-rise {
  from { opacity: 0; transform: translate(-50%, 28px) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .chill-glass-break--impact .chill-glass-break__flash,
  .chill-glass-break--impact .chill-glass-break__shard,
  .chill-glass-break--scatter .chill-glass-break__rays {
    animation-duration: 0.01ms !important;
  }
  .chill-glass-break--crack .chill-glass-break__crack-main,
  .chill-glass-break--crack .chill-glass-break__crack-fork-a,
  .chill-glass-break--crack .chill-glass-break__crack-fork-b,
  .chill-glass-break--crack .chill-glass-break__crack-fork-c {
    animation-duration: 0.4s !important;
  }
  .chill-glass-break--scatter .chill-glass-break__scatter-portal {
    animation-duration: 0.8s !important;
  }
}
