/* Hilal: the living sky. The card around the app's own sky shader, which livesky.js draws on the canvas.
   Without JavaScript or WebGL only the poster shows and the controls stay hidden.
   The layout follows the app's Sun & Moon card (App/Today/LiveSkyCard.swift): the clock and its label at the
   top left in white, a glass bar of controls along the bottom, and a soft shade behind the clock that grows
   with the sun (--day, 0 at night to 1 at a high sun, set by livesky.js) so white text reads at noon too. */
.livesky{position:relative;margin-top:clamp(34px,5vw,56px);aspect-ratio:4/5;border-radius:30px;overflow:hidden;isolation:isolate;
  background:#060B17;color:#fff;--day:0;--ivory:242,227,194;
  box-shadow:0 40px 80px -40px rgba(4,6,24,.8),0 16px 32px -18px rgba(0,0,0,.4);
  -webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
/* The edge: the app's light rim (bright at the top left, almost gone in the middle), tinted gold. */
.livesky::after{content:'';position:absolute;inset:0;z-index:3;border-radius:inherit;padding:1px;pointer-events:none;
  background:linear-gradient(135deg,rgba(243,212,142,.46),rgba(243,212,142,.07) 46%,rgba(233,192,106,.22));
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude}
.livesky__poster,.livesky__canvas{position:absolute;inset:0;width:100%;height:100%}
.livesky__poster{object-fit:cover}
.livesky__canvas{display:block;opacity:0;transition:opacity .7s ease}
.livesky.is-live .livesky__canvas{opacity:1}
/* A click on the water sends out a ring; livesky.js marks the card while the pointer is over the water. */
.livesky.is-water{cursor:pointer}

.livesky__ui{position:absolute;inset:0;z-index:2;display:flex;flex-direction:column;justify-content:space-between;padding:12px;pointer-events:none}
.livesky__ui[hidden]{display:none}
/* The header shade: from the top left corner, gone well before the middle of the sky. */
.livesky__ui::before{content:'';position:absolute;left:0;top:0;z-index:-1;width:min(100%,300px);height:200px;opacity:var(--day);
  background:radial-gradient(circle 220px at 0 0,rgba(0,0,0,.5),transparent)}
.livesky__now{display:grid;justify-items:start;gap:7px;padding:8px;color:#fff;
  text-shadow:0 2px 6px rgba(0,0,0,.25),0 1px 3px rgba(0,0,0,calc(.3 * var(--day)))}
.livesky__now strong{font-size:2.125rem;font-weight:300;line-height:1;letter-spacing:-.02em;font-variant-numeric:tabular-nums;white-space:nowrap}
.livesky__now span{display:inline-flex;align-items:center;gap:6px;font-size:.75rem;line-height:1.2}
.livesky__now span::before{content:'';width:5px;height:5px;border-radius:50%;background:#fff;transition:background .3s}
.livesky.is-playing .livesky__now span::before{background:rgb(var(--ivory))}
.livesky__now small{font-size:.6875rem;line-height:1.2}

/* The controls: light glass, so the water shows through. */
.livesky__bar{pointer-events:auto;display:grid;grid-template-columns:auto 1fr auto;
  grid-template-areas:"play rise set" "rule rule rule" "range range range";align-items:center;gap:8px 12px;
  padding:10px 16px 4px 10px;border-radius:22px;color:#fff;background:rgba(8,13,23,.44);
  -webkit-backdrop-filter:blur(14px) saturate(1.5);backdrop-filter:blur(14px) saturate(1.5);
  box-shadow:inset 0 0 0 .5px rgba(255,255,255,.1),inset 0 1px 0 rgba(255,255,255,.2)}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){.livesky__bar{background:rgba(8,13,23,.66)}}
.livesky__bar::before{content:'';grid-area:rule;height:1px;background:rgba(255,255,255,.12)}
.livesky__play{grid-area:play;display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;cursor:pointer;
  color:#fff;background:rgba(255,255,255,.12);box-shadow:inset 0 0 0 .5px rgba(255,255,255,.22);
  transition:background .25s,transform .35s var(--ease)}
.livesky__play[hidden]{display:none}
.livesky__play:hover{background:rgba(255,255,255,.2)}
.livesky__play:active{transform:scale(.94)}
.livesky__play svg{width:14px;height:14px}
.livesky__play .i-play,.livesky__play[aria-pressed="false"] .i-pause{display:none}
.livesky__play[aria-pressed="false"] .i-play{display:block}
.livesky__event{display:grid;gap:2px;font-size:.6875rem;line-height:1.2;color:rgba(255,255,255,.8);white-space:nowrap}
.livesky__event b{font-size:.94rem;font-weight:500;color:#fff;font-variant-numeric:tabular-nums}
.livesky__play + .livesky__event{grid-area:rise}
.livesky__range + .livesky__event{grid-area:set;text-align:right}

/* The slider: the day, midnight to midnight. --f is where the thumb is (0 to 1); --rise and --set mark
   sunrise and sunset on the track, as the app marks the day's times on its own. All three come from livesky.js. */
.livesky__range{grid-area:range;-webkit-appearance:none;appearance:none;display:block;width:100%;min-width:0;height:36px;margin:0;padding:0;
  border-radius:999px;background:none;cursor:pointer;touch-action:pan-y;--f:.92;--rise:-1;--set:-1;
  --track:radial-gradient(circle at calc(13px + (100% - 26px) * var(--rise)) 50%,rgba(var(--ivory),.95) 1.4px,transparent 1.9px),
    radial-gradient(circle at calc(13px + (100% - 26px) * var(--set)) 50%,rgba(var(--ivory),.95) 1.4px,transparent 1.9px),
    linear-gradient(90deg,rgba(var(--ivory),.7) calc(13px + (100% - 26px) * var(--f)),rgba(255,255,255,.26) 0)}
.livesky__range::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:var(--track)}
.livesky__range::-moz-range-track{height:4px;border-radius:2px;background:var(--track)}
.livesky__range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:26px;height:16px;margin-top:-6px;border:0;border-radius:8px;
  background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.42)}
.livesky__range::-moz-range-thumb{width:26px;height:16px;border:0;border-radius:8px;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.42)}
.livesky :focus-visible{outline:2px solid rgb(var(--ivory));outline-offset:3px}
.livesky__range:focus-visible{outline-offset:0}

/* Reduced motion has no day preview, so no button for one. */
.livesky.is-still .livesky__bar{grid-template-columns:1fr auto;grid-template-areas:"rise set" "rule rule" "range range";padding-left:16px}

/* Reduce Transparency and Increased Contrast, as in the app: solid controls, and a scrim for the header text. */
@media (prefers-reduced-transparency:reduce),(prefers-contrast:more){
  .livesky__bar{background:#0E131F;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:inset 0 0 0 .5px rgba(255,255,255,.25)}
  .livesky__ui::after{content:'';position:absolute;inset:0;z-index:-1;
    background:linear-gradient(180deg,rgba(0,0,0,.2),transparent 40%,transparent 60%,rgba(0,0,0,.45))}
}

.livesky__note{margin:18px auto 0;max-width:44em;text-align:center;font-size:.9rem;color:var(--dim)}

/* Wider than a phone: the card turns to landscape and the controls fit on one line. */
@media (min-width:600px){
  .livesky{aspect-ratio:16/10}
  .livesky__bar{grid-template-columns:auto auto minmax(0,1fr) auto;grid-template-areas:"play rise range set";gap:0 16px;
    padding:10px 20px 10px 10px}
  .livesky__bar::before{display:none}
  .livesky.is-still .livesky__bar{grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"rise range set";padding-left:20px}
}
@media (min-width:760px){
  .livesky{aspect-ratio:16/9;border-radius:36px}
  .livesky__ui{padding:20px}
  .livesky__ui::before{width:420px;height:280px;background:radial-gradient(circle 308px at 0 0,rgba(0,0,0,.5),transparent)}
  .livesky__now{gap:9px;padding:8px 10px}
  .livesky__now strong{font-size:clamp(2.6rem,4.4vw,3.1rem)}
  .livesky__now span{font-size:.84rem}
  .livesky__now small{font-size:.78rem}
  .livesky__bar{gap:0 22px;padding:10px 24px 10px 10px;border-radius:26px}
  .livesky__event{font-size:.72rem}
  .livesky__event b{font-size:1rem}
  .livesky.is-still .livesky__bar{padding-left:24px}
}
