:root {
  font-family: "Helvetica Neue", Arial, "PingFang SC", sans-serif;
  color: #111;
  background: #fff;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button, a { color: inherit; }
button { font: inherit; cursor: pointer; }
header {
  height: 88px;
  max-width: 1040px;
  margin: auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.brand { text-decoration: none; font-size: 30px; font-weight: 700; letter-spacing: -1px; }
header button { position: absolute; right: 10px; border: 0; background: none; width: 44px; height: 44px; display: grid; place-items: center; }
main { max-width: 1040px; margin: auto; padding: 20px 18px 60px; }
.section-head { margin: 0 0 24px; }
h1, h2 { font-size: 38px; font-weight: 500; letter-spacing: -1.3px; margin: 0; line-height: 1.2; }
.card { display: block; text-align: left; width: 100%; border: 0; padding: 0; background: none; }
.image-wrap { overflow: hidden; background: #eee; }
.card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.caption { padding-top: 12px; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.title-row h3 { font-size: 25px; letter-spacing: -.6px; margin: 0; font-weight: 500; line-height: 1.25; }
.arrow { display: none; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tags span { font-size: 16px; color: #777; line-height: 1.5; }
.tags span:not(:last-child)::after { content: " /"; padding-left: 8px; color: #aaa; }
.library { margin-top: 60px; padding-top: 36px; border-top: 1px solid #aaa; }
nav { display: flex; gap: 24px; padding-bottom: 26px; overflow: auto; }
nav button { white-space: nowrap; border: 0; border-bottom: 1px solid transparent; padding: 10px 0; font-size: 17px; background: none; min-height: 44px; }
nav button.active { border-bottom-color: #111; }
#grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 42px; }
.search { margin-bottom: 20px; }
.search input { width: 100%; border: 1px solid #888; background: #fff; padding: 16px; font-size: 18px; border-radius: 0; }
dialog { padding: 0; border: 0; width: calc(100% - 36px); max-width: 520px; background: #fff; color: #111; max-height: 90dvh; overflow: auto; }
dialog::backdrop { background: #0009; }
dialog > img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.close { position: absolute; right: 10px; top: 10px; width: 44px; height: 44px; background: #fff; border: 0; font-size: 30px; }
.dialog-body { padding: 24px; }
.dialog-body h2 { font-size: 30px; }
.dialog-body p { font-size: 18px; line-height: 1.8; margin: 28px 0; }
.dialog-footer { border-top: 1px solid #ddd; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.dialog-footer > span { font-size: 16px; color: #777; }
.dialog-footer a { border: 1px solid #111; padding: 16px 20px; text-decoration: none; font-size: 18px; display: flex; gap: 24px; }
:focus-visible { outline: 2px solid #111; outline-offset: 4px; }
[hidden] { display: none !important; }
#empty { font-size: 18px; padding: 24px 0; color: #777; }
@media (min-width: 700px) {
  header { height: 110px; }
  main { padding: 30px 42px 80px; }
  h1, h2 { font-size: 42px; }
  .title-row h3 { font-size: 30px; }
  #grid { gap: 56px; }
}

.brand img { display: block; width: 72px; height: 72px; object-fit: contain; }

/* OFFBALL: black canvas, white typography, brand red for active controls. */
:root { color: #f5f5f5; background: #000; color-scheme: dark; }
header { height: 112px; }
.brand img { width: 100px; height: 100px; object-fit: contain; }
.image-wrap { background: #171717; }
.library { border-top-color: #333; }
nav button { color: #a8a8a8; }
nav button.active { color: #ff3333; border-bottom-color: #ff3333; }
.search input { color: #f5f5f5; background: #0d0d0d; border-color: #555; }
.search input::placeholder { color: #aaa; }
dialog { color: #f5f5f5; background: #0d0d0d; }
dialog::backdrop { background: #000c; }
.close { color: #fff; background: #111; }
.dialog-footer { border-top-color: #333; }
.dialog-footer > span { color: #aaa; }
.dialog-footer a { color: #fff; background: #dc2424; border-color: #dc2424; }
:focus-visible { outline-color: #ff3333; }
#empty { color: #aaa; }
@media (min-width: 700px) { header { height: 124px; } }

header #menuToggle { left: 10px; right: auto; }
#drawer { position: fixed; inset: 0 auto 0 0; margin: 0; width: min(84vw, 360px); height: 100dvh; max-height: 100dvh; background: #080808; border-right: 1px solid #333; }
#drawer nav { display: flex; flex-direction: column; gap: 0; padding: 100px 28px 28px; }
#drawer nav button { text-align: left; font-size: 25px; color: #f5f5f5; padding: 24px 0; border-bottom: 1px solid #333; }
#drawer nav button:hover { color: #ff3333; }

/* A24 mobile navigation: full-screen black overlay and large plain links. */
#drawer { inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; background: #000; border: 0; }
#drawer::backdrop { background: #000; }
#drawer .close { position: absolute; top: 12px; left: 10px; right: auto; width: auto; min-height: 44px; padding: 0 8px; display: flex; align-items: center; gap: 14px; color: #fff; background: none; }
#drawer .close span:first-child { font-size: 30px; font-weight: 300; }
#drawer .close span:last-child { font-size: 16px; }
#drawer nav { padding: 106px 18px 40px; gap: 0; overflow: visible; }
#drawer nav button { font-size: 44px; font-weight: 400; letter-spacing: -1.8px; line-height: 1.4; padding: 0; border: 0; color: #fff; min-height: 62px; }
#drawer nav button:hover { color: #aaa; }
@media (prefers-reduced-motion: no-preference) { #drawer[open] nav { animation: menu-appear 180ms ease-out; } @keyframes menu-appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } } }

#favoriteToggle { width:100%; min-height:48px; font-size:18px; background:none; color:#fff; border:1px solid #666; margin-bottom:24px; padding:12px; }
#favoriteToggle[aria-pressed="true"] { color:#ff3333; border-color:#ff3333; }

#drawer nav button, #drawer nav a { display:block; width:100%; text-align:left; font-size:44px; font-weight:400; letter-spacing:-1.8px; line-height:1.4; padding:22px 0; border:0; border-bottom:1px solid #303030; color:#fff; background:none; text-decoration:none; }
#drawer nav button:hover, #drawer nav a:hover { color:#aaa; }

#drawer nav a { margin-top: 28px; }

/* App-selected theme tokens shared by all OFFBALL pages. */
:root { --page:#000; --text:#f5f5f5; --muted:#aaa; --line:#333; --surface:#0d0d0d; --image:#171717; --brand:#ff3333; --outline:#666; color:var(--text); background:var(--page); color-scheme:dark; }
:root[data-theme="light"] { --page:#fff; --text:#111; --muted:#666; --line:#ddd; --surface:#f7f7f7; --image:#eee; --brand:#d92020; --outline:#888; color-scheme:light; }
body { background:var(--page); color:var(--text); }
.image-wrap { background:var(--image); }
.library { border-top-color:var(--line); }
nav button { color:var(--muted); }
nav button.active { color:var(--brand); border-bottom-color:var(--brand); }
.search input { color:var(--text); background:var(--surface); border-color:var(--outline); }
.search input::placeholder { color:var(--muted); }
dialog { color:var(--text); background:var(--surface); }
.close { color:var(--text); background:var(--surface); }
.dialog-footer { border-top-color:var(--line); }
.dialog-footer > span { color:var(--muted); }
.dialog-footer a { background:var(--brand); border-color:var(--brand); color:#fff; }
#favoriteToggle { color:var(--text); border-color:var(--outline); }
#favoriteToggle[aria-pressed="true"] { color:var(--brand); border-color:var(--brand); }
#empty { color:var(--muted); }
#drawer, #drawer::backdrop { background:var(--page); }
#drawer .close { color:var(--text); }
#drawer nav button, #drawer nav a { color:var(--text); border-bottom-color:var(--line); }
#drawer nav button:hover, #drawer nav a:hover { color:var(--muted); }
:focus-visible { outline-color:var(--brand); }

.title-row h3 { min-width:0; overflow-wrap:anywhere; }
.title-right-text { font-size:16px; line-height:1.5; color:var(--muted); flex-shrink:0; max-width:45%; overflow-wrap:anywhere; text-align:right; }

#featured { display:grid; gap:42px; }

#drawer nav a[href*="digitalCollection"] { margin-top:0; }

.image-wrap { position:relative; touch-action:pan-y; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
.image-wrap img { -webkit-user-drag:none; }
.hold-progress { position:absolute; top:0; left:0; right:0; height:4px; background:#ffffff50; opacity:0; pointer-events:none; }
.hold-progress>span { display:block; height:100%; width:100%; background:#ff3333; transform:scaleX(0); transform-origin:left; }
.is-holding .hold-progress { opacity:1; }
.is-holding .hold-progress>span { transform:scaleX(1); transition:transform 800ms linear; }
.frame-counter { position:absolute; bottom:12px; right:12px; padding:7px 12px; background:#000b; color:#fff; font-size:16px; line-height:1.5; pointer-events:none; }

.preview-track { position:absolute; inset:0; display:flex; width:100%; height:100%; transition:transform 450ms ease; pointer-events:none; background:var(--image); }
.preview-track img { width:100%; height:100%; flex:0 0 100%; aspect-ratio:auto; object-fit:cover; }
@media(prefers-reduced-motion:reduce){ .preview-track{transition:none;} }

.view-all { display:flex; align-items:center; justify-content:space-between; margin-top:38px; padding:20px 0; border-top:1px solid var(--line); color:var(--text); font-size:22px; text-decoration:none; }
#drawer nav a.all-stories-link { margin-top:0; }
body[data-page="all"] .library { margin-top:0; border-top:0; padding-top:0; }

.preview-actions { display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:10px; margin-bottom:24px; }
.preview-actions button, .preview-actions #favoriteToggle { width:100%; min-height:48px; margin:0; padding:12px 6px; font-size:18px; background:none; color:var(--text); border:1px solid var(--outline); }
.preview-actions #favoriteToggle[aria-pressed="true"] { color:var(--brand); border-color:var(--brand); }

/* Mobile drawer: readable navigation without oversized Chinese headings. */
#drawer nav button, #drawer nav a { font-size:36px; letter-spacing:-1px; line-height:1.3; padding:20px 0; min-height:0; }

/* Pointer clicks do not display a focus rectangle. Keyboard Tab retains a neutral cue. */
:focus:not(:focus-visible) { outline:none; }
:root:not([data-focus-input="keyboard"]) :focus-visible { outline:none; }
:root[data-focus-input="keyboard"] :focus-visible { outline:2px solid var(--text); outline-offset:4px; }

/* Tighten the space from the brand header to the first visible content section. */
header { height:96px; }
main { padding-top:12px; }
main > section[hidden] + .library { margin-top:0; padding-top:12px; border-top:0; }
@media (min-width:700px) { header { height:108px; } main { padding-top:20px; } }

#filters[hidden], .nominate-button[hidden] { display:none; }
.nominate-button { display:inline-flex; align-items:center; justify-content:center; min-height:48px; padding:12px 24px; margin:0 0 28px; border:1px solid var(--text); color:var(--text); background:transparent; text-decoration:none; font-size:18px; line-height:1.2; }
.nominate-button:hover { color:var(--page); background:var(--text); }
