/* Base layer: reset, document typography, focus rings, layout primitives and utilities.
   Component styles live next to their component (app/ui/components/*.css). */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scrollbar-color: var(--ink-400) transparent;
}
body {
  min-height: 100dvh;
  background: var(--floodlight), var(--bg);
  background-attachment: fixed;
  color: var(--text-1);
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  font-feature-settings: 'cv11', 'ss01'; /* Inter: single-storey a off, open digits */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
button:disabled {
  cursor: not-allowed;
}
a {
  color: var(--volt-300);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--volt-200);
}
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}
ul[role='list'],
ol[role='list'] {
  list-style: none;
  padding: 0;
}
table {
  border-collapse: collapse;
}
[hidden] {
  display: none !important;
}
::selection {
  background: rgb(205 245 69 / 0.35);
  color: var(--text-1);
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-heavy);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  text-transform: uppercase;
  text-wrap: balance;
}
h1 {
  font-size: var(--display-lg);
}
h2 {
  font-size: var(--display-md);
}
h3 {
  font-size: var(--display-sm);
}
h4 {
  font-size: var(--display-xs);
}
p {
  text-wrap: pretty;
}

.display {
  font-family: var(--font-display);
  font-weight: var(--weight-heavy);
  line-height: var(--leading-tight);
  text-transform: uppercase;
  letter-spacing: var(--tracking-display);
}
.display-2xl {
  font-size: var(--display-2xl);
}
.display-xl {
  font-size: var(--display-xl);
}

/* Small uppercase label above a heading */
.eyebrow {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--volt-400);
}
.eyebrow.is-gold {
  color: var(--gold-400);
}
.eyebrow.is-muted {
  color: var(--text-3);
}

/* Tabular condensed numerals for ratings, scores, clocks */
.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: var(--weight-bold);
  letter-spacing: 0;
}

.text-1 {
  color: var(--text-1);
}
.text-2 {
  color: var(--text-2);
}
.text-3 {
  color: var(--text-3);
}
.text-volt {
  color: var(--volt-400);
}
.text-gold {
  color: var(--gold-400);
}
.text-coral {
  color: var(--coral-400);
}
.text-green {
  color: var(--green-400);
}
.text-xs {
  font-size: var(--text-xs);
}
.text-sm {
  font-size: var(--text-sm);
}
.text-lg {
  font-size: var(--text-lg);
}
.lead {
  font-size: var(--text-lg);
  color: var(--text-2);
  line-height: 1.45;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Tier-coloured numerals (also used outside rows) */
.tier-text-superstar {
  background: linear-gradient(170deg, #ffd3f0 0%, #c9b6ff 40%, #8fe3ff 75%, #c4ffd9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tier-text-star {
  color: var(--gold-400);
}
.tier-text-starter {
  color: var(--tier-starter);
}
.tier-text-normal {
  color: var(--tier-normal);
}
.tier-text-bench {
  color: var(--tier-bench);
}

/* ---------- Focus ---------- */
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
/* Elements with their own rounded shape keep that shape for the ring */

/* ---------- Accessibility helpers ---------- */
.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
/* Visually hidden on phones only — e.g. a screen h1 that the top bar already shows as its title */
@media (max-width: 559px) {
  .sr-only-mobile {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
  }
}
.skip-link {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--volt-400);
  color: var(--on-volt);
  font-weight: var(--weight-bold);
  transform: translateY(-200%);
}
.skip-link:focus-visible {
  transform: none;
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow {
  width: 100%;
  max-width: calc(var(--column-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, var(--space-4));
}
.stack-md {
  --stack-gap: var(--space-4);
}
.stack-lg {
  --stack-gap: var(--space-6);
}
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, var(--space-2));
}
.row {
  display: flex;
  align-items: center;
  gap: var(--row-gap, var(--space-3));
  min-width: 0;
}
.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
}
.grow {
  flex: 1 1 auto;
  min-width: 0;
}
.center {
  display: grid;
  place-items: center;
}
/* Two-pane: one column on phones; main + side from 960 px */
.split {
  display: grid;
  gap: var(--split-gap, var(--space-6));
  align-items: start;
}
@media (min-width: 960px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(320px, var(--split-side, 420px));
  }
  .split.is-side-left {
    grid-template-columns: minmax(320px, var(--split-side, 420px)) minmax(0, 1fr);
  }
}
/* Sticky bottom action bar (phones: the primary action stays under the thumb) */
.action-bar {
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
  display: flex;
  gap: var(--space-2);
  margin-inline: calc(-1 * var(--gutter));
  padding: var(--space-6) var(--gutter) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgb(7 11 22 / 0.94) 40%);
  pointer-events: none;
}
.action-bar > * {
  pointer-events: auto;
}
.action-bar > .btn--primary {
  flex: 1;
}

/* ---------- Screens & transitions ---------- */
.screen {
  padding-block: var(--space-5) var(--space-10);
  min-height: calc(100dvh - var(--topbar-h));
}
.screen-enter {
  /* backwards, never both: a transform left on the wrapper once the entrance is over (even the
     identity one) makes it the containing block of every position: fixed inside the screen —
     the draft's duo banner and pick moments, the action bars — which then scroll away with
     the page instead of staying on the screen. */
  animation: screen-enter var(--dur-slow) var(--ease-emph) backwards;
}
.screen-enter.is-back {
  animation-name: screen-enter-back;
}
@keyframes screen-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes screen-enter-back {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 var(--pulse-color, var(--volt-glow));
  }
  70% {
    box-shadow: 0 0 0 10px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
@keyframes shimmer {
  from {
    background-position: 150% 0;
  }
  to {
    background-position: -50% 0;
  }
}

/* Reduced motion: stop keyframe animations too (durations are already ~0 via tokens) */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion='full']) *,
  :root:not([data-motion='full']) *::before,
  :root:not([data-motion='full']) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
:root[data-motion='reduce'] *,
:root[data-motion='reduce'] *::before,
:root[data-motion='reduce'] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
}
