/* Underdogs Stage 1 — studio tokens and compatibility base */
@font-face {
  font-family: "Underdogs Geist";
  src: url("../../fonts/geist-latin.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Underdogs Geist Mono";
  src: url("../../fonts/geist-mono-latin.woff2") format("woff2");
  font-display: swap;
}

:root {
  --pb-viewport-height: 100vh;

  /* Canonical Underdogs studio palette. */
  --black: #050506;
  --black-raised: #0a090d;
  --purple: #7a4cf2;
  --purple-bright: #a786ff;
  --purple-deep: #35126e;
  --cream: #f5f3ef;
  --cream-muted: rgba(245, 243, 239, .68);
  --cream-dim: var(--cream-muted);

  /* Neutral structure and depth. */
  --black-soft: #100e14;
  --black-elevated: #15121b;
  --ink: var(--cream);
  --ink-dim: rgba(245, 243, 239, .76);
  --ink-faint: rgba(245, 243, 239, .54);
  --line: rgba(245, 243, 239, .15);
  --line-subtle: rgba(245, 243, 239, .09);
  --line-strong: rgba(245, 243, 239, .28);
  --focus-ring: var(--purple-bright);
  --glow-purple: 0 0 24px rgba(122, 76, 242, .18);

  /* Operational state colours. Green is reserved for positive function. */
  --ok: #4fbf72;
  --warn: #d4a552;
  --bad: #d06a64;
  --red: #d85d58;

  /* Typography. The legacy --serif alias deliberately resolves to the
     operational sans during this compatibility-shell stage. */
  --font-sans: "Underdogs Geist", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Underdogs Geist Mono", "SFMono-Regular", Consolas, monospace;
  --sans: var(--font-sans);
  --serif: var(--font-sans);
  --mono: var(--font-mono);

  --fs-display: 1.42em;
  --fs-feature: 1.16em;
  --fs-body: .96em;
  --fs-meta: .86em;
  --fs-label: .76em;

  /* Shared spacing and shell geometry. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --header-height: 70px;
  --dashboard-edge: clamp(8px, .85vw, 14px);
  --dashboard-gutter: clamp(8px, .85vw, 14px);
  --dashboard-card-padding: clamp(10px, .9vw, 14px);

  --r-panel: 12px;
  --r-card: 8px;
  --r-pill: 999px;
  --shadow-panel: 0 16px 42px rgba(0, 0, 0, .34);
  --shadow-card: 0 8px 22px rgba(0, 0, 0, .22);

  /* Dark surface materials consumed by the existing component selectors. */
  --panel-light: rgba(10, 9, 13, .96);
  --panel-lighter: rgba(16, 14, 20, .96);
  --panel-dash: rgba(10, 9, 13, .97);
  --panel-contact: rgba(10, 9, 13, .94);
  --panel-blur: 10px;
  --cream-2: var(--black-soft);
  --line-soft: var(--line-subtle);

  /* Compatibility aliases. Existing classic scripts and component rules use
     these names; retaining them avoids a behavioural or selector migration.
     They now express the purple studio system rather than club green/gold. */
  --bg: var(--black);
  --green-deep: var(--purple);
  --green-mid: var(--purple-bright);
  --green-btn: var(--purple);
  --gold: var(--purple);
  --gold-bright: var(--purple-bright);
  --gold-deep: var(--purple-deep);
  --calendar-accent: var(--purple-bright);
  --gold-tint: rgba(122, 76, 242, .18);
  --line-gold: rgba(167, 134, 255, .55);
  --line-gold-soft: rgba(167, 134, 255, .28);
  --label-gold: var(--cream-muted);
  --rose: var(--purple-bright);

  /* Position accents remain distinguishable without reintroducing green as
     decorative brand colour. */
  --blue-deep: #6388bd;
  --blue-tint: rgba(99, 136, 189, .18);
  --green-tint: rgba(122, 76, 242, .18);
  --red-tint: rgba(216, 93, 88, .18);
  --gold-tint-solid: #30224d;
  --blue-tint-solid: #202a3a;
  --green-tint-solid: #281d42;
  --red-tint-solid: #3b2022;

  --msg-avatar-size: 36px;
  --msg-avatar-gap: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  color-scheme: dark;
  width: 100%;
  height: var(--pb-viewport-height);
  max-height: var(--pb-viewport-height);
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: var(--black);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: clamp(13px, .95vw, 15px);
  font-weight: 420;
  line-height: 1.3;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(167, 134, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 134, 255, .018) 1px, transparent 1px);
  background-size: 64px 64px;
}

button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

img { display: block; }

.ui-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  overflow: visible;
  color: currentColor;
  vertical-align: -.14em;
}

p { margin: 0; }

input,
textarea {
  color: inherit;
  font: inherit;
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb {
  border: 1px solid transparent;
  border-radius: 4px;
  background: rgba(245, 243, 239, .22);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(167, 134, 255, .5);
  background-clip: padding-box;
}

.desktop-required {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  place-items: center;
  padding: 40px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(53, 18, 110, .5), transparent 48%),
    linear-gradient(rgba(167, 134, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 134, 255, .025) 1px, transparent 1px),
    var(--black);
  background-size: auto, 52px 52px, 52px 52px, auto;
  color: var(--cream);
  text-align: center;
}

.desktop-required div {
  width: min(520px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  background: rgba(10, 9, 13, .92);
  box-shadow: var(--shadow-panel), var(--glow-purple);
}

.desktop-required strong {
  display: block;
  margin-bottom: 10px;
  color: var(--cream);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.desktop-required span {
  display: block;
  color: var(--cream-muted);
  line-height: 1.5;
}

@media (max-width: 1023px) {
  .desktop-required { display: grid; }

  #app {
    visibility: hidden;
    pointer-events: none;
  }
}

/* Movement is removed without priority overrides. The attribute selectors
   exceed the specificity of the component animation declarations while
   preserving opacity feedback and native scrolling. */
@media (prefers-reduced-motion: reduce) {
  html body [class],
  html body [id],
  html body [class]::before,
  html body [class]::after,
  html body [id]::before,
  html body [id]::after {
    animation-duration: .01ms;
    animation-iteration-count: 1;
    transition-duration: .01ms;
    scroll-behavior: auto;
  }

  html body #app [class][class][class],
  html body #app [class][class][class]::before,
  html body #app [class][class][class]::after,
  html body #live-match [class][class][class],
  html body #live-match [class][class][class]::before,
  html body #live-match [class][class][class]::after {
    animation-duration: .01ms;
    animation-iteration-count: 1;
    transition-duration: .01ms;
    scroll-behavior: auto;
  }
}

/* Fixed-width figures keep scores, times and table columns stable. */
.status-v,
.snap-val,
.match-fact .v,
.bubble .meta,
.msg-item .when,
.table-row,
.pressure .lbl,
.t-fx,
.day-change .chg,
.log-row .d {
  font-variant-numeric: tabular-nums;
}

::selection {
  background: var(--purple);
  color: var(--cream);
}
