/* 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);
  }
}
/* Scene changes belong to the game: every loading surface between scenes (the empty document root, PageLoading and the
   page-change notice) is the floodlit pitch in both themes. Light-theme pages themselves keep their own palette. */
:root {
  --scene-bg: #071a13; --scene-text: #f2f6ed; --scene-muted: #bed0c2; --scene-surface: #10271e; --scene-raised: #173429;
  --scene-track: #355244; --scene-edge: #506e58; --scene-mark: #d4f65a; --scene-on-fill: #071a13;
  --scene-stripes: repeating-linear-gradient(90deg, rgba(212, 246, 90, .035) 0 56px, transparent 56px 112px);
  --scene-floodlight: radial-gradient(ellipse 85% 60% at 50% 36%, #1b4030 0, rgba(7, 26, 19, 0) 72%);
}
: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(--scene-floodlight), var(--scene-stripes), var(--scene-bg);
  color: var(--scene-text);
  color-scheme: dark;
  text-align: center;
  font: 500 16px/1.5 'DM Sans', system-ui, sans-serif;
}
/* The full-screen scene also draws the halfway line and centre circle. */
#root:empty, .page-loading-initial {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 86px, rgba(212, 246, 90, .09) 86px 88px, transparent 88px),
    linear-gradient(transparent calc(50% - 1px), rgba(212, 246, 90, .07) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    var(--scene-floodlight), var(--scene-stripes), var(--scene-bg);
}
#root:empty::before, .page-loading-mark {
  content: '';
  display: block;
  width: 42px;
  height: 42px;
  background: var(--scene-mark);
  mask: url('/socc-mono.svg') center / contain no-repeat;
}
#root:empty::after { content: 'Socc'; letter-spacing: -.03em; font-size: 22px; }
.page-loading { min-height: 240px; border: 1px solid var(--scene-track); border-radius: 12px; }
.page-loading-initial { min-height: 100svh; border: 0; border-radius: 0; }
.page-loading p { max-width: 34rem; margin: 0; color: var(--scene-muted); }
.page-loading-track { width: 112px; height: 3px; overflow: hidden; border-radius: 4px; background: var(--scene-track); }
.page-loading-track::after, html[data-navigating]::after {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  background: var(--scene-mark);
  animation: gr-loading 1.2s ease-in-out infinite alternate;
}
html[data-navigating]::after { background: var(--nv-mark); }
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(--scene-edge);
  border-radius: 10px;
  background: var(--scene-surface);
  color: var(--scene-text);
  color-scheme: dark;
  box-shadow: 0 8px 32px #0006;
  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(--scene-muted); font: 500 22px/1 'DM Sans', system-ui, sans-serif; cursor: pointer; pointer-events: auto; }
.gr-navigation-dismiss:hover { background: var(--scene-raised); }
.gr-navigation-dismiss:focus-visible { outline: 2px solid var(--scene-mark); 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(--scene-edge); border-radius: 8px; background: var(--scene-raised); color: var(--scene-text); font: inherit; text-decoration: none; cursor: pointer; }
.page-load-actions button { background: var(--scene-mark); border-color: var(--scene-mark); color: var(--scene-on-fill); }
.page-load-actions :focus-visible { outline: 2px solid var(--scene-mark); outline-offset: 4px; }
/* Same-origin page loads cross-fade like in-document scene changes instead of cutting through a blank frame. */
@view-transition { navigation: auto; }
@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%; }
}

/* Phones keep the game at full width. iOS zooms into a focused field whose text is under 16px and stays zoomed after
   the field closes, so touch screens get 16px fields; double-tap zoom is off. Pinch zoom stays available. */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (pointer: coarse) {
  input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='color']), select, textarea {
    font-size: max(16px, 1em) !important;
  }
}
