/* All Saints' Day / Zaduszki: HUD button + remembrance card + fly caption (js/zaduszki.js) */
#zniczBtn { display: inline-flex; align-items: center; gap: 5px; }
#zniczBtn .zd-ico { display: block; image-rendering: pixelated; }
#zniczBtn .zd-fl { opacity: .25; }
#zniczBtn.active { background: var(--accent); }
#zniczBtn.active .zd-fl { opacity: 1; animation: zd-flicker 1.1s steps(1, end) infinite; }
/* fixed order of the mode buttons, whichever module finishes first */
#hud .row > #tourBtn { order: 1; }
#hud .row > #retroBtn { order: 2; }
#hud .row > #zniczBtn { order: 3; }

@keyframes zd-flicker {
  0%, 100% { transform: translateY(0); opacity: 1; }
  35% { transform: translateY(-.4px); opacity: .85; }
  60% { transform: translateY(.3px); opacity: 1; }
  80% { opacity: .9; }
}

.zad-card {
  position: fixed; left: 16px; bottom: 30px; z-index: 21; width: 380px; max-width: calc(100vw - 32px);
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: start;
  background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  padding: 14px 16px 14px 14px;
  transform: translateY(calc(100% + 60px)); visibility: hidden;
  transition: transform .4s steps(7), visibility 0s linear .4s;
}
.zad-card.show { transform: none; visibility: visible; transition: transform .4s steps(7), visibility 0s; }
/* the tour and the retro card own the bottom of the screen while they are open */
body.touring .zad-card, body:has(#retroCard.show) .zad-card { visibility: hidden; transform: translateY(calc(100% + 60px)); }
.zad-card::before {          /* thin candle-red band along the top edge */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: #8c1222;
  border-bottom: 2px solid var(--ink);
}
.zad-candle { padding-top: 10px; }
.zad-candle .zd-ico { display: block; image-rendering: pixelated; }
.zad-candle .zd-fl { animation: zd-flicker 1.3s steps(1, end) infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.zad-body { min-width: 0; padding-top: 4px; }
.zad-date { font-family: "Silkscreen", monospace; font-size: 11px; letter-spacing: .5px; color: #8c1222; text-transform: uppercase; padding-right: 28px; }
.zad-title { margin: 4px 0 6px; font-size: 21px; line-height: 1.15; font-weight: 600; }
.zad-text { margin: 0 0 10px; font-family: system-ui, sans-serif; font-size: 14px; line-height: 1.45; color: #3b3342; }
.zad-actions { display: flex; gap: 8px; }
.zad-go { font: inherit; font-size: 15px; cursor: pointer; color: var(--ink); background: var(--accent);
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 4px 12px 5px; }
.zad-go::after { content: " ▸"; }
.zad-go:hover { background: #f1c94a; }
.zad-go:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.zad-x { position: absolute; right: 4px; top: 8px; width: 32px; height: 32px; padding: 0; display: grid; place-items: center;
  background: none; border: 0; cursor: pointer; color: var(--ink); }
.zad-x svg { display: block; image-rendering: pixelated; }
.zad-x:hover { color: #8c1222; }
.zad-go:focus-visible, .zad-x:focus-visible { outline: 2px dashed var(--ink); outline-offset: 2px; }

/* caption after the fly: which cemetery this is */
.zad-cap {
  position: fixed; left: 50%; bottom: 34px; z-index: 19; max-width: calc(100vw - 32px);
  transform: translateX(-50%); text-align: center; pointer-events: none;
  background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  padding: 6px 14px 7px; opacity: 0; visibility: hidden;
  transition: opacity .6s steps(4), visibility 0s linear .6s;
}
.zad-cap.show { opacity: 1; visibility: visible; transition: opacity .3s steps(3), visibility 0s; }
.zad-cap b { display: block; font-size: 18px; font-weight: 600; line-height: 1.2; }
.zad-cap span { display: block; margin-top: 3px; font-family: "Silkscreen", monospace; font-size: 10px; letter-spacing: .5px;
  color: #8c1222; text-transform: uppercase; }
body.touring .zad-cap { visibility: hidden; }

@media (max-width: 600px) {
  .zad-card { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; gap: 2px 10px; padding: 12px 12px 12px 10px; }
  .zad-candle .zd-ico { width: 20px; height: 32px; }
  .zad-title { font-size: 18px; }
  .zad-text { font-size: 13.5px; margin-bottom: 8px; }
  .zad-x { right: 2px; top: 6px; width: 40px; height: 40px; }
  .zad-x svg { width: 16px; height: 16px; }
  .zad-date { padding-right: 34px; }
  body:has(.zad-card.show) #credits, body:has(.zad-cap.show) #credits { display: none; }
  .zad-cap { bottom: 14px; padding: 5px 10px 6px; }
  .zad-cap b { font-size: 16px; }
  #hud .row > #zniczBtn { margin-left: 0; }   /* sit right next to the other mode buttons */
}
@media (prefers-reduced-motion: reduce) {
  .zad-card, .zad-card.show, .zad-cap, .zad-cap.show { transition: none; }
  #zniczBtn.active .zd-fl, .zad-candle .zd-fl { animation: none; }
}
