/* ==========================================================================
   u7777 game — Reset / Normalise
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
}

/* Horizontal overflow is never allowed anywhere on this site. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text-secondary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--sp-4);
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--color-text-primary);
  overflow-wrap: break-word;
}

p, ul, ol, dl, figure, blockquote, table, pre { margin: 0 0 var(--sp-4); }

ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.45rem; }

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--color-accent-bright); }

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

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

button {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}

table { border-collapse: collapse; width: 100%; }

/* [hidden] must win over any component display rule (used by the game filter) */
[hidden] { display: none !important; }

hr {
  border: 0;
  height: 1px;
  background: var(--gradient-gold-line);
  opacity: 0.5;
  margin: var(--sp-7) 0;
}

strong, b { color: var(--color-text-primary); font-weight: 700; }

::selection {
  background: rgba(212, 175, 55, 0.28);
  color: var(--color-text-primary);
}

/* Focus visibility — WCAG AA */
:focus-visible {
  outline: 2px solid var(--color-accent-bright);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--color-bg-alt); }
::-webkit-scrollbar-thumb {
  background: var(--color-slate);
  border-radius: var(--r-pill);
  border: 3px solid var(--color-bg-alt);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-slate-light); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
