@font-face {
  font-family: 'RW Roboto';
  font-style: normal; font-weight: 100 1000; font-display: swap;
  src: url('fonts/RobotoFlex_latin.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
    U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'RW Roboto';
  font-style: normal; font-weight: 100 1000; font-display: swap;
  src: url('fonts/RobotoFlex_latin-ext.woff2') format('woff2-variations');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --rw-h: 89.4;
  --rw-accent: #ae9d75;

  --rw-prog:        oklch(48% 0.085 var(--rw-h));
  --rw-prog-hover:  oklch(53% 0.085 var(--rw-h));
  --rw-prog-active: oklch(43% 0.085 var(--rw-h));

  --rw-s0: oklch(96.5% 0.008 var(--rw-h));
  --rw-s1: oklch(94%   0.012 var(--rw-h));
  --rw-s2: oklch(91.5% 0.016 var(--rw-h));

  --rw-emph:   oklch(18% 0.020 var(--rw-h));
  --rw-text:   oklch(31% 0.022 var(--rw-h));
  --rw-subtle: oklch(46% 0.026 var(--rw-h));

  --rw-border: rgb(60 48 20 / 0.16);
  --rw-hover:  rgb(60 48 20 / 0.05);
  --rw-active: rgb(60 48 20 / 0.11);

  --rw-font: 'RW Roboto', system-ui, -apple-system, Arial, sans-serif;
  --rw-radius: 4px;
  --rw-max: 1080px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --rw-prog:        oklch(76% 0.090 var(--rw-h));
    --rw-prog-hover:  oklch(81% 0.090 var(--rw-h));
    --rw-prog-active: oklch(71% 0.090 var(--rw-h));

    --rw-s0: oklch(15%   0.012 var(--rw-h));
    --rw-s1: oklch(18%   0.016 var(--rw-h));
    --rw-s2: oklch(21.5% 0.020 var(--rw-h));

    --rw-emph:   oklch(95% 0.018 var(--rw-h));
    --rw-text:   oklch(85% 0.024 var(--rw-h));
    --rw-subtle: oklch(70% 0.030 var(--rw-h));

    --rw-border: rgb(255 240 205 / 0.14);
    --rw-hover:  rgb(255 240 205 / 0.05);
    --rw-active: rgb(255 240 205 / 0.10);

    color-scheme: dark;
  }
}

/* ---- shared page shell ---- */

:root, body {
  background: var(--rw-s0);
  color: var(--rw-text);
  font-family: var(--rw-font);
  font-size: 1rem;
  line-height: 1.625;
}
body {
  margin: 0;
  min-height: 100vh;
  border-top: 4px solid var(--rw-accent);
}

main {
  max-width: var(--rw-max);
  padding: 1.25rem 1.5rem 3rem;
  margin-inline: auto;
}
@media (min-width: 1180px) { main { max-width: 1280px; } }

/* header block: eyebrow above title on both pages */
main > header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0 0 1.75rem;
}
main > header span, .eyebrow {
  order: -1;
  margin: 0;
  color: var(--rw-accent);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}
.intro { margin: 0; color: var(--rw-subtle); }

h1, h2, h3 { color: var(--rw-emph); font-weight: 600; }
h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: normal;
}
h2 { font-size: 1.5rem; line-height: 2.125rem; }

a { color: var(--rw-prog); text-decoration: none; text-underline-offset: 0.25em; }
a:hover  { color: var(--rw-prog-hover); text-decoration: underline; }
a:active { color: var(--rw-prog-active); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--rw-prog); outline-offset: 2px;
}

main p, footer, #status, #scores-status { color: var(--rw-subtle); }
main section:not(.leaderboard) p {
  font-size: 1rem;
  line-height: 1.625;
}
footer, footer p { font-size: 0.875rem; line-height: 1.6; }
#status, #scores-status { font-size: 0.875rem; }

button {
  font: inherit; font-weight: 500; cursor: pointer;
  color: var(--rw-text);
  background: var(--rw-s1);
  border: 1px solid var(--rw-border);
  border-radius: var(--rw-radius);
  padding: 8px 16px;
  transition: background-color 100ms cubic-bezier(0.2, 0, 0, 1);
}
button:hover  { color: var(--rw-emph); background: var(--rw-hover); }
button:active { background: var(--rw-active); }

input[type="range"] { accent-color: var(--rw-prog); }
label, output { font-size: 0.875rem; color: var(--rw-subtle); }

.toolbar { gap: 12px; align-items: center; margin: 1rem 0; }

section {
  border-top: 1px solid var(--rw-border);
  margin: 1.75rem 0 0;
  padding-top: 1rem;
}
footer { margin-top: 2rem; font-size: 0.875rem; }

/* frame around the game surface — not the game itself */
#game {
  border: 1px solid var(--rw-border);
  border-radius: var(--rw-radius);
  box-shadow: none;
  overflow: hidden;
}

.controls {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 12px 30px;
  padding: 0; margin: 1rem 0; list-style: none;
  color: var(--rw-text);
  font-size: 1rem; line-height: 1.625;
}
.controls li {
  display: flex; align-items: center; gap: 0.5rem;
}

kbd {
  display: inline-block;
  box-sizing: border-box;
  min-width: 2.1em;
  padding: 2px 7px;
  font-family: var(--rw-font);
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
  color: var(--rw-subtle);
  background: var(--rw-s1);
  border: 1px solid var(--rw-border);
  border-bottom-width: 3px;
  border-radius: var(--rw-radius);
}
.controls kbd + kbd { margin-left: -0.25rem; }

table th { color: var(--rw-emph); font-weight: 600; }
table td, table th { border-bottom: 1px solid var(--rw-border); }
table tbody tr:hover { background: var(--rw-hover); }

/* ---- header bar ---- */

.rw-bar {
  display: flex; align-items: center;
  margin: 0;
  min-height: 3.5rem;
  padding: 0.5rem 1.5rem;
  background: var(--rw-s0);
  border-bottom: 1px solid var(--rw-border);
  font-size: 0.875rem;
}
.rw-bar__inner {
  display: flex; align-items: center; gap: 1rem;
  width: 100%; max-width: var(--rw-max); margin-inline: auto;
}
.rw-bar__home {
  display: flex; align-items: center; gap: 0.75rem;
  color: var(--rw-emph); font-size: 1.25rem; font-weight: 600;
  line-height: 1; text-decoration: none;
}
.rw-bar__home:hover { color: var(--rw-emph); text-decoration: none; }
.rw-bar__logo { display: block; width: auto; height: 2rem; }
.rw-bar__title {
  padding-left: 1rem;
  border-left: 1px solid var(--rw-border);
  color: var(--rw-subtle); font-weight: 500; white-space: nowrap;
  letter-spacing: normal; font-size: 0.875rem; text-transform: none;
}
html.embed .rw-bar { display: none; }
html.embed main section { display: none; }

@media (max-width: 640px) {
  .rw-bar { padding-inline: 1rem; }
  .rw-bar__title { display: none; }
}
