description: >-
English summary: Onoo design system — dark-first (.dark) with complete :root light-mode tokens in src/app/globals.css and Grain role mappings in src/app/grain-bridge.css. OKLch color system with S7 Monlive duo: --brand-ember (oklch(0.583 0.202 35)) and --brand-blue (oklch(0.64 0.14 240.5)), stepped surfaces (--surface-1..--surface-3), Fira Sans Extra Condensed + Golos Text + JetBrains Mono typography, vendored Grain (@grain) primitives, 360px mobile-first contract, and broadcast-desk public shell (BroadcastMasthead).
Оноо Design System
Харанхуй canvas. Broadcast energy. Stat-ууд бол түүх.
Onoo is a Mongolian basketball statistics platform. The design system combines editorial sports storytelling, trusted game records, and fast mobile-first scanning on a near-black canvas (.dark) backed by complete light-mode :root tokens.
0. Product Brief & Surfaces
Onoo's public and production surfaces serve two core journeys (full six-question briefs live in docs/plans/product-brief-seo-prod.md):
Discovery surface
- User/job: Fans, teams, journalists, and crawlers find Onoo and open a trusted public game, team, player, or competition page in one click.
- Ranking: Title/template → description → OG preview → JSON-LD → sitemap/robots/icons/manifest.
- Flow: Search or share → matching public page → browse games, standings, teams, or players.
- Hierarchy: Title and description first; social share image second; structured metadata supports discovery.
- States: Empty schedules, shell loading, route error, provisional data, canonical not-found, and success; private routes stay excluded.
- Layout: Broadcast editorial public shell; one-column mobile stacking with reachable browse navigation.
Edge & reliability surface
- User/job: Visitors recover from missing or failed routes in one action; operators receive a
no-storehealth signal. - Ranking: Plain Mongolian message → retry/home action → surviving shell → global fallback → JSON health endpoint.
- Flow: Retry returns to the attempted public page; not-found returns home; health
oksupports monitoring. - Hierarchy: Heading, short explanation, and one recovery action; no diagnostic clutter.
- States: Transient error, global failure, not-found, partial shell, recovery success, and health status; public recovery has no auth wall.
1. Design Principles
- Stats as story, not spreadsheet. Visual charts, badges, and leader strips lead; complete box score tables sit below the visual story.
- Broadcast energy. Every surface reads at a single glance on desktop and mobile.
- Mongolian readability. Cyrillic text is wider than Latin text. Layouts protect line height, wrap rules, and
Ө/Үglyphs. - Dark-first canvas with complete light tokens.
.darksets the near-black broadcast canvas;:rootprovides full light-mode contrast tokens (--surface-1..--surface-3,--brand-sports,--brand-purple). - Cold-start ready empty states. Every surface looks intentional when no games or statistics exist.
2. Stack
- Framework: Next.js 16 App Router with React Server Components by default.
- Styling: Tailwind CSS v4 (
src/app/globals.css) and Grain compatibility mappings (src/app/grain-bridge.css). - Components: Local shadcn/ui wrappers and vendored Grain primitives (
@grain,ui.zuiio.app) undersrc/registry/grain/. Never install@grain/grain-theme(it overwrites Onoo tokens, fonts, and radii). - Charts: Recharts via local chart primitives (
src/components/ui/chart.tsxandsrc/components/overtrue/radar-chart.tsx). - Icons: Lucide React.
- Motion: CSS transitions (
globals.cssandgrain-bridge.css) and theuseCountUphook, withprefers-reduced-motionsupport. No Framer Motion /motion/reactin public chrome.
3. Color System (src/app/globals.css & src/app/grain-bridge.css)
Onoo defines all tokens in OKLch for perceptual uniformity and smooth color-mix() interpolation.
Brand palette (S7 Monlive Duo)
| Token | Value | Usage |
|---|---|---|
--brand-blue | oklch(0.64 0.14 240.5) | Secondary focus, cool broadcast flash |
--brand-blue-light | oklch(0.75 0.11 240) | High-contrast blue highlight |
--brand-blue-dim | oklch(0.39 0.13 256) | Deep blue container accent |
--brand-blue-glow | oklch(0.64 0.14 240.5 / 0.14) | Ambient blue glow |
--brand-ember | oklch(0.583 0.202 35) | Primary action, energy, competition |
--brand-ember-light | oklch(0.7 0.17 35) | Interactive labels, active tab text |
--brand-ember-dim | oklch(0.48 0.18 32) | Deep ember shade |
--brand-ember-glow | oklch(0.583 0.202 35 / 0.14) | Ambient active glow |
--brand-sports* aliases --brand-ember* and --brand-purple* aliases --brand-blue* in both :root and .dark.
Surface & semantic tokens — Light mode (:root)
| Token | Value | Usage |
|---|---|---|
--background | oklch(0.98 0.005 80) | Light page canvas |
--foreground / --ink | oklch(0.13 0.003 80) | Primary text on light |
--card / --popover | oklch(0.98 0.005 80) | Card and popover background |
--surface-1 | oklch(0.96 0.005 80) | Light card/panel step 1 |
--surface-2 | oklch(0.93 0.006 80) | Elevated surface step 2 |
--surface-3 | oklch(0.89 0.008 80) | Hover / active surface step 3 |
--primary | oklch(0.583 0.202 35) | Primary CTA (ember) |
--primary-foreground | oklch(0.98 0.005 60) | Text on primary |
--secondary | oklch(0.96 0.012 100) | Secondary surface |
--muted | oklch(0.96 0.008 80) | Muted panels |
--muted-foreground | oklch(0.5 0.008 80) | Secondary text |
--accent | oklch(0.64 0.14 240.5 / 14%) | Hover/selection tint |
--accent-foreground | oklch(0.39 0.13 256) | Accent text |
--destructive | oklch(0.55 0.22 25) | Errors / destructive actions |
--border / --input | oklch(0.92 0.01 80) | Hairline borders and inputs |
--ring | oklch(0.64 0.14 240.5) | Focus ring |
Surface & semantic tokens — Dark mode (.dark, default)
| Token | Value | Usage |
|---|---|---|
--background | oklch(0.02 0.002 60) | Global near-black canvas |
--foreground / --ink | oklch(0.98 0.005 60) | Primary text on dark |
--card / --surface-1 | oklch(0.07 0.003 60) | Cards and panels |
--surface-2 | oklch(0.1 0.004 60) | Elevated surfaces |
--surface-3 | oklch(0.14 0.005 60) | Hover / active surfaces |
--primary | oklch(0.583 0.202 35) | Primary CTA (ember) |
--primary-foreground | oklch(0.98 0.005 60) | Text on primary |
--secondary | oklch(0.64 0.14 240.5 / 22%) | Secondary cool container |
--secondary-foreground | oklch(0.85 0.07 240) | Text on secondary |
--muted | oklch(0.12 0.005 60) | Muted panels |
--muted-foreground | oklch(0.62 0.01 60) | Helper text (WCAG AA on dark) |
--accent | oklch(0.64 0.14 240.5 / 16%) | Hover tint |
--accent-foreground | oklch(0.8 0.09 240) | Accent text |
--destructive | oklch(0.7 0.19 25) | Errors / negative deltas |
--success | oklch(0.65 0.18 145) | Positive deltas |
--warning | oklch(0.78 0.18 55) | Scoreboard warnings |
--info | oklch(0.64 0.14 240.5) | Informational |
--border | oklch(1 0 0 / 10%) | Soft borders |
--input | oklch(1 0 0 / 15%) | Input borders |
--ring | oklch(0.64 0.14 240.5) | Focus ring |
Chart palette
| Token | Value (.dark) | Usage |
|---|---|---|
--chart-1 | oklch(0.583 0.202 35) | Primary series (ember) |
--chart-2 | oklch(0.64 0.14 240.5) | Secondary series (blue) |
--chart-3 | oklch(0.7 0.17 35) | Light ember series |
--chart-4 | oklch(0.75 0.11 240) | Light blue series |
--chart-5 | oklch(0.78 0.18 55) | Warm baseline |
--chart-6 | var(--brand-blue-light) | Grain sixth chart role |
Use src/components/overtrue/radar-chart.tsx for player profiles, team report cards, and team analytics pages.
Grain bridge roles (src/app/grain-bridge.css)
grain-bridge.css maps Grain roles (--surface, --surface-raised, --surface-active, --surface-selected, --border-muted, --border-strong, --accent-text, --accent-soft, --signal, --primary-hover, --primary-active, --tier-strong/medium/muted/soft/faint) onto globals.css tokens in both :root and .dark, and provides utilities (surface-lit, text-tier-*, label-mono, label-mono-tick, tabular, press, focus-ring, tap-clean).
Token rules
- Use
--brand-emberfor primary actions and active navigation highlights. - Use
--brand-bluefor secondary contrast, focus rings (--ring), and cool accents. - Use
--brand-ember-lightwhen ember text sits directly on a dark background. - Team colors act as accents only; readable text and data surfaces keep neutral contrast.
4. Typography
Onoo self-hosts three local WOFF2 font families in src/app/fonts/ (cyrillic + cyrillic-ext for Ө/Ү):
| Role | Font | Weight | Size | Usage |
|---|---|---|---|---|
Display (--font-display) | Fira Sans Extra Condensed | 600–800 | 24–60px | Hero headlines, mastheads, leaderboards |
Body (--font-body, --font-sans) | Golos Text | 400–700 | 12–18px | All Mongolian UI copy |
Stat (--font-stat, --font-mono) | JetBrains Mono | 400–700 | 11–48px | Tabular numerals, scores, clocks |
Scale
| Token | Class | Size | Line height | Usage |
|---|---|---|---|---|
--text-tick | text-tick | 11px (0.6875rem) | 14px | Non-essential chart axis ticks only |
--text-micro | text-micro | 12px (0.75rem) | 16px | Labels, metadata, timestamps |
--text-dense | text-dense | 13px (0.8125rem) | 18px | Dense tables, short notes |
--text-sm | text-sm | 14px | 20px | Supporting text |
--text-base | text-base | 16px | 24px | Body text |
- 12px floor. Readable UI text starts at 12px. Only non-essential chart axis ticks may use 11px.
- No synthetic bold weight.
htmlsetsfont-synthesis: style. Use only shipped weights (Golos Text up to 700, Fira Sans Extra Condensed up to 800). - No negative tracking below 24px. Keep Cyrillic letter spacing neutral or positive on small text.
- No
leading-nonebelow 14px. Preserve line height so Cyrillic descenders do not clip.
Type classes (globals.css)
| Class | Font | Typography |
|---|---|---|
.type-display | Fira Sans Extra Condensed 800 | -0.01em tracking, 1.05 line height, balanced wrap |
.type-heading | Fira Sans Extra Condensed 700 | 0em tracking, 1.15 line height, balanced wrap |
.type-body | Golos Text 400 | 1.6 line height, pretty wrap |
.type-label | Golos Text 600 | 12px uppercase, 0.04em tracking |
.type-score | JetBrains Mono 700 | tabular-nums, -0.03em tracking |
label-mono | JetBrains Mono 500 | 12px/16px uppercase, 0.08em tracking |
label-mono-tick | JetBrains Mono 500 | 11px/14px uppercase, 0.06em tracking (axis ticks only) |
5. Spacing, Radius, Shadows & Motion
Spacing
Base unit --spacing: 0.25rem (4px). Use Tailwind 4px-step utilities (gap-4 to gap-6 between components, gap-8 to gap-12 between sections).
Border radius
Core scale (globals.css):
| Token | Value | Usage |
|---|---|---|
--radius / --radius-md | 8px | Controls, compact badges |
--radius-sm | 4px | Small chips |
--radius-lg | 12px | Standard cards, panels |
--radius-xl | 16px | Large cards, modal sheets |
--radius-full | 9999px | Floating capsules, pill toggles, avatars |
Grain component scale (grain-bridge.css): --radius-stage (24px), --radius-panel (20px), --radius-card (16px), --radius-rail (14px), --radius-menu (12px), --radius-control (10px), --radius-chip (8px), --radius-badge (6px).
Shadows & Glass Material (globals.css)
| Token | Value | Usage |
|---|---|---|
--shadow-xs / --shadow-sm | Subtle dark elevation | Controls and standard cards |
--shadow-md / --shadow-lg / --shadow-xl | Stepped depth | Popovers, panels, menus |
--shadow-brand | Ember/blue border + soft glow | Featured brand panels |
--shadow-float | 0 14px 40px oklch(0 0 0 / 0.65) | Detached floating docks |
--shadow-glass | 0 12px 36px oklch(0 0 0 / 0.25), inset 0 1px 0 oklch(1 0 0 / 0.15) | Specular glass surfaces |
No decorative glass blur on content cards; reserve frosted glass (backdrop-blur-2xl) for floating mobile navigation controls.
Motion (globals.css & grain-bridge.css)
| Token | Value | Usage |
|---|---|---|
--duration-instant | 80ms | Immediate press feedback |
--duration-fast | 120ms | Hover, small transitions |
--duration-base | 200ms | Standard UI transitions |
--duration-normal | 250ms | Panel shifts |
--duration-slow | 280ms | Drawers, emphasis |
--duration-slower | 350ms | Larger state transitions |
--ease-spring | cubic-bezier(0.34, 1.56, 0.64, 1) | Playful snap |
--ease-sport | cubic-bezier(0.22, 1, 0.36, 1) | Crisp deceleration |
--ease-out | cubic-bezier(0.23, 1, 0.32, 1) | Entering elements |
--ease-move | cubic-bezier(0.25, 1, 0.5, 1) | Positional shift |
--ease-in-out | cubic-bezier(0.77, 0, 0.175, 1) | Symmetric shift |
Grain adds --duration-press (140ms), --duration-tooltip (160ms), --duration-menu (200ms), --duration-move (240ms), --duration-panel (280ms), --duration-drawer (320ms), --duration-draw (600ms), and entry scale floors at 0.95 (src/registry/grain/lib/motion.ts). All motion respects prefers-reduced-motion.
6. Component Patterns & Broadcast Shell
Broadcast shell (T-97.2)
All public list pages render one BroadcastMasthead (src/app/components/broadcast-masthead.tsx). It owns the kicker (lang="mn"), horizontal rule, single h1, optional status badge, description, and right-aligned action slot. The homepage pulse uses the same masthead with an h2 so each page keeps one h1.
Additive utilities in src/app/globals.css: .broadcast-masthead, .broadcast-kicker, .broadcast-rule, .broadcast-panel, .broadcast-score, and .focus-panel-active. Vendored Grain primitives live under src/registry/grain/ (one component per file, Mongolian defaults).
Floating navigation menu (Mobile)
- Safe-area offset keeps the collapsed trigger above the screen edge:
fixed inset-x-3 bottom-[calc(0.75rem+env(safe-area-inset-bottom,0px))]. - Expands upward into a scrollable panel with a close button and dismissible backdrop; closes on Escape.
- Keep
pb-[calc(4.75rem+env(safe-area-inset-bottom))]on the mobile page root for clearance.
Full-screen focus view
- Used on dense read-only surfaces such as the game scoreboard.
- Trigger: outline button with visible label, accessible name, and
aria-pressed. - Prefers the browser Fullscreen API with an in-page
.focus-panel-activefallback; Escape exits both.
Key components
| Component | Location / Pattern |
|---|---|
SiteNav | src/app/components/site-nav.tsx — responsive public navigation shell |
TeamCardGrid | src/app/teams/components/team-card-grid.tsx — compact logo + name + W-L (grid-cols-3 mobile, lg:grid-cols-4 desktop) |
TeamLeadersStrip | src/app/teams/[slug]/components/team-leaders-strip.tsx — flush square tiles with full-bleed photos and initials fallback |
HeroCard, RecentGames, SeasonArc, ShootingProfile, SkillRadar, Milestones, SeasonSelector | src/app/(public)/players/[id]/components/ — athlete showcase hierarchy |
PlayerAvatar, TeamLogo | src/components/player-avatar.tsx, src/components/team-logo.tsx — resilient portrait/crest fallbacks |
PricingPage, PricingHero, MarketSnapshot, PricingTerms, PricingDisclaimer, PricingPlanCard, RevenueScenarioCard | src/app/(public)/pricing/components/ — hardcoded commercial surface (noindex) |
Directory tables & controls
- Player and team directories use
.table-stripedodd/even rows and sticky.table-identitycolumns (w-36for players so statistics stay visible on mobile). - Keep fixed scale heights app-wide: toolbars
h-8, line tabsh-9, icon chipssize-8. - Segmented toggles (
Grid/List,Үр дүн/Хүснэгт) use pill-in-pillrounded-fullcontainers. - Empty states render an icon, Mongolian heading, explanation, and one primary CTA.
7. Responsive Contract
- 360px (mobile-first): One-column flow; no horizontal page scroll; box score tables scroll inside their card with a sticky player column; stat grids use at least 2 columns; formula headers wrap (
flex-wrap); leader podiums stack avatar above text. sm(640px): Navigation controls align horizontally; leader podiums switch to side-by-side layout; duel-bar comparisons sit on one 12-column row.md(768px): Identity and supporting context separate into columns; dense charts remain stacked where legibility requires.lg(1024px): Asymmetric player showcase grid, two-column homepage layouts, 12-column team pages.
8. Accessibility
- One
mainlandmark, one visibleh1, and valid heading hierarchy per route. - Visible focus rings (
--ring,focus-ring) and>= 44pxtouch targets for mobile controls. - Charts pair with accessible data tables (
AccessibleChartTable) or text summaries. StatCardexposesIncrease,Decrease, orNo changewhen a trend change value is present.- Team colors never carry meaning alone; icon-only controls include
aria-label.
9. Decisions
- 2026-07-15 — Adopted Next.js + Tailwind v4 + shadcn stack; player profiles follow identity hero → recent form → analysis grid → full box score; team colors act as accents only; missing photos use designed fallbacks.
- 2026-08-28 — Search opens as a full command surface; shop categories use a persistent desktop rail and horizontal mobile control.
- 2026-08-31 — Public shell defaults to the Space Basketball horizontal lockup (white on dark, black on light); tenant overrides stay authoritative.
- 2026-09-25 — Team leaders use flush square tiles with full-bleed photos; team games history uses compact 5-row previews +
/teams/[slug]/gameshistory log. - 2026-09-28 — Adopted S7 Monlive duo (
--brand-ember,--brand-blue),.table-striped/w-36sticky player columns, and rounded-full segmented pills. - 2026-10-05 — Team pages stream identity, recent games, and leaders before secondary data via Suspense boundaries.
- 2026-11-01 — Mobile navigation uses a collapsed floating capsule that expands upward and dismisses with Escape or backdrop click.
- 2026-11-18 — Vendored Grain primitives (
@grain,ui.zuiio.app) live insrc/registry/grain/and map onto Onoo tokens throughsrc/app/grain-bridge.css. - 2026-11-19 — Scoreboard focus view uses Grain
Kbd; breadcrumbs and/gamesdate picker render localized Grain primitives. - 2026-11-20 — Broadcast shell (
BroadcastMasthead) unified across public listing pages; E2E route sweep verifies 360px, 375px, and 1280px viewports.
10. Non-Goals
- No Figma sync.
- No AI-generated athlete imagery.
- No hardcoded hex values or arbitrary Tailwind colors in components.
- No mock public data fallbacks.
- No
@grain/grain-themepackage installation.
Implementation Notes
- Authoritative CSS tokens live in
src/app/globals.css. - Grain compatibility roles and utilities live in
src/app/grain-bridge.css. - Every new component must consume semantic design tokens rather than hardcoded colors or inline
styleattributes.