/* Aussie Skies app layer: player, phone watching modes, scroll reveals, install helper.
   Night theme tokens from the Aussie Skies brand guidelines. Link this after the site's main stylesheet. */
:root {
  --as-midnight: #0A1E3C; --as-deep: #051327; --as-twilight: #14305A; --as-gold: #D6B26E;
  --as-starlight: #F4ECDB; --as-muted: #A9B4C8; --as-line: #27406B; --as-live: #DA2E24;
  --as-sans: 'Jost', 'Futura', 'Century Gothic', system-ui, sans-serif;
  --as-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}
html, body { overflow-x: clip; }
html.as-noscroll, html.as-noscroll body { overflow: hidden; }

/* ---------- Player ---------- */
.as-watch { width: 100%; max-width: 100%; }
.as-player { position: relative; width: 100%; max-width: 100%; }
.as-player__frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9; min-height: 200px;
  background: var(--as-deep); border-radius: 12px; overflow: hidden; isolation: isolate;
}
.as-player__frame::before { /* loading shimmer, shown until Twitch is ready */
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(244, 236, 219, .06) 50%, transparent 70%) var(--as-deep);
  background-size: 250% 100%; animation: as-shimmer 1.8s linear infinite;
}
.as-player__status {
  position: absolute; inset: 0; z-index: 0; display: flex; align-items: center; justify-content: center;
  font: 500 12px/16px var(--as-sans); letter-spacing: .24em; text-transform: uppercase; color: var(--as-muted);
}
.as-player__frame iframe {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; border: 0;
  opacity: 0; transition: opacity .6s ease;
}
.as-player.is-loaded .as-player__frame iframe { opacity: 1; }
.as-player.is-loaded .as-player__frame::before { animation: none; }
.as-player__top, .as-player__rotate { display: none; }
@keyframes as-shimmer { from { background-position: 125% 0; } to { background-position: -125% 0; } }

/* ---------- Phone watching-mode bar ---------- */
.as-watch__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.as-watch__bar[hidden] { display: none; }
.as-watch__label { font: 500 12px/16px var(--as-sans); letter-spacing: .24em; text-transform: uppercase; color: var(--as-gold); white-space: nowrap; }
.as-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--as-deep); border: 1px solid var(--as-line); }
.as-seg__btn {
  box-sizing: border-box; text-decoration: none; justify-content: center;
  min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--as-muted);
  font: 500 13px/1 var(--as-sans); letter-spacing: .02em; white-space: nowrap; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; -webkit-tap-highlight-color: transparent;
}
.as-seg__btn svg { width: 16px; height: 16px; flex: none; }
.as-seg__btn[aria-pressed="true"] { background: var(--as-twilight); color: var(--as-starlight); }
.as-seg__btn:focus-visible, .as-option:focus-visible, .as-theatre-close:focus-visible, .as-sheet__later:focus-visible {
  outline: 2px solid var(--as-gold); outline-offset: 2px;
}
.as-watch__hint { margin: 10px 0 0; font: 400 14px/20px var(--as-sans); color: var(--as-muted); }
.as-watch__hint[hidden] { display: none; }

@media (max-width: 600px) {
  .as-player__frame { border-radius: 0; }
  .as-watch__bar { padding: 0 12px; }
  .as-watch__label { display: none; }
  .as-seg { display: flex; width: 100%; }
  .as-seg__btn { flex: 1 1 0; padding: 0 6px; }
  .as-watch__hint { padding: 0 16px; }
}
@media (max-width: 380px) {
  .as-seg__btn { padding: 0 9px; font-size: 12px; }
  .as-seg__btn svg { display: none; }
}

/* ---------- Full-screen (theatre) mode: the same player, restyled, so the stream never reloads ---------- */
.as-player.is-theatre {
  position: fixed; inset: 0; z-index: 2147482000; display: flex; flex-direction: column;
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; background: #000;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  animation: as-theatre-in .3s ease-out;
}
.as-player.is-theatre .as-player__top {
  display: flex; align-items: center; justify-content: space-between; flex: none; height: 52px; padding: 0 8px 0 16px;
  background: var(--as-deep); color: var(--as-starlight);
}
.as-player__brand { display: flex; align-items: center; gap: 10px; font: 500 12px/16px var(--as-sans); letter-spacing: .24em; text-transform: uppercase; }
.as-player__brand svg { width: 26px; height: 26px; }
.as-live-pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: 999px; background: var(--as-live); color: #fff; font: 500 11px/1 var(--as-sans); letter-spacing: .14em; }
.as-live-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: as-pulse 1.6s ease-in-out infinite; }
.as-theatre-close {
  display: inline-flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--as-starlight); font: 500 13px/1 var(--as-sans); letter-spacing: .04em; cursor: pointer;
}
.as-theatre-close svg { width: 18px; height: 18px; }
.as-player.is-theatre .as-player__frame { flex: 1; aspect-ratio: auto; min-height: 0; border-radius: 0; background: #000; }
.as-player.is-theatre .as-player__rotate {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex: none; min-height: 52px; margin: 0; padding: 0 16px;
  background: var(--as-deep); color: var(--as-muted); font: 400 14px/20px var(--as-sans); text-align: center;
}
.as-player__rotate svg { width: 20px; height: 20px; flex: none; color: var(--as-gold); }
@media (orientation: landscape) {
  .as-player.is-theatre .as-player__rotate { display: none; }
  .as-player.is-theatre .as-player__top { height: 44px; }
}
@keyframes as-theatre-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes as-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- First-visit "How do you want to watch?" sheet (phones) ---------- */
.as-sheet { position: fixed; inset: 0; z-index: 2147482500; display: flex; align-items: flex-end; justify-content: center; background: rgba(5, 19, 39, .6); opacity: 0; transition: opacity .25s ease; }
.as-sheet.is-open { opacity: 1; }
.as-sheet__panel {
  width: 100%; max-width: 520px; padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--as-midnight); border: 1px solid var(--as-line); border-bottom: 0; border-radius: 18px 18px 0 0;
  color: var(--as-starlight); transform: translateY(24px); transition: transform .3s cubic-bezier(.2, .9, .3, 1);
}
.as-sheet.is-open .as-sheet__panel { transform: none; }
.as-sheet__grab { width: 40px; height: 4px; margin: 0 auto 16px; border-radius: 2px; background: var(--as-line); }
.as-sheet__eyebrow { margin: 0; font: 500 12px/16px var(--as-sans); letter-spacing: .24em; text-transform: uppercase; color: var(--as-gold); }
.as-sheet__title { margin: 6px 0 16px; font: 500 22px/28px var(--as-sans); color: var(--as-starlight); }
.as-option {
  box-sizing: border-box; text-decoration: none; font: inherit;
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; margin: 0 0 10px; padding: 12px 14px; text-align: left;
  background: var(--as-deep); border: 1px solid var(--as-line); border-radius: 12px; color: var(--as-starlight); cursor: pointer;
}
.as-option:active { border-color: var(--as-gold); }
.as-option__icon { display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--as-twilight); color: var(--as-gold); }
.as-option__icon svg { width: 22px; height: 22px; }
.as-option__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.as-option__name { font: 500 16px/22px var(--as-sans); }
.as-option__desc { font: 400 14px/20px var(--as-sans); color: var(--as-muted); }
.as-sheet__later { display: block; width: 100%; min-height: 44px; margin-top: 4px; border: 0; background: transparent; color: var(--as-muted); font: 500 14px/1 var(--as-sans); cursor: pointer; }

/* ---------- Scroll reveals (only when JS is running) ---------- */
.as-js .as-reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.as-js .as-reveal.is-in { opacity: 1; transform: none; }

/* ---------- Install helper ---------- */
.as-install { margin-top: 24px; text-align: center; }
.as-install[hidden], .as-install [hidden] { display: none; }
.as-install__btn {
  min-height: 48px; padding: 0 24px; border-radius: 8px; border: 1px solid var(--as-gold); background: transparent; color: var(--as-gold);
  font: 500 13px/1 var(--as-sans); letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
}
.as-install__ios { margin: 0; font: 400 14px/1.5 var(--as-sans); color: var(--as-muted); }
.as-install__ios strong { color: var(--as-starlight); font-weight: 500; }

@media (prefers-reduced-motion: reduce) {
  .as-js .as-reveal { opacity: 1; transform: none; transition: none; }
  .as-player__frame::before, .as-live-pill::before { animation: none; }
  .as-player.is-theatre, .as-sheet, .as-sheet__panel { animation: none; transition: none; }
}
