/* Observatory presentation: quiet controls, real observations, mobile participation. */
.starwish-page {
  --observatory-line: rgba(199, 217, 227, 0.19);
  --observatory-surface: rgba(8, 14, 23, 0.94);
  --observatory-muted: #a0b0bd;
}

.site-header { padding: clamp(22px, 3.5vh, 64px) 4vw; }
.brand-lockup { gap: 16px; align-items: center; }
.display-mode .brand-copy { display: block; }
.brand-copy p {
  margin: 0 0 8px;
  color: #9bafbc;
  font: 500 clamp(9px, 0.63vw, 18px)/1.2 var(--font-mono);
  letter-spacing: 0.20em;
}
.brand-copy h1 {
  margin: 0;
  font: 400 clamp(23px, 1.65vw, 52px)/1.2 var(--font-source-serif);
  letter-spacing: 0.14em;
}
.star-sigil { width: 26px; height: 38px; }
.star-sigil::before { height: 32px; width: 1px; }
.star-sigil::after { width: 24px; height: 1px; }
.sky-count { align-items: flex-end; gap: 8px; }
.sky-count > span { color: #97a9b6; font-size: clamp(10px, 0.65vw, 18px); }
.sky-count strong {
  font: 300 clamp(27px, 2.3vw, 70px)/1.05 var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}
.sky-vignette {
  background:
    linear-gradient(to bottom, rgba(1, 3, 8, 0.30), transparent 20%, transparent 78%, rgba(1, 3, 8, 0.56)),
    linear-gradient(to right, rgba(1, 3, 8, 0.18), transparent 18%, transparent 82%, rgba(1, 3, 8, 0.18));
}
.display-mode .mountains { opacity: 0.32; height: 4vh; min-height: 0; }
.connection-state { bottom: auto; top: clamp(105px, 11vh, 205px); left: 4vw; font-size: 10px; color: #92a8b6; }

.kiosk-login-dock {
  right: max(clamp(12px, 0.7vw, 24px), env(safe-area-inset-right));
  bottom: max(clamp(12px, 1.2vh, 24px), env(safe-area-inset-bottom));
  width: clamp(158px, 9vw, 300px);
  padding: clamp(10px, 0.65vw, 22px);
  border: 1px solid var(--observatory-line);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(16, 27, 40, 0.97), rgba(5, 10, 18, 0.97));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  backdrop-filter: none;
}
.kiosk-login-heading { gap: 8px; margin-bottom: 10px; }
.kiosk-login-heading strong { font-size: clamp(13px, 0.75vw, 22px); font-weight: 500; }
.kiosk-login-heading span { margin-top: 4px; color: #96aab9; font: 400 clamp(10px, 0.50vw, 16px)/1.3 var(--font-display); }
.kiosk-login-dock > p { margin-top: 9px; color: #bdccd6; font: 400 clamp(11px, 0.56vw, 17px)/1.55 var(--font-display); }
.kiosk-qr-frame { border: 8px solid #f4fafc; border-radius: 8px; }
.kiosk-qr-frame img { inset: 0; width: 100%; height: 100%; }

.wish-composer,
.wish-result,
.star-inspector,
.participant-account,
.session-countdown-display {
  border-color: var(--observatory-line);
  border-radius: 12px;
  background: var(--observatory-surface);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.25);
  backdrop-filter: none;
}
.wish-composer { min-height: 64px; }
.wish-composer input { font-size: 15px; }
.wish-composer input::placeholder { color: #9aabb8; }
.wish-composer:focus-within { border-color: rgba(166, 206, 222, 0.72); }
.wish-composer #submit-button {
  border: 1px solid rgba(191, 222, 234, 0.30);
  border-radius: 8px;
  background: #d9e8ec;
  color: #14212c;
  font-weight: 600;
  box-shadow: none;
}
.wish-composer #submit-button:hover:not(:disabled) { background: #f1f8fa; border-color: #f1f8fa; }
.wish-composer .wish-preset-roll { border-radius: 8px; }
.wish-station { gap: 14px; }
.wish-beacon {
  display: inline-flex;
  width: auto;
  min-width: 138px;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid var(--observatory-line);
  border-radius: 999px;
  background: rgba(8, 14, 23, 0.92);
  box-shadow: none;
  aspect-ratio: auto;
  filter: none;
}
.wish-beacon::before { content: "✦"; position: static; color: #c8dfe8; font-size: 17px; background: none; box-shadow: none; border: 0; opacity: 1; }
.wish-beacon .beacon-label { position: static; width: auto; color: #c8d6df; font: 500 12px/1.3 var(--font-display); letter-spacing: 0; transform: none; }
.beacon-core,
.beacon-orbit { display: none; }
.wish-result { padding: 28px; }
.wish-result blockquote,
.star-inspector blockquote { font-family: var(--font-source-serif); font-weight: 400; line-height: 1.7; }
.result-author,
.result-nebula,
.star-inspector p { color: #a6b8c6; }
.wish-result #send-another { border-radius: 8px; }
.form-message { color: #e5b8a2; line-height: 1.6; }
.participant-login-retry { min-height: 44px; padding: 8px 14px; border: 1px solid #617f90; border-radius: 8px; color: #dfedf3; background: #142330; }
.participant-mode[data-participant-state="binding"] .form-message { color: #b0c6d2; }
.participant-mode[data-participant-state="ready"] .form-message { color: #a8c2cf; }
.display-notice { position: fixed; z-index: 60; left: 50%; top: 8.5%; max-width: min(520px, calc(100vw - 40px)); padding: 14px 24px; border: 1px solid rgba(166,206,222,.28); border-radius: 12px; background: rgba(8,14,23,.94); color: #d9e8ec; font: 400 clamp(15px,1vw,22px)/1.6 var(--font-source-serif); text-align: center; transform: translateX(-50%); pointer-events: none; }
.participant-mode .display-notice { display: none; }
.display-mode .kiosk-login-dock { z-index: 70; }
@media (prefers-reduced-motion: reduce) { .reveal-flash { display: none !important; } }

.nebula-guide-dialog {
  width: min(1000px, calc(100vw - 32px));
  max-height: min(88dvh, 820px);
  border-color: var(--observatory-line);
  border-radius: 18px;
  background: #0b111b;
  box-shadow: 0 32px 120px rgba(0, 0, 0, 0.7);
}
.nebula-guide-shell { max-height: min(88dvh, 820px); }
.nebula-guide-dialog::backdrop { background: rgba(1, 4, 9, 0.84); backdrop-filter: none; }
.nebula-guide-header { padding: 25px 30px 21px; }
.nebula-guide-header h2 { font-family: var(--font-source-serif); font-size: 34px; font-weight: 400; }
.nebula-guide-header > button { border-color: var(--observatory-line); border-radius: 10px; }
.nebula-guide-tabs { padding: 14px 24px; gap: 7px; scrollbar-width: thin; scrollbar-color: #475b6c transparent; }
.nebula-guide-tabs button { min-height: 38px; padding: 7px 12px; color: #aab9c4; font-size: 12px; }
.nebula-guide-tabs button.active { box-shadow: none; background: rgba(166, 206, 222, 0.13); border-color: rgba(166, 206, 222, 0.6); color: #f1f7fa; }
.nebula-guide-content { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 18px 28px; padding: 26px 30px; }
.nebula-guide-content > * { grid-column: 2; margin: 0; }
.nebula-guide-content .nebula-guide-observation { grid-column: 1; grid-row: 1 / 5; align-self: start; }
.nebula-guide-observation img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: contain; border-radius: 8px; background: #03060b; }
.nebula-guide-observation figcaption { margin-top: 13px; color: #94a8b7; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.nebula-guide-observation figcaption p { margin: 0 0 6px; color: #c4d1db; }
.nebula-guide-observation a { color: inherit; text-decoration-color: #536774; text-underline-offset: 3px; }
#choose-guide-nebula { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; margin-top: 20px; padding: 11px 15px; border: 1px solid #617f90; border-radius: 8px; background: #152736; color: #e1eef4; font-size: 13px; }
.nebula-guide-heading { grid-template-columns: 1fr; gap: 13px; }
.nebula-guide-heading p { color: #e5edf2; font-size: 21px; line-height: 1.65; font-weight: 400; }
.nebula-guide-meta { gap: 10px; margin: 0; }
.nebula-guide-meta dt { color: #8ea4b4; }
.nebula-guide-meta dd { color: #d3dfe7; }
.nebula-guide-summary,
.nebula-guide-facts li { color: #b5c5d0; font-size: 13px; line-height: 1.85; }
.nebula-guide-footer { color: #91a7b6; padding: 15px 30px; line-height: 1.6; }

@media (max-width: 720px) {
  .site-header { padding: max(22px, env(safe-area-inset-top)) 20px 12px; }
  .participant-account { min-height: 34px; border-radius: 9px; padding: 0 10px; }
  .wish-station { bottom: max(18px, env(safe-area-inset-bottom)); gap: 10px; padding: 0 14px; }
  .wish-beacon { min-width: 152px; height: 40px; }
  .wish-composer { min-height: 116px; border-radius: 14px; }
  .wish-composer input { height: 56px; font-size: 16px; }
  .wish-composer #name { min-width: 0; }
  .wish-composer #submit-button { height: 45px; margin-bottom: 7px; font-size: 14px; }
  .nebula-guide-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 24px); border-radius: 14px; }
  .nebula-guide-shell { max-height: calc(100dvh - 24px); }
  .nebula-guide-header { padding: 20px 20px 16px; }
  .nebula-guide-header h2 { font-size: 28px; }
  .nebula-guide-tabs { padding: 11px 16px; }
  .nebula-guide-tabs button { min-height: 40px; }
  .nebula-guide-content { display: block; padding: 20px; }
  .nebula-guide-content > * + * { margin-top: 20px; }
  .nebula-guide-observation img { height: 180px; width: 100%; object-fit: contain; }
  .nebula-guide-observation figcaption { font-size: 10px; }
  #choose-guide-nebula { min-height: 44px; margin-top: 14px; }
  .nebula-guide-footer { padding: 13px 20px; font-size: 10px; }
  .wish-result { padding: 22px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .participant-mode .wish-station { flex-direction: row; bottom: 12px; }
  .participant-mode .wish-composer { min-height: 52px; }
  .participant-mode .wish-composer input { height: 50px; font-size: 13px; }
  .nebula-guide-content { display: block; }
  .nebula-guide-observation { max-width: 38%; float: left; margin: 0 20px 15px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .starwish-page *, .starwish-page *::before, .starwish-page *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

.wish-beacon::after { display: none; }
.wish-beacon:hover { filter: none; transform: translateY(-1px); border-color: #829eaf; }
.wish-beacon .beacon-label { text-shadow: none; }

/* Keep phone controls and their feedback inside the usable viewport. */
.participant-mode:not(.has-session-countdown):not(.has-participant-account) .brand-copy { display: block; }
@media (max-width: 720px) {
  .participant-mode .site-header {
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
    gap: 10px;
  }
  .participant-mode .brand-copy p { margin-bottom: 5px; font-size: 9px; }
  .participant-mode .brand-copy h1 { font-size: 22px; }
  .participant-mode .sky-count { flex-direction: column; gap: 4px; }
  .participant-mode .sky-count > span { display: block; font-size: 10px; }
  .participant-mode .sky-count strong { font-size: 27px; }
  .participant-mode .participant-logout { width: 40px; height: 40px; }
  .participant-mode .site-actions { gap: 8px; }
  .participant-mode .wish-station {
    bottom: max(12px, env(safe-area-inset-bottom));
    max-height: calc(100dvh - max(96px, env(safe-area-inset-top)) - env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    gap: 10px;
    padding: 2px max(14px, env(safe-area-inset-right)) 2px max(14px, env(safe-area-inset-left));
  }
  .participant-mode .wish-station > * { flex-shrink: 0; }
  .participant-mode .wish-beacon { height: 44px; max-width: 100%; }
  .participant-mode .wish-composer {
    width: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 48px;
    grid-template-rows: 44px 52px 48px;
    gap: 4px 0;
    padding: 6px;
  }
  .participant-mode .wish-composer .composer-divider { display: none; }
  .participant-mode .wish-composer input { min-width: 0; width: 100%; height: 100%; padding: 0 12px; font-size: 16px; }
  .participant-mode .wish-composer #name { grid-column: 1 / -1; grid-row: 1; border-bottom: 1px solid var(--observatory-line); }
  .participant-mode .wish-composer #wish { grid-column: 1; grid-row: 2; }
  .participant-mode .wish-composer .wish-preset-roll { grid-column: 2; grid-row: 2; width: 44px; height: 44px; margin: 0; }
  .participant-mode .wish-composer #submit-button { grid-column: 1 / -1; grid-row: 3; width: 100%; height: 48px; margin: 0; font-size: 14px; }
  .participant-mode .form-message { position: static; width: 100%; max-width: 420px; min-height: 20px; padding: 0 6px; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; transform: none; }
  .participant-mode .form-message:empty { display: none; }
  .participant-mode .wish-result { max-height: calc(100dvh - 100px - env(safe-area-inset-bottom)); overflow-y: auto; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .participant-mode .brand-copy p { margin-bottom: 4px; font-size: 9px; }
  .participant-mode .brand-copy h1 { font-size: 20px; }
  .participant-mode .sky-count { flex-direction: column; gap: 4px; }
  .participant-mode .sky-count > span { font-size: 10px; }
  .participant-mode .sky-count strong { font-size: 25px; }
  .participant-mode .wish-station {
    flex-direction: column;
    gap: 6px;
    bottom: max(10px, env(safe-area-inset-bottom));
    max-height: calc(100dvh - 84px - env(safe-area-inset-bottom));
    overflow-y: auto;
    padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  }
  .participant-mode .wish-beacon { width: auto; min-width: 152px; height: 36px; }
  .participant-mode .wish-composer { width: 100%; min-height: 0; grid-template-columns: minmax(80px, .26fr) minmax(0, 1fr) 44px auto; grid-template-rows: 48px; gap: 0; padding: 4px; }
  .participant-mode .wish-composer .composer-divider { display: none; }
  .participant-mode .wish-composer input { width: 100%; min-width: 0; height: 48px; padding: 0 10px; font-size: 16px; }
  .participant-mode .wish-composer #name { grid-column: 1; grid-row: 1; border-bottom: 0; border-right: 1px solid var(--observatory-line); }
  .participant-mode .wish-composer #wish { grid-column: 2; grid-row: 1; }
  .participant-mode .wish-composer .wish-preset-roll { grid-column: 3; grid-row: 1; width: 40px; height: 44px; margin: 0; }
  .participant-mode .wish-composer #submit-button { grid-column: 4; grid-row: 1; width: auto; height: 44px; margin: 0; padding: 0 12px; font-size: 13px; }
  .participant-mode .form-message { position: static; width: 100%; min-height: 0; margin: 0; line-height: 1.5; transform: none; }
}
