/* Cardinals portal design system.
   Navy, cardinal red and gold carried over from the original season page, set in
   Oswald for display and Source Sans 3 for reading. Motion: cross-page view
   transitions, scroll-driven reveals, spring easing on interactive elements, and
   everything collapses to instant changes under prefers-reduced-motion. */

@font-face { font-family: "Oswald"; src: url("../fonts/oswald.22c3b00d2e65.woff2") format("woff2"); font-weight: 200 700; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-3.9ef356ea553a.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-3-italic.cd60e3b13ca1.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

@view-transition { navigation: auto; }

:root {
  --navy: #0c2340;
  --navy-2: #13325a;
  --navy-3: #071528;
  --red: #c41e3a;
  --red-2: #e23d55;
  --gold: #ffd200;
  --bg: #f4f1ef;
  --bg-2: #ebe5e1;
  --surface: #ffffff;
  --surface-2: #f3efec;
  --surface-3: #e9e3df;
  --line: #e2dad5;
  --line-2: #cfc5bf;
  --fg: #15131a;
  --fg-2: #3b3842;
  --muted: #6b6670;
  --win: #1f7a4d;
  --loss: #b3261e;
  --tie: #8a6a00;
  --info: #2f5aa8;
  --on-accent: #ffffff;
  --focus: #2f5aa8;
  --font-display: "Oswald", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --shadow-1: 0 1px 2px rgb(12 35 64 / .05), 0 4px 18px -6px rgb(12 35 64 / .10);
  --shadow-2: 0 2px 6px rgb(12 35 64 / .07), 0 22px 44px -18px rgb(12 35 64 / .32);
  --shadow-3: 0 30px 80px -30px rgb(12 35 64 / .55);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --spring: linear(0, .009, .035 2.1%, .141, .281 6.7%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1.004 83.8%, 1);
  --spring-soft: linear(0, .02 1.6%, .085 3.3%, .312 8.6%, .638 15.6%, .84 21.3%, .962 27.3%, 1.024 33.5%, 1.045 38.4%, 1.046 42.6%, 1.031 49.2%, 1.006 60.6%, .997 73.3%, 1);
  --max: 1120px;
  --topbar-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0c11; --bg-2: #15131a; --surface: #1a1820; --surface-2: #221f29; --surface-3: #2b2833;
    --line: #2f2c37; --line-2: #403c4a; --fg: #f3f0f5; --fg-2: #d5d0db; --muted: #a29dab;
    --red: #e23d55; --red-2: #ff5c72; --win: #45b87f; --loss: #ff6f66; --tie: #e2c24b; --info: #7fa6ea; --focus: #9cbcff;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .4), 0 6px 20px -8px rgb(0 0 0 / .6);
    --shadow-2: 0 2px 6px rgb(0 0 0 / .45), 0 24px 48px -18px rgb(0 0 0 / .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0c11; --bg-2: #15131a; --surface: #1a1820; --surface-2: #221f29; --surface-3: #2b2833;
  --line: #2f2c37; --line-2: #403c4a; --fg: #f3f0f5; --fg-2: #d5d0db; --muted: #a29dab;
  --red: #e23d55; --red-2: #ff5c72; --win: #45b87f; --loss: #ff6f66; --tie: #e2c24b; --info: #7fa6ea; --focus: #9cbcff;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .4), 0 6px 20px -8px rgb(0 0 0 / .6);
  --shadow-2: 0 2px 6px rgb(0 0 0 / .45), 0 24px 48px -18px rgb(0 0 0 / .8);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 24px); scrollbar-gutter: stable; }
/* In the home screen app on a phone, navy behind everything: the strip under the clock
   and battery, and the edges seen when pulling the page past its ends, match the bars.
   The page keeps its light background on body. */
@media (display-mode: standalone) and (pointer: coarse) { html { background: var(--navy); } }
body {
  margin: 0;
  isolation: isolate; /* keeps the background glow (body::before) above the body color */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 110% -10%, color-mix(in srgb, var(--red) 10%, transparent), transparent 60%),
    radial-gradient(50rem 36rem at -20% 0%, color-mix(in srgb, var(--navy) 12%, transparent), transparent 60%);
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.ico { flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--gold); color: #000; padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 12px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.display { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .01em; }
.eyebrow { font: 500 12px/1.2 var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }
.stack-lg { display: grid; gap: 28px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.center { text-align: center; }
hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top);
  color: #fff;
  /* Solid, not see-through: iPhone then treats it as the page header and carries its
     color up behind the clock, instead of blurring the team name and buttons. */
  background: var(--navy);
  border-bottom: 1px solid rgb(255 255 255 / .08);
  view-transition-name: topbar;
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  height: var(--topbar-h);
  padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand .logo { width: 38px; height: 38px; flex: none; transition: transform .6s var(--spring); }
.brand:hover .logo { transform: rotate(-14deg) scale(1.06); }
.brand-text { display: grid; line-height: 1; min-width: 0; }
.brand-text b { font: 700 21px/1 var(--font-display); text-transform: uppercase; letter-spacing: .03em; }
.brand-text small { font: 500 11px/1.4 var(--font-display); letter-spacing: .18em; color: #ffb3bf; text-transform: uppercase; }
.mainnav { display: none; gap: 2px; margin-left: 18px; }
.mainnav a {
  position: relative;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font: 500 14px var(--font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgb(255 255 255 / .78);
  transition: color .2s, background-color .2s;
}
.mainnav a:hover { color: #fff; background: rgb(255 255 255 / .08); }
.mainnav a[aria-current="page"] { color: #fff; }
.mainnav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 3px;
  border-radius: 3px;
  background: var(--gold);
  view-transition-name: nav-indicator;
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.record-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgb(255 255 255 / .1);
  border: 1px solid rgb(255 255 255 / .14);
  font: 600 15px var(--font-display);
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}
.record-pill small { font-size: 10px; letter-spacing: .14em; color: rgb(255 255 255 / .6); }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / .16);
  background: rgb(255 255 255 / .06);
  color: #fff;
  cursor: pointer;
  transition: transform .4s var(--spring), background-color .2s;
}
.icon-btn:hover { background: rgb(255 255 255 / .14); }
.icon-btn:active { transform: scale(.9); }
.icon-btn[aria-pressed="true"] { background: var(--gold); color: var(--navy); border-color: transparent; }
.icon-btn[hidden] { display: none; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--red), #ff7a5c);
  color: #fff; text-decoration: none;
  font: 600 17px var(--font-display);
  box-shadow: 0 0 0 2px rgb(255 255 255 / .25);
}
.signin { color: #fff; text-decoration: none; font: 500 14px var(--font-display); letter-spacing: .1em; text-transform: uppercase; padding: 8px 14px; border-radius: 999px; background: var(--red); }

/* ---------- bottom tab bar (phones) ---------- */
.tabbar {
  position: fixed;
  left: 10px; right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 40;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 6px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--navy) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: 0 18px 40px -12px rgb(7 21 40 / .55), inset 0 0 0 1px rgb(255 255 255 / .08);
  view-transition-name: tabbar;
}
.tabbar a {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 2px 6px;
  color: rgb(255 255 255 / .66);
  text-decoration: none;
  font: 500 10.5px var(--font-display);
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 18px;
  transition: color .25s;
}
.tabbar a[aria-current="page"] { color: #fff; }
.tabbar a[aria-current="page"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 18px;
  background: linear-gradient(180deg, rgb(255 255 255 / .16), rgb(255 255 255 / .06));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .1);
  view-transition-name: tab-indicator;
}
.tabbar a:active .ico { transform: scale(.85); }
/* Same for the phone tab bar: icons and labels stay above the moving highlight. */
.tabbar a:nth-child(1) > .ico { view-transition-name: tab-icon-1; } .tabbar a:nth-child(1) > span { view-transition-name: tab-label-1; }
.tabbar a:nth-child(2) > .ico { view-transition-name: tab-icon-2; } .tabbar a:nth-child(2) > span { view-transition-name: tab-label-2; }
.tabbar a:nth-child(3) > .ico { view-transition-name: tab-icon-3; } .tabbar a:nth-child(3) > span { view-transition-name: tab-label-3; }
.tabbar a:nth-child(4) > .ico { view-transition-name: tab-icon-4; } .tabbar a:nth-child(4) > span { view-transition-name: tab-label-4; }
.tabbar a:nth-child(5) > .ico { view-transition-name: tab-icon-5; } .tabbar a:nth-child(5) > span { view-transition-name: tab-label-5; }
.tabbar .ico { transition: transform .35s var(--spring); }
@media (min-width: 900px) {
  .mainnav { display: flex; }
  .tabbar { display: none; }
}

/* ---------- page shell ---------- */
.page {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left));
  display: grid;
  align-content: start;
  gap: 26px;
}
@media (min-width: 900px) { .page { padding-bottom: 60px; } }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 20px; }
.page-head h1 { font: 700 clamp(34px, 7vw, 54px)/.95 var(--font-display); text-transform: uppercase; letter-spacing: .005em; }
.page-head h1 .accent { color: var(--red); }
.page-head p { color: var(--muted); max-width: 60ch; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title h2 { font: 600 15px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.section-title a { font-size: 14px; color: var(--muted); }
.sitefoot {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  /* Room for the floating tab bar on phones, so the last links are never under it. */
  padding: 20px max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  color: var(--muted);
  font-size: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "league theme" "links theme";
  gap: 10px 20px;
  align-items: center;
}
.foot-league { grid-area: league; font: 500 12px var(--font-display); letter-spacing: .14em; text-transform: uppercase; }
.foot-links { grid-area: links; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.foot-links form { display: contents; }
.sitefoot a, .sitefoot .link-btn { color: var(--muted); }
.sitefoot .theme-btn { grid-area: theme; justify-self: end; }
@media (max-width: 560px) {
  .sitefoot { grid-template-columns: 1fr; grid-template-areas: "league" "links" "theme"; }
  .sitefoot .theme-btn { justify-self: start; margin-top: 4px; }
}
/* The theme button offers the other mode: a moon in light mode, a sun in dark mode. */
.theme-btn > span { display: inline-flex; align-items: center; gap: 8px; }
.theme-btn .to-light { display: none; }
:root[data-theme="dark"] .theme-btn .to-dark { display: none; }
:root[data-theme="dark"] .theme-btn .to-light { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .to-dark { display: none; }
  :root:not([data-theme="light"]) .theme-btn .to-light { display: inline-flex; }
}
@media (min-width: 900px) { .sitefoot { padding-bottom: 32px; } }

/* ---------- notice banner ---------- */
.banner {
  --b-bg: var(--gold); --b-fg: #1c1a1f;
  background: var(--b-bg);
  color: var(--b-fg);
  overflow: hidden;
  animation: bannerIn .7s var(--ease-out) both;
}
.banner.urgent { --b-bg: var(--red); --b-fg: #fff; }
.banner.celebrate { --b-bg: linear-gradient(90deg, #ffd200, #ff9f1c, #ffd200); background-size: 200% 100%; animation: bannerIn .7s var(--ease-out) both, shimmer 6s linear infinite; }
.banner-inner { max-width: var(--max); margin: 0 auto; padding: 10px 16px; display: flex; gap: 12px; align-items: flex-start; }
.banner .tag { font: 600 12px var(--font-display); letter-spacing: .16em; text-transform: uppercase; padding-top: 3px; flex: none; }
.banner p { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.banner a { font-weight: 600; white-space: nowrap; }
@keyframes bannerIn { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- cards and bento ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 18px;
  min-width: 0;
}
.card.pad-lg { padding: 24px; }
.card.flush { padding: 0; overflow: hidden; }
.card-title { font: 600 13px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
a.card { text-decoration: none; transition: transform .45s var(--spring), box-shadow .3s, border-color .3s; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
a.card:active { transform: translateY(-1px) scale(.99); }
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.bento > * { grid-column: span 12; }
@media (min-width: 640px) {
  .span-6 { grid-column: span 6 !important; }
  .span-4 { grid-column: span 6 !important; }
  .span-3 { grid-column: span 6 !important; }
}
@media (min-width: 980px) {
  .hero.span-8 { grid-row: span 2; }
  .span-8 { grid-column: span 8 !important; }
  .span-7 { grid-column: span 7 !important; }
  .span-5 { grid-column: span 5 !important; }
  .span-4 { grid-column: span 4 !important; }
  .span-3 { grid-column: span 3 !important; }
}
.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }

/* ---------- hero (next game / live) ---------- */
.hero {
  --opp: #eb6e1f;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--navy);
  color: #fff;
  padding: clamp(18px, 4vw, 30px);
  min-height: 320px;
  display: grid;
  gap: 18px;
  align-content: space-between;
  box-shadow: var(--shadow-3);
  view-transition-name: hero;
}
/* Background art lives in its own clipped layer: animated, blurred children can
   escape a parent's rounded corners in Chromium, and clip-path stops that. */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  border-radius: inherit;
  clip-path: inset(0 round var(--r-xl));
  pointer-events: none;
}
.hero .blob {
  position: absolute;
  z-index: 0;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  animation: drift 16s ease-in-out infinite alternate;
}
.hero .blob.us { background: var(--red); top: -45%; left: -20%; }
.hero .blob.them { background: var(--opp); bottom: -55%; right: -20%; animation-delay: -8s; animation-duration: 20s; }
.hero .grain {
  position: absolute; inset: 0; z-index: 1; opacity: .18; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero .stitches { position: absolute; z-index: 2; right: -60px; top: -60px; width: 340px; height: 340px; opacity: .22; color: #fff; pointer-events: none; }
.hero .stitches path { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 2.4s var(--ease-out) .2s forwards; }
.hero .stitches .seam { stroke-dasharray: 2.5 9; stroke-dashoffset: 0; stroke-linecap: butt; animation: none; opacity: .9; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(8%, 6%) scale(1.12); } 100% { transform: translate(-6%, 10%) scale(.94); } }
.hero-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.hero .eyebrow { color: var(--gold); }
.hero .chip { background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .16); color: #fff; }
.matchup { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; }
.side { display: grid; justify-items: center; gap: 8px; text-align: center; min-width: 0; }
.side .tname { font: 700 clamp(20px, 5vw, 30px)/1 var(--font-display); text-transform: uppercase; letter-spacing: .02em; overflow-wrap: anywhere; }
.side .tsub { font: 500 11px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: rgb(255 255 255 / .6); }
.versus { font: 600 18px var(--font-display); color: var(--gold); letter-spacing: .1em; display: grid; justify-items: center; gap: 2px; }
/* "Away @ Home", the way MLB writes a matchup: one @, level with the logos. */
.versus.at { align-self: start; height: clamp(64px, 16vw, 92px); align-content: center; font: 500 clamp(26px, 6vw, 38px)/1 var(--font-display); letter-spacing: 0; color: rgb(255 255 255 / .62); }
.versus small { font-size: 10px; letter-spacing: .2em; color: rgb(255 255 255 / .55); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: rgb(255 255 255 / .82); font-size: 15px; }
.hero-meta span { display: inline-flex; gap: 6px; align-items: center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* team badges */
.badge {
  --c: var(--navy); --ct: #fff;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 20%, color-mix(in srgb, var(--c) 70%, #fff) 0%, var(--c) 46%, color-mix(in srgb, var(--c) 70%, #000) 100%);
  color: var(--ct);
  font: 700 13px var(--font-display);
  letter-spacing: .04em;
  flex: none;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / .22), 0 6px 16px -8px var(--c);
}
.badge::after {
  content: "";
  position: absolute; inset: 4px;
  border-radius: 50%;
  border: 1.5px dashed color-mix(in srgb, var(--ct) 45%, transparent);
}
.badge.has-logo { background: #fff; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 35%, transparent), 0 6px 16px -8px var(--c); }
.badge.has-logo::after { display: none; }
.badge img { width: 78%; height: 78%; object-fit: contain; }
.brand img.logo { object-fit: contain; }
.badge-sm { width: 30px; height: 30px; font-size: 10px; }
.badge-sm::after { inset: 3px; border-width: 1px; }
.badge-lg { width: clamp(64px, 16vw, 92px); height: clamp(64px, 16vw, 92px); font-size: clamp(18px, 4.5vw, 26px); box-shadow: inset 0 0 0 3px rgb(255 255 255 / .25), 0 14px 34px -10px var(--c); }
.badge-lg::after { inset: 7px; border-width: 2px; }
.hero .badge-lg { animation: badgeIn .9s var(--spring) both; }
.hero .side:last-child .badge-lg { animation-delay: .12s; }
@keyframes badgeIn { from { transform: scale(.4) rotate(-30deg); opacity: 0; } }

/* countdown with flipping digits */
.countdown { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-unit {
  display: grid; justify-items: center;
  min-width: 66px;
  padding: 10px 10px 8px;
  border-radius: 16px;
  background: rgb(255 255 255 / .08);
  border: 1px solid rgb(255 255 255 / .14);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.cd-num { display: inline-flex; font: 600 clamp(30px, 8vw, 44px)/1 var(--font-display); font-variant-numeric: tabular-nums; overflow: hidden; height: 1em; }
.cd-num .d { display: inline-block; }
.cd-num .d.in { animation: digitIn .55s var(--spring) both; }
.cd-lbl { font: 500 10px var(--font-display); letter-spacing: .2em; text-transform: uppercase; color: rgb(255 255 255 / .6); margin-top: 4px; }
@keyframes digitIn { from { transform: translateY(-75%); opacity: 0; filter: blur(3px); } }
.cd-today { font: 600 clamp(30px, 8vw, 44px)/1 var(--font-display); text-transform: uppercase; color: var(--gold); }

/* live scoreboard */
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font: 600 12px var(--font-display);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgb(255 255 255 / .7); } 50% { opacity: .65; transform: scale(.8); box-shadow: 0 0 0 6px rgb(255 255 255 / 0); } }
.bigscore { font: 700 clamp(54px, 15vw, 96px)/.9 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.bigscore.bump { animation: bump .8s var(--spring); }
@keyframes bump { 0% { transform: scale(1); color: inherit; } 25% { transform: scale(1.28); color: var(--gold); text-shadow: 0 0 30px rgb(255 210 0 / .6); } 100% { transform: scale(1); } }
.inning-ind { display: grid; justify-items: center; gap: 6px; min-width: 84px; white-space: nowrap; font: 600 15px var(--font-display); letter-spacing: .06em; }
.inning-ind .arrow { color: var(--gold); font-size: 12px; }
.outs { display: inline-flex; gap: 5px; }
.outs i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid rgb(255 255 255 / .6); transition: background-color .3s, transform .4s var(--spring); }
.outs i.on { background: var(--gold); border-color: var(--gold); transform: scale(1.15); }

/* ---------- chips, pills, buttons ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--fg-2);
  font: 600 11.5px var(--font-display);
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip.home { background: var(--red); color: #fff; }
.chip.away { background: var(--surface-3); color: var(--fg); }
.chip.gold { background: var(--gold); color: #1c1a1f; }
.chip.navy { background: var(--navy); color: #fff; }
.chip.ok { background: color-mix(in srgb, var(--win) 16%, transparent); color: var(--win); }
.chip.warn { background: color-mix(in srgb, var(--loss) 14%, transparent); color: var(--loss); }
.result {
  display: inline-grid; place-items: center;
  min-width: 70px;
  padding: 6px 10px;
  border-radius: 12px;
  font: 600 17px var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  white-space: nowrap;
}
.result.W { background: var(--win); color: #fff; }
.result.L { background: var(--loss); color: #fff; }
.result.T { background: var(--tie); color: #fff; }
.result.up { background: var(--surface-2); color: var(--fg); font-size: 15px; }
.result.pending { border: 1.5px dashed var(--tie); color: var(--tie); font-size: 13px; }
.result.off { border: 1px solid var(--line-2); color: var(--muted); font-size: 13px; }
.result.live { background: var(--red); color: #fff; }

.btn {
  --b-bg: var(--surface); --b-fg: var(--fg); --b-line: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--b-line);
  background: var(--b-bg);
  color: var(--b-fg);
  font: 600 15px var(--font-body);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .45s var(--spring), background-color .2s, box-shadow .25s, border-color .2s, color .2s;
  user-select: none;
}
.btn:hover { box-shadow: var(--shadow-1); border-color: color-mix(in srgb, var(--b-line) 60%, var(--fg)); }
.btn:active { transform: scale(.95); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-primary { --b-bg: var(--red); --b-fg: #fff; --b-line: transparent; box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--red) 80%, transparent); }
.btn-primary:hover { --b-bg: var(--red-2); box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--red) 90%, transparent); }
.btn-navy { --b-bg: var(--navy); --b-fg: #fff; --b-line: transparent; }
.btn-gold { --b-bg: var(--gold); --b-fg: #1c1a1f; --b-line: transparent; }
.btn-glass { --b-bg: rgb(255 255 255 / .1); --b-fg: #fff; --b-line: rgb(255 255 255 / .2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.btn-glass:hover { --b-bg: rgb(255 255 255 / .18); }
.btn-ghost { --b-bg: transparent; --b-line: transparent; }
.btn-ghost:hover { --b-bg: var(--surface-2); box-shadow: none; }
.btn-danger { --b-fg: var(--loss); }
.btn-sm { min-height: 34px; padding: 6px 13px; font-size: 14px; }
.btn-lg { min-height: 54px; padding: 12px 26px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; padding: 0; }
.btn-sm.btn-icon { width: 34px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--info); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font: inherit; }

.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg a, .seg button {
  position: relative;
  padding: 7px 15px;
  border: 0; background: none;
  border-radius: 999px;
  text-decoration: none;
  font: 500 13.5px var(--font-display);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}
.seg [aria-current="true"], .seg [aria-pressed="true"] { color: var(--fg); }
.seg [aria-current="true"]::before, .seg [aria-pressed="true"]::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-1);
}
.seg { isolation: isolate; }
.seg [aria-current="true"]::before { view-transition-name: seg-pill; }
/* The sliding pill is drawn above the page while it moves, so the labels get their
   own layers above it; otherwise the pill hides the text for half a second. */
.seg a > span { display: inline-block; }
.seg a:nth-child(1) > span { view-transition-name: seg-label-1; }
.seg a:nth-child(2) > span { view-transition-name: seg-label-2; }
.seg a:nth-child(3) > span { view-transition-name: seg-label-3; }

/* ---------- stat tiles ---------- */
.tile { display: grid; gap: 2px; align-content: start; }
.tile .v { font: 600 clamp(30px, 7vw, 40px)/1.05 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile .v.pos { color: var(--win); }
.tile .v.neg { color: var(--loss); }
.tile .k { font: 500 11.5px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.tile .sub { font-size: 13.5px; color: var(--muted); }
.tile-record { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.ring { width: 88px; height: 88px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.6; }
.ring .track { stroke: var(--surface-3); }
.ring .seg-w { stroke: var(--win); }
.ring .seg-l { stroke: var(--loss); }
.ring .seg-t { stroke: var(--tie); }
.ring .arc { stroke-linecap: round; animation: ringIn 1.4s var(--ease-out) both; }
@keyframes ringIn { from { stroke-dasharray: 0 100; } }
.spark { width: 100%; height: 40px; overflow: visible; }
.spark polyline { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark .us { stroke: var(--red); stroke-dasharray: 400; animation: sparkIn 1.6s var(--ease-out) both; }
.spark .them { stroke: var(--muted); opacity: .5; stroke-dasharray: 3 4; }
@keyframes sparkIn { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }

/* form dots */
.form { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font: 600 13px var(--font-display);
  border: 2px solid transparent;
  text-decoration: none;
  animation: pop .6s var(--spring) both;
  animation-delay: calc(var(--i, 0) * 45ms);
  transition: transform .35s var(--spring);
}
.dot:hover { transform: translateY(-3px) scale(1.08); }
.dot.W { background: var(--win); color: #fff; }
.dot.L { background: var(--loss); color: #fff; }
.dot.T { background: var(--tie); color: #fff; }
.dot.U { border-color: var(--line-2); border-style: dashed; color: var(--muted); }
.dot.N { border-color: var(--red); color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 15%, transparent); }
.dot.X { border-color: var(--line-2); color: var(--muted); text-decoration: line-through; }
@keyframes pop { from { transform: scale(0); opacity: 0; } }

/* ---------- schedule ---------- */
.month { display: grid; gap: 10px; }
.month-head {
  position: sticky;
  top: calc(var(--topbar-h) + env(safe-area-inset-top));
  z-index: 5;
  margin: 0 -6px;
  padding: 10px 6px 8px;
  display: flex; align-items: baseline; gap: 10px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.month-head h2 { font: 700 26px var(--font-display); text-transform: uppercase; letter-spacing: .02em; }
.month-head span { font: 500 13px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.gcard {
  --opp: var(--line-2);
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: center;
  padding: 12px 14px 12px 12px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  overflow: hidden;
  transition: transform .45s var(--spring), box-shadow .3s, border-color .3s;
}
.gcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--opp); }
a.gcard:hover { transform: translateX(4px); box-shadow: var(--shadow-2); }
.gcard.next { border-color: var(--red); box-shadow: 0 0 0 1.5px var(--red), var(--shadow-2); }
.gcard.next .datebox { background: var(--red); color: #fff; }
.gcard.next .datebox small { color: rgb(255 255 255 / .8); }
.gcard.live { border-color: var(--red); }
.datebox {
  display: grid; justify-items: center; gap: 0;
  padding: 6px 4px 7px;
  margin-left: 4px;
  border-radius: 12px;
  background: var(--surface-2);
  font-family: var(--font-display);
  line-height: 1;
  text-transform: uppercase;
}
.datebox small { font-size: 10.5px; letter-spacing: .14em; color: var(--muted); }
.datebox b { font-size: 24px; font-weight: 600; margin: 2px 0; font-variant-numeric: tabular-nums; }
.gcard .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gcard .who .t { font: 600 clamp(18px, 4.6vw, 22px)/1.1 var(--font-display); text-transform: uppercase; min-width: 0; overflow-wrap: anywhere; }
.gcard .who .at { color: var(--red); font-weight: 600; margin-right: 2px; }
.gcard .sub { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13.5px; color: var(--muted); }
.gcard .result { grid-column: 3; grid-row: 1 / span 2; }
.gcard .note { grid-column: 2 / -1; font-size: 14px; color: var(--fg-2); }
.gcard .rsvp-inline { grid-column: 1 / -1; }
.ecard { --opp: var(--info); }
.ecard .datebox { background: color-mix(in srgb, var(--info) 12%, var(--surface)); }
.ecard.cancelled { opacity: .6; }
.ecard.cancelled .t { text-decoration: line-through; }
.offweek {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 2px 14px; align-items: center;
  padding: 12px 14px 12px 12px;
  border-radius: var(--r);
  border: 1.5px dashed var(--line-2);
  color: var(--muted);
  background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--line) 45%, transparent) 10px 11px);
}
.offweek .t { font: 600 18px var(--font-display); text-transform: uppercase; color: var(--fg-2); }
.offweek .datebox { background: transparent; }

/* scroll-driven reveal, where supported */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
    @keyframes reveal { from { opacity: .001; transform: translateY(26px) scale(.97); } }
  }
}
/* stagger for first paint */
.rise { animation: rise .8s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- RSVP ---------- */
.rsvp { display: grid; gap: 8px; }
.rsvp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; justify-content: space-between; }
.rsvp-row .kid { font-weight: 600; }
.rsvp-btns { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.rsvp-btns button {
  border: 0; background: none;
  padding: 6px 12px;
  border-radius: 999px;
  font: 600 13.5px var(--font-body);
  color: var(--muted);
  cursor: pointer;
  transition: background-color .25s, color .25s, transform .4s var(--spring);
}
.rsvp-btns button:active { transform: scale(.92); }
.rsvp-btns button[aria-pressed="true"][value="yes"] { background: var(--win); color: #fff; }
.rsvp-btns button[aria-pressed="true"][value="maybe"] { background: var(--tie); color: #fff; }
.rsvp-btns button[aria-pressed="true"][value="no"] { background: var(--loss); color: #fff; }
.hero .rsvp-btns { background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .15); }
.hero .rsvp-btns button { color: rgb(255 255 255 / .75); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 15px; }
th { font: 600 11.5px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
tbody tr { transition: background-color .2s; }
tbody tr:hover { background: var(--surface-2); }
tr.ours { background: color-mix(in srgb, var(--red) 7%, transparent); }
td.num, th.num { text-align: right; }
td .tn { display: inline-flex; align-items: center; gap: 10px; font: 600 17px var(--font-display); text-transform: uppercase; }
.linescore { min-width: 100%; }
.linescore th, .linescore td { text-align: center; padding: 9px 8px; font: 600 17px var(--font-display); }
.linescore th { font-size: 12px; }
.linescore td:first-child, .linescore th:first-child { text-align: left; padding-left: 14px; }
.linescore .tot { background: var(--surface-2); }
.linescore .R { color: var(--red); font-size: 20px; }
.linescore .cur { background: color-mix(in srgb, var(--gold) 28%, transparent); }
.linescore td.flash { animation: cellFlash 1.2s var(--ease-out); }
@keyframes cellFlash { 0% { background: var(--gold); color: #000; } }

/* ---------- forms ---------- */
.form-grid { display: grid; gap: 18px 20px; align-items: start; }
@media (min-width: 720px) { .form-grid.two { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
/* align-content: start keeps the label and box together when a neighbour in the
   same row is taller, so boxes line up across columns. */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .label { font: 500 12px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.field .help { font-size: 13px; color: var(--muted); }
.field .errors, .errorlist { color: var(--loss); font-size: 14px; margin: 0; padding: 0; list-style: none; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="tel"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"], input[type="search"], select, textarea {
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 10px 13px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background-color: var(--surface);
  color: var(--fg);
  font: 400 16px/1.3 var(--font-body);
  transition: border-color .2s, box-shadow .2s;
}
/* Safari ignores size and corners on native dropdowns, so draw our own arrow. */
select:not([multiple]) {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8592' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  text-overflow: ellipsis;
  cursor: pointer;
}
/* iPhone centers date values and collapses empty date boxes. */
input::-webkit-date-and-time-value { text-align: left; min-height: 1.3em; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 22%, transparent); }
textarea { min-height: 96px; resize: vertical; }
input[type="color"] { width: 64px; height: 46px; padding: 4px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); }
input[type="file"] { font: inherit; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input[type="checkbox"], input.switch {
  appearance: none; -webkit-appearance: none;
  flex: none;
  width: 44px; height: 26px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  position: relative;
  cursor: pointer;
  transition: background-color .25s;
  margin: 0;
}
.check input[type="checkbox"]::after, input.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / .3);
  transition: transform .45s var(--spring);
}
.check input[type="checkbox"]:checked, input.switch:checked { background: var(--win); border-color: transparent; }
.check input[type="checkbox"]:checked::after, input.switch:checked::after { transform: translateX(18px); }
.choices { display: grid; gap: 8px; max-height: 260px; overflow: auto; padding: 4px; }
.choices ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.choices label { display: flex; gap: 8px; align-items: center; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--fg); font-family: var(--font-body); }
.choices input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--red); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 6px; }

/* ---------- toasts ---------- */
.toasts {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid; gap: 8px; justify-items: center;
  width: min(92vw, 460px);
  pointer-events: none;
}
@media (min-width: 900px) { .toasts { bottom: 26px; } }
.toast {
  pointer-events: auto;
  display: flex; gap: 10px; align-items: center;
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 20px 40px -16px rgb(7 21 40 / .7);
  font-weight: 600;
  animation: toastIn .6s var(--spring) both;
}
.toast.success { background: #145a39; }
.toast.error { background: #8c1d16; }
.toast.out { animation: toastOut .35s var(--ease-in-out) forwards; }
@keyframes toastIn { from { transform: translateY(30px) scale(.9); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(16px) scale(.96); opacity: 0; } }

/* ---------- roster ---------- */
.roster { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
.pcard {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: end;
  min-height: 190px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--navy-2), var(--navy));
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: transform .5s var(--spring), box-shadow .3s;
  transform-style: preserve-3d;
}
.pcard:hover { box-shadow: var(--shadow-2); }
.pcard .bignum {
  position: absolute; right: 14px; top: 14px;
  font: 700 92px/.8 var(--font-display);
  color: transparent;
  -webkit-text-stroke: 2px rgb(255 255 255 / .2);
  letter-spacing: -.04em;
  transition: transform .6s var(--spring);
}
.pcard:hover .bignum { transform: translate(-4px, 4px) scale(1.04); }
/* Big outlined jersey number on the player page, kept inside the header card. */
.hero-num {
  position: absolute; z-index: -1; right: clamp(16px, 3vw, 32px); top: 50%;
  transform: translateY(-56%);
  font: 700 clamp(110px, 22vw, 190px)/.8 var(--font-display);
  letter-spacing: -.02em;
  color: transparent;
  -webkit-text-stroke: 2px rgb(255 255 255 / .18);
  pointer-events: none;
}
.pcard .full { position: relative; font-size: 12.5px; color: rgb(255 255 255 / .7); margin-top: 2px; }
.pcard .nm { position: relative; font: 600 21px/1.05 var(--font-display); text-transform: uppercase; }
.pcard .pos { position: relative; font: 500 11px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-top: 4px; }
.pcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgb(7 21 40 / .7)); }
.pcard > * { z-index: 1; }

/* ---------- prints gallery ---------- */
.prints { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.print { display: grid; gap: 10px; }
.print .thumb {
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-2);
  transform-style: preserve-3d;
  transition: transform .5s var(--spring), box-shadow .3s;
}
.print .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--surface-3); }

/* ---------- misc components ---------- */
.empty { padding: 30px 18px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: color-mix(in srgb, var(--info) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.callout.warn { background: color-mix(in srgb, var(--loss) 8%, var(--surface)); border-color: color-mix(in srgb, var(--loss) 25%, transparent); }
.callout.ok { background: color-mix(in srgb, var(--win) 9%, var(--surface)); border-color: color-mix(in srgb, var(--win) 25%, transparent); }
.callout .ico { margin-top: 2px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; align-items: baseline; }
.kv dt { font: 500 11.5px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.list > li:last-child { border-bottom: 0; }
.qrbox { background: #fff; color: #0c2340; padding: 14px; border-radius: 18px; width: 180px; box-shadow: var(--shadow-1); }
.qrbox svg { display: block; width: 100%; height: auto; }
.copyline { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.copyline code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); font-size: 14px; }
.person i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 11px var(--font-display); font-style: normal; background: var(--navy); color: #fff; }
.person.yes i { background: var(--win); }
.person.maybe i { background: var(--tie); }
.person.no i { background: var(--loss); }
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--win); transform-origin: left; animation: grow 1s var(--ease-out) both; }
@keyframes grow { from { transform: scaleX(0); } }
.legend-row { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 13.5px; color: var(--muted); }
.legend-row span { display: inline-flex; gap: 6px; align-items: center; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
details.more > summary { cursor: pointer; list-style: none; display: inline-flex; gap: 6px; align-items: center; color: var(--info); font-weight: 600; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary .ico { transform: rotate(180deg); }
details.more > summary .ico { transition: transform .35s var(--spring); }
.tilt { transition: transform .5s var(--spring); will-change: transform; }

/* game page */
.game-hero { min-height: 0; }
.info-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.infobox { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.infobox .ico { color: var(--red); margin-top: 2px; }
.infobox b { display: block; font: 600 17px var(--font-display); text-transform: uppercase; letter-spacing: .02em; }
.infobox small { color: var(--muted); font-size: 13.5px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }

/* confetti canvas */
.confetti { position: fixed; inset: 0; z-index: 80; pointer-events: none; }

/* page transitions */
::view-transition-old(root) { animation: vtOut .22s var(--ease-in-out) both; }
::view-transition-new(root) { animation: vtIn .42s var(--ease-out) both; }
::view-transition-group(hero) { animation-duration: .5s; animation-timing-function: var(--ease-out); }
::view-transition-group(tab-indicator), ::view-transition-group(nav-indicator), ::view-transition-group(seg-pill) { animation-duration: .5s; animation-timing-function: var(--spring-soft); }
/* Same page again (a filter, or after saving a form): crossfade only, nothing moves.
   The class is set by the pagereveal script in base.html. */
:root.vt-same::view-transition-old(root) { animation: vtFadeOut .2s linear both; }
:root.vt-same::view-transition-new(root) { animation: vtFadeIn .2s linear both; }
@keyframes vtFadeOut { to { opacity: 0; } }
@keyframes vtFadeIn { from { opacity: 0; } }
@keyframes vtOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .hero .blob { animation: none; }
}

@media print {
  .topbar, .tabbar, .sitefoot, .banner, .toasts, .no-print { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; }
  .card { box-shadow: none; }
}

/* ---------- sign-in and join ---------- */
.auth { display: grid; gap: 18px; align-items: stretch; }
@media (min-width: 860px) { .auth { grid-template-columns: 1.1fr 1fr; } }
.auth-hero { min-height: 260px; align-content: end; }
.auth-card { align-content: start; }
[data-push-panel][data-state="on"] .push-on, [data-push-panel][data-state="off"] .push-off { display: none; }

@media (max-width: 560px) {
  .linescore .tn-name { display: none; }
  .linescore th, .linescore td { padding: 9px 6px; font-size: 16px; }
  .linescore td:first-child, .linescore th:first-child { padding-left: 10px; }
}

/* ---------- scoring console ---------- */
.console { display: grid; gap: 16px; max-width: 640px; width: 100%; margin: 0 auto; }
.console.busy .run-btn, .console.busy [data-act] { cursor: progress; }
/* Fixed middle column, so the team boxes keep their width when Top turns to Bottom. */
.sb { display: grid; grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.sb-team {
  --c: var(--navy); --ct: #fff;
  position: relative;
  display: grid; justify-items: center; align-content: center; gap: 2px;
  padding: 14px 8px 12px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 85%, #fff), var(--c));
  color: var(--ct);
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform .45s var(--spring), box-shadow .3s, outline-color .3s;
  outline: 3px solid transparent;
  outline-offset: 3px;
}
.sb-team:active { transform: scale(.96); }
.sb-team.batting { outline-color: var(--gold); box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 25%, transparent), var(--shadow-2); }
.sb-name { font: 600 16px var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.sb-runs { font: 700 64px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.sb-runs.bump { animation: bump .8s var(--spring); }
.sb-bat { font: 600 10.5px var(--font-display); letter-spacing: .18em; text-transform: uppercase; opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .4s var(--spring); }
.sb-team.batting .sb-bat { opacity: .9; transform: none; }
.sb-mid { display: grid; justify-items: center; align-content: center; gap: 6px; }
.sb-inning { display: grid; justify-items: center; line-height: 1; }
.sb-inning span { white-space: nowrap; font: 500 12px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.sb-inning b { font: 700 40px var(--font-display); }
.start-panel, .live-panel { display: grid; gap: 14px; }
.run-btn {
  display: grid; justify-items: center; gap: 2px;
  min-height: 112px;
  border: 0;
  border-radius: 26px;
  background: radial-gradient(120% 140% at 50% 0%, var(--red-2), var(--red));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 18px 36px -14px color-mix(in srgb, var(--red) 80%, transparent), inset 0 1px 0 rgb(255 255 255 / .25);
  transition: transform .45s var(--spring), box-shadow .25s;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
.run-btn span { font: 700 40px/1 var(--font-display); text-transform: uppercase; letter-spacing: .02em; }
.run-btn small { font-size: 14px; opacity: .85; }
.run-btn:active { transform: scale(.96); box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--red) 80%, transparent); }
.outs-big { display: flex; align-items: center; justify-content: center; gap: 16px; }
.outs-big .label { font: 600 14px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.outs-big button {
  width: 54px; height: 54px; border-radius: 50%;
  border: 3px solid var(--line-2);
  background: var(--surface);
  cursor: pointer;
  transition: background-color .25s, border-color .25s, transform .45s var(--spring);
  touch-action: manipulation;
}
.outs-big button.on { background: var(--gold); border-color: #d9b100; transform: scale(1.06); }
.outs-big button:active { transform: scale(.9); }
.three-outs { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 12px; border-radius: 18px; background: color-mix(in srgb, var(--gold) 22%, var(--surface)); animation: rise .5s var(--spring); }
.three-outs span { font: 600 18px var(--font-display); text-transform: uppercase; letter-spacing: .06em; }
.he-grid { display: grid; gap: 10px; margin-top: 12px; }
.he { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.stepper .label { padding: 0 4px 0 6px; font: 600 12px var(--font-display); letter-spacing: .12em; color: var(--muted); white-space: nowrap; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); font: 600 20px/1 var(--font-body); cursor: pointer; touch-action: manipulation; transition: transform .35s var(--spring); }
.stepper button:active { transform: scale(.88); }
.stepper b { min-width: 26px; text-align: center; font: 600 20px var(--font-display); font-variant-numeric: tabular-nums; }
.linescore .cell { width: 100%; min-width: 28px; padding: 4px 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; border-radius: 6px; }
.linescore .cell:hover { background: var(--surface-2); }

/* ---------- pitch counter ---------- */
.pitcher { --tone: var(--win); display: grid; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); border-top: 6px solid var(--tone); animation: rise .5s var(--spring) both; }
.pitcher.warn { --tone: var(--tie); }
.pitcher.near { --tone: #e07b00; }
.pitcher.max { --tone: var(--loss); }
.pc-main { display: grid; grid-template-columns: 64px 1fr 120px; gap: 12px; align-items: center; }
.pc-ring { position: relative; width: 150px; height: 150px; justify-self: center; display: grid; place-items: center; }
.pc-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.pc-ring circle { fill: none; stroke-width: 9; }
.pc-ring .trk { stroke: var(--surface-3); }
.pc-ring .val { stroke: var(--tone); stroke-linecap: round; transition: stroke-dasharray .5s var(--spring-soft), stroke .3s; }
.pc-ring div { display: grid; justify-items: center; line-height: 1; }
.pc-num { font: 700 58px var(--font-display); font-variant-numeric: tabular-nums; }
.pc-ring small { font: 500 11px var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.pc-plus, .pc-minus { border: 0; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; transition: transform .4s var(--spring); }
.pc-plus { height: 120px; border-radius: 28px; background: radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--tone) 70%, #fff), var(--tone)); color: #fff; font: 700 38px var(--font-display); box-shadow: 0 16px 30px -14px var(--tone); }
.pc-minus { height: 64px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line-2); font: 600 28px var(--font-display); color: var(--fg); }
.pc-plus:active, .pc-minus:active { transform: scale(.92); }
.pc-bar { position: relative; height: 10px; border-radius: 99px; background: var(--surface-3); overflow: visible; }
.pc-bar span { display: block; height: 100%; border-radius: 99px; background: var(--tone); transition: width .5s var(--spring-soft); }
.pc-bar i { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--fg-2); opacity: .45; border-radius: 2px; }
.pc-msg { font-weight: 600; }
.pick { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; transition: transform .4s var(--spring), border-color .2s; }
.pick:hover { border-color: var(--line-2); transform: translateX(3px); }
.pick.no { opacity: .7; }
.pick-name { flex: 1; display: grid; font-weight: 600; }
.pick-name small { font-weight: 400; color: var(--muted); font-size: 13px; }
@media (max-width: 420px) { .pc-main { grid-template-columns: 56px 1fr 96px; } .pc-ring { width: 128px; height: 128px; } .pc-num { font-size: 48px; } .pc-plus { height: 104px; } }

/* ---------- data entry sheets ---------- */
.sheet th, .sheet td { padding: 6px 4px; }
.sheet td:first-child, .sheet th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; padding-left: 12px; }
.sheet input[type="number"] { width: 52px; min-height: 40px; padding: 6px; text-align: center; border-radius: 10px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.sheet input::-webkit-outer-spin-button, .sheet input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sheet .grp { border-left: 2px solid var(--line-2); }
.sticky-actions { position: sticky; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 6; display: flex; gap: 10px; justify-content: flex-end; padding: 10px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 85%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--shadow-2); }
@media (min-width: 900px) { .sticky-actions { bottom: 16px; } }

/* ---------- lineup builder ---------- */
.lineup { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1000px) { .lineup { grid-template-columns: 380px minmax(0, 1fr); } }
.order { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.order li { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); transition: transform .35s var(--spring), box-shadow .2s, opacity .2s; }
.order li[draggable="true"] { cursor: grab; }
.order li.dragging { opacity: .6; box-shadow: var(--shadow-2); transform: scale(1.02); }
.order .handle { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font: 600 14px var(--font-display); flex: none; }
.order .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order.bench li { background: transparent; border-style: dashed; }
.grid-def select.pos { min-height: 38px; width: 62px; padding: 4px 6px; background-image: none; border-radius: 10px; font: 600 14px var(--font-display); text-align: center; text-align-last: center; }
.grid-def .pos-P { background: color-mix(in srgb, var(--red) 18%, var(--surface)); border-color: var(--red); }
.grid-def .pos-C { background: color-mix(in srgb, var(--info) 16%, var(--surface)); border-color: var(--info); }
.grid-def .pos-BN { color: var(--muted); background: var(--surface-2); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checks li { padding: 8px 12px; border-radius: 12px; font-size: 14.5px; animation: rise .4s var(--spring) both; }
.checks li.warn { background: color-mix(in srgb, var(--loss) 10%, var(--surface)); color: var(--loss); }
.checks li.ok { background: color-mix(in srgb, var(--win) 12%, var(--surface)); color: var(--win); font-weight: 600; }

/* ---------- print studio ---------- */
.tpl-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.tpl { display: grid; gap: 6px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); text-decoration: none; }
.tpl b { font: 600 19px var(--font-display); text-transform: uppercase; }
.tpl-art { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; margin-bottom: 6px; background: linear-gradient(150deg, var(--navy-2), var(--navy)); }
.tpl-art i { position: absolute; display: block; border-radius: 4px; background: rgb(255 255 255 / .18); transition: transform .6s var(--spring); }
.tpl:hover .tpl-art i { transform: translateY(-3px); }
.tpl-art i:nth-child(1) { left: 10%; top: 10%; width: 55%; height: 14%; background: #fff; }
.tpl-art i:nth-child(2) { left: 10%; top: 30%; width: 80%; height: 10%; }
.tpl-art i:nth-child(3) { left: 10%; top: 45%; width: 80%; height: 10%; transition-delay: .03s; }
.tpl-art i:nth-child(4) { left: 10%; top: 60%; width: 80%; height: 10%; transition-delay: .06s; }
.tpl-art i:nth-child(5) { left: 10%; top: 78%; width: 22%; height: 14%; background: var(--gold); }
.tpl-gameday { background: linear-gradient(160deg, var(--red) 0 35%, var(--navy) 35% 70%, #eb6e1f 70%); }
.tpl-gameday i:nth-child(2), .tpl-gameday i:nth-child(3) { width: 30%; height: 30%; border-radius: 50%; top: 34%; }
.tpl-gameday i:nth-child(3) { left: 60%; }
.tpl-gameday i:nth-child(4) { display: none; }
.tpl-result i:nth-child(2) { left: 22%; width: 56%; height: 32%; background: #fff; opacity: .9; }
.tpl-result i:nth-child(3), .tpl-result i:nth-child(4) { display: none; }
.tpl-player { background: linear-gradient(140deg, var(--gold), #fff3b0, var(--gold)); }
.tpl-player i:nth-child(1) { left: 24%; top: 8%; width: 52%; height: 84%; background: var(--red); }
.tpl-player i:nth-child(2) { left: 24%; top: 18%; width: 30%; height: 8%; background: var(--gold); }
.tpl-player i:nth-child(n+3) { display: none; }
.tpl-moment { background: linear-gradient(150deg, var(--navy), #2b1550); }
.tpl-moment i:nth-child(1) { left: 14%; top: 8%; width: 72%; height: 16%; background: var(--gold); transform: rotate(-3deg); }
.tpl-moment i:nth-child(2) { left: 28%; top: 30%; width: 44%; height: 56%; background: #fff; transform: rotate(3deg); }
.tpl-moment i:nth-child(3) { left: 32%; top: 34%; width: 36%; height: 38%; background: var(--red); transform: rotate(3deg); }
.tpl-moment i:nth-child(n+4) { display: none; }
.tpl-thanks { background: linear-gradient(150deg, var(--red), #8e1328); }
.tpl-thanks i:nth-child(1) { left: 15%; width: 70%; background: var(--gold); }
.tpl-thanks i:nth-child(2) { left: 12%; top: 34%; width: 76%; height: 40%; background: rgb(255 255 255 / .85); }
.tpl-thanks i:nth-child(n+3) { display: none; }
.tpl-roster i:nth-child(n+2):nth-child(-n+4) { width: 24%; height: 22%; top: 34%; }
.tpl-roster i:nth-child(3) { left: 38%; }
.tpl-roster i:nth-child(4) { left: 66%; }
.tpl-summary i:nth-child(2) { left: 25%; width: 50%; height: 30%; background: #fff; }
.tpl-summary i:nth-child(3), .tpl-summary i:nth-child(4) { width: 36%; top: 66%; }
.tpl-summary i:nth-child(4) { left: 54%; }
.tpl-summary i:nth-child(5) { display: none; }
.tpl-flyer { background: linear-gradient(150deg, var(--red), #8e1328); }
.tpl-flyer i:nth-child(1) { height: 26%; width: 70%; }

.studio { display: grid; gap: 18px; align-items: start; }
@media (min-width: 980px) { .studio { grid-template-columns: 360px minmax(0, 1fr); } .studio-controls { position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100dvh - var(--topbar-h) - 32px); overflow: auto; } }
.studio-stage { display: grid; gap: 14px; min-width: 0; }
.stage-frame {
  position: relative;
  width: 100%;
  border-radius: 18px;
  display: grid;
  justify-items: center;
  transition: height .5s var(--spring-soft);
}
.stage-sheet { position: absolute; top: 0; left: 50%; margin-left: calc(var(--sheet-w, 0px) / -2); transform-origin: top left; transition: transform .5s var(--spring-soft), width .3s, height .3s; box-shadow: 0 40px 80px -30px rgb(7 21 40 / .6), 0 0 0 1px rgb(0 0 0 / .06); border-radius: 4px; overflow: hidden; background: #fff; }
.stage-sheet iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity .35s var(--ease-out); pointer-events: none; }
.stage-sheet iframe.show { opacity: 1; }
.stage-frame.loading .stage-sheet { filter: saturate(.85); }
.stage-busy { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 12px; border-radius: 18px; background: color-mix(in srgb, var(--bg) 70%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-weight: 700; }
.stage-busy[hidden] { display: none; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--surface-3); border-top-color: var(--red); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chips-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-chip { position: relative; cursor: pointer; }
.pick-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pick-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; transition: background-color .2s, color .2s, border-color .2s, transform .35s var(--spring); }
.pick-chip:active span { transform: scale(.95); }
.pick-chip input:checked + span { background: var(--navy); color: #fff; border-color: transparent; }
.pick-chip input:focus-visible + span { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.pick-chip[class*="swatch-"] span::before { content: ""; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.swatch-navy span::before { background: #0c2340; }
.swatch-red span::before { background: #c41e3a; }
.swatch-paper span::before { background: #fff; }
.swatch-gold span::before { background: #ffd200; }
.swatch-night span::before { background: #0f0e12; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { margin-bottom: 6px; }
.photo-pick { display: grid; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.photo-drop { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; border: 1.5px dashed var(--line-2); cursor: pointer; transition: border-color .2s, background-color .2s; }
.photo-drop:hover { border-color: var(--red); background: color-mix(in srgb, var(--red) 5%, transparent); }
.photo-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo-thumb { width: 64px; height: 64px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2) center / cover no-repeat; color: var(--muted); }
.photo-thumb.has svg { display: none; }
.range-field input[type="range"] { width: 100%; accent-color: var(--red); }
.drag-layer { position: absolute; inset: 0; z-index: 2; cursor: grab; touch-action: none; }
.drag-layer.grabbing { cursor: grabbing; }
.result-grid input[type="number"] { width: 46px; }
.result-grid input[readonly] { background: var(--surface-2); color: var(--muted); }
.result-grid .R { color: var(--red); }
