/* Base: page defaults, headings, links, focus, and the Simple mode / reduced motion rules. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh);
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { margin: 0 0 var(--space-3); }

a {
  color: var(--link);
  font-weight: 700;
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: min(100% - 2rem, 70rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-3);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  color: var(--text);
  border: var(--outline-w) solid var(--outline);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: var(--space-3);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.muted { color: var(--text-muted); }

/* Things hidden with the hidden attribute stay hidden, even when a style gives them a layout. */
[hidden] { display: none !important; }

/* Reduced motion (phone setting) and Simple mode (our setting) both stop animations. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

:root[data-simple="on"] *,
:root[data-simple="on"] *::before,
:root[data-simple="on"] *::after {
  animation: none !important;
  transition: none !important;
}

/* Game extras disappear in Simple mode. Nothing needed to use the app may be game-only. */
:root[data-simple="on"] .game-only {
  display: none !important;
}
