/* ═══════════════════════════════════════════════════
   Oficjalne odliczanie — Lubelski OTS 7.6
   ═══════════════════════════════════════════════════ */

.ots-cd {
  --cd-gold: #e8c56a;
  --cd-gold-bright: #ffe9a8;
  --cd-wood: #2b140a;
  --cd-wood-deep: #1a0d07;
  --cd-ink: #f3e6c8;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 0 18px;
  padding: 22px 28px 20px;
  text-align: center;
  border-radius: 4px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 90% at 50% 0%, rgba(232, 197, 106, 0.18), transparent 55%),
    linear-gradient(180deg, #4a210d 0%, #2b140a 52%, #1a0d07 100%);
  border: 1px solid #1a0d07;
  box-shadow:
    0 0 0 1px #8a4b1f,
    0 0 0 2px #1a0d07,
    0 4px 16px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(243, 214, 162, 0.22),
    inset 0 -2px 10px rgba(0, 0, 0, 0.45);
}

.ots-cd::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(216, 163, 90, 0.3);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}

/* Scena z outfitami — w środku ramki, bez wychodzenia */
.ots-cd__stage {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
  border-radius: 4px;
}

.ots-cd__actor {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: 0;
  transform: translate(-50%, -50%);
  will-change: left, top;
}

.ots-cd__outfit {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.8));
}

/* Dymek nad outfitem */
.ots-cd__say {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%) translateY(4px) scale(0.85);
  z-index: 5;
  white-space: nowrap;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #1a0d07;
  background: linear-gradient(180deg, #ffe9a8 0%, #e8c56a 100%);
  border: 1px solid #8a4b1f;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.ots-cd__say::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: #e8c56a;
}

.ots-cd__say.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.ots-cd.is-launched .ots-cd__stage {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s;
}

.ots-cd.is-gone {
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
  border-width: 0;
  box-shadow: none;
  transition:
    max-height 0.7s ease,
    opacity 0.55s ease,
    margin 0.7s ease,
    padding 0.7s ease;
}

.ots-cd__kicker {
  position: relative;
  z-index: 2;
  display: block;
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cd-gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.ots-cd__title {
  position: relative;
  z-index: 2;
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cd-gold-bright);
  text-shadow:
    0 0 18px rgba(232, 197, 106, 0.45),
    0 2px 0 #1a0d07,
    0 3px 6px rgba(0, 0, 0, 0.75);
}

.ots-cd__date {
  position: relative;
  z-index: 2;
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--cd-ink);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.ots-cd__date span {
  color: var(--cd-gold);
}

.ots-cd__boxes {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.ots-cd__box {
  min-width: 72px;
  padding: 10px 12px 8px;
  background: rgba(10, 6, 3, 0.72);
  border: 1px solid rgba(232, 197, 106, 0.55);
  border-radius: 4px;
  box-shadow:
    0 0 12px rgba(232, 197, 106, 0.12),
    inset 0 0 14px rgba(0, 0, 0, 0.45);
}

.ots-cd__num {
  display: block;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.25),
    0 2px 3px rgba(0, 0, 0, 0.9);
}

.ots-cd__lbl {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cd-gold);
}

.ots-cd__pulse .ots-cd__num {
  animation: otsCdTick 1s ease-in-out infinite;
}

@keyframes otsCdTick {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.92; }
}

/* ── Stan po starcie ── */

.ots-cd.is-launched .ots-cd__boxes {
  display: none;
}

.ots-cd__launch {
  position: relative;
  z-index: 3;
  display: none;
  padding: 10px 8px 6px;
}

.ots-cd.is-launched .ots-cd__launch {
  display: block;
  animation: otsCdLaunchIn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.ots-cd__launch-text {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 0 20px rgba(255, 200, 80, 0.9),
    0 0 40px rgba(255, 80, 40, 0.65),
    0 3px 0 #5a1a00,
    0 4px 10px rgba(0, 0, 0, 0.85);
  animation: otsCdTextGlow 1.4s ease-in-out infinite alternate;
}

@keyframes otsCdLaunchIn {
  0% { transform: scale(0.2) rotate(-6deg); opacity: 0; }
  60% { transform: scale(1.12) rotate(1deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes otsCdTextGlow {
  from {
    filter: brightness(1);
    text-shadow:
      0 0 18px rgba(255, 200, 80, 0.85),
      0 0 36px rgba(255, 80, 40, 0.55),
      0 3px 0 #5a1a00;
  }
  to {
    filter: brightness(1.15);
    text-shadow:
      0 0 28px rgba(255, 230, 120, 1),
      0 0 55px rgba(255, 60, 20, 0.8),
      0 3px 0 #5a1a00;
  }
}

/* ── Warstwa wybuchów / fajerwerków ── */

.ots-cd__fx {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  border-radius: 4px;
}

.ots-cd__burst {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2);
}

.ots-cd.is-bursting .ots-cd__burst {
  animation: otsCdBurst 1.1s ease-out forwards;
}

.ots-cd .ots-cd__burst:nth-child(3) { left: 18%; top: 35%; background: #ffcf4d; }
.ots-cd .ots-cd__burst:nth-child(4) { left: 50%; top: 22%; background: #ff5a2a; }
.ots-cd .ots-cd__burst:nth-child(5) { left: 82%; top: 38%; background: #ffe9a8; }
.ots-cd .ots-cd__burst:nth-child(6) { left: 30%; top: 70%; background: #ff8a3d; }
.ots-cd .ots-cd__burst:nth-child(7) { left: 70%; top: 68%; background: #ffd76a; }
.ots-cd .ots-cd__burst:nth-child(8) { left: 45%; top: 55%; background: #fff; }
.ots-cd .ots-cd__burst:nth-child(9) { left: 12%; top: 58%; background: #ffb347; }
.ots-cd .ots-cd__burst:nth-child(10) { left: 88%; top: 60%; background: #ff6b3d; }

.ots-cd.is-bursting .ots-cd__burst:nth-child(3) { animation-delay: 0s; }
.ots-cd.is-bursting .ots-cd__burst:nth-child(4) { animation-delay: 0.08s; }
.ots-cd.is-bursting .ots-cd__burst:nth-child(5) { animation-delay: 0.15s; }
.ots-cd.is-bursting .ots-cd__burst:nth-child(6) { animation-delay: 0.22s; }
.ots-cd.is-bursting .ots-cd__burst:nth-child(7) { animation-delay: 0.3s; }
.ots-cd.is-bursting .ots-cd__burst:nth-child(8) { animation-delay: 0.12s; }
.ots-cd.is-bursting .ots-cd__burst:nth-child(9) { animation-delay: 0.35s; }
.ots-cd.is-bursting .ots-cd__burst:nth-child(10) { animation-delay: 0.4s; }

@keyframes otsCdBurst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.3);
    box-shadow:
      0 0 0 0 currentColor,
      0 0 0 0 transparent,
      14px -18px 0 -2px #ffcf4d,
      -16px -12px 0 -2px #ff5a2a,
      20px 8px 0 -2px #ffe9a8,
      -18px 14px 0 -2px #ff8a3d,
      8px 22px 0 -2px #fff,
      -10px -24px 0 -2px #ffd76a,
      24px -6px 0 -2px #ffb347,
      -24px 4px 0 -2px #ff6b3d;
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.8);
    box-shadow:
      0 0 40px 18px rgba(255, 180, 60, 0.35),
      0 0 80px 36px rgba(255, 80, 20, 0.15),
      42px -54px 0 -4px transparent,
      -48px -36px 0 -4px transparent,
      60px 24px 0 -4px transparent,
      -54px 42px 0 -4px transparent,
      24px 66px 0 -4px transparent,
      -30px -72px 0 -4px transparent,
      72px -18px 0 -4px transparent,
      -72px 12px 0 -4px transparent;
  }
}

.ots-cd__shockwave {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  border: 3px solid rgba(255, 210, 100, 0.85);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.ots-cd.is-bursting .ots-cd__shockwave {
  animation: otsCdShock 0.9s ease-out forwards;
}

.ots-cd .ots-cd__shockwave:nth-child(2) {
  border-color: rgba(255, 90, 40, 0.7);
}

.ots-cd.is-bursting .ots-cd__shockwave:nth-child(2) {
  animation-delay: 0.25s;
}

@keyframes otsCdShock {
  0% {
    opacity: 0.95;
    transform: scale(0.4);
  }
  100% {
    opacity: 0;
    transform: scale(18);
  }
}

.ots-cd.is-launched {
  animation: otsCdFlash 0.55s ease-out;
  box-shadow:
    0 0 0 1px #d8a35a,
    0 0 0 2px #1a0d07,
    0 0 40px rgba(255, 160, 40, 0.55),
    0 6px 20px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(243, 214, 162, 0.35);
}

@keyframes otsCdFlash {
  0% { filter: brightness(2.2) saturate(1.4); }
  40% { filter: brightness(1.4) saturate(1.2); }
  100% { filter: brightness(1) saturate(1); }
}

.ots-cd__sparks {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}

.ots-cd.is-bursting .ots-cd__sparks {
  opacity: 1;
  background:
    radial-gradient(circle at 20% 40%, rgba(255, 220, 120, 0.55) 0 2px, transparent 3px),
    radial-gradient(circle at 75% 30%, rgba(255, 100, 40, 0.5) 0 2px, transparent 3px),
    radial-gradient(circle at 55% 75%, rgba(255, 240, 180, 0.55) 0 2px, transparent 3px),
    radial-gradient(circle at 35% 80%, rgba(255, 160, 60, 0.45) 0 2px, transparent 3px),
    radial-gradient(circle at 85% 65%, rgba(255, 80, 30, 0.45) 0 2px, transparent 3px);
  animation: otsCdSparks 1.6s ease-out forwards;
}

@keyframes otsCdSparks {
  0% { opacity: 1; transform: scale(0.85); }
  100% { opacity: 0; transform: scale(1.25); }
}

@media (max-width: 520px) {
  .ots-cd { padding: 18px 20px 16px; }
  .ots-cd__title { font-size: 17px; }
  .ots-cd__date { font-size: 12px; margin-bottom: 12px; }
  .ots-cd__box { min-width: 58px; padding: 8px 8px 6px; }
  .ots-cd__num { font-size: 28px; }
  .ots-cd__lbl { font-size: 9px; }
  .ots-cd__launch-text { font-size: 18px; }
  .ots-cd__actor,
  .ots-cd__outfit { width: 60px; height: 60px; }
  .ots-cd__say { font-size: 10px; padding: 3px 6px; }
}
