/* Amen Pickleball — design system.
   Color + font tokens come from brand.json (injected into index.html by scripts/sync.mjs).
   This file only uses the tokens, so a rebrand never touches it. */

*, *::before, *::after { box-sizing: border-box; }
:root {
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 28px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --shadow: 0 1px 2px rgb(32 34 37 / .05), 0 1px 3px rgb(32 34 37 / .06);
  --shadow-lg: 0 12px 32px -8px rgb(32 34 37 / .18), 0 4px 8px -4px rgb(32 34 37 / .08);
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --soft: color-mix(in srgb, var(--text) 6%, transparent);
  --softer: color-mix(in srgb, var(--text) 3.5%, transparent);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --success-soft: color-mix(in srgb, var(--success) 14%, transparent);
  --danger-soft: color-mix(in srgb, var(--danger) 12%, transparent);
  --warning-soft: color-mix(in srgb, var(--warning) 14%, transparent);
}
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- type ---------- */
.display, h1, h2, .h1, .h2, .h3 {
  font-family: var(--font-display); font-stretch: 78%; font-weight: 800; text-transform: uppercase;
  letter-spacing: .005em; line-height: 1; margin: 0;
}
h1, .h1 { font-size: clamp(30px, 6vw, 44px); }
h2, .h2 { font-size: 22px; }
.h3 { font-size: 17px; }
.eyebrow { font-family: var(--font-display); font-stretch: 90%; font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-family: var(--font-display); font-stretch: 80%; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.tabnum { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
p { margin: 0 0 var(--s3); }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- layout shell ---------- */
.shell { min-height: 100dvh; }
.main { padding: var(--s4) var(--s4) calc(var(--nav-h) + var(--safe-b) + 28px); max-width: 1120px; margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--s2);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--s4) 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; }
.brand .mark { width: 30px; height: 30px; color: var(--text); flex: none; }
img.mark { object-fit: contain; display: block; } /* official monogram, kept at its own proportions inside the logo box */
.brand img.logo { height: 30px; width: auto; }
.wordmark { display: flex; flex-direction: column; line-height: .9; }
.wordmark b { font-family: var(--font-display); font-stretch: 100%; font-weight: 900; font-size: 19px; letter-spacing: .06em; }
.wordmark span { font-family: var(--font-display); font-stretch: 100%; font-weight: 600; font-size: 8.5px; letter-spacing: .34em; color: var(--muted); }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  border: 0; background: transparent; cursor: pointer; color: var(--text); flex: none;
}
.icon-btn:hover { background: var(--soft); }
/* top-bar Light/Dark switch: same quiet icon button as Search and Notifications, with a small turn when pressed */
.theme-toggle .icon { transition: transform .3s var(--ease); }
.theme-toggle:active .icon { transform: rotate(-30deg) scale(.92); }
@media (prefers-reduced-motion: reduce) { .theme-toggle .icon { transition: none; } }
@media (hover: none) { .theme-toggle:hover { background: transparent; } } /* no sticky highlight after a tap on phones */
.icon-btn .dot { position: absolute; top: 7px; right: 7px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: var(--danger-ink); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.icon { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 17px; height: 17px; }
.icon.xs { width: 14px; height: 14px; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-top: 1px solid var(--border);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); position: relative; }
.bottomnav a.active { color: var(--text); }
.bottomnav a.active::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.bottomnav a .icon { width: 24px; height: 24px; }
.sidebar { display: none; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 252px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100dvh; padding: 22px 14px;
    border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto;
  }
  .sidebar .brand { padding: 4px 10px 22px; margin: 0; }
  .sidebar .brand .mark { width: 34px; height: 34px; }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; font-weight: 600; color: var(--muted); }
  .side-link:hover { background: var(--softer); color: var(--text); }
  .side-link.active { background: var(--soft); color: var(--text); }
  .side-link.active .icon { color: var(--accent-text); }
  .side-sep { margin: 16px 12px 6px; }
  .side-foot { margin-top: auto; padding-top: 16px; }
  .bottomnav { display: none; }
  .topbar .brand { visibility: hidden; }
  .main { padding: var(--s6) var(--s8) 64px; }
}

/* ---------- page scaffolding ---------- */
.view-enter { animation: page-in .28s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin: var(--s2) 0 var(--s5); flex-wrap: wrap; }
.page-head .sub { margin-top: 8px; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: var(--s3); padding: 6px 0; }
.back:hover { color: var(--text); }
.section { margin-top: var(--s8); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.section-head a, .link { color: var(--muted); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 2px; }
.section-head a:hover, .link:hover { color: var(--text); }
.grid { display: grid; gap: var(--s4); }
.grid-2 { display: grid; gap: var(--s4); }
.grid-3 { display: grid; gap: var(--s4); }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.dash { display: grid; gap: var(--s6); }
@media (min-width: 1080px) { .dash { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; } .dash > .span { grid-column: 1 / -1; } }
.row { display: flex; align-items: center; gap: var(--s3); }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--s3); }
.stack.lg { gap: var(--s5); }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: var(--s4); } .mt-lg { margin-top: var(--s6); } .mt-sm { margin-top: var(--s2); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card.pad { padding: var(--s5); }
.card.tight { padding: var(--s4); }
a.card, .card.clickable { transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s; cursor: pointer; }
a.card:hover, .card.clickable:hover { border-color: color-mix(in srgb, var(--text) 18%, var(--border)); box-shadow: var(--shadow-lg); }
a.card:active, .card.clickable:active { transform: scale(.995); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.card-body { padding: var(--s4) var(--s5); }
.divider { height: 1px; background: var(--border); margin: var(--s4) 0; border: 0; }

/* hero / next game */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: var(--s6);
  background: var(--hero); color: var(--hero-ink); box-shadow: var(--shadow-lg);
}
.hero::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle at center, color-mix(in srgb, var(--hero-accent) 12%, transparent) 0, transparent 68%); pointer-events: none;
}
.hero .eyebrow { color: var(--hero-accent); }
.hero .muted, .hero .hm { color: var(--hero-muted); }
.hero h2 { font-size: clamp(30px, 7vw, 46px); margin: 10px 0 6px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--hero-muted); font-weight: 500; }
.hero .meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero .capacity { margin: var(--s5) 0; }
.hero .bar { background: rgb(255 255 255 / .14); }
.hero .btn.ghost { color: var(--hero-ink); border-color: rgb(255 255 255 / .22); }
.hero .btn.ghost:hover { background: rgb(255 255 255 / .08); }
.hero .avatar { box-shadow: 0 0 0 2px var(--hero); }
.hero-actions { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; position: relative; z-index: 1; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
  background: var(--primary); color: var(--primary-ink); transition: transform .12s var(--ease), filter .15s, background .15s, box-shadow .15s;
  user-select: none; -webkit-tap-highlight-color: transparent; position: relative;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn.loading::after { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.success { background: var(--success); color: var(--success-ink); }
.btn.danger { background: var(--danger); color: var(--danger-ink); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--softer); filter: none; }
.btn.subtle { background: var(--soft); color: var(--text); }
.btn.subtle:hover { background: color-mix(in srgb, var(--text) 10%, transparent); filter: none; }
.btn.text { background: none; color: var(--muted); padding: 0 8px; min-height: 36px; }
.btn.text:hover { color: var(--text); filter: none; }
.btn.danger-text { background: none; color: var(--danger); padding: 0 8px; min-height: 36px; }
.btn.lg { min-height: 54px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn.xl { min-height: 60px; padding: 0 30px; font-size: 17px; border-radius: 16px; font-family: var(--font-display); font-stretch: 90%; letter-spacing: .06em; text-transform: uppercase; font-weight: 800; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.icon-only { width: 44px; padding: 0; }
.btn.sm.icon-only { width: 34px; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.pop { animation: pop .45s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ---------- chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--soft); color: var(--text); white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 55%, var(--text)); }
.chip.success { background: var(--success-soft); color: var(--success); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.warning { background: var(--warning-soft); color: var(--warning); }
.chip.solid { background: var(--accent); color: var(--accent-ink); }
.chip.outline { background: none; border: 1px solid var(--border); }
.hero .chip { background: rgb(255 255 255 / .12); color: var(--hero-ink); }
.hero .chip.success { background: color-mix(in srgb, var(--success) 30%, transparent); color: #d9ffe9; }
.hero .chip.warning { background: color-mix(in srgb, var(--warning) 30%, transparent); color: #fff1d6; }
.role { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 50%, var(--text)); }
.demo-flag { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--warning-soft); color: var(--warning); }

/* ---------- avatars ---------- */
.avatar {
  --size: 40px; width: var(--size); height: var(--size); border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; font-weight: 700; font-size: calc(var(--size) * .38); letter-spacing: .02em;
  background: hsl(var(--h, 220) 35% 88%); color: hsl(var(--h, 220) 45% 26%);
}
:root[data-theme="dark"] .avatar:not(:has(img)) { background: hsl(var(--h, 220) 28% 26%); color: hsl(var(--h, 220) 60% 86%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar:not(:has(img)) { background: hsl(var(--h, 220) 28% 26%); color: hsl(var(--h, 220) 60% 86%); } }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xs { --size: 26px; } .avatar.sm { --size: 32px; } .avatar.lg { --size: 64px; } .avatar.xl { --size: 104px; }
.stack-avatars { display: flex; }
.stack-avatars .avatar { box-shadow: 0 0 0 2px var(--surface); }
.stack-avatars .avatar + .avatar { margin-left: -9px; }
.stack-avatars .more { --size: 32px; background: var(--soft); color: var(--muted); font-size: 12px; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: var(--s3); padding: 12px var(--s5); min-height: 60px; }
.list-item + .list-item { border-top: 1px solid var(--border); }
a.list-item:hover, .list-item.clickable:hover { background: var(--softer); }
.list-item .title { font-weight: 600; }
.list-item .sub { font-size: 13px; color: var(--muted); }
.card .list-item:first-child { border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.card .list-item:last-child { border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }

/* ---------- game cards ---------- */
.game-card { display: grid; grid-template-columns: 64px 1fr; gap: var(--s4); padding: var(--s4); }
.date-block { border-radius: 14px; background: var(--surface2); display: flex; flex-direction: column; align-items: center; justify-content: center; height: 72px; }
.date-block .dow { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.date-block .day { font-family: var(--font-display); font-stretch: 80%; font-weight: 800; font-size: 30px; line-height: 1; }
.date-block .mon { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.date-block.today { background: var(--accent); color: var(--accent-ink); }
.date-block.today .dow, .date-block.today .mon { color: inherit; opacity: .75; }
.game-card .title { font-weight: 700; font-size: 16px; }
.game-card .meta { color: var(--muted); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; }
.game-card .meta span { display: inline-flex; align-items: center; gap: 4px; }
.game-card .foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: var(--s3); }
.cancelled { opacity: .6; }
.cancelled .title { text-decoration: line-through; }

/* capacity bar */
.capacity .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.capacity .big { font-size: 30px; }
.bar { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .5s var(--ease); }
.bar.full > i { background: var(--danger); }
.bar.sm { height: 5px; }

/* ---------- stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); }
@media (min-width: 560px) { .stat-grid.four { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 720px) { .stat-grid.six { grid-template-columns: repeat(6, 1fr); } .stat-grid.five { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 560px) and (max-width: 719px) { .stat-grid.six, .stat-grid.five { grid-template-columns: repeat(3, 1fr); } }
.stat { background: var(--surface); padding: var(--s4); min-width: 0; }
.stat .v { font-size: 30px; line-height: 1; margin-top: 8px; }
.stat .d { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.stat .v small { font-size: 16px; color: var(--muted); margin-left: 2px; }
.kpi .v { font-size: 36px; }
.up { color: var(--success); } .down { color: var(--danger); }

/* leaderboard */
.lb-row { display: grid; grid-template-columns: 34px 40px 1fr auto; align-items: center; gap: var(--s3); padding: 10px var(--s4); min-height: 60px; }
.lb-row + .lb-row { border-top: 1px solid var(--border); }
.lb-row .rank { font-family: var(--font-display); font-stretch: 80%; font-weight: 800; font-size: 20px; color: var(--muted); text-align: center; }
.lb-row.top1 .rank { color: var(--accent-text); }
.lb-row .val { text-align: right; }
.lb-row .val .num { font-size: 22px; }
.lb-row.me { background: var(--accent-soft); }
.lb-table { width: 100%; border-collapse: collapse; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); align-items: end; margin-bottom: var(--s4); }
.podium .p { text-align: center; padding: var(--s4) var(--s2); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.podium .p.first { padding-top: var(--s6); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--accent) 45%, transparent); }
.podium .p .avatar { margin: 0 auto 8px; }
.podium .medal { font-family: var(--font-display); font-weight: 800; font-size: 13px; letter-spacing: .1em; color: var(--muted); }
.podium .first .medal { color: var(--accent-text); }

/* ---------- tabs / segmented ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--soft); border-radius: 13px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; border: 0; background: none; padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.pills::-webkit-scrollbar { display: none; }
.pill { border: 1px solid var(--border); background: var(--surface); padding: 7px 14px; border-radius: 99px; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; color: var(--muted); }
.pill.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- forms ---------- */
.form { display: grid; gap: var(--s4); }
.form-row { display: grid; gap: var(--s4); }
@media (min-width: 560px) { .form-row.two { grid-template-columns: 1fr 1fr; } .form-row.three { grid-template-columns: 1fr 1fr 1fr; } }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: 13.5px; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  font-size: 16px; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 44px; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 11px 14px; border-radius: 12px; font-weight: 600; font-size: 14px; }
.form-note { background: var(--softer); border: 1px solid var(--border); padding: 12px 14px; border-radius: 12px; font-size: 13.5px; color: var(--muted); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: 12px 0; }
.switch-row + .switch-row { border-top: 1px solid var(--border); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: color-mix(in srgb, var(--text) 18%, transparent); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.check-grid { display: grid; grid-template-columns: 52px repeat(3, 1fr); gap: 6px; align-items: center; }
.check-grid .h { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: .08em; }
.toggle-cell { height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 700; color: var(--muted); }
.toggle-cell.on { background: var(--success); border-color: var(--success); color: var(--success-ink); }
.stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; width: fit-content; }
.stepper button { width: 44px; height: 46px; border: 0; background: var(--surface); cursor: pointer; font-size: 20px; }
.stepper input { width: 64px; text-align: center; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); height: 46px; font-weight: 700; font-size: 18px; background: var(--surface); }

/* ---------- modal / sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgb(8 12 20 / .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 8px var(--s5) calc(var(--s6) + var(--safe-b)); animation: sheet-up .3s var(--ease); overscroll-behavior: contain;
}
.sheet::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 4px auto 14px; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.sheet-foot { display: flex; gap: var(--s3); justify-content: flex-end; margin-top: var(--s5); flex-wrap: wrap; }
.sheet-foot .btn { flex: 1 1 auto; }
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: 24px; padding: var(--s6); animation: modal-in .24s var(--ease); }
  .sheet.wide { max-width: 860px; }
  .sheet::before { display: none; }
  .sheet-foot .btn { flex: 0 0 auto; }
  @keyframes modal-in { from { transform: scale(.97); opacity: 0; } }
}

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 14px); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
@media (min-width: 960px) { .toasts { bottom: 24px; left: auto; right: 24px; transform: none; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 14px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14.5px; animation: toast-in .3s var(--ease); }
.toast.error { background: var(--danger); color: var(--danger-ink); }
.toast.success .icon { color: var(--success); }
.toast.out { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(8px); opacity: 0; } }

/* achievement unlock */
.unlock { position: fixed; z-index: 110; inset: 0; display: grid; place-items: center; background: rgb(8 12 20 / .55); animation: fade .2s; padding: 24px; }
.unlock .box { text-align: center; background: var(--surface); border-radius: 28px; padding: 32px 28px; max-width: 340px; animation: unlock-in .5s var(--ease); }
@keyframes unlock-in { 0% { transform: scale(.8); opacity: 0; } 60% { transform: scale(1.03); } 100% { transform: none; opacity: 1; } }

/* ---------- empty / loading ---------- */
.empty { text-align: center; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty .glyph { width: 60px; height: 60px; border-radius: 18px; background: var(--soft); display: grid; place-items: center; color: var(--muted); margin-bottom: 8px; }
.empty .glyph .icon { width: 28px; height: 28px; }
.empty h3 { font-family: var(--font-display); font-stretch: 85%; font-weight: 800; text-transform: uppercase; font-size: 19px; margin: 0; }
.empty p { color: var(--muted); margin: 0; max-width: 340px; }
.empty .btn { margin-top: 12px; }
.skel { background: linear-gradient(90deg, var(--soft) 0%, var(--softer) 50%, var(--soft) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: 10px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel.line { height: 14px; margin: 8px 0; }
.skel.block { height: 88px; border-radius: var(--r-lg); }
.skel.hero { height: 260px; border-radius: var(--r-xl); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--soft); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 40px auto; }
.error-state { text-align: center; padding: 48px 20px; }

/* splash */
.splash { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--bg); transition: opacity .3s; }
.splash.hide { opacity: 0; pointer-events: none; }
.splash-mark { width: 72px; height: 72px; background: url(/icons/icon-192.png) center/contain no-repeat; animation: breathe 1.6s ease-in-out infinite; border-radius: 18px; }
@keyframes breathe { 50% { transform: scale(.94); opacity: .8; } }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; }
@media (min-width: 960px) { .auth { grid-template-columns: 1.05fr 1fr; } }
.auth-art { display: none; position: relative; overflow: hidden; background: var(--hero); color: var(--hero-ink); padding: 48px; }
@media (min-width: 960px) { .auth-art { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-art .mark { width: 56px; height: 56px; color: #fff; }
.auth-art h1 { font-size: 76px; line-height: .9; max-width: 560px; }
.auth-art h1 em { font-style: normal; color: var(--hero-accent); }
.auth-art .court { position: absolute; right: -120px; bottom: -80px; width: 520px; opacity: .14; }
/* Light mode only: the court drawing shares the class name of the game-page court cards, which gave it a pale card fill
   that hid its lines in Light mode. Use the same fill and edge it has in Dark mode, so the court looks identical in both. */
:root[data-theme="light"] .auth-art svg.court { background: #1E2122; border-color: #373C3D; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .auth-art svg.court { background: #1E2122; border-color: #373C3D; } }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: calc(env(safe-area-inset-top, 0px) + 28px) 22px 32px; max-width: 460px; width: 100%; margin: 0 auto; }
.auth-panel .brand { margin-bottom: 36px; }
.auth-panel .brand .mark { width: 40px; height: 40px; }
.auth-panel h1 { font-size: 38px; margin-bottom: 8px; }
.auth-switch { text-align: center; margin-top: var(--s5); color: var(--muted); }
.auth-switch a { color: var(--text); font-weight: 700; }
.demo-box { margin-top: var(--s6); padding: var(--s4); border: 1px dashed color-mix(in srgb, var(--warning) 55%, var(--border)); border-radius: var(--r); background: var(--warning-soft); }
/* ---------- auth entry: the members' entrance (sign in / create account / reset) ---------- */
.auth-panel.entry { max-width: 440px; padding-top: calc(env(safe-area-inset-top, 0px) + 40px); padding-bottom: 40px; }
.entry .crest { display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--text); text-decoration: none; margin: 0 auto 30px; }
.entry .crest .mark { width: 84px; height: 84px; margin-bottom: 14px; }
.entry .crest b { font-family: var(--font-display); font-stretch: 112%; font-weight: 900; font-size: 22px; letter-spacing: .2em; margin-right: -.2em; line-height: 1; }
.entry .crest span { font-family: var(--font-display); font-stretch: 112%; font-weight: 600; font-size: 9.5px; letter-spacing: .52em; margin-right: -.52em; color: var(--muted); margin-top: 7px; }
.entry .crest::after { content: ''; width: 40px; height: 1px; background: color-mix(in srgb, var(--accent) 70%, transparent); margin-top: 22px; }
.entry h1 { text-align: center; text-transform: none; font-stretch: 100%; font-weight: 600; font-size: 34px; letter-spacing: -.012em; line-height: 1.1; margin-bottom: 10px; }
.entry h1 + .muted { text-align: center; font-size: 15px; line-height: 1.5; max-width: 36ch; margin: 0 auto; }
.entry .form { gap: 18px; margin-top: 34px; }
.entry .form > div:empty { display: none; } /* an empty message area (Reset password) adds no gap */
.entry .field { gap: 8px; }
.entry .field > label, .entry .field .row label { font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--text) 82%, var(--bg)); letter-spacing: .01em; }
.entry .input { min-height: 52px; border-radius: 10px; padding: 13px 16px; background-color: var(--surface); border-color: var(--border); }
.entry .input:hover { border-color: color-mix(in srgb, var(--text) 26%, var(--border)); }
.entry .input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 16%, transparent); }
.entry .field .link.small { font-size: 13px; font-weight: 600; color: var(--accent-text); text-decoration: none; }
.entry .field .link.small:hover { text-decoration: underline; text-underline-offset: 3px; }
.entry .btn.lg { margin-top: 6px; min-height: 54px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-display); font-stretch: 104%; font-weight: 700; font-size: 16px; letter-spacing: .03em;
  box-shadow: 0 1px 0 rgb(255 255 255 / .2) inset; }
.entry .btn.lg:hover { filter: none; background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.entry .auth-switch { margin-top: 28px; font-size: 14.5px; }
.entry .auth-switch a { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
@media (max-width: 959px) { .auth-panel.entry { justify-content: flex-start; padding-top: calc(env(safe-area-inset-top, 0px) + 48px); } .entry .crest .mark { width: 72px; height: 72px; } .entry h1 { font-size: 30px; } }
/* Desktop: the entry panel is exactly one screen tall and scrolls on its own when a short window can't fit it,
   so the page never grows and the left panel always renders exactly as designed. Auto margins center the content
   when there is room and keep the top reachable when there isn't. */
@media (min-width: 960px) { .auth-panel.entry { height: 100dvh; min-height: 0; overflow-y: auto; justify-content: flex-start; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
  .auth-panel.entry > :first-child { margin-top: auto; } .auth-panel.entry > :last-child { margin-bottom: auto; } }
/* ---------- end auth entry ---------- */

/* ---------- courts ---------- */
.courts { display: grid; gap: var(--s3); }
@media (min-width: 720px) { .courts { grid-template-columns: 1fr 1fr; } }
.court { border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.court-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--surface2); }
.court-head .num { font-size: 15px; letter-spacing: .08em; }
.court-body { display: grid; grid-template-columns: 1fr auto; }
.team { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; min-height: 56px; }
.team + .team { border-top: 1px dashed var(--border); }
.team .names { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.team .names .p { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.team .score { font-size: 28px; min-width: 38px; text-align: right; }
.team.won .score { color: var(--success); }
.team.won .names .p { font-weight: 700; }
.team.lost { color: var(--muted); }
.vs { font-family: var(--font-display); font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--muted); padding: 0 14px; }
.court-foot { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); justify-content: flex-end; flex-wrap: wrap; }
.slot { border: 1.5px dashed var(--border); border-radius: 10px; padding: 8px 10px; min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; background: none; width: 100%; text-align: left; font-weight: 600; font-size: 14px; }
.slot.filled { border-style: solid; background: var(--softer); }
.slot:hover { border-color: var(--accent); }
.explain { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 14px; border-top: 1px solid var(--border); background: var(--softer); }
.score-input { width: 72px; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 26px; min-height: 54px; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: var(--s4) var(--s5); }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 88%; }
.msg .bubble { background: var(--surface2); padding: 9px 13px; border-radius: 16px 16px 16px 5px; overflow-wrap: anywhere; }
.msg .who { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--primary); color: var(--primary-ink); border-radius: 16px 16px 5px 16px; }
.msg.mine .who { text-align: right; }
.chat-form { display: flex; gap: 8px; padding: var(--s3) var(--s4); border-top: 1px solid var(--border); }
.chat-form .input { min-height: 44px; }

/* ---------- achievements ---------- */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s3); }
.ach { text-align: center; padding: var(--s4) var(--s3); border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); }
.ach .medal { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.ach .medal .icon { width: 28px; height: 28px; stroke-width: 2; }
.ach.bronze .medal { background: linear-gradient(145deg, #e6b089, #a7653c); color: #3f200b; }
.ach.silver .medal { background: linear-gradient(145deg, #eef1f5, #9ea7b3); color: #263040; }
.ach.gold .medal { background: linear-gradient(145deg, #ffe08a, #d69b12); color: #4a3200; }
.ach.legend .medal { background: linear-gradient(145deg, #c7b6ff, #6a4bd6); color: #1c0f4d; }
.ach .medal::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; border: 1.5px solid rgb(255 255 255 / .5); }
.ach .n { font-weight: 800; font-family: var(--font-display); font-stretch: 85%; text-transform: uppercase; font-size: 15px; letter-spacing: .02em; }
.ach .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ach.locked { opacity: .5; }
.ach.locked .medal { background: var(--soft); color: var(--muted); filter: none; }

/* ---------- profile ---------- */
.profile-head { display: grid; grid-template-columns: auto 1fr; gap: var(--s5); align-items: center; }
.profile-head h1 { font-size: clamp(30px, 7vw, 48px); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3) var(--s5); }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.avail { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.avail div { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.avail i { display: block; height: 10px; border-radius: 4px; background: var(--soft); margin-top: 3px; }
.avail i.on { background: var(--success); }

/* ---------- announcements ---------- */
.ann { padding: var(--s5); }
.ann + .ann { border-top: 1px solid var(--border); }
.ann h3 { margin: 6px 0 8px; font-size: 18px; font-weight: 700; }
.ann.pinned { background: linear-gradient(0deg, transparent, var(--accent-soft)); }
.reactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--s3); }
.react { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; height: 34px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; font-weight: 600; }
.react.on { border-color: var(--accent); background: var(--accent-soft); }
.react .c { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- tables (admin) ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: default; background: var(--surface); }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--softer); }
@media (max-width: 719px) {
  .table.responsive thead { display: none; }
  .table.responsive tr { display: grid; grid-template-columns: 1fr 1fr; padding: 12px 14px; border-bottom: 1px solid var(--border); gap: 6px 12px; }
  .table.responsive td { border: 0; padding: 0; }
  .table.responsive td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
  .table.responsive td.full { grid-column: 1 / -1; }
}
.admin-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: var(--s5); }
.admin-nav::-webkit-scrollbar { display: none; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.chart .line { fill: none; stroke: var(--chart); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: color-mix(in srgb, var(--chart) 14%, transparent); }
.chart .bar-rect { fill: var(--chart); opacity: .85; }
.chart .bar-rect.dim { fill: color-mix(in srgb, var(--text) 16%, transparent); opacity: 1; }
.chart .hit:hover + .bar-rect, .chart .bar-rect:hover { opacity: 1; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { fill: var(--surface); stroke: var(--chart); stroke-width: 2.5; }
.chart-tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 600; padding: 6px 9px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -130%); opacity: 0; transition: opacity .12s; }
.chart-box { position: relative; }

/* ---------- misc ---------- */
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 600; }
.banner.warning { background: var(--warning-soft); color: var(--warning); }
.banner.info { background: var(--softer); border: 1px solid var(--border); color: var(--muted); }
.banner.danger { background: var(--danger-soft, var(--warning-soft)); color: var(--danger); font-weight: 600; }
.demo-bar { background: var(--warning-soft); color: var(--warning); text-align: center; font-size: 12.5px; font-weight: 700; padding: 6px 12px; }
.demo-bar button { background: none; border: 0; color: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; padding: 0 0 0 6px; }
.kbd { font-family: ui-monospace, monospace; font-size: 12px; padding: 1px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); }
.search-results .group { margin-top: var(--s5); }
.rating-pill { display: inline-flex; align-items: baseline; gap: 4px; }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; background: var(--surface2); border-radius: 12px; padding: 14px 16px; overflow-x: auto; line-height: 1.7; }
.w-l { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-size: 12px; font-weight: 800; }
.w-l.w { background: var(--success-soft); color: var(--success); }
.w-l.l { background: var(--danger-soft); color: var(--danger); }
.delta.up::before { content: '+'; }
.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 35; width: 56px; height: 56px; border-radius: 18px;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: var(--shadow-lg); border: 0; cursor: pointer;
}
@media (min-width: 960px) { .fab { display: none; } }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; animation: fade .15s; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; border: 0; background: none; cursor: pointer; font-weight: 600; font-size: 14px; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--soft); }
.rel { position: relative; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.col { min-width: 0; }
.center { text-align: center; }
@media (min-width: 960px) { .mobile-only { display: none !important; } }
@media (max-width: 959px) { .desktop-only { display: none !important; } }
.dash > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
@media (max-width: 559px) { .stat-grid > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (max-width: 719px) { .table.responsive tr:hover td { background: none; } }
.hold-bar { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--danger-soft); color: var(--danger); font-size: 13px; font-weight: 700; padding: 8px 14px; text-align: center; }
.trust { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.trust.founding { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 50%, var(--text)); }
.trust.verified { background: var(--success-soft); color: var(--success); }
.trust.pending { background: var(--warning-soft); color: var(--warning); }
.trust.shepherd { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--text); }
.steps { counter-reset: s; display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.steps li::before { counter-increment: s; content: counter(s); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--soft); }
.steps li.done::before { content: '✓'; background: var(--success); color: var(--success-ink); }
.history { display: grid; gap: 8px; }
.history .h { display: grid; grid-template-columns: 10px 1fr; gap: 10px; font-size: 13px; }
.history .h::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; }
.hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* Communities (Foundation step 2) */
.ctag { display: inline-flex; align-items: center; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface2); color: var(--muted); border: 1px solid var(--border); text-decoration: none; flex: none; }
.hero .ctag { background: color-mix(in srgb, var(--hero-ink) 12%, transparent); color: var(--hero-ink); border-color: transparent; }


details > summary { cursor: pointer; }

/* Score integrity (Foundation step 4) */
.court-note { padding: 8px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--border); line-height: 1.45; }
.court .score.pending { opacity: .55; font-style: italic; }
.court-foot { flex-wrap: wrap; }
.report-link { min-height: 0 !important; padding: 0 4px !important; font-size: 11px !important; }
