/* SPORT ARENA – reset, typography, layout primitives, utilities, motion. */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 8% -8%, rgba(47, 123, 255, 0.16), transparent 62%),
    radial-gradient(900px 480px at 102% 4%, rgba(143, 128, 255, 0.12), transparent 60%),
    linear-gradient(rgba(140, 170, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 170, 255, 0.025) 1px, transparent 1px);
  background-size: auto, auto, 56px 56px, 56px 56px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* German compounds (e.g. "Trainingswissenschaft") must never overflow their box. */
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

h1,
h2,
.btn,
.chip,
.badge,
.kicker {
  hyphens: manual;
  -webkit-hyphens: manual;
}

/* Grid and flex children may shrink below their longest word. */
.topic-columns > *,
.results-grid > *,
.subject-layout > *,
.dash-top > *,
.mistake-cols > *,
.two-col > *,
.bar-label > *,
.topic-list li > *,
.option-text,
.order-text,
.match-left {
  min-width: 0;
}

main {
  flex: 1;
  outline: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.012em;
}

p,
ul,
ol,
dl,
figure {
  margin: 0;
}

ul,
ol {
  padding-left: 1.2em;
}

li + li {
  margin-top: 0.3em;
}

a {
  color: var(--accent-text);
  text-underline-offset: 3px;
}
a:hover {
  color: #b7d1ff;
}

img,
svg {
  max-width: 100%;
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid #8fb8ff;
  outline-offset: 2px;
  border-radius: 6px;
}

[tabindex='-1']:focus {
  outline: none;
}

::selection {
  background: rgba(77, 147, 255, 0.4);
}

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container.narrow {
  max-width: 860px;
}
.screen {
  padding-bottom: 56px;
}
.screen > .container {
  padding-top: 28px;
}
.screen > .container > * + * {
  margin-top: 22px;
}

/* ---------- utilities ---------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.muted {
  color: var(--text-3);
}
.small {
  font-size: var(--fs-sm);
}
.ok {
  color: var(--success-text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bad {
  color: var(--danger-text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.quote {
  border-left: 3px solid var(--line-strong);
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  white-space: pre-wrap;
}
.icon {
  flex: none;
  vertical-align: -0.18em;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  top: 12px;
}

.boot {
  display: grid;
  place-items: center;
  min-height: 60vh;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--text-3);
}
.noscript {
  padding: 24px;
  text-align: center;
}

/* ---------- motion ---------- */
@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.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
:root[data-motion='reduce'] *,
:root[data-motion='reduce'] *::before,
:root[data-motion='reduce'] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pop {
  0% {
    transform: scale(0.96);
    opacity: 0;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}
@keyframes lane-run {
  from {
    stroke-dashoffset: 0;
  }
  to {
    stroke-dashoffset: -2400;
  }
}
@keyframes beam {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
  }
}
@keyframes pulse-urgent {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}
