/* Színek: minden szöveg/háttér pár legalább 7:1 kontrasztú. */
:root {
  --bg: #ffffff;
  --text: #111111;
  --muted-bg: #f0f0f0;
  --border: #111111;
  --focus: #0b3d91;
  --button-bg: #ffffff;
  --button-text: #111111;
  --button-hover-bg: #e6e6e6;
  color-scheme: light dark;
}

/* Sötét téma: fekete háttér, fehér szöveg. Alapból a rendszerbeállítást követi,
   a Sötét téma gomb felülírja (data-theme a <html> elemen). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
      --bg: #000000;
      --text: #ffffff;
      --muted-bg: #1a1a1a;
      --border: #ffffff;
      --focus: #ffdd00;
      --button-bg: #000000;
      --button-text: #ffffff;
      --button-hover-bg: #262626;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
    --bg: #000000;
    --text: #ffffff;
    --muted-bg: #1a1a1a;
    --border: #ffffff;
    --focus: #ffdd00;
    --button-bg: #000000;
    --button-text: #ffffff;
    --button-hover-bg: #262626;
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

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

html {
  font-size: 125%; /* 20px alap */
}

body {
  margin: 0;
  padding: 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  overflow-wrap: break-word;
}

.site-header,
main {
  max-width: 40rem;
  margin: 0 auto;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.4rem;
  margin: 1.5rem 0 1rem;
}

h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.75rem;
}

p {
  margin: 0 0 1rem;
}

/* Fókusz: vastag, nagy kontrasztú körvonal mindenhol. */
:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

/* A címsorok programból kapnak fókuszt; náluk is látszódjon, de ne zavarjon. */
h2:focus {
  outline: 3px dashed var(--focus);
  outline-offset: 4px;
}

button {
  font: inherit;
  min-height: 48px;
  min-width: 48px;
  padding: 0.5rem 1rem;
  border: 3px solid var(--border);
  border-radius: 0.5rem;
  background: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  text-align: left;
}

button:hover {
  background: var(--button-hover-bg);
}

ul.toolbar,
ul.choices {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toolbar button {
  font-size: 0.9rem;
}

.choices li + li {
  margin-top: 0.75rem;
}

.choices button {
  width: 100%;
}

.real-world {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 3px solid var(--border);
  border-left-width: 10px;
  background: var(--muted-bg);
}

.real-world h3 {
  margin-top: 0;
}

.real-world p:last-child {
  margin-bottom: 0;
}

.feedback {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 3px dashed var(--border);
}

dialog {
  width: min(40rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.5rem;
  border: 3px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

dialog h2 {
  margin-top: 0;
}

dialog button {
  margin: 0.5rem 0.5rem 0 0;
}

.scene-list {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.scene-list li + li,
.help-list li + li,
.clue-list li + li {
  margin-top: 0.75rem;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  padding: 0.5rem 1rem;
  background: var(--bg);
  color: var(--text);
  border: 3px solid var(--border);
}

.skip-link:focus {
  top: 1rem;
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
