/* The raid: Ignaroth over its crater, a party of heroes facing it, the three steps and three of the battle cards. */

.raid { background: radial-gradient(ellipse 50% 60% at 72% 45%, #ff4d6d1a, transparent 70%), var(--night); }
.raid-grid { display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 64px; }
.raid .lead { max-width: 440px; }
/* Ignaroth's head: a 16 x 16 crop of its idle frame at 3x. */
.marker-wyrm { width: 48px; height: 48px; background: url("../assets/boss/ignaroth-idle.png") -114px -48px / 3072px 768px no-repeat; image-rendering: pixelated; }

.raid-steps { margin-top: 40px; border-top: 1px solid var(--line); }
.raid-steps li { display: flex; align-items: flex-start; gap: 14px; padding-block: 20px; border-bottom: 1px solid var(--line); }
.raid-steps .loop-number { padding-top: 6px; color: var(--accent); }
.raid-steps h3 { margin-bottom: 6px; font-size: 30px; }
.raid-steps p { max-width: 420px; color: var(--muted); font-size: 16px; }

.raid-visual { display: grid; gap: 14px; min-width: 0; }
.raid-stage {
  position: relative;
  height: 430px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 46% 26% at 66% 84%, #ff6a3a3d, transparent 70%),
    radial-gradient(ellipse 70% 60% at 60% 60%, #ff4d6d1f, transparent 72%),
    #14121a;
  box-shadow: inset 0 3px 0 var(--accent), inset 0 0 0 2px #4a2a33;
  clip-path: var(--corners);
}
/* The crater: the room's floor fading into the dark around a glowing pit. */
.raid-crater {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 150px;
  background: url("../assets/dungeon/lineup-floor.png") 0 0 / 192px 64px repeat;
  opacity: .32;
  mask: linear-gradient(transparent, #000 60%);
}
.raid-embers i {
  position: absolute;
  bottom: 40px;
  left: var(--x);
  width: 6px;
  height: 6px;
  background: #ffb04a;
  box-shadow: 0 0 8px #ff6a3a;
  opacity: 0;
  animation: ember-rise var(--t, 3.4s) linear infinite;
  animation-delay: var(--d, 0s);
}
.raid-embers i:nth-child(1) { --x: 52%; --d: 0s; }
.raid-embers i:nth-child(2) { --x: 61%; --d: -.7s; --t: 4s; }
.raid-embers i:nth-child(3) { --x: 70%; --d: -1.6s; }
.raid-embers i:nth-child(4) { --x: 78%; --d: -2.4s; --t: 3s; }
.raid-embers i:nth-child(5) { --x: 86%; --d: -.3s; --t: 4.2s; }
.raid-embers i:nth-child(6) { --x: 57%; --d: -2s; --t: 3.6s; }
.raid-embers i:nth-child(7) { --x: 74%; --d: -3s; --t: 4.4s; }
.raid-embers i:nth-child(8) { --x: 92%; --d: -1.2s; }
@keyframes ember-rise {
  0% { opacity: 0; translate: 0 0; }
  15% { opacity: .9; }
  100% { opacity: 0; translate: -18px -260px; }
}

/* Ignaroth at --s, facing front left (row 1), feet on the frame's row 41: idle, and every few seconds a breath of
   fire (js/raid.js sets data-phase: start, loop, end). */
.wyrm {
  --s: 6;
  position: absolute;
  right: 0;
  bottom: calc(46px - 22px * var(--s));
  width: calc(64px * var(--s));
  height: calc(64px * var(--s));
  background: url("../assets/boss/ignaroth-idle.png") 0 calc(-64px * var(--s)) / calc(1024px * var(--s)) calc(256px * var(--s)) no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 22px #ff4d6d33);
  animation: wyrm-idle 1.92s steps(16) infinite;
}
@keyframes wyrm-idle { to { background-position-x: calc(-1024px * var(--s)); } }
.wyrm[data-phase="start"] { background-image: url("../assets/boss/ignaroth-attack-start.png"); background-size: calc(192px * var(--s)) calc(256px * var(--s)); animation: wyrm-three .33s steps(3) infinite; }
.wyrm[data-phase="loop"] { background-image: url("../assets/boss/ignaroth-attack-loop.png"); background-size: calc(256px * var(--s)) calc(256px * var(--s)); animation: wyrm-loop .36s steps(4) infinite; }
.wyrm[data-phase="end"] { background-image: url("../assets/boss/ignaroth-attack-end.png"); background-size: calc(192px * var(--s)) calc(256px * var(--s)); animation: wyrm-three .33s steps(3) infinite; }
@keyframes wyrm-three { to { background-position-x: calc(-192px * var(--s)); } }
@keyframes wyrm-loop { to { background-position-x: calc(-256px * var(--s)); } }

/* The party seen from behind (row 2), each hero in its aura. */
.raid-party { position: absolute; left: 8%; bottom: 18px; display: flex; align-items: flex-end; }
.raid-party .field-hero { --row: 2; margin: 0 -24px calc(-10px * var(--s)) 0; }
.raid-party .field-hero:nth-child(2) { margin-bottom: calc(-6px * var(--s)); }
.raid-party .field-hero:nth-child(2) .field-sprite { animation-delay: -1s; }
.raid-party .field-hero:nth-child(3) .field-sprite { animation-delay: -2.1s; }

.raid-name { position: absolute; top: 22px; left: 24px; display: grid; gap: 2px; color: var(--accent); font: 34px/.9 var(--display); letter-spacing: 1px; text-shadow: 0 2px 0 #2b1408; }
.raid-name small { color: #d9a7b0; font: 14px/1.2 var(--text-font); letter-spacing: 0; text-shadow: none; }

/* Three of the battle cards, one of each leaning (16 x 16 icons at 3x). */
.raid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.raid-cards li {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  padding: 12px 14px;
  background: var(--plate);
  box-shadow: inset 0 3px 0 var(--lean), inset 0 0 0 2px var(--line);
  clip-path: var(--corners);
}
.raid-card-icon { --card: 0; grid-row: span 2; width: 48px; height: 48px; background: url("../assets/ui/raid-cards.png") calc(-48px * var(--card)) 0 / 336px 48px no-repeat; image-rendering: pixelated; }
.raid-cards b { align-self: end; font: 24px/1 var(--display); font-weight: 400; }
.raid-cards li > span:last-child { align-self: start; color: var(--lean); font-size: 13px; }

@media (max-width: 1199px) {
  .raid-grid { gap: 40px; }
  .wyrm { --s: 5; }
  .raid-stage { height: 380px; }
  .raid-party { left: 4%; }
  .raid-party .field-hero { --s: 3; margin-right: -18px; }
  .raid-cards li { grid-template-columns: 32px 1fr; column-gap: 10px; padding: 10px 12px; }
  .raid-card-icon { width: 32px; height: 32px; background-position: calc(-32px * var(--card)) 0; background-size: 224px 32px; }
  .raid-cards b { font-size: 21px; }
}
@media (max-width: 959px) {
  .raid-grid { grid-template-columns: 1fr; }
  .raid-visual { width: min(640px, 100%); justify-self: center; }
  .wyrm { --s: 6; }
  .raid-stage { height: 430px; }
  .raid-party { left: 8%; }
  .raid-party .field-hero { --s: 4; margin-right: -24px; }
  .raid-cards li { grid-template-columns: 48px 1fr; column-gap: 12px; padding: 12px 14px; }
  .raid-card-icon { width: 48px; height: 48px; background-position: calc(-48px * var(--card)) 0; background-size: 336px 48px; }
  .raid-cards b { font-size: 24px; }
}
@media (max-width: 719px) {
  .raid-stage { height: 300px; }
  .wyrm { --s: 4; right: -36px; bottom: calc(30px - 22px * var(--s)); }
  .raid-party { left: 2%; bottom: 12px; }
  .raid-party .field-hero { --s: 3; margin-right: -34px; }
  .raid-name { top: 16px; left: 16px; font-size: 28px; }
  .raid-cards { grid-template-columns: 1fr; gap: 8px; }
  .raid-steps h3 { font-size: 27px; }
  .raid-steps p { font-size: 15px; }
}
