/* Easter eggs: HUD button + caption card + floating pixel text (js/eggs.js) */
#hud .row > #eggBtn { order: 4; display: inline-flex; align-items: center; gap: 4px; }
#eggBtn .egg-ico-svg { display: block; image-rendering: pixelated; animation: egg-twinkle 1.6s steps(1, end) infinite; }
#eggBtn span { line-height: 1; }

/* opacity only: scaling a crispEdges pixel icon smears its art pixels */
@keyframes egg-twinkle {
  0%, 100% { opacity: 1; }
  40% { opacity: .45; }
  70% { opacity: .85; }
}

.egg-card {
  position: fixed; left: 16px; bottom: 30px; z-index: 22; width: 372px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 150px); overflow: auto;
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start;
  background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  padding: 14px 16px 13px 12px;
  transform: translateY(calc(100% + 60px)); visibility: hidden;
  transition: transform .4s steps(7), visibility 0s linear .4s;
}
.egg-card.show { transform: none; visibility: visible; transition: transform .4s steps(7), visibility 0s; }
/* the tour, the retro card and the zaduszki card own the bottom of the screen while they are open */
body.touring .egg-card, body:has(#retroCard.show) .egg-card, body:has(.zad-card.show) .egg-card {
  visibility: hidden; transform: translateY(calc(100% + 60px));
}
.egg-card::before {           /* gold band along the top edge; secrets get a night-blue one */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--accent);
  border-bottom: 2px solid var(--ink);
}
.egg-card.secret::before { background: #2c3c78; }
.egg-ico { padding-top: 8px; }
.egg-ico svg { display: block; image-rendering: pixelated; animation: egg-twinkle 1.9s steps(1, end) infinite; }
.egg-body { min-width: 0; padding-top: 4px; }
.egg-date { font-family: "Silkscreen", monospace; font-size: 11px; letter-spacing: .5px; color: #8a5a00; text-transform: uppercase; padding-right: 28px; }
.egg-card.secret .egg-date { color: #2c3c78; }
.egg-title { margin: 4px 0 6px; font-size: 21px; line-height: 1.15; font-weight: 600; padding-right: 8px; }
.egg-text, .egg-long { margin: 0 0 10px; font-family: system-ui, sans-serif; font-size: 14px; line-height: 1.45; color: #3b3342; }
.egg-src { font-size: 12px; opacity: .75; margin: -4px 0 10px; }
.egg-src a { color: var(--ink); }
.egg-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.egg-go, .egg-more-btn { font: inherit; font-size: 15px; cursor: pointer; color: var(--ink); border: 2px solid var(--ink); padding: 4px 12px 5px; }
.egg-go { background: var(--accent); box-shadow: 3px 3px 0 var(--ink); }
.egg-go::after { content: " ▸"; }
.egg-go:hover { background: #f1c94a; }
.egg-go:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.egg-more-btn { background: #fff; padding: 3px 9px 4px; font-size: 14px; }
.egg-pager { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-family: "Silkscreen", monospace; font-size: 11px; }
.egg-pager button { font: inherit; font-size: 14px; width: 24px; height: 24px; padding: 0; background: #fff; border: 2px solid var(--ink); cursor: pointer; color: var(--ink); }
.egg-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); }
.egg-x svg { display: block; image-rendering: pixelated; }
.egg-x:hover { color: #8a5a00; }
.egg-go:focus-visible, .egg-x:focus-visible, .egg-more-btn:focus-visible, .egg-pager button:focus-visible { outline: 2px dashed var(--ink); outline-offset: 2px; }

/* one-line toast while a secret plays (phones) */
.egg-toast {
  position: fixed; left: 50%; bottom: 14px; z-index: 23; max-width: calc(100vw - 32px);
  transform: translate(-50%, calc(100% + 30px)); visibility: hidden;
  background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  padding: 7px 12px 8px; font-family: "Silkscreen", monospace; font-size: 12px; letter-spacing: .4px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  transition: transform .3s steps(5), visibility 0s linear .3s;
}
.egg-toast::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: #2c3c78; }
.egg-toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .3s steps(5), visibility 0s; }

/* 1 April: the town name in the HUD is clickable */
#hud .title.egg-title-swap { cursor: pointer; }
#hud .title.egg-title-swap:hover, #hud .title.egg-title-swap:focus-visible { color: #8a5a00; outline: none; }

/* floating pixel text over the map (place names on the Kopiec) */
.egg-float {
  position: fixed; left: 0; top: 0; z-index: 18; pointer-events: none; white-space: nowrap;
  font-family: "Silkscreen", monospace; font-size: 15px; color: #fff3c4; letter-spacing: .5px;
  text-shadow: 2px 0 var(--ink), -2px 0 var(--ink), 0 2px var(--ink), 0 -2px var(--ink), 2px 2px var(--ink);
}

@media (max-width: 600px) {
  .egg-card { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; max-height: 52vh; gap: 2px 10px; padding: 12px 12px 12px 10px; }
  .egg-ico svg { width: 20px; height: 20px; }
  .egg-title { font-size: 18px; }
  .egg-text, .egg-long { font-size: 13.5px; margin-bottom: 8px; }
  .egg-x { right: 2px; top: 6px; width: 40px; height: 40px; }
  .egg-x svg { width: 16px; height: 16px; }
  .egg-date { padding-right: 34px; }
  body:has(.egg-card.show) #credits { display: none; }
  #hud .row > #eggBtn { order: 0; margin-left: 0; }   /* first row, next to the clock */
  #eggBtn span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .egg-card, .egg-card.show, .egg-toast, .egg-toast.show { transition: none; }
  #eggBtn .egg-ico-svg, .egg-ico svg { animation: none; }
}
