:root {
  color-scheme: dark;
  --bg: #0b0b0c;
  --panel: #161617;
  --field: #0f0f10;
  --ink: #f7f7f8;
  --muted: #c7c7cc;
  --subtle: #a9a9af;
  --line: #38383c;
  --accent: #ebd296;
  --amber: #f4cb83;
  --danger: #ffa8aa;
  --sans: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 var(--sans);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
a { color: inherit; text-decoration: none; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#main:focus { outline: none; }
.sr-only, .team-marker, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  z-index: 30;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--bg);
}

/* The brief brand layer never intercepts input or delays page startup. */
.site-intro {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 46%, #232324, #0b0b0c 62%);
  pointer-events: none;
  animation: intro-exit 860ms ease-out both;
}
body:focus-within .site-intro { opacity: 0 !important; visibility: hidden !important; }
.intro-lockup {
  display: grid;
  justify-items: center;
  gap: 7px;
  animation: rise-in 430ms cubic-bezier(.2,.75,.25,1) both;
}
.intro-lockup strong { font-size: 32px; line-height: 1.25; letter-spacing: .07em; }
.intro-lockup strong span, .brand-type strong span { color: var(--amber); }
.intro-caption { color: var(--accent); font: 10px/1.5 var(--mono); letter-spacing: .18em; }
.intro-lockup::after {
  width: 74px;
  height: 1px;
  margin-top: 13px;
  background: var(--accent);
  box-shadow: 0 0 12px #ebd29660;
  content: "";
  animation: signal-line 510ms cubic-bezier(.2,.75,.25,1) both;
}
@keyframes intro-exit {
  0%, 54% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}
@keyframes signal-line { from { transform: scaleX(.06); } to { transform: scaleX(1); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

.topbar {
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--line);
  background: #101011;
}
.topbar-inner, .page-shell {
  width: min(100%, 1570px);
  margin-inline: auto;
  padding-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right));
}
.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 7px; flex: none; }
.brand img { width: 36px; height: 36px; }
.brand-type { display: grid; gap: 2px; }
.brand-type strong { font-size: 18px; line-height: 1.15; letter-spacing: .03em; }
.brand-type small { color: var(--subtle); font: 9px/1.2 var(--mono); letter-spacing: .15em; }
.header-location { border-left: 1px solid var(--line); padding-left: 15px; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 13px; margin-left: auto; }
.readonly-label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.eyebrow > span:first-child {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}
.page-shell { padding-block: 11px max(12px, env(safe-area-inset-bottom)); }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--accent);
  font: 600 11px/1.5 var(--mono), var(--sans);
  letter-spacing: .09em;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
  width: min(100%, 945px);
  margin: clamp(12px, 3.7vw, 45px) auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 24px 72px #0006;
  animation: rise-in 460ms 240ms cubic-bezier(.2,.75,.25,1) both;
}
.login-art {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 22px clamp(20px, 3.2vw, 38px) 18px;
  background: linear-gradient(151deg, #252526, #1a1a1b 56%, #111112);
  border-right: 1px solid var(--line);
}
.art-head, .art-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font: 10px/1.5 var(--mono);
  letter-spacing: .11em;
}
.art-head { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.art-head > :last-child { color: var(--accent); }
.art-foot { margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line); }
.art-copy { position: relative; z-index: 1; margin-top: clamp(16px, 2.6vw, 28px); }
.art-title { margin: 10px 0 8px; font-size: clamp(28px, 3.7vw, 46px); line-height: 1.16; font-weight: 750; letter-spacing: -.04em; }
.art-title em { color: var(--accent); font-style: normal; }
.art-description { margin: 0; color: var(--muted); font-size: 14px; }
.pitch-graphic { margin: -4px -22px -14px; filter: grayscale(1); pointer-events: none; }
.pitch-art { display: block; width: 100%; height: auto; }

.login-box {
  align-self: center;
  min-width: 0;
  padding: clamp(21px, 3.6vw, 43px);
  animation: rise-in 420ms 340ms cubic-bezier(.2,.75,.25,1) both;
}
.login-box h1, .recheck-panel h1 { margin: 8px 0 5px; font-size: clamp(25px, 2.8vw, 35px); line-height: 1.25; letter-spacing: -.03em; }
.login-description { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.login-box form, .login-field { display: grid; }
.login-box form { gap: 11px; }
.login-field { gap: 5px; }
.login-field label { color: var(--ink); font-size: 13px; font-weight: 600; }
.login-field input, .search-field, .select-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid #525257;
  border-radius: 8px;
  background: var(--field);
}
.login-field input { min-height: 45px; padding: 9px 13px; font-size: 16px; }
input::placeholder { color: var(--subtle); opacity: 1; }
.login-field input:focus, .search-field:focus-within, .select-field select:focus { border-color: var(--accent); }
.action-button, .quiet-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid #525257;
  border-radius: 8px;
  background: #232325;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  transition: background-color 160ms, border-color 160ms, transform 160ms;
}
.action-button {
  position: relative;
  margin-top: 4px;
  min-height: 45px;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-size: 16px;
}
.submit-arrow { position: absolute; right: 15px; font-size: 20px; transition: transform 160ms; }
.action-button:active:not(:disabled), .quiet-button:active:not(:disabled) { transform: translateY(1px); }
.login-notice { margin: -2px 0 0; color: var(--amber); font-size: 13px; }
.login-notice:empty { margin: -11px 0 0; }
#retry-signout { justify-self: start; }
.device-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 20px 0 0;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.device-mark { flex: none; width: 10px; height: 13px; margin-top: 3px; border: 1px solid var(--accent); border-radius: 2px; }
.recheck-panel {
  width: min(100%, 510px);
  margin: clamp(0px, 3vw, 34px) auto 0;
  padding: clamp(24px, 5vw, 38px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.recheck-panel > p:not(.eyebrow) { color: var(--muted); }

.feed-heading, .feed-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.feed-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 12px; }
.feed-title h1 { margin: 0; font-size: clamp(21px, 2.1vw, 27px); line-height: 1.2; letter-spacing: -.025em; }
.feed-title p { margin: 0; color: var(--muted); font-size: 12px; }
.refresh-button { flex: none; }
.refresh-button span { font-size: 17px; line-height: 1; transition: transform 180ms; }

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(104px, 170px) minmax(98px, 140px) auto;
  gap: 6px;
  margin: 7px 0 9px;
}
.search-field { display: flex; align-items: center; gap: 8px; padding-inline: 10px; }
.search-mark { position: relative; flex: none; width: 12px; height: 12px; margin-right: 2px; border: 1.5px solid var(--subtle); border-radius: 50%; }
.search-mark::after { position: absolute; left: 8px; top: 8px; width: 6px; height: 1.5px; transform: rotate(45deg); background: var(--subtle); content: ""; }
.search-field input, .select-field select { min-height: 35px; font-size: 14px; }
.search-field input { width: 100%; min-width: 0; padding: 4px 0; border: 0; background: transparent; }
.search-field input:focus-visible { outline: none; }
.search-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.select-field { min-width: 0; }
.select-field select { height: 100%; padding: 4px 8px; cursor: pointer; }
.notice { margin-bottom: 9px; padding: 7px 10px; border: 1px solid #6c5632; border-radius: 6px; background: #282118; color: var(--amber); font-size: 13px; }
.notice.data-error { border-color: #744447; background: #2c1b1d; color: var(--danger); }

.record-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
#record-grid, #record-grid * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.match-card {
  --result-color: var(--amber);
  --result-bg: #2c2518;
  --result-line: #65502b;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  transition: border-color 150ms;
}
.match-card.result-win { --result-color: #a4edb9; --result-bg: #192b20; --result-line: #3b6347; }
.match-card.result-loss { --result-color: var(--danger); --result-bg: #302023; --result-line: #6a4146; }
.match-card.result-void { --result-color: var(--muted); --result-bg: #262629; --result-line: #505055; }
.match-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
}
.league-label { min-width: 0; color: var(--ink); font-size: 13px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.stage { max-width: 8em; color: var(--muted); text-align: right; font-size: 12px; line-height: 1.3; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result-pill {
  padding: 2px 6px;
  border: 1px solid var(--result-line);
  border-radius: 4px;
  background: var(--result-bg);
  color: var(--result-color);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.match-body { flex: 1; padding: 6px 10px; }
.matchup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(78px, .7fr) minmax(0, 1fr); align-items: center; gap: 6px; }
.team { min-width: 0; line-height: 1.38; }
.team.home { text-align: right; }
.team-name { color: var(--ink); font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.scoreline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 30px;
  color: var(--ink);
  font: 700 clamp(22px, 2vw, 25px)/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.06em;
  white-space: nowrap;
}
.score-divider { color: var(--muted); font-size: .74em; }
.recommendation { display: flex; align-items: baseline; gap: 6px; margin-top: 5px; padding-top: 4px; border-top: 1px solid var(--line); }
.field-caption { flex: none; color: var(--subtle); font-size: 11px; }
.recommendation p { min-width: 0; margin: 0; color: var(--ink); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.custom-fields { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 4px; }
.custom-field { max-width: 100%; color: var(--ink); font-size: 12px; overflow-wrap: anywhere; }
.custom-field span { margin-right: 5px; color: var(--subtle); }
.match-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 3px 10px;
  border-top: 1px solid var(--line);
  background: var(--field);
  color: var(--subtle);
  font-size: 11px;
}
.match-footer time { color: var(--muted); font-variant-numeric: tabular-nums; }
.record-watermark {
  position: absolute;
  z-index: 1;
  top: 54%;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 20px);
  transform: translate(-50%, -50%) rotate(-8deg);
  color: #d0d0d4;
  opacity: .38;
  text-align: center;
  text-shadow: 0 1px 2px var(--bg);
  font: 10px/1.3 var(--mono);
  overflow-wrap: anywhere;
  pointer-events: none;
}

.empty-state { display: grid; justify-items: center; align-content: center; min-height: 148px; padding: 14px; border: 1px dashed var(--line); border-radius: 8px; background: var(--panel); text-align: center; }
.empty-symbol { margin-bottom: 3px; color: var(--accent); font-size: 23px; }
.empty-state h2 { margin: 0; font-size: 16px; }
.empty-state p { max-width: 360px; margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.feed-bottom { min-height: 45px; color: var(--muted); font-size: 12px; }
.page-footer { padding-block: 8px 4px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 12px; }
.noscript { margin: 12px; color: var(--amber); text-align: center; }

@media (hover: hover) and (pointer: fine) {
  .action-button:hover:not(:disabled) { background: #dedee2; }
  .action-button:hover:not(:disabled) .submit-arrow { transform: translateX(4px); }
  .quiet-button:hover:not(:disabled) { border-color: #77777e; background: #2e2e31; }
  .refresh-button:hover:not(:disabled) span { transform: rotate(30deg); }
  .match-card:hover { border-color: #65656a; }
}
@media (min-width: 650px) {
  .record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .record-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .record-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar-inner, .page-shell { padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
  .topbar-inner { gap: 8px; }
  .brand { gap: 6px; }
  .brand img { width: 34px; height: 34px; }
  .brand-type strong { font-size: 17px; }
  .header-location { display: none; }
  .page-shell { padding-top: 8px; }
  .login-panel { width: min(100%, 440px); grid-template-columns: minmax(0, 1fr); margin-top: 5px; }
  .login-art { padding: 13px 17px 15px; border-right: 0; border-bottom: 1px solid var(--line); }
  .art-head { padding-bottom: 7px; }
  .art-copy { margin-top: 10px; }
  .art-title { margin: 5px 0 4px; font-size: clamp(23px, 6vw, 31px); }
  .art-break, .art-foot { display: none; }
  .art-description { font-size: 12px; }
  .pitch-graphic { position: absolute; z-index: -1; width: 73%; right: -17%; bottom: -18%; margin: 0; opacity: .45; }
  .login-box { padding: 18px 17px 17px; }
  .login-description { margin-bottom: 14px; }
  .login-box form { gap: 10px; }
  .login-notice:empty { margin-top: -10px; }
  .device-note { margin-top: 13px; padding-top: 10px; }
}
@media (max-width: 520px) {
  .feed-title p { display: none; }
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .search-field { grid-column: 1 / -1; }
  .search-field input, .select-field select { min-height: 42px; font-size: 16px; }
  .quiet-button { min-height: 44px; }
}
@media (pointer: coarse) {
  .quiet-button { min-height: 44px; }
  .search-field input, .select-field select { min-height: 42px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-intro { display: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
