/* Mason Report: the frame around everything. Follows the phone's light/dark setting; cards keep their board's colors. */
@font-face { font-family: 'Chakra Petch'; src: url('/fonts/ChakraPetch-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Chakra Petch'; src: url('/fonts/ChakraPetch-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Chakra Petch'; src: url('/fonts/ChakraPetch-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('/fonts/IBMPlexSans-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('/fonts/IBMPlexSans-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('/fonts/IBMPlexSans-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/IBMPlexMono-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/IBMPlexMono-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/fonts/IBMPlexMono-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  --bg: #f3f3f1; --panel: #ffffff; --panel2: #ececea; --line: #d9d9d6; --ink: #141516; --ink2: #4a4c50; --ink3: #7b7e83;
  --hot: #d6249f; --ok: #1f8a4c; --bad: #c62828; --focus: #141516;
  --f-disp: 'Chakra Petch', ui-sans-serif, system-ui, sans-serif; --f-body: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif; --f-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --gut: max(16px, env(safe-area-inset-left, 0px)); --gutr: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121314; --panel: #1a1b1d; --panel2: #232427; --line: #333437; --ink: #dcdddf; --ink2: #a5a6a9; --ink3: #737477; --hot: #ff4fd8; --ok: #4cc283; --bad: #ff6b6b; --focus: #dcdddf; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.5; min-height: 100vh; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-disp); font-weight: 600; margin: 0; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(28px, 7vw, 40px); font-weight: 700; }
h2 { font-size: 22px; } h3 { font-size: 17px; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* top bar + menu */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px var(--gutr) 10px var(--gut);
  padding-top: max(10px, env(safe-area-inset-top, 0px)); background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 6px; align-items: baseline; text-decoration: none; font-family: var(--f-disp); font-weight: 700; font-size: 20px; letter-spacing: .04em; }
.brand .mark2, .brand-big .mark2 { color: var(--ink3); }
.crewname { flex: 1; min-width: 0; font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menubtn { width: 44px; height: 44px; display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; align-items: center; background: none; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.menubtn span { display: block; width: 20px; height: 2px; background: var(--ink); }
.menu { position: fixed; z-index: 30; top: 0; right: 0; bottom: 0; width: min(300px, 84vw); background: var(--panel); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .2s ease; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top, 0px)) 0 16px; overflow-y: auto; }
.menu a, .menu .linklike { display: block; padding: 14px 22px; text-decoration: none; font-family: var(--f-disp); font-weight: 600; font-size: 19px; border-bottom: 1px solid var(--line); text-align: left; }
.menu .linklike { background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--ink2); cursor: pointer; width: 100%; font-size: 17px; }
.scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
body.menu-open .menu { transform: none; } body.menu-open .scrim { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .menu, .scrim { transition: none; } }

/* page */
.page { max-width: 1020px; margin: 0 auto; padding: 18px var(--gutr) 64px var(--gut); display: flex; flex-direction: column; gap: 18px; }
.loading { color: var(--ink3); font-family: var(--f-mono); font-size: 13px; padding: 30px 0; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.lede { color: var(--ink2); font-size: 17px; }
.small { font-size: 14px; color: var(--ink2); }
.muted { color: var(--ink3); }
.mono { font-family: var(--f-mono); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-end { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.eyebrow { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); }

/* forms */
.field { display: flex; flex-direction: column; gap: 4px; }
.field .lab { font-size: 13px; font-weight: 500; color: var(--ink2); }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--panel); border: 1px solid var(--line); padding: 11px 12px; border-radius: 0; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
.hint { font-size: 13px; color: var(--ink3); } .hint.ok { color: var(--ok); } .hint.bad { color: var(--bad); }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.check input { width: 20px; height: 20px; }
.warn { font-size: 13.5px; color: var(--ink2); border-left: 3px solid var(--hot); padding: 6px 10px; background: var(--panel2); }
.btn { font: inherit; font-family: var(--f-disp); font-weight: 600; font-size: 16px; letter-spacing: .02em; color: var(--ink); background: var(--panel); border: 1px solid var(--ink3);
  padding: 10px 16px; min-height: 44px; cursor: pointer; border-radius: 0; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.big { min-height: 52px; font-size: 18px; width: 100%; }
.btn.slim { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.linklike { font: inherit; }

/* auth */
.auth { max-width: 460px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.brand-big { font-family: var(--f-disp); font-weight: 700; font-size: clamp(44px, 14vw, 64px); line-height: .9; letter-spacing: .03em; display: flex; flex-direction: column; }
.code { font-family: var(--f-mono); font-size: clamp(18px, 5.4vw, 24px); font-weight: 600; letter-spacing: .06em; padding: 16px; background: var(--panel); border: 1px dashed var(--ink3); text-align: center; word-break: break-all; }

/* toast + modal */
#toast { position: fixed; z-index: 50; left: 50%; bottom: max(18px, env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 150%); background: var(--ink); color: var(--bg);
  padding: 12px 16px; max-width: min(92vw, 520px); font-size: 15px; transition: transform .2s; }
#toast.show { transform: translate(-50%, 0); } #toast.err { background: var(--bad); color: #fff; }
.modal { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 20px; max-width: min(92vw, 520px); width: 100%; }
.modal::backdrop { background: rgba(0, 0, 0, .5); }
.modal h2 { margin-bottom: 10px; }

/* lists */
.list { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--panel); }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; min-height: 56px; }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .t1 { font-weight: 600; } .item .t2 { font-size: 13.5px; color: var(--ink2); font-family: var(--f-mono); }
.badge { display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; align-items: center; justify-content: center; background: var(--hot); color: #fff; font-size: 12px; font-weight: 600; font-family: var(--f-mono); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; padding: 6px 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--ink2); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tag { font-family: var(--f-mono); font-size: 11.5px; padding: 2px 6px; border: 1px solid var(--line); color: var(--ink2); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); font-weight: 500; }
.tw { overflow-x: auto; }
.bar { height: 10px; background: var(--panel2); position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--ink2); }
.progress { height: 6px; background: var(--panel2); } .progress > i { display: block; height: 100%; background: var(--hot); width: 0; transition: width .2s; }
.cardframe { width: 100%; border: 0; display: block; background: #121314; min-height: 70vh; }
/* leaderboards */
table.lb td, table.lb th { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.lb thead th { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); font-weight: 500; }
table.lb tr.me td { background: var(--panel2); font-weight: 600; }
table.lb td a { color: inherit; }
details > summary { cursor: pointer; padding: 6px 0; }
.segmap { width: 100%; height: auto; display: block; border: 1px solid var(--line); }
/* head-to-head and compare */
table.h2h th, table.h2h td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.h2h tbody th { text-transform: none; letter-spacing: 0; font-family: var(--f-body); font-size: 14px; color: var(--ink); font-weight: 600; min-width: 150px; white-space: normal; }
table.h2h tbody th .small { font-weight: 400; }
table.h2h td { font-family: var(--f-mono); white-space: nowrap; }
table.h2h td.win { font-weight: 700; background: var(--panel2); }
table.h2h .pt { color: var(--hot); font-weight: 700; }
/* stats */
.stgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px 20px; }
.st .sv { font-family: var(--f-disp); font-weight: 700; font-size: 26px; line-height: 1.1; }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hb { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.hb .hl { font-family: var(--f-mono); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb .ht { position: relative; height: 14px; background: var(--panel2); }
.hb .ht > i { position: absolute; left: 0; top: 0; bottom: 0; display: block; }
.hb .hv { font-family: var(--f-mono); white-space: nowrap; min-width: 64px; text-align: right; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 720px) { .two { grid-template-columns: minmax(0, 1fr); } .hb { grid-template-columns: 70px minmax(0, 1fr) auto; } }
#toast:not(.show) { visibility: hidden; transition: transform .2s, visibility 0s .2s; }
.menubtn.dot::after { content: ""; position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--hot); } .menubtn { position: relative; }
.artprev img { width: 100%; max-width: 420px; height: auto; display: block; } .artprev { min-height: 20px; }
