/* ============================================================
   xx7 Game — Modern Reset
   Includes the global horizontal-overflow guard: nothing on this
   site may ever push the page sideways.
   ============================================================ */

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

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Reserve the scrollbar gutter so layouts never shift or overflow. */
  scrollbar-gutter: stable;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  /* Belt-and-braces against sideways scroll on mobile. */
  overflow-x: hidden;
  max-width: 100%;
  line-height: var(--lh-body);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

/* The `hidden` attribute must win over component `display` rules
   (.btn is inline-flex, .game-notice is flex, and so on). */
[hidden] { display: none !important; }

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

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

p,
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  text-wrap: balance;
}

p { text-wrap: pretty; }

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

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

/* Visible, on-brand focus ring for keyboard users (WCAG 2.4.7). */
:focus-visible {
  outline: 2px solid var(--color-champagne);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

::selection {
  background: var(--color-burgundy-bright);
  color: #fff;
}

/* Themed scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg-deep); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-champagne-dim), var(--color-burgundy));
  border-radius: var(--radius-pill);
  border: 2px solid var(--color-bg-deep);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-champagne); }

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