/* css/star-page.css - your star on a page of its own (#/star,
   views/star-page.js, v135). One screen with no scrolling (v136): the stage
   fills the window under the header, the star takes all the height it can
   beside a column of the rest (on a phone, the rest above and below it), and
   the footer steps aside. Light and Dark are the share card's two styles, so
   the page previews the card's ground. */

.star-page { --sp-bg: #f4efe4; --sp-ink: #1b1b1b; --sp-muted: #4a4a4a; --sp-gap: clamp(12px, 2.2vh, 24px); }
.star-page[data-theme="navy"] { --sp-bg: #16213e; --sp-ink: #ffffff; --sp-muted: #c9ccd6; }
body:has(.star-page) .site-footer { display: none; }
/* The frame is at least a window tall below the header; here the stage is
   exactly the rest of the window, so that floor would add a scroll. */
body:has(.star-page) .app-container { min-height: 0; }

.star-page .sp-stage {
  position: relative;
  height: calc(100vh - var(--frame-header-h));
  height: calc(100svh - var(--frame-header-h));
  min-height: 460px;
  overflow: hidden;
  border-radius: 0;
  background: var(--sp-bg);
  color: var(--sp-ink);
  transition: background-color 320ms ease, color 320ms ease;
}
/* The warp in (views/star-zoom.js). While it plays, the stage shows Home's
   paper; a disc of night opens over it from the tapped star, gold streaks
   and rings fly out of the star, and a disc of the page's own ground opens
   over the night from where the star lands. The night and the effects are
   only there while the stage is blooming. */
.star-page .sp-stage[data-blooming] { background: var(--frame-page); transition: none; }
.star-page :is(.sp-bloom, .sp-night) {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 300vmax;
  height: 300vmax;
  margin: -150vmax 0 0 -150vmax;
  border-radius: 50%;
  background: var(--sp-bg);
  pointer-events: none;
}
.star-page .sp-night { background: radial-gradient(circle, #1f2c52 0%, #0d1428 60%); }
.star-page .sp-fx { position: absolute; inset: 0; pointer-events: none; }
.star-page .sp-fx > i { position: absolute; left: 0; top: 0; opacity: 0; }
.star-page .sp-streak {
  width: 150px;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(246, 227, 184, 0), #f6e3b8 70%, #ffffff);
  transform-origin: 0 50%;
}
.star-page .sp-ring {
  width: 120px;
  height: 120px;
  box-sizing: border-box;
  border: 3px solid #e2b866;
  border-radius: 50%;
}
.star-page .sp-stage:not([data-blooming]) :is(.sp-night, .sp-fx) { display: none; }
/* The radar's and the asterism's ways in (views/star-shape-zoom.js, v152).
   The radar opens the page's ground behind its grid, with no night and no
   streaks; the asterism's night is its own sky, the figure's ink with the
   same faint specks, so the figure's sky and the page's are one. */
.star-page .sp-stage[data-blooming="radar"] :is(.sp-night, .sp-fx),
.star-page .sp-stage[data-blooming="asterism"] .sp-fx { display: none; }
.star-page .sp-stage[data-blooming="asterism"] .sp-night { background: #1b1b1b; }
/* The sky's specks sit on a layer of their own that does not grow with the
   black, so they never crowd into a lattice while it opens; they fade in
   once it has filled the page. */
.star-page .sp-specks { display: none; position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.star-page .sp-stage[data-blooming="asterism"] .sp-specks {
  display: block;
  /* Scattered specks: several in each of two large tiles of different
     sizes, so no row or column of them lines up. */
  --speck: rgba(255, 255, 255, 0.5) 0 1px, transparent 1.6px;
  background:
    radial-gradient(circle at 12% 18%, var(--speck)) 0 0 / 437px 389px,
    radial-gradient(circle at 63% 9%, var(--speck)) 0 0 / 437px 389px,
    radial-gradient(circle at 38% 47%, var(--speck)) 0 0 / 437px 389px,
    radial-gradient(circle at 86% 58%, var(--speck)) 0 0 / 437px 389px,
    radial-gradient(circle at 21% 81%, var(--speck)) 0 0 / 437px 389px,
    radial-gradient(circle at 71% 92%, var(--speck)) 0 0 / 437px 389px,
    radial-gradient(circle at 47% 22%, var(--speck)) 0 0 / 293px 331px,
    radial-gradient(circle at 9% 63%, var(--speck)) 0 0 / 293px 331px,
    radial-gradient(circle at 78% 36%, var(--speck)) 0 0 / 293px 331px,
    radial-gradient(circle at 56% 74%, var(--speck)) 0 0 / 293px 331px;
}
/* While the stars are drawn on the sky, their labels are light to read on
   it, and darken again as the sky fades into the page's style. */
.star-page .sp-stage[data-sky] .sp-labels { --sp-ink: #f4efe4; --sp-muted: #c9ccd6; }
.star-page :is(.sp-label, .sp-value) { transition: color 450ms ease; }
/* The shape folds and its rays open about the figure's centre; each star
   pops about its own. */
.star-page .sp-mark :is(.sh-you, .sh-fill polygon) { transform-origin: 50px 50px; }
.star-page .sp-mark .sh-stars circle { transform-box: fill-box; transform-origin: center; }

/* The star is the page (v137): a slim line above it (the way back, the
   title, Share) and a slim line of switches below it, so the star takes the
   middle and all the height between. */
.star-page .sp-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "head share" "fig fig" "controls controls";
  align-items: center;
  column-gap: clamp(16px, 3vw, 48px);
  row-gap: var(--sp-gap);
  height: 100%;
  box-sizing: border-box;
  padding: var(--sp-gap) var(--frame-gutter);
}
.star-page .sp-head { grid-area: head; display: flex; align-items: center; gap: 16px; min-width: 0; }
.star-page .sp-figure { grid-area: fig; container-type: size; min-width: 0; min-height: 0; height: 100%; display: grid; place-items: center; }
.star-page .sp-controls { grid-area: controls; justify-self: center; }
.star-page .sp-share { grid-area: share; margin: 0; }

.star-page .sp-title {
  margin: 0;
  font-family: var(--frame-word);
  font-weight: 400;
  font-size: clamp(26px, 4.5vh, 44px);
  line-height: 1;
  white-space: nowrap;
  color: var(--sp-ink);
}

/* The square the star and its labels share: as big as the cell allows. */
.star-page .sp-square { position: relative; width: min(100cqw, 100cqh); height: min(100cqw, 100cqh); }
.star-page .sp-mark { position: absolute; inset: 17%; }
.star-page .sp-labels { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.star-page .sp-label {
  position: absolute;
  width: max-content;
  max-width: 30%;
  font-size: clamp(11px, 1.8cqh, 16px);
  line-height: 1.25;
  color: var(--sp-ink);
}
.star-page .sp-label-in { display: block; }
.star-page .sp-label[data-side="r"] { transform: translate(0, -50%); text-align: left; }
.star-page .sp-label[data-side="l"] { transform: translate(-100%, -50%); text-align: right; }
.star-page .sp-label[data-side="t"] { transform: translate(-50%, -100%); text-align: center; }
.star-page .sp-label[data-side="b"] { transform: translate(-50%, 0); text-align: center; }
.star-page .sp-region { display: block; font-weight: 700; }
.star-page .sp-region::before {
  content: "";
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-right: 0.35em;
  border-radius: 50%;
  background: var(--hue);
  vertical-align: 0.02em;
}
.star-page .sp-value { display: block; color: var(--sp-muted); }

/* The three switches on one line, each with a small name above it. */
.star-page .sp-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 10px 20px; min-width: 0; }
@media (max-width: 1180px) { .star-page .sp-controls { column-gap: 12px; } }
.star-page .sp-control { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.star-page .sp-control-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sp-muted); }
.star-page .sp-group { flex-wrap: nowrap; }
.star-page .sp-opt { min-height: 36px; padding: 0 12px; font-size: 14px; white-space: nowrap; }

/* On the dark ground the switches and the star's guides turn light. */
.star-page[data-theme="navy"] .shape-switch { background: rgba(255, 255, 255, 0.1); }
.star-page[data-theme="navy"] .sp-opt { color: #ffffff; }
.star-page[data-theme="navy"] .sp-opt[aria-pressed="true"] { background: #ffffff; color: #16213e; }
.star-page[data-theme="navy"] :is(.sp-opt, .shape-dot):focus-visible { outline-color: #ffffff; }
.star-page[data-theme="navy"] .shape-dot { color: #ffffff; }
.star-page[data-theme="navy"] .dial-ring { color: #e2d3b4; }
.star-page[data-theme="navy"] .dial-band { stroke: rgba(255, 255, 255, 0.12); }
.star-page[data-theme="navy"] .dial-ticks line { stroke: #e2d3b4; stroke-opacity: 0.6; }
.star-page[data-theme="navy"] .dial-mark { fill: #ffffff; }
.star-page[data-theme="navy"] .dial-hint { color: #c9ccd6; }
.star-page[data-theme="navy"] .shape .sh-grid { stroke: #e2d3b4; }
.star-page[data-theme="navy"] #sp-share { background: #ffffff; color: #16213e; }

/* A phone, or a tablet held upright: one column. The way back and the
   heading on the top line, the star in the height left over with its eight
   labels in two columns under it, then three lines: the shape, the style
   beside the label choice, and Share. The group names stay for screen
   readers. */
@media (max-width: 767px), (max-width: 1100px) and (orientation: portrait) {
  .star-page { --sp-gap: 10px; }
  .star-page .sp-layout {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    grid-template-areas: "head head" "fig fig" "shape shape" "theme detail" "share share";
    align-content: stretch;
    padding: 12px 16px;
  }
  .star-page .sp-head { flex-direction: row; align-items: center; gap: 10px; min-width: 0; }
  .star-page .sp-back { padding-left: 14px; padding-right: 14px; }
  .star-page .sp-title { font-size: 26px; }

  .star-page .sp-figure { container-type: normal; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; place-items: stretch; }
  .star-page .sp-square { display: contents; }
  .star-page .sp-mark { position: relative; inset: auto; min-height: 0; container-type: size; display: grid; place-items: center; }
  .star-page .sp-mark .shape-dial { width: min(100cqw, 100cqh); height: min(100cqw, 100cqh); }
  .star-page .sp-labels { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; text-align: left; }
  .star-page .sp-label,
  .star-page .sp-label[data-side] { position: static; width: auto; max-width: none; transform: none; text-align: left; font-size: 12px; }
  .star-page .sp-value { padding-left: 0.97em; }

  .star-page .sp-controls { display: contents; }
  .star-page .sp-control-shape { grid-area: shape; }
  .star-page .sp-control-theme { grid-area: theme; }
  .star-page .sp-control-detail { grid-area: detail; min-width: 0; }
  .star-page .sp-share { justify-self: stretch; }
  .star-page .sp-control-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .star-page .sp-group { flex-wrap: nowrap; }
  .star-page .sp-opt { min-height: 40px; padding: 0 12px; white-space: nowrap; }
  .star-page .sp-share .pill { width: 100%; justify-content: center; }
}

html[data-reduce-motion] .star-page .sp-stage { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .star-page .sp-stage { transition: none; }
}
