/* Der Messbereich ist bewusst immer schwarz auf weiss, damit Lesebedingungen vergleichbar bleiben. */
:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5b6673;
  --line: #d5dbe1;
  --accent: #0b5cad;
  --accent-ink: #ffffff;
  --surface: #ffffff;
  --page: #f2f4f6;
  --ok: #17693a;
  --warn: #b45309;
  --target: #d62828;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

#app { padding: 32px 16px 64px; }

.card {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

h1 { margin: 0 0 16px; font-size: 1.6rem; line-height: 1.25; }
h2 { margin: 28px 0 10px; font-size: 1.1rem; }
p { margin: 0 0 14px; }
ul { margin: 0 0 14px; padding-left: 22px; }
li { margin-bottom: 4px; }

.library-logo {
  display: block;
  height: 36px;
  margin-bottom: 20px;
  padding: 6px 10px;
  background: #000;
  border-radius: 6px;
}

.notice {
  padding: 10px 14px;
  background: #fef3c7;
  border: 1px solid #f0c674;
  border-radius: 6px;
}

button {
  min-height: 44px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #9aa5b1;
  border-radius: 6px;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #e8edf2; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #7ab3ef;
  outline-offset: 1px;
}
button.primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
button.primary:hover:not(:disabled) { background: #094b8d; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.field-label { font-weight: 600; }
.hint { color: var(--muted); font-size: 0.875rem; }

input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #9aa5b1;
  border-radius: 6px;
}
textarea { resize: vertical; }
form > .field { margin-bottom: 16px; }

.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; font-weight: 600; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }

.likert { margin: 0 0 18px; padding: 0; border: 0; }
.likert legend { margin-bottom: 6px; padding: 0; font-weight: 600; }
.likert-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.likert-options { display: flex; gap: 6px; }
.likert-end { flex: 0 1 110px; }
.likert-option { position: relative; cursor: pointer; }
.likert-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.likert-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 1px solid #9aa5b1;
  border-radius: 6px;
}
.likert-option input:checked + span { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.likert-option input:focus-visible + span { outline: 3px solid #7ab3ef; outline-offset: 1px; }

.status { margin-top: 14px; color: var(--muted); }
.preview { display: block; width: 100%; max-width: 480px; margin-top: 16px; border-radius: 6px; background: #000; transform: scaleX(-1); }
.face-status { margin-top: 10px; font-weight: 600; color: var(--warn); }
.face-status.ok { color: var(--ok); }

.summary { width: 100%; margin-top: 24px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.summary th, .summary td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.summary th { font-weight: 400; color: var(--muted); }

/* Messbereich */
#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  color: #000;
  background: #fff;
}
#stage.hide-cursor, #stage.hide-cursor * { cursor: none; }
#stage.look-away { box-shadow: inset 0 0 0 28px #f97316; }

.target-dot {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  background: var(--target);
  border-radius: 50%;
}
.target-dot::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
}
.target-dot.small { width: 12px; height: 12px; margin: -6px 0 0 -6px; }
.target-dot.small::after { display: none; }

.calibration-progress {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  pointer-events: none;
}
.calibration-point {
  --done: 0;
  position: absolute;
  width: 44px;
  height: 44px;
  min-height: 0;
  margin: -22px 0 0 -22px;
  padding: 0;
  color: #fff;
  background: var(--target);
  border: 0;
  border-radius: 50%;
  opacity: calc(1 - var(--done) * 0.6);
}
.calibration-point:hover:not(:disabled) { background: var(--target); }

.reading-text {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  text-align: left;
}
.reading-line { white-space: pre; }
.highlight-line { background: #fff3b0; }
.highlight-word { background: #ffd60a; }

.wink-fixation {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 40px;
  font-weight: 700;
}
.wink-fixation.cue { color: var(--target); }

.tracker-hidden { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sim-dot { position: fixed; z-index: 99999; width: 12px; height: 12px; margin: -6px 0 0 -6px; background: #2563eb; border-radius: 50%; opacity: 0.7; pointer-events: none; }

.pause-overlay {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.75);
}

@media (max-width: 640px) {
  .card { padding: 20px 16px; }
  .likert-end { flex-basis: 100%; }
}
