/* Shared visual contract for Bracketr's signed-in player workspace. */
:root {
  --brk-workspace-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --brk-workspace-canvas: #050d18;
  --brk-workspace-surface: #07182b;
  --brk-workspace-surface-raised: #0b2036;
  --brk-workspace-surface-subtle: #0d2741;
  --brk-workspace-border: #244561;
  --brk-workspace-border-strong: #3476a8;
  --brk-workspace-text: #f4f8ff;
  --brk-workspace-muted: #9fb4cd;
  --brk-workspace-primary: #0876dd;
  --brk-workspace-primary-hover: #0562bb;
  --brk-workspace-primary-soft: rgba(8, 118, 221, .14);
  --brk-workspace-highlight: #42c8ff;
  --brk-workspace-side-blue: #4aa8ff;
  --brk-workspace-side-orange: #ffad55;
  --brk-workspace-decorative: #7c5cff;
  --brk-workspace-success: #38d39f;
  --brk-workspace-warning: #f3c969;
  --brk-workspace-warning-text: #f3c969;
  --brk-workspace-danger: #ff6b7c;
  --brk-workspace-danger-text: #ff8c99;
  --brk-workspace-radius-control: 8px;
  --brk-workspace-radius-card: 12px;
  --brk-workspace-page-title: clamp(1.85rem, 2.7vw, 2.5rem);
  --brk-workspace-section-title: 1.125rem;
  --brk-workspace-body: .875rem;
  --brk-workspace-label: .6875rem;
}

html.bracketr-theme-light {
  --brk-workspace-canvas: #edf4fb;
  --brk-workspace-surface: #ffffff;
  --brk-workspace-surface-raised: #f7fbff;
  --brk-workspace-surface-subtle: #eaf3fb;
  --brk-workspace-border: #c7d8e8;
  --brk-workspace-border-strong: #76a9d2;
  --brk-workspace-text: #102033;
  --brk-workspace-muted: #5d7088;
  --brk-workspace-primary: #0876dd;
  --brk-workspace-primary-hover: #0562bb;
  --brk-workspace-primary-soft: rgba(8, 118, 221, .1);
  --brk-workspace-highlight: #0876dd;
  --brk-workspace-side-blue: #145a9e;
  --brk-workspace-side-orange: #974300;
  --brk-workspace-warning-text: #704600;
  --brk-workspace-danger: #b4233c;
  --brk-workspace-danger-text: #8f1830;
}

body.team-manager-page,
body.brk-achievements-page,
body.brk-talent-shell,
body.my-teams-page {
  font-family: var(--brk-workspace-font);
  color: var(--brk-workspace-text);
}

body.team-manager-page {
  --team-bg: var(--brk-workspace-canvas);
  --team-surface: var(--brk-workspace-surface);
  --team-surface-2: var(--brk-workspace-surface-raised);
  --team-border: var(--brk-workspace-border);
  --team-text: var(--brk-workspace-text);
  --team-muted: var(--brk-workspace-muted);
  --team-accent: var(--brk-workspace-primary);
  --team-accent-2: var(--brk-workspace-success);
  --team-danger: var(--brk-workspace-danger);
  --team-warning: var(--brk-workspace-warning);
  --bg: var(--brk-workspace-canvas);
  --panel: var(--brk-workspace-surface);
  --panel2: var(--brk-workspace-surface-raised);
  --surface: var(--brk-workspace-surface);
  --surface-2: var(--brk-workspace-surface-raised);
  --border: var(--brk-workspace-border);
  --line: var(--brk-workspace-border);
  --text: var(--brk-workspace-text);
  --muted: var(--brk-workspace-muted);
  --blue: var(--brk-workspace-primary);
  --accent: var(--brk-workspace-primary);
}

body.brk-achievements-page,
body.brk-talent-shell {
  --brk-bg: var(--brk-workspace-canvas);
  --brk-panel: var(--brk-workspace-surface);
  --brk-panel-2: var(--brk-workspace-surface-raised);
  --brk-border: var(--brk-workspace-border);
  --brk-border-strong: var(--brk-workspace-border-strong);
  --brk-text: var(--brk-workspace-text);
  --brk-muted: var(--brk-workspace-muted);
  --brk-blue: var(--brk-workspace-primary);
  --brk-cyan: var(--brk-workspace-highlight);
  --brk-green: var(--brk-workspace-success);
  --brk-red: var(--brk-workspace-danger);
  --brk-yellow: var(--brk-workspace-warning);
}

.community-directory {
  --community-surface: var(--brk-workspace-surface);
  --community-soft: var(--brk-workspace-surface-raised);
  --community-border: var(--brk-workspace-border);
  --community-text: var(--brk-workspace-text);
  --community-muted: var(--brk-workspace-muted);
  --community-accent: var(--brk-workspace-primary);
  --community-success: var(--brk-workspace-success);
}

:is(body.team-manager-page, body.brk-achievements-page, body.brk-talent-shell, body.my-teams-page)
  :is(button, input, select, textarea) {
  font-family: inherit;
}

:is(body.team-manager-page, body.brk-achievements-page, body.brk-talent-shell, body.my-teams-page)
  :is(button, a, input, select, textarea):focus-visible {
  outline: 3px solid var(--brk-workspace-highlight);
  outline-offset: 2px;
}

/* Keep page hierarchy stable while feature layouts remain independently owned. */
:is(.registry-page-head, .community-hero-copy, .brk-dashboard-title, .brk-talent-main > .hero) h1 {
  font-size: var(--brk-workspace-page-title);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.025em;
}

:is(.team-manager-page, .brk-achievements-page, .brk-talent-shell, .my-teams-page)
  :is(h2, h3, strong, button) {
  text-wrap: pretty;
}

/* Talent previously carried its own global theme; map its common primitives back. */
body.brk-talent-shell {
  background: var(--brk-workspace-canvas);
}

.brk-talent-shell :is(.card, .talent-tabs, .availability-row, .competition-card, .assignment-card) {
  border-color: var(--brk-workspace-border);
  background-color: var(--brk-workspace-surface);
  border-radius: var(--brk-workspace-radius-card);
}

.brk-talent-shell :is(input, select, textarea) {
  border-color: var(--brk-workspace-border);
  border-radius: var(--brk-workspace-radius-control);
  background: var(--brk-workspace-surface-raised);
  color: var(--brk-workspace-text);
}

.brk-talent-shell :is(.actions button, .org-apply-form button, .talent-tabs button[aria-selected="true"], .profile-edit-link) {
  border-color: var(--brk-workspace-primary);
  background: var(--brk-workspace-primary);
  color: #fff;
}

.brk-talent-shell :is(.actions button, .org-apply-form button, .profile-edit-link):hover {
  background: var(--brk-workspace-primary-hover);
}

/* Purple remains available for progression art, not ordinary primary actions. */
.brk-achievements-page {
  --brk-progression-decorative: var(--brk-workspace-decorative);
}

@media (max-width: 720px) {
  :root {
    --brk-workspace-page-title: clamp(1.7rem, 8vw, 2rem);
  }
}

@media (forced-colors: active) {
  :is(body.team-manager-page, body.brk-achievements-page, body.brk-talent-shell, body.my-teams-page)
    :is(button, a, input, select, textarea):focus-visible {
    outline-color: Highlight;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(body.team-manager-page, body.brk-achievements-page, body.brk-talent-shell, body.my-teams-page) * {
    scroll-behavior: auto !important;
  }
}
