/* AGENT_TARGET: aurora-balcony-styles — imagegen-backed sky destination */

.aurora-balcony-modal {
  position: fixed;
  inset: 0;
  z-index: 10162;
  display: grid;
  place-items: center;
  padding: 16px;
}

.aurora-balcony-modal[hidden] {
  display: none;
}

.aurora-balcony-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 31, 67, 0.66);
  backdrop-filter: blur(4px);
}

.aurora-balcony-shell {
  position: relative;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, auto) auto auto;
  gap: 10px;
  width: min(1120px, calc(100vw - 24px));
  max-height: min(92vh, 900px);
  overflow: auto;
  padding: 14px;
  border: 3px solid #91d8f6;
  border-radius: 12px;
  background: #fffdf7;
  color: #252a52;
  box-shadow: 0 24px 70px rgba(24, 31, 67, 0.36);
}

.aurora-balcony-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid rgba(37, 42, 82, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #663d86;
  font: 900 24px/1 Arial, sans-serif;
  cursor: pointer;
}

.aurora-balcony-heading {
  width: min(720px, calc(100% - 56px));
  padding: 2px 4px 0;
}

.aurora-balcony-heading span,
.aurora-ribbon-card small {
  display: block;
  color: #663d86;
  font:
    900 12px/1.2 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.aurora-balcony-heading h2 {
  margin: 3px 0;
  color: #252a52;
  font:
    900 25px/1.08 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0;
}

.aurora-balcony-heading p,
.aurora-ribbon-card span,
.aurora-balcony-finale span,
.aurora-balcony-live {
  margin: 0;
  color: #5c6276;
  font: 800 13px/1.34 "Trebuchet MS", Arial, sans-serif;
}

.aurora-balcony-stage {
  position: relative;
  width: 100%;
  height: clamp(300px, 48vh, 440px);
  overflow: hidden;
  border-radius: 8px;
  background: #252a52;
  box-shadow: 0 14px 34px rgba(24, 31, 67, 0.24);
}

.aurora-balcony-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  transform: scale(1.012);
  transform-origin: center 42%;
  filter: saturate(1.06) brightness(1.02);
}

.aurora-flow-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.aurora-stream-river {
  position: absolute;
  left: -16%;
  width: 132%;
  height: 24%;
  border-radius: 999px;
  filter: blur(10px) saturate(1.16);
  mix-blend-mode: screen;
  opacity: 0.9;
  transform-origin: center;
  animation: aurora-stream-flow var(--aurora-cycle, 5200ms) linear infinite;
}

.aurora-stream-river-main {
  top: 19%;
  background:
    radial-gradient(circle at 18% 50%, rgba(255, 146, 189, 0.78), transparent 13%),
    radial-gradient(circle at 36% 45%, rgba(255, 215, 122, 0.76), transparent 15%),
    radial-gradient(circle at 52% 55%, rgba(101, 239, 223, 0.86), transparent 16%),
    radial-gradient(circle at 70% 42%, rgba(185, 149, 255, 0.72), transparent 15%),
    radial-gradient(circle at 88% 52%, rgba(246, 251, 255, 0.8), transparent 12%),
    linear-gradient(90deg, transparent, rgba(116, 229, 238, 0.44), rgba(255, 226, 147, 0.36), transparent);
  clip-path: polygon(0 58%, 9% 42%, 20% 37%, 32% 20%, 44% 42%, 55% 34%, 67% 16%, 79% 36%, 91% 30%, 100% 48%, 100% 72%, 88% 60%, 73% 75%, 62% 58%, 49% 74%, 36% 58%, 22% 72%, 9% 66%, 0 78%);
}

.aurora-stream-river-soft {
  top: 31%;
  height: 20%;
  opacity: 0.58;
  animation-duration: calc(var(--aurora-cycle, 5200ms) * 1.25);
  animation-direction: reverse;
  background:
    linear-gradient(90deg, transparent, rgba(255, 146, 189, 0.32), rgba(101, 239, 223, 0.5), rgba(185, 149, 255, 0.42), transparent);
  clip-path: polygon(0 46%, 14% 62%, 27% 38%, 41% 54%, 55% 35%, 70% 52%, 84% 40%, 100% 58%, 100% 76%, 84% 65%, 68% 78%, 52% 62%, 37% 78%, 22% 60%, 8% 76%, 0 66%);
}

.aurora-comet {
  position: absolute;
  z-index: 2;
  width: clamp(38px, 5.4vw, 74px);
  height: clamp(38px, 5.4vw, 74px);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 21%, rgba(101, 239, 223, 0.9) 22% 42%, rgba(255, 146, 189, 0.44) 58%, transparent 72%);
  box-shadow:
    0 0 20px rgba(255, 255, 255, 0.9),
    0 0 40px rgba(101, 239, 223, 0.72),
    0 0 74px rgba(185, 149, 255, 0.48);
  transform: translate(-50%, -50%);
  animation: aurora-comet-flow var(--aurora-cycle, 5200ms) linear infinite;
}

.aurora-flow-gate {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: clamp(44px, 6vw, 64px);
  height: clamp(44px, 6vw, 64px);
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 255, 255, 0.84);
  border-radius: 999px;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--gate-color) 70%, #ffffff) 0 26%, rgba(255, 255, 255, 0.6) 28% 52%, transparent 68%);
  color: #252a52;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
  font:
    900 16px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.2),
    0 0 26px color-mix(in srgb, var(--gate-color) 58%, transparent);
}

.aurora-flow-gate.current {
  border-color: #ffdf8d;
  background:
    radial-gradient(circle, #fff 0 18%, var(--gate-color) 20% 48%, rgba(255, 255, 255, 0.28) 60%, transparent 73%);
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.55),
    0 0 34px color-mix(in srgb, var(--gate-color) 78%, transparent),
    0 12px 24px rgba(24, 31, 67, 0.24);
  animation: aurora-target-pulse 1.5s ease-in-out infinite;
}

.aurora-flow-gate.lit {
  border-color: #baf4d2;
  background:
    radial-gradient(circle, #fff 0 18%, var(--gate-color) 20% 55%, rgba(231, 255, 233, 0.2) 66%, transparent 76%);
  color: #23633a;
  animation: aurora-lit-pulse 3.2s ease-in-out infinite;
}

.aurora-flow-gate.waiting {
  opacity: 0.68;
}

.aurora-ribbon-label {
  position: absolute;
  z-index: 4;
  min-width: 42px;
  transform: translate(-50%, calc(-50% + 42px));
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.8);
  color: #252a52;
  font: 900 10px/1 "Trebuchet MS", Arial, sans-serif;
  text-align: center;
  text-transform: uppercase;
}

.aurora-ribbon-label.current {
  background: #ffdf8d;
}

.aurora-ribbon-label.lit {
  background: #e7ffe9;
  color: #23633a;
}

.aurora-stream-guide {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 5;
  display: grid;
  gap: 2px;
  min-width: min(220px, calc(100% - 28px));
  min-height: 54px;
  padding: 8px 14px;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  background: #ffdf8d;
  color: #24294e;
  box-shadow: 0 14px 30px rgba(24, 31, 67, 0.28);
  cursor: pointer;
}

.aurora-stream-guide span {
  font:
    900 15px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}

.aurora-stream-guide small {
  color: #663d86;
  font: 900 11px/1.1 "Trebuchet MS", Arial, sans-serif;
  text-transform: uppercase;
}

.aurora-balcony-stage.helping .aurora-flow-gate.current {
  animation-duration: 1s;
}

.aurora-balcony-stage.complete .aurora-stream-river,
.aurora-balcony-stage.complete .aurora-comet {
  animation-duration: 7s;
}

.aurora-balcony-live {
  min-height: 18px;
  padding: 0 4px;
}

.aurora-balcony-tray {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.aurora-ribbon-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 2px solid rgba(37, 42, 82, 0.14);
  border-radius: 8px;
  background: #fff;
}

.aurora-ribbon-card.current {
  border-color: #d7a436;
  background: #fff8ea;
}

.aurora-ribbon-card.lit {
  background: #edf9f4;
}

.aurora-ribbon-card strong {
  color: #252a52;
  font:
    900 14px/1.12 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}

.aurora-balcony-finale {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  padding: 12px;
  border: 2px solid rgba(37, 42, 82, 0.13);
  border-radius: 8px;
  background: #f2fbff;
}

.aurora-balcony-finale strong {
  color: #1c5d84;
  font:
    900 18px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}

.aurora-balcony-finale button {
  grid-row: 1 / span 2;
  grid-column: 2;
  min-width: 128px;
  min-height: 46px;
  border: 2px solid rgba(37, 42, 82, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #252a52;
  font:
    900 12px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  cursor: pointer;
}

.aurora-balcony-close:focus-visible,
.aurora-stream-guide:focus-visible,
.aurora-balcony-finale button:focus-visible {
  outline: 3px solid rgba(102, 61, 134, 0.72);
  outline-offset: 3px;
}

@keyframes aurora-stream-flow {
  0%,
  100% {
    background-position: 0% 50%;
    transform: translate3d(-2%, 0, 0) rotate(-1.5deg) scaleY(1);
  }
  50% {
    background-position: 100% 50%;
    transform: translate3d(2%, -4%, 0) rotate(1.2deg) scaleY(1.08);
  }
}

@keyframes aurora-comet-flow {
  0% {
    left: 3%;
    top: 47%;
  }
  14%,
  18% {
    left: 16%;
    top: 36%;
  }
  31%,
  35% {
    left: 33%;
    top: 30%;
  }
  48%,
  52% {
    left: 50%;
    top: 35%;
  }
  66%,
  70% {
    left: 68%;
    top: 31%;
  }
  83%,
  87% {
    left: 85%;
    top: 36%;
  }
  100% {
    left: 97%;
    top: 44%;
  }
}

@keyframes aurora-target-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 5px rgba(255, 255, 255, 0.5),
      0 12px 24px rgba(24, 31, 67, 0.24);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(255, 229, 139, 0.38),
      0 0 28px rgba(145, 216, 246, 0.44),
      0 12px 24px rgba(24, 31, 67, 0.22);
  }
}

@keyframes aurora-lit-pulse {
  0%,
  100% {
    box-shadow: 0 10px 22px rgba(24, 31, 67, 0.2);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(186, 244, 210, 0.3),
      0 0 24px rgba(145, 216, 246, 0.34),
      0 10px 22px rgba(24, 31, 67, 0.18);
  }
}

@media (max-width: 860px) {
  .aurora-balcony-modal {
    align-items: start;
    padding: 8px;
  }
  .aurora-balcony-shell {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 10px;
    border-radius: 10px;
  }
  .aurora-balcony-heading {
    width: calc(100% - 56px);
  }
  .aurora-balcony-heading h2 {
    font-size: 21px;
  }
  .aurora-ribbon-target {
    width: 44px;
    height: 44px;
  }
  .aurora-flow-gate {
    width: 44px;
    height: 44px;
    border-width: 2px;
    font-size: 13px;
  }
  .aurora-balcony-stage {
    height: clamp(260px, 42vh, 360px);
  }
  .aurora-ribbon-label {
    display: none;
  }
  .aurora-stream-guide {
    right: 10px;
    bottom: 10px;
    min-width: min(190px, calc(100% - 20px));
    min-height: 50px;
  }
  .aurora-balcony-tray {
    grid-template-columns: 1fr;
  }
  .aurora-balcony-finale {
    grid-template-columns: 1fr;
  }
  .aurora-balcony-finale button {
    grid-row: auto;
    grid-column: auto;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-balcony-stage img,
  .aurora-stream-river,
  .aurora-comet,
  .aurora-flow-gate.current,
  .aurora-flow-gate.lit {
    animation: none;
  }
  .aurora-balcony-stage img {
    filter: saturate(1.08) brightness(1.03);
    transform: scale(1.012);
  }
  .aurora-stream-river-main {
    opacity: 0.76;
    transform: translate3d(0, 0, 0) rotate(-1deg);
  }
  .aurora-comet {
    left: 16%;
    top: 36%;
  }
}
