/* First paint and page changes share the matchday palette, before React loads. The --nv-* values are the dark theme
   (default) and the light theme (html[data-theme="light"], or "system" on a light device), set by theme-boot.js. */
:root {
  --nv-bg: #071a13; --nv-text: #f2f6ed; --nv-muted: #bed0c2; --nv-surface: #10271e; --nv-raised: #173429; --nv-track: #355244;
  --nv-edge: #506e58; --nv-edge-soft: #637d6b; --nv-mark: #d4f65a; --nv-fill: #d4f65a; --nv-on-fill: #071a13; --nv-focus: #d4f65a;
  --nv-shadow: #0006;
}
html[data-theme=light] {
  color-scheme: light; --nv-bg: #eef3ec; --nv-text: #10231a; --nv-muted: #4a5d52; --nv-surface: #ffffff; --nv-raised: #f6f9f4; --nv-track: #cdd9ca;
  --nv-edge: #aebcab; --nv-edge-soft: #aebcab; --nv-mark: #3d6600; --nv-fill: #d4f65a; --nv-on-fill: #0b1f12; --nv-focus: #3d6600;
  --nv-shadow: 0 8px 24px rgba(16, 35, 26, .16);
}
@media (prefers-color-scheme: light) {
  html[data-theme=system] {
    color-scheme: light; --nv-bg: #eef3ec; --nv-text: #10231a; --nv-muted: #4a5d52; --nv-surface: #ffffff; --nv-raised: #f6f9f4; --nv-track: #cdd9ca;
    --nv-edge: #aebcab; --nv-edge-soft: #aebcab; --nv-mark: #3d6600; --nv-fill: #d4f65a; --nv-on-fill: #0b1f12; --nv-focus: #3d6600;
    --nv-shadow: 0 8px 24px rgba(16, 35, 26, .16);
  }
}
:root { color-scheme: dark; background: var(--nv-bg); }
html, html body { margin: 0; min-width: 0; background: var(--nv-bg); }
html { color: var(--nv-text); }
#root:empty, .page-loading {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 100svh;
  padding: 28px;
  background: var(--nv-bg);
  color: var(--nv-text);
  text-align: center;
  font: 500 16px/1.5 'DM Sans', system-ui, sans-serif;
}
#root:empty::before, .page-loading-mark {
  content: '';
  display: block;
  width: 42px;
  height: 42px;
  background: var(--nv-mark);
  mask: url('/media/brand/goalrook-mark.svg') center / contain no-repeat;
}
#root:empty::after { content: 'GoalRook'; letter-spacing: -.03em; font-size: 22px; }
.page-loading { min-height: 240px; background: var(--nv-surface); border: 1px solid var(--nv-track); border-radius: 12px; }
.page-loading-initial { min-height: 100svh; border: 0; border-radius: 0; background: var(--nv-bg); }
.page-loading p { max-width: 34rem; margin: 0; color: var(--nv-muted); }
.page-loading-track { width: 112px; height: 3px; overflow: hidden; border-radius: 4px; background: var(--nv-track); }
.page-loading-track::after, html[data-navigating]::after {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  background: var(--nv-mark);
  animation: gr-loading 1.2s ease-in-out infinite alternate;
}
html[data-navigating]::after { position: fixed; inset: 0 auto auto 0; height: 3px; z-index: 2147483647; pointer-events: none; }
.gr-navigation-status {
  display: flex;
  align-items: center;
  gap: 12px;
  position: fixed;
  inset: auto 16px max(20px, env(safe-area-inset-bottom)) auto;
  z-index: 2147483646;
  max-width: calc(100vw - 64px);
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--nv-edge);
  border-radius: 10px;
  background: var(--nv-surface);
  color: var(--nv-text);
  box-shadow: 0 8px 32px var(--nv-shadow);
  font: 500 14px/1.4 'DM Sans', system-ui, sans-serif;
  pointer-events: none;
}
.gr-navigation-dismiss { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--nv-muted); font: 500 22px/1 'DM Sans', system-ui, sans-serif; cursor: pointer; pointer-events: auto; }
.gr-navigation-dismiss:hover { background: var(--nv-raised); }
.gr-navigation-dismiss:focus-visible { outline: 2px solid var(--nv-focus); outline-offset: 2px; }
.page-load-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.page-load-actions button, .page-load-actions a { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--nv-edge-soft); border-radius: 8px; background: var(--nv-raised); color: var(--nv-text); font: inherit; text-decoration: none; cursor: pointer; }
.page-load-actions button { background: var(--nv-fill); border-color: var(--nv-fill); color: var(--nv-on-fill); }
.page-load-actions :focus-visible { outline: 2px solid var(--nv-focus); outline-offset: 4px; }
@keyframes gr-loading { to { transform: translateX(150%); } }
@keyframes gr-page-in { from { opacity: .5; } to { opacity: 1; } }
::view-transition-old(root) { animation-duration: 140ms; }
::view-transition-new(root) { animation: gr-page-in 160ms ease-out both; }
::view-transition-group(root) { animation-duration: 160ms; }
html[data-page-hidden]::after, html[data-page-hidden] .page-loading-track::after { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  html[data-navigating]::after, .page-loading-track::after { animation: none; width: 100%; }
}
