/* ============================================================
   Radio DM • Jeden ultra-realistyczny znicz z żywym płomieniem
   1 listopada — klasyczny
   2 listopada — inny (Zaduszki)
   Lewy dolny róg (delikatnie w prawo)
   Napis „ZAPAL ZNICZ” wtopiony w tło — zanika po zapaleniu
   Po zapaleniu pozostaje zapalony (localStorage)
   Magia + czary
   ============================================================ */

body.rdm-znicze-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 12% 92%, rgba(255, 140, 40, 0.22), transparent 42%);
  mix-blend-mode: soft-light;
  animation: ambient 14s ease-in-out infinite alternate;
}

@keyframes ambient {
  0% { opacity: 0.45; }
  100% { opacity: 0.9; }
}

/* Wiadomość — wtopiona w tło, bez ramek */
.rdm-znicze-mention {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8700;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  color: #ffe8c0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-shadow: 0 0 18px rgba(255, 160, 40, 0.55), 0 1px 2px rgba(0,0,0,0.6);
  opacity: 0;
  animation: mentionIn 1.4s ease-out 0.5s forwards;
  max-width: 92vw;
  white-space: nowrap;
  pointer-events: none;
}

body.rdm-znicze-active .rdm-znicze-mention {
  display: flex;
}

@keyframes mentionIn {
  to { opacity: 0.92; }
}

.rdm-znicze-mention .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffb040;
  box-shadow: 0 0 12px #ffb040;
  animation: dotPulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* Kontener znicza — lewy dolny róg, delikatnie w prawo */
.rdm-znicz-wrap {
  position: fixed;
  bottom: 18px;
  left: 38px;
  z-index: 8500;
  display: none;
  pointer-events: auto;
}

body.rdm-znicze-active .rdm-znicz-wrap {
  display: block;
}

/* Napis ZAPAL ZNICZ — wtopiony w tło */
.znicz-label {
  position: absolute;
  bottom: -2px;
  left: 78px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffe0b0;
  text-shadow: 0 0 14px rgba(255, 160, 40, 0.5), 0 1px 2px rgba(0,0,0,0.7);
  white-space: nowrap;
  opacity: 0.75;
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
  animation: labelPulse 2.8s ease-in-out infinite;
}

.znicz-label.is-hidden {
  opacity: 0;
  transform: translateX(6px);
  pointer-events: none;
}

@keyframes labelPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.9; }
}

/* ===== Znicz 1 listopada (klasyczny) ===== */
.znicz-classic {
  position: relative;
  width: 70px;
  height: 116px;
  cursor: pointer;
  transition: transform 0.3s;
}

.znicz-classic:hover {
  transform: translateY(-5px);
}

.znicz-classic .jar {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 54px;
  height: 76px;
  background: linear-gradient(180deg, rgba(255,255,255,0.11) 0%, rgba(255,150,40,0.28) 42%, rgba(40,18,8,0.68) 100%);
  border: 2px solid rgba(255, 190, 90, 0.5);
  border-radius: 9px 9px 24px 24px;
  box-shadow:
    inset 0 10px 18px rgba(255,160,40,0.15),
    0 8px 20px rgba(0,0,0,0.55);
  overflow: hidden;
}

.znicz-classic .jar::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: linear-gradient(180deg, transparent 18%, rgba(255,140,40,0.25) 55%, rgba(255,80,20,0.35));
  border-radius: 7px 7px 18px 18px;
  opacity: 0;
  transition: opacity 0.7s;
}

.znicz-classic.is-lit .jar::after {
  opacity: 1;
}

.znicz-classic .wick {
  position: absolute;
  bottom: 70px;
  left: 50%;
  width: 3px;
  height: 18px;
  background: #2a1a10;
  transform: translateX(-50%);
  border-radius: 1px;
  z-index: 2;
}

.znicz-classic .flame {
  position: absolute;
  bottom: 84px;
  left: 50%;
  width: 22px;
  height: 52px;
  transform: translateX(-50%) scale(0);
  transform-origin: bottom center;
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.34, 1.5, 0.64, 1), opacity 0.5s;
  z-index: 3;
  pointer-events: none;
}

.znicz-classic.is-lit .flame {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

.znicz-classic .flame-inner {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 78%, #fff 0%, #ffe070 14%, #ffaa22 40%, #ff5500 70%, transparent 100%);
  border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%;
  animation: flameFlicker 0.14s infinite alternate, flameSway 2.1s ease-in-out infinite;
  box-shadow:
    0 0 18px #ffcc55,
    0 0 36px rgba(255, 150, 40, 0.75),
    0 -12px 22px rgba(255, 200, 80, 0.45);
  filter: blur(0.3px);
}

.znicz-classic .flame-outer {
  position: absolute;
  inset: -10px -6px;
  background: radial-gradient(ellipse at 50% 70%, rgba(255,180,60,0.45), transparent 68%);
  border-radius: 50%;
  animation: flameSway 2.6s ease-in-out infinite reverse;
  filter: blur(10px);
}

.znicz-classic.is-lit .jar {
  box-shadow:
    inset 0 10px 18px rgba(255,160,40,0.22),
    0 0 32px rgba(255, 150, 40, 0.7),
    0 8px 20px rgba(0,0,0,0.55);
}

/* Magia — iskierki wokół płomienia */
.znicz-classic.is-lit::after,
.znicz-zaduszki.is-lit::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow:
    8px 12px 0 0 #ffcc55,
    -6px 18px 0 0 #ffaa33,
    12px 28px 0 0 #ff8844,
    -10px 8px 0 0 #ffe070;
  animation: sparks 1.8s ease-out infinite;
  opacity: 0;
  pointer-events: none;
}

@keyframes sparks {
  0% { opacity: 0; transform: translateX(-50%) translateY(0); }
  20% { opacity: 0.9; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-40px); }
}

@keyframes flameFlicker {
  0% { opacity: 0.88; transform: scaleY(1) scaleX(1); }
  100% { opacity: 1; transform: scaleY(1.08) scaleX(0.94); }
}
@keyframes flameSway {
  0%, 100% { transform: rotate(-2deg) translateX(-0.8px); }
  50% { transform: rotate(2.4deg) translateX(1.2px); }
}

/* ===== Znicz 2 listopada (Zaduszki — inny) ===== */
.znicz-zaduszki {
  position: relative;
  width: 74px;
  height: 122px;
  cursor: pointer;
  transition: transform 0.3s;
}

.znicz-zaduszki:hover {
  transform: translateY(-5px);
}

.znicz-zaduszki .jar {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 80px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(180,40,60,0.32) 40%, rgba(30,8,12,0.72) 100%);
  border: 2px solid rgba(255, 140, 100, 0.48);
  border-radius: 10px 10px 28px 28px;
  box-shadow:
    inset 0 10px 18px rgba(200,60,80,0.14),
    0 8px 20px rgba(0,0,0,0.55);
  overflow: hidden;
}

.znicz-zaduszki .jar::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: linear-gradient(180deg, transparent 18%, rgba(200,50,70,0.26) 55%, rgba(160,30,50,0.4));
  border-radius: 8px 8px 22px 22px;
  opacity: 0;
  transition: opacity 0.7s;
}

.znicz-zaduszki.is-lit .jar::after {
  opacity: 1;
}

.znicz-zaduszki .wick {
  position: absolute;
  bottom: 74px;
  left: 50%;
  width: 3px;
  height: 18px;
  background: #2a1a10;
  transform: translateX(-50%);
  border-radius: 1px;
  z-index: 2;
}

.znicz-zaduszki .flame {
  position: absolute;
  bottom: 88px;
  left: 50%;
  width: 20px;
  height: 50px;
  transform: translateX(-50%) scale(0);
  transform-origin: bottom center;
  opacity: 0;
  transition: transform 0.7s cubic-bezier(0.34, 1.5, 0.64, 1), opacity 0.5s;
  z-index: 3;
  pointer-events: none;
}

.znicz-zaduszki.is-lit .flame {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

.znicz-zaduszki .flame-inner {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 78%, #fff 0%, #ffb070 16%, #ff7040 42%, #cc3040 72%, transparent 100%);
  border-radius: 50% 50% 38% 38% / 58% 58% 42% 42%;
  animation: flameFlicker 0.15s infinite alternate, flameSway 2.3s ease-in-out infinite;
  box-shadow:
    0 0 18px #ff9050,
    0 0 34px rgba(200, 60, 50, 0.65),
    0 -10px 20px rgba(255, 160, 80, 0.4);
  filter: blur(0.3px);
}

.znicz-zaduszki .flame-outer {
  position: absolute;
  inset: -10px -6px;
  background: radial-gradient(ellipse at 50% 70%, rgba(200,60,50,0.4), transparent 68%);
  border-radius: 50%;
  animation: flameSway 2.9s ease-in-out infinite reverse;
  filter: blur(10px);
}

.znicz-zaduszki.is-lit .jar {
  box-shadow:
    inset 0 10px 18px rgba(200,60,80,0.2),
    0 0 30px rgba(200, 60, 50, 0.6),
    0 8px 20px rgba(0,0,0,0.55);
}

@media (max-width: 700px) {
  .rdm-znicze-mention {
    top: 100px;
    font-size: 0.74rem;
  }
  .rdm-znicz-wrap {
    bottom: 12px;
    left: 18px;
  }
  .znicz-classic, .znicz-zaduszki {
    transform: scale(0.82);
    transform-origin: bottom left;
  }
  .znicz-label {
    font-size: 0.62rem;
    left: 64px;
  }
}
