/* BJ Leroy Hub: shared look. Black and GM blue, like GameDay's GM theme.
   The --cds-* and --font-* tokens are the ones GameDay's stylesheet expects. */
:root {
  --font-anthropic-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-anthropic-serif: 'Source Serif 4', 'Georgia', 'Times New Roman', serif;

  --cds-font-size-caption: 12px;
  --cds-font-size-body: 14px;
  --cds-font-size-heading: 17px;
  --cds-font-size-title: 26px;
  --cds-font-weight-medium: 560;
  --cds-gap-sm: 8px;
  --cds-gap-md: 12px;
  --cds-gap-lg: 20px;
  --cds-pad-xs: 4px;
  --cds-pad-sm: 8px;
  --cds-pad-md: 12px;
  --cds-pad-lg: 16px;
  --cds-pad-xl: 24px;
  --cds-radius: 8px;
  --cds-shadow-popover: 0 8px 28px rgba(0, 0, 0, .45);
  --cds-dur-slow: 320ms;
  --cds-ease-out: cubic-bezier(.2, .8, .2, 1);

  --hub-bg: #050608;
  --hub-panel: #0e1218;
  --hub-panel-2: #141a22;
  --hub-line: #1f2833;
  --hub-fg: #f4f7fb;
  --hub-muted: #9aa6b4;
  --hub-accent: #1f8fff;
  --hub-accent-ink: #ffffff;
  --hub-bad: #ff5c4d;
  --hub-ok: #2fd27a;

  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--hub-bg);
  color: var(--hub-fg);
  font-family: var(--font-anthropic-sans);
  font-size: var(--cds-font-size-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--hub-accent); }
button, input, select { font: inherit; }

/* ---------- top bar ---------- */
.hub-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--hub-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hub-line);
}
.hub-brand { display: flex; align-items: center; gap: 10px; color: var(--hub-fg); text-decoration: none; flex: none; }
.hub-brand img { height: 30px; width: auto; display: block; }
@media (max-width: 640px) { .hub-brand img { height: 24px; } }
.hub-brand b { font-family: var(--font-anthropic-serif); font-weight: 500; font-size: 18px; letter-spacing: .01em; }
.hub-brand small { display: block; color: var(--hub-muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.hub-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.hub-nav::-webkit-scrollbar { display: none; }
.hub-nav a {
  white-space: nowrap; padding: 7px 12px; border-radius: 999px; color: var(--hub-muted);
  text-decoration: none; font-size: 13px;
}
.hub-nav a:hover { color: var(--hub-fg); background: var(--hub-panel); }
.hub-nav a[aria-current="page"] { color: var(--hub-accent-ink); background: var(--hub-accent); }
.hub-nav a.soon { opacity: .45; }
.hub-user { position: relative; flex: none; }
.hub-user > button {
  display: flex; align-items: center; gap: 8px; background: var(--hub-panel); color: var(--hub-fg);
  border: 1px solid var(--hub-line); border-radius: 999px; padding: 4px 10px 4px 4px; cursor: pointer;
}
.hub-avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--hub-accent); color: var(--hub-accent-ink); font-size: 12px; font-weight: 600;
}
.hub-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; padding: 6px;
  background: var(--hub-panel-2); border: 1px solid var(--hub-line); border-radius: 10px; box-shadow: var(--cds-shadow-popover);
}
.hub-menu[hidden] { display: none; }
.hub-menu .who { padding: 8px 10px; color: var(--hub-muted); font-size: 12px; border-bottom: 1px solid var(--hub-line); margin-bottom: 4px; }
.hub-menu .who b { display: block; color: var(--hub-fg); font-size: 14px; }
.hub-menu a, .hub-menu button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; border: 0;
  background: none; color: var(--hub-fg); text-decoration: none; cursor: pointer; font-size: 14px;
}
.hub-menu a:hover, .hub-menu button:hover { background: var(--hub-panel); }
@media (max-width: 640px) {
  .hub-top { flex-wrap: wrap; gap: 8px 12px; }
  .hub-nav { order: 3; flex-basis: 100%; }
  .hub-brand small, .hub-user .hub-name { display: none; }
  .hub-user { margin-left: auto; }
}

/* ---------- page frame ---------- */
.hub-main { max-width: 1440px; margin: 0 auto; padding: 20px 16px 40px; }
.hub-h1 { font-family: var(--font-anthropic-serif); font-weight: 400; font-size: 32px; margin: 8px 0 4px; }
.hub-sub { color: var(--hub-muted); margin: 0 0 24px; }

/* home tiles */
.hub-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.hub-tile {
  display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 14px; min-height: 150px;
  background: linear-gradient(135deg, var(--hub-panel) 0%, var(--hub-panel-2) 100%);
  border: 1px solid var(--hub-line); color: var(--hub-fg); text-decoration: none; position: relative; overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.hub-tile:hover { border-color: var(--hub-accent); transform: translateY(-1px); }
.hub-tile h2 { margin: 0; font-family: var(--font-anthropic-serif); font-weight: 500; font-size: 22px; }
.hub-tile p { margin: 0; color: var(--hub-muted); }
.hub-tile .tag {
  align-self: flex-start; margin-top: auto; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--hub-accent) 18%, transparent); color: var(--hub-accent);
}
.hub-tile.soon { cursor: default; opacity: .6; }
.hub-tile.soon:hover { border-color: var(--hub-line); transform: none; }
.hub-tile.soon .tag { background: var(--hub-panel-2); color: var(--hub-muted); }
.hub-tile::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--hub-accent) 22%, transparent), transparent 70%);
}
.hub-tile.soon::after { display: none; }

/* forms (sign-in, setup, admin) */
.hub-card { background: var(--hub-panel); border: 1px solid var(--hub-line); border-radius: 14px; padding: 24px; }
.hub-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.hub-auth .hub-card { width: 100%; max-width: 380px; }
.hub-auth .logo { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.hub-auth .logo img { width: 100%; max-width: 300px; height: auto; display: block; }
.hub-auth .logo b { font-family: var(--font-anthropic-serif); font-weight: 500; font-size: 22px; display: block; }
.hub-auth .logo small { color: var(--hub-muted); }
.hub-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.hub-field label { font-size: 13px; color: var(--hub-muted); }
.hub-field input, .hub-field select {
  background: var(--hub-bg); color: var(--hub-fg); border: 1px solid var(--hub-line); border-radius: 8px;
  padding: 10px 12px; font-size: 16px; /* 16px stops iPhone from zooming in */
}
.hub-field input:focus, .hub-field select:focus { outline: 2px solid var(--hub-accent); outline-offset: 1px; border-color: transparent; }
.hub-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 8px;
  border: 0; background: var(--hub-accent); color: var(--hub-accent-ink); font-weight: 600; cursor: pointer; font-size: 15px;
}
.hub-btn.block { width: 100%; }
.hub-btn.ghost { background: transparent; color: var(--hub-fg); border: 1px solid var(--hub-line); }
.hub-btn.danger { background: transparent; color: var(--hub-bad); border: 1px solid color-mix(in srgb, var(--hub-bad) 40%, transparent); }
.hub-btn:disabled { opacity: .6; cursor: wait; }
.hub-msg { min-height: 20px; font-size: 13px; margin: 0 0 10px; }
.hub-msg.err { color: var(--hub-bad); }
.hub-msg.ok { color: var(--hub-ok); }
.hub-note { color: var(--hub-muted); font-size: 13px; }

/* live password checklist */
.pw-rules { list-style: none; margin: -6px 0 14px; padding: 0; display: grid; gap: 3px; font-size: 13px; color: var(--hub-muted); }
.pw-rules li::before { content: '○'; display: inline-block; width: 18px; color: var(--hub-muted); }
.pw-rules li.ok { color: var(--hub-fg); }
.pw-rules li.ok::before { content: '✓'; color: var(--hub-ok); font-weight: 700; }

/* tables (admin) */
.hub-table { width: 100%; border-collapse: collapse; }
.hub-table th, .hub-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--hub-line); }
.hub-table th { color: var(--hub-muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }

/* "add to home screen" hint + runtime errors */
.hub-install {
  position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30;
  max-width: 460px; margin: 0 auto; display: flex; gap: 12px; align-items: center;
  background: var(--hub-panel-2); border: 1px solid var(--hub-line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--cds-shadow-popover);
}
.hub-install[hidden] { display: none; }
.hub-install p { margin: 0; flex: 1; font-size: 13px; }
.hub-error {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; max-width: 640px; margin: 0 auto;
  background: #2a0f0f; color: #ffd6d2; border: 1px solid #5c1f1f; border-radius: 10px; padding: 10px 14px; font-size: 13px;
}
.hub-error[hidden] { display: none; }

/* GameDay host: loading shimmer the page expects */
#dash-root .dash-skeleton { color: transparent !important; border-radius: 6px; background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.14), rgba(255,255,255,.06)); background-size: 200% 100%; animation: hub-shimmer 1.2s linear infinite; }
@keyframes hub-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { #dash-root .dash-skeleton { animation: none; } }
.gd-boot { color: var(--hub-muted); padding: 40px 0; text-align: center; }
