/**
 * Static King — shell / install-adjacent polish (Agent E)
 * Complements shell.css. Safe for FR card host + install pages if linked.
 */

/* ── Safe area + phone density ── */
:root {
  --sk-touch-min: 44px;
  --sk-lime: #b8ff00;
  --sk-lime-hot: #d4ff4a;
  --sk-amber: #ff6a2a;
  --sk-radius-ctl: 0.55rem;
  --sk-radius-tile: 0.6rem;
}

/* ── Pro control language (soft rects, not bubble pills) ── */
html.sk-app-only .af-radio-br-pill {
  border-radius: 0.35rem;
  font-weight: 750;
  letter-spacing: 0.03em;
}

html.sk-app-only .af-radio-row-live {
  border-radius: 0.35rem;
}

/* Station list rows — denser, cleaner phone cards */
@media (max-width: 900px) {
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-list {
    border-radius: 0.7rem !important;
    border-color: rgba(255, 255, 255, 0.07) !important;
    background: rgba(0, 0, 0, 0.32) !important;
    padding: 0.28rem !important;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-row {
    border-radius: 0.55rem !important;
    margin-bottom: 0.15rem;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-genre-bar {
    margin-top: 0.1rem;
  }
}

html {
  -webkit-tap-highlight-color: transparent;
}

/* Safe-area is applied on .ad-stage — avoid double padding that shoves chrome down */
body.ad-body {
  padding-left: 0;
  padding-right: 0;
}

/* Brand mark — subtle crown pulse (shell has static glow) */
.ad-brand-mark {
  transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.ad-brand:hover .ad-brand-mark {
  box-shadow:
    0 0 0 2px rgba(184, 255, 0, 0.7),
    0 0 36px rgba(184, 255, 0, 0.45),
    0 10px 24px -10px rgba(0, 0, 0, 0.9) !important;
}

/* Hero chips feel premium */
.ad-hero strong {
  text-shadow: 0 0 18px rgba(184, 255, 0, 0.35);
}

/* Titlebar radio slot — ensure ≥44px hit area around injected button */
.af-titlebar-center,
#ad-titlebar-center {
  min-height: var(--sk-touch-min);
  min-width: var(--sk-touch-min);
  padding: 0.1rem;
}

/* Focus rings for keyboard / a11y */
.ad-body a:focus-visible,
.ad-body button:focus-visible,
.af-radio-root button:focus-visible,
.af-radio-root input:focus-visible {
  outline: 2px solid rgba(184, 255, 0, 0.75);
  outline-offset: 2px;
}

/* Play legal gate + LEGAL control. Plain caps, same cabinet. */
html.sk-app-only .af-radio-legal {
  flex: 0 0 auto;
  position: relative;
  z-index: 62;
  pointer-events: auto;
  min-height: var(--sk-touch-min);
  min-width: var(--sk-touch-min);
  padding: 0.35rem 0.5rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 10, 8, 0.92);
  color: #f5f5f5;
  font: 900 0.62rem/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.06em;
  cursor: pointer;
  touch-action: manipulation;
}

html.sk-app-only .af-radio-legal:hover {
  border-color: rgba(184, 255, 0, 0.55);
}

.sk-legal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding:
    calc(0.75rem + env(safe-area-inset-top, 0px))
    calc(0.75rem + env(safe-area-inset-right, 0px))
    calc(0.75rem + env(safe-area-inset-bottom, 0px))
    calc(0.75rem + env(safe-area-inset-left, 0px));
  background: rgba(0, 0, 0, 0.72);
}

.sk-consent-gate {
  align-items: center;
}

.sk-legal-card {
  width: min(26rem, 100%);
  max-height: min(34rem, 100%);
  overflow: auto;
  padding: 1rem 1rem 0.85rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: #100c08;
  color: #f5f5f5;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.sk-legal-title {
  margin: 0 0 0.45rem;
  font: 900 1rem/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.04em;
}

.sk-legal-copy {
  margin: 0 0 0.85rem;
  color: #d6d3d1;
  font: 400 0.92rem/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.sk-legal-btn {
  display: block;
  width: 100%;
  min-height: var(--sk-touch-min);
  margin: 0 0 0.45rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #1a140f;
  color: #f5f5f5;
  font: 750 0.78rem/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.sk-legal-card .sk-legal-btn:first-of-type,
.sk-consent-gate .sk-legal-btn:first-of-type {
  border-color: rgba(184, 255, 0, 0.55);
  background: #1c2410;
}

.sk-legal-row {
  display: flex;
  gap: 0.45rem;
}

.sk-legal-row .sk-legal-btn {
  flex: 1 1 0;
}

/* Phone: one mute, list is the scroller, panel stays full screen. */
@media (max-width: 900px) {
  html.sk-app-only .af-radio-panel.is-phone-sheet.is-open {
    display: flex !important;
    flex-direction: column !important;
    height: calc(
      100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)
    ) !important;
    overflow: hidden !important;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-cabinet {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-genre-bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 0.35rem !important;
    max-height: none !important;
    padding: 0.15rem 0 0.2rem !important;
  }

  html.sk-app-only .af-radio-root.is-genre-mode .af-radio-genre-bar:not([hidden])::before,
  html.sk-app-only .af-radio-root.is-name-mode .af-radio-genre-bar:not([hidden])::before {
    content: none !important;
    display: none !important;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-gchip {
    flex: 0 0 auto !important;
    min-height: 44px !important;
    min-width: 5.4rem;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-glass {
    height: 1.7rem !important;
    min-height: 0 !important;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-top,
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-search-block,
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-place,
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-dial-wrap,
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-now,
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-vol-row,
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-hint {
    flex-shrink: 0 !important;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-glass,
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-freq-readout,
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-dial,
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-extra,
  html.sk-app-only .af-radio-panel.is-phone-sheet #af-radio-surprise,
  html.sk-app-only .af-radio-panel.is-phone-sheet #af-radio-sleep,
  html.sk-app-only .af-radio-panel.is-phone-sheet #af-radio-share {
    display: none !important;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-dial-wrap {
    min-height: 0 !important;
    height: auto !important;
    margin: 0 0 0.35rem !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    transform: none !important;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-dial-wrap::before {
    display: none !important;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-dial-tools {
    display: flex !important;
    gap: 0.4rem !important;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-ch {
    flex: 1 1 0;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
  }

  html.sk-app-only .af-radio-drag-grip {
    display: none !important;
  }

  @media (max-height: 720px) {
    html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-place,
    html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-now-meta,
    html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-dial-wrap {
      display: none !important;
    }

    html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-now {
      padding: 0.35rem 0.45rem !important;
    }

    html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-play {
      min-height: 42px !important;
      min-width: 4.4rem !important;
      font-size: 0.82rem !important;
    }

    html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-mode-btn,
    html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-gchip {
      min-height: 36px !important;
    }

    html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-top {
      margin-bottom: 0.15rem !important;
      padding-top: 0.15rem !important;
      padding-bottom: 0.15rem !important;
    }
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-sort-bar,
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-list-filter-row,
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-hint,
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-recents,
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-now-label {
    display: none !important;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-now-head,
  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-now-status {
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-vault-racks {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    max-height: 52px !important;
    flex-shrink: 0 !important;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-rack-chip {
    flex: 0 0 auto !important;
  }

  html.sk-app-only .af-radio-panel.is-phone-sheet .af-radio-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
  }

  html.sk-app-only .af-radio-play {
    min-width: 5.5rem;
    min-height: 48px;
    border: 0;
    border-radius: 0.5rem;
    background: #b8ff00;
    color: #111;
    font: 900 0.95rem/1 system-ui, sans-serif;
    letter-spacing: 0.06em;
  }

  html.sk-app-only .af-radio-root.is-on-air .af-radio-play {
    background: #1c2410;
    color: #d4ff4a;
    box-shadow: inset 0 0 0 1px rgba(184, 255, 0, 0.7);
  }

  html.sk-app-only #af-radio-mute-onair {
    display: none !important;
  }

  html.sk-app-only .af-radio-pins,
  html.sk-app-only .af-radio-extra {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: auto;
    margin: 0.15rem 0 0.35rem;
    padding-bottom: 0.15rem;
  }

  html.sk-app-only .af-radio-pin,
  html.sk-app-only .af-radio-extra .af-radio-tool-btn {
    flex: 0 0 auto;
    min-height: 44px;
    border-radius: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #14110e;
    color: #f5f5f5;
    font: 750 0.68rem/1 system-ui, sans-serif;
    letter-spacing: 0.03em;
    padding: 0.35rem 0.6rem;
  }

  html.sk-app-only .af-radio-pin.is-on,
  html.sk-app-only .af-radio-pin.is-vault {
    border-color: rgba(184, 255, 0, 0.55);
    color: #d4ff4a;
  }

  html.sk-app-only .af-radio-now-song {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.25;
    color: #fff;
  }

  html.sk-app-only .af-radio-now-fav,
  html.sk-app-only .af-radio-now-fav--empty {
    width: 36px;
    height: 36px;
    border-radius: 0.4rem;
  }

  html.sk-app-only .af-radio-move {
    flex: 0 0 auto;
    min-height: 36px;
    border: 0;
    background: transparent;
    color: #d4ff4a;
    font: 800 0.62rem/1 system-ui, sans-serif;
  }

  html.sk-app-only .af-radio-top {
    cursor: default;
    touch-action: manipulation;
  }
}

/* Install-adjacent pages (privacy / terms / install) — consistent chrome */
body.sk-legal,
body.sk-install,
.sk-page {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  background:
    radial-gradient(ellipse 70% 45% at 50% -5%, rgba(184, 255, 0, 0.1), transparent 55%),
    #050505;
  color: #f5f5f5;
  margin: 0;
  min-height: 100dvh;
  line-height: 1.5;
}

.sk-page-wrap {
  max-width: 40rem;
  margin: 0 auto;
  padding:
    calc(1.25rem + env(safe-area-inset-top, 0px))
    calc(1.25rem + env(safe-area-inset-right, 0px))
    calc(2rem + env(safe-area-inset-bottom, 0px))
    calc(1.25rem + env(safe-area-inset-left, 0px));
}

.sk-page h1 {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fff 0%, #e8e8e8 40%, #b8ff00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 0.75rem;
}

.sk-page a {
  color: #b8ff00;
  text-decoration: none;
}

.sk-page a:hover {
  text-decoration: underline;
  color: #d4ff4a;
}

.sk-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--sk-touch-min);
  min-width: var(--sk-touch-min);
  padding: 0.65rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(184, 255, 0, 0.45);
  background: linear-gradient(145deg, rgba(184, 255, 0, 0.2), rgba(40, 60, 0, 0.4));
  color: #f5f5f5;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow: 0 0 20px -6px rgba(184, 255, 0, 0.45);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sk-cta:hover {
  border-color: rgba(184, 255, 0, 0.75);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 0 28px -4px rgba(184, 255, 0, 0.6);
}

.sk-cta--amber {
  border-color: rgba(255, 120, 40, 0.55);
  background: linear-gradient(145deg, rgba(255, 90, 30, 0.35), rgba(80, 25, 8, 0.55));
  box-shadow: 0 0 20px -6px rgba(255, 90, 30, 0.5);
}

/* Card-style sections for install.html siblings */
.sk-card {
  border-radius: 1rem;
  border: 1px solid rgba(184, 255, 0, 0.22);
  background:
    radial-gradient(ellipse 90% 50% at 50% 0%, rgba(184, 255, 0, 0.08), transparent 55%),
    rgba(12, 12, 12, 0.92);
  padding: 1.1rem 1.15rem;
  margin: 1rem 0;
  box-shadow: 0 16px 40px -20px rgba(0, 0, 0, 0.85);
}

/* iOS client: prevent accidental zoom on inputs anywhere in shell */
html.ios-client input,
html.ios-client select,
html.ios-client textarea {
  font-size: 16px;
}

html.ios-client button,
html.ios-client .af-radio-btn,
html.ios-client .sk-cta {
  min-height: var(--sk-touch-min);
  touch-action: manipulation;
}

/* Open-radio body dim polish */
body.ad-radio-open .ad-stage {
  /* Keep brand readable while cabinet owns focus */
  filter: none;
}

body.ad-radio-open .ad-brand-name {
  filter: drop-shadow(0 0 10px rgba(184, 255, 0, 0.25));
}

/* Landscape phone: maximize radio chrome */
@media (max-height: 480px) and (orientation: landscape) {
  .ad-top {
    border-bottom-color: rgba(184, 255, 0, 0.25);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ad-brand-mark,
  .sk-cta,
  body.ad-radio-open .ad-main {
    transition: none !important;
  }
}

/* Print legal pages cleanly */
@media print {
  body.sk-legal,
  body.sk-install {
    background: #fff;
    color: #000;
  }
  .sk-cta {
    display: none;
  }
}
