/* AGENT_TARGET: starlight-gallery-styles — imagegen-backed visual destination */

.starlight-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 10156;
  display: grid;
  place-items: center;
  padding: 16px;
}

.starlight-gallery-modal[hidden] {
  display: none;
}

.starlight-gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 36, 58, 0.64);
  backdrop-filter: blur(4px);
}

.starlight-gallery-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 #6fbef2;
  border-radius: 12px;
  background: #fffdf7;
  color: #24344c;
  box-shadow: 0 24px 70px rgba(21, 36, 58, 0.34);
}

.starlight-gallery-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid rgba(36, 52, 76, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #1c5d84;
  font: 900 24px/1 Arial, sans-serif;
  cursor: pointer;
}

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

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

.starlight-gallery-heading h2 {
  margin: 3px 0;
  color: #24344c;
  font:
    900 25px/1.08 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0;
}

.starlight-gallery-heading p,
.starlight-gallery-card span,
.starlight-gallery-finale span {
  margin: 0;
  color: #596677;
  font: 800 13px/1.34 "Trebuchet MS", Arial, sans-serif;
}

.starlight-gallery-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: #24344c;
  box-shadow: 0 14px 34px rgba(21, 36, 58, 0.22);
}

.starlight-gallery-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.starlight-gallery-window {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: clamp(42px, 6.5vw, 72px);
  height: clamp(42px, 6.5vw, 72px);
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.76);
  color: #24344c;
  font:
    900 18px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  box-shadow: 0 10px 22px rgba(21, 36, 58, 0.24);
  cursor: pointer;
}

.starlight-gallery-number {
  display: block;
}

.starlight-gallery-cue {
  display: block;
  color: #1c5d84;
  font:
    900 9px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.starlight-gallery-window.current {
  border-color: #ffdf8d;
  background: #fff1ad;
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.55),
    0 12px 24px rgba(21, 36, 58, 0.24);
}

.starlight-gallery-stage.needs-guide .starlight-gallery-window.current {
  box-shadow:
    0 0 0 6px rgba(255, 239, 178, 0.72),
    0 12px 24px rgba(21, 36, 58, 0.24);
}

.starlight-gallery-window.lit {
  border-color: #baf4d2;
  background: #e7ffe9;
  color: #23633a;
}

.starlight-gallery-window.lit .starlight-gallery-cue {
  color: #23633a;
}

.starlight-gallery-window.waiting {
  opacity: 0.72;
  background: rgba(255, 253, 247, 0.68);
}

.starlight-gallery-window.waiting .starlight-gallery-cue {
  color: #596677;
}

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

.starlight-gallery-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border: 2px solid rgba(36, 52, 76, 0.14);
  border-radius: 8px;
  background: #fff;
}

.starlight-gallery-card.current {
  border-color: #d7a436;
  background: #fff8ea;
}

.starlight-gallery-card.lit {
  background: #edf9f4;
}

.starlight-gallery-card.waiting {
  background: #f8fafc;
}

.starlight-gallery-card strong {
  color: #24344c;
  font:
    900 14px/1.12 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}

.starlight-gallery-finale {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  padding: 12px;
  border: 2px solid rgba(36, 52, 76, 0.13);
  border-radius: 8px;
  background: #f2fbff;
}

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

.starlight-gallery-finale button {
  grid-row: 1 / span 2;
  grid-column: 2;
  min-width: 128px;
  min-height: 46px;
  border: 2px solid rgba(36, 52, 76, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #24344c;
  font:
    900 12px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  cursor: pointer;
}

.starlight-gallery-close:focus-visible,
.starlight-gallery-window:focus-visible,
.starlight-gallery-finale button:focus-visible {
  outline: 3px solid rgba(28, 93, 132, 0.72);
  outline-offset: 3px;
}

@media (max-width: 860px) {
  .starlight-gallery-modal {
    align-items: start;
    padding: 8px;
  }
  .starlight-gallery-shell {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 10px;
    border-radius: 10px;
  }
  .starlight-gallery-heading {
    width: calc(100% - 56px);
  }
  .starlight-gallery-heading h2 {
    font-size: 21px;
  }
  .starlight-gallery-window {
    width: 48px;
    height: 48px;
    border-width: 2px;
    font-size: 14px;
  }
  .starlight-gallery-tray {
    grid-template-columns: 1fr;
  }
  .starlight-gallery-finale {
    grid-template-columns: 1fr;
  }
  .starlight-gallery-finale button {
    grid-row: auto;
    grid-column: auto;
    width: 100%;
  }
}
