/* SportsBadger as an app (sb-app.js): the footer link, the card on phones, the popup and the /app/ page.
   Loaded by sb-app.js (and linked by app/index.html). Colors come from sb.css, so light and dark both work. */

/* ---------- footer link (every page): the size of the footer's small print ---------- */
.site-foot .sb-app-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 0 0 6px; font-size: .84rem; }
.sb-app-foot a { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; text-decoration: none; color: var(--ink); }
.sb-app-foot a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.sb-app-foot a .sb-app-i { width: 14px; height: 14px; color: var(--turf); }
.sb-app-foot-sub { color: var(--muted); }

/* ---------- the app icon wherever it's shown ---------- */
.sb-app-icon { display: block; flex: none; border-radius: 22%; box-shadow: 0 2px 8px rgb(0 0 0 / .18), 0 0 0 1px rgb(0 0 0 / .06); }

/* ---------- the card on phones ---------- */
.sb-app-nudge {
  position: fixed; z-index: 66; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 520px; margin-inline: auto; display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 10px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 12px 32px rgb(0 0 0 / .22), 0 2px 6px rgb(0 0 0 / .10);
  transform: translateY(calc(100% + 40px)); transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.sb-app-nudge.in { transform: none; }
.sb-app-nudge-t { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.sb-app-nudge-t b { font: 700 1.06rem/1.15 var(--font-display); letter-spacing: .01em; }
.sb-app-nudge-t span { color: var(--muted); font-size: .84rem; }
.sb-app-nudge .btn.sb-app-nudge-go { min-height: 40px; padding: 0 16px; flex: none; }
.sb-app-nudge .sb-app-x { position: static; flex: none; width: 34px; height: 34px; }

/* ---------- the popup: a sheet from the bottom on phones, a card in the middle on bigger screens ---------- */
html.sb-app-lock { overflow: hidden; }
dialog.sb-app-sheet {
  padding: 0; margin: 0; border: 0; background: transparent; color: var(--ink);
  width: 100%; height: 100%; max-width: none; max-height: none; inset: 0; position: fixed; z-index: 90;
}
dialog.sb-app-sheet[open] { display: flex; align-items: flex-end; justify-content: center; }
dialog.sb-app-sheet::backdrop { background: rgb(6 12 8 / 0); transition: background .25s; }
dialog.sb-app-sheet.in::backdrop { background: rgb(6 12 8 / .55); }
dialog.sb-app-sheet:not(:modal) { background: rgb(6 12 8 / .55); }   /* browsers without showModal */
.sb-app-card {
  position: relative; width: min(480px, 100%); max-height: 92vh; overflow: auto; overscroll-behavior: contain;
  padding: 22px 20px calc(18px + env(safe-area-inset-bottom)); background: var(--surface);
  border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgb(0 0 0 / .25);
  transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}
dialog.sb-app-sheet.in .sb-app-card { transform: none; }
@media (min-width: 600px) {
  dialog.sb-app-sheet[open] { align-items: center; }
  .sb-app-card { border-radius: 22px; padding: 26px 26px 22px; transform: translateY(18px); opacity: 0; transition: transform .25s, opacity .25s; }
  dialog.sb-app-sheet.in .sb-app-card { transform: none; opacity: 1; }
}
.sb-app-x {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
}
.sb-app-x:hover, .sb-app-x:focus-visible { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.sb-app-head { display: flex; align-items: center; gap: 14px; padding-right: 36px; margin-bottom: 14px; }
.sb-app-head h2 { font: 700 1.6rem/1.02 var(--font-display); }
.sb-app-tags { margin: 5px 0 0; color: var(--muted); font-size: .86rem; font-weight: 600; }
.sb-app-lead { margin: 0 0 14px; }
.sb-app-note { margin: 10px 0 0; color: var(--muted); font-size: .88rem; text-align: center; }
.sb-app-fine { margin: 16px 0 0; color: var(--muted); font-size: .8rem; text-align: center; }
.sb-app-card .btn, .sb-app-slot .btn { width: 100%; justify-content: center; }
.btn .sb-app-i { width: 20px; height: 20px; }

/* the numbered steps */
.sb-app-steps { list-style: none; margin: 0 0 6px; padding: 0; }
.sb-app-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; padding: 11px 0; border-top: 1px solid var(--line); }
.sb-app-steps li:first-child { border-top: 0; padding-top: 2px; }
.sb-app-n {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--turf); color: var(--surface); font: 700 1.05rem/1 var(--font-display);
}
.sb-app-steps li > div { min-height: 30px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; }
.sb-app-steps b { font-weight: 700; }
.sb-app-steps .sb-app-i {   /* drawn like the button they'll look for */
  box-sizing: content-box; width: 18px; height: 18px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
  background: color-mix(in srgb, var(--ink) 3%, var(--surface));
}
.sb-app-steps small { flex-basis: 100%; color: var(--muted); font-size: .86rem; line-height: 1.35; margin-top: 2px; }
.sb-app-done { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--turf) 12%, var(--surface)); }
.sb-app-done .sb-app-i { flex: none; width: 22px; height: 22px; padding: 7px; border-radius: 50%; background: var(--turf); color: var(--surface); }
.sb-app-copy { margin-top: 8px; }

/* a computer: iPhone | Android */
.sb-app-other { margin-top: 4px; }
.sb-app-other.also { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.sb-app-seg { display: inline-flex; padding: 3px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 999px; }
.sb-app-seg button { border: 0; background: none; color: var(--muted); font: 600 .9rem/1 var(--font-body); padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.sb-app-seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

/* ---------- the /app/ page ---------- */
.sb-app-page { padding: 28px 0 40px; display: grid; gap: 22px; max-width: 560px; }
.sb-app-hero { display: flex; align-items: center; gap: 18px; }
.sb-app-hero h1 { font-size: clamp(2rem, 7vw, 2.6rem); text-wrap: balance; }
.sb-app-hero p { margin: 6px 0 0; }
.sb-app-slot { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.sb-app-gets { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sb-app-gets li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.sb-app-gets li::before { content: ""; width: 10px; height: 10px; margin: 7px 0 0 4px; border-radius: 50%; background: var(--turf); }
.sb-app-page h2 { font-size: 1.4rem; margin-bottom: 10px; }
@media (max-width: 420px) { .sb-app-hero { gap: 14px; } .sb-app-hero .sb-app-icon { width: 76px !important; height: 76px !important; } }

@media (prefers-reduced-motion: reduce) {
  .sb-app-nudge, .sb-app-card, dialog.sb-app-sheet::backdrop { transition: none; }
}
