/* Uma fonte, três tamanhos. O resto é GIF. */
body {
  margin: 8px;
  background: #000 url("assets/hylics/battle-swirl.png") repeat;
  color: #fff;
  font: 16px "Times New Roman", Times, serif;
}

button, h1, h2 { font-family: inherit; }
button, h2 { font-size: 16px; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: #00ffff; }
a:visited { color: #ff66ff; }
a:focus-visible, button:focus-visible { outline: 2px solid #ff0; outline-offset: 3px; }
img { image-rendering: pixelated; object-fit: contain; max-width: 100%; }

nav { text-align: right; max-width: 850px; margin: 12px auto; }
nav button { margin: 2px; }
nav button[aria-pressed="true"] { border-style: inset; background: #ffff00; color: #000; }
.page { position: relative; max-width: 850px; margin: auto; text-align: center; }

.magic {
  display: flex;
  justify-content: space-around;
  height: 68px;
  overflow: hidden;
}

header { border: 5px ridge #aaa; background: #000; margin: 4px 22px 16px; }
.sun { display: block; margin: 6px auto; }
h1 { font-size: 32px; color: #ffff00; text-shadow: 2px 2px #ff0000; margin: 8px 4px; }
h2 { margin: 10px 0 20px; }
main h2 { font-size: 28px; text-transform: uppercase; }
p { margin: 20px 0; }
.date { font-size: 24px; font-weight: bold; }
hr { width: 80%; border: 0; border-top: 2px groove #fff; }
.fire { display: flex; height: 40px; overflow: hidden; }
.fire img { width: 25%; height: 40px; object-fit: fill; }
.upside-down { transform: rotate(180deg); }

.rainbow-rule {
  height: 6px;
  background: linear-gradient(90deg, red, #ff0, #0f0, #0ff, blue, #f0f, red);
  border: 1px solid #fff;
  margin: 12px 0;
}

.columns {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 120px;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}
aside { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 15px; }
.left { border: 3px ridge #00f; padding: 8px 0; background: #00002b; }
.right { border: 3px ridge #f0f; padding: 8px 0; background: #190019; }
.dancer { height: 120px; width: 80px; }
.mirror { transform: scaleX(-1); }
main { border: 6px ridge #ddd; background: #c0c0c0; color: #5b1685; text-shadow: 2px 2px #d999ff; }
.checker { height: 16px; background: conic-gradient(#000 25%, #fff 0 50%, #000 0 75%, #fff 0) 0 0 / 16px 16px; }
.eyes { display: flex; justify-content: space-around; padding: 10px 8px; }
.eyes img:last-child { transform: scaleX(-1); }
.center-gifs { display: flex; align-items: center; justify-content: space-around; padding: 12px 6px; }
.center-gifs img { width: 30%; }

.rsvp-banner {
  margin: 24px auto 12px;
  padding: 8px;
  width: min(380px, 80%);
  background: repeating-linear-gradient(-45deg, #ff0 0 12px, #000 12px 24px);
  border: 3px ridge #aaa;
}
.rsvp-banner a { display: block; background: #ff0; color: #000; padding: 7px; font-weight: bold; text-decoration: none; text-transform: uppercase; }
.rsvp-banner a:hover { text-decoration: underline; }

#rsvp { box-sizing: border-box; width: 380px; max-width: calc(100% - 24px); max-height: calc(100% - 24px); padding: 3px; border: 5px ridge #0ff; background: #c0c0c0; color: #210033; font: inherit; box-shadow: 8px 8px #000; }
#rsvp::backdrop { background: #080015b3; }
.rsvp-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px; background: #600080; color: #0ff; }
.rsvp-titlebar h2 { margin: 0; font-weight: bold; text-shadow: 1px 1px #000; }
.rsvp-titlebar button { padding: 0 7px; }
.rsvp-body { padding: 12px 18px 18px; }
.rsvp-body > img { display: block; margin: 0 auto 12px; }
.rsvp-body label { display: block; margin-bottom: 4px; font-weight: bold; }
.rsvp-body input { box-sizing: border-box; display: block; width: 100%; min-width: 0; margin-bottom: 16px; padding: 6px; border: 3px inset #eee; background: #fff5ff; color: #210033; font: inherit; }
.rsvp-body input:focus-visible { outline: 2px solid #800080; outline-offset: 2px; }
.rsvp-body button { display: block; margin: 4px auto 0; padding: 7px 26px; border: 3px outset #dfff00; background: #dfff00; color: #31004e; font-weight: bold; }
.rsvp-body button:active { border-style: inset; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.gif-pile { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0; }

/* Each GIF has its own position; the moving wrapper leaves mirrored images intact. */
.scattered-gifs { position: absolute; inset: 0; pointer-events: none; }
.scattered-gifs > span {
  position: absolute;
  top: var(--y);
  width: var(--size);
  transform: rotate(var(--tilt));
}
.scattered-gifs img { display: block; width: 100%; height: auto; }
.scattered-gifs .to-left { left: calc(-1 * var(--offset)); }
.scattered-gifs .to-right { right: calc(-1 * var(--offset)); }
.scattered-gifs .drifting { animation: wander var(--duration) steps(16, end) infinite alternate; }

@keyframes wander {
  from { transform: translate(-6px, -9px) rotate(var(--tilt)); }
  to { transform: translate(8px, 10px) rotate(calc(var(--tilt) + 7deg)); }
}

/* Without wide margins, give the loose decorations room instead of covering the invite. */
@media (max-width: 1199px) {
  .scattered-gifs { position: relative; inset: auto; height: 600px; margin: 12px 0; }
  .scattered-gifs > span { width: min(var(--size), 76px); }
  .scattered-gifs .to-left { left: 13%; }
  .scattered-gifs .to-right { right: 13%; }
  .scattered-gifs > span:nth-child(2n) { margin-left: 24px; margin-right: 18px; }
}

footer { margin: 26px 0; }
.paused * { animation-play-state: paused !important; }

@media (max-width: 600px) {
  nav { text-align: center; }
  header { margin-inline: 0; }
  h1 { font-size: 24px; }
  .columns { grid-template-columns: 50px minmax(0, 1fr) 50px; gap: 5px; }
  aside { gap: 28px; }
  aside img, .dancer { width: 44px; height: auto; }
  .eyes img { width: 42%; height: auto; }
  .center-gifs { padding-inline: 0; }
  .center-gifs img { height: 60px; }
  .date { font-size: 24px; }
  .gif-pile { gap: 4px; }
  .gif-pile img { width: 64px; height: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}
