@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --bg: #191b14;
  --panel: #23271d;
  --panel-border: #3a4130;
  --ink: #eae7da;
  --ink-dim: #a7ab98;
  --accent: #d9b23c;      /* тактический янтарь, не терракота */
  --ok: #6fae5c;
  --fail: #c2544a;
  --radius: 2px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    repeating-linear-gradient(135deg, rgba(217,178,60,0.035) 0 2px, transparent 2px 14px),
    var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  display: flex;
  justify-content: center;
  padding: 24px 16px 64px;
}

.wrap { width: 100%; max-width: 480px; }

.hdr { text-align: center; margin-bottom: 28px; }
.hdr__mark {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--accent);
  letter-spacing: 6px;
  font-size: 13px;
  margin-bottom: 10px;
}
.hdr__title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 28px;
  margin: 0 0 6px;
}
.hdr__sub { color: var(--ink-dim); font-size: 14px; margin: 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px 20px;
}
.hidden { display: none !important; }

.field { display: block; margin-bottom: 16px; }
.field__label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  background: #14160f;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 12px 14px;
  font-size: 16px;
  font-family: 'IBM Plex Sans', sans-serif;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 15px;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: #1a1a10; }
.btn--primary:disabled { background: #4a4738; color: #86836f; cursor: not-allowed; }
.btn--primary:not(:disabled):active { transform: translateY(1px); }

.hint { color: var(--ink-dim); font-size: 12.5px; margin-top: 14px; text-align: center; line-height: 1.5; }
.error { color: var(--fail); font-size: 13px; margin: 4px 0 12px; }

.progress {
  height: 4px;
  background: #14160f;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress__bar { height: 100%; background: var(--accent); width: 0%; transition: width .25s; }

/* Счётчик и таймер в одну строку, но если не помещаются — таймер уходит на
   свою. Без переноса на узком экране строка «Вопрос 4 из 10» рвалась на три. */
.quiz-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 12px;
}

.quiz-counter {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--ink-dim);
  font-size: 12px;
  letter-spacing: 1px;
  margin: 0 0 10px;
  white-space: nowrap;
}

/* Таймер. Цифры моноширинные и с фиксированной шириной знака: иначе строка
   дёргается на каждой смене секунды. */
.timer {
  font-family: 'IBM Plex Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--ink-dim);
  margin: 0 0 10px;
  white-space: nowrap;
}
.timer--warn { color: var(--accent); }
.timer--over { color: var(--fail); }

.timer-track {
  height: 2px;
  background: var(--panel-border);
  overflow: hidden;
  margin: 0 0 14px;
}
.timer-track__fill {
  height: 100%;
  width: 100%;
  background: var(--ink-dim);
  transform-origin: left center;
}
.timer-track__fill--warn { background: var(--accent); }
.timer-track__fill--over { background: var(--fail); }

/* Когда время вышло: короткая вспышка, чтобы переход к следующему вопросу
   не выглядел как случайный скачок. */
@keyframes timeout-flash {
  0%   { background: rgba(194, 84, 74, .28); }
  100% { background: transparent; }
}
.options--timeout { animation: timeout-flash .5s ease-out; }

/* У кого в системе выключены анимации — обходимся без вспышки и плавности */
@media (prefers-reduced-motion: reduce) {
  .timer-track__fill { transition: none !important; }
  .options--timeout { animation: none; }
}

.quiz-question {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.35;
  margin: 0 0 18px;
}

.quiz-hint {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: -8px 0 12px;
}

.options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--panel-border);
  background: #14160f;
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14.5px;
  line-height: 1.4;
}
.option:hover { border-color: var(--accent); }
.option.selected { border-color: var(--accent); background: rgba(217,178,60,0.12); }

/* Кружок — один вариант, квадрат — можно отметить несколько.
   Форма метки заранее говорит игроку, чего от него ждут. */
.option__mark {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  position: relative;
}
.option--multi .option__mark { border-radius: 2px; }
.option.selected .option__mark { border-color: var(--accent); }
.option.selected .option__mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  background: var(--accent);
  border-radius: 50%;
}
.option--multi.selected .option__mark::after { border-radius: 1px; }

.result { text-align: center; }
.result__badge {
  display: inline-block;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 14px;
}
.result__badge--ok { background: rgba(111,174,92,0.15); color: var(--ok); border: 1px solid var(--ok); }
.result__badge--fail { background: rgba(194,84,74,0.15); color: var(--fail); border: 1px solid var(--fail); }
.result__score { font-family: 'IBM Plex Mono', monospace; font-size: 15px; color: var(--ink-dim); margin: 0 0 18px; }

.qr { display: flex; justify-content: center; background: #fff; padding: 16px; border-radius: var(--radius); margin-bottom: 14px; }
/* На узком экране QR должен ужиматься вместе с карточкой: если он вылезет
   за белую подложку, вокруг кода не останется светлого поля и камера
   организатора его не поймает. pixelated — чтобы при сжатии не размывались
   границы модулей. */
.qr img, .qr canvas {
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.token {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 17px;
  letter-spacing: 2px;
  color: var(--accent);
  margin: 0 0 8px;
}

/* ===== Страница проверки допуска (организатор сканирует QR) ===== */
.verdict {
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  border: 1px solid var(--panel-border);
  background: var(--panel);
}
.verdict--ok   { background: rgba(111,174,92,0.14); border-color: var(--ok); }
.verdict--fail { background: rgba(194,84,74,0.14); border-color: var(--fail); }
.verdict--wait { background: var(--panel); border-color: var(--panel-border); }

.verdict__badge {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 34px;
  line-height: 1.1;
  margin: 0 0 12px;
}
.verdict--ok   .verdict__badge { color: var(--ok); }
.verdict--fail .verdict__badge { color: var(--fail); }
.verdict--wait .verdict__badge { color: var(--ink-dim); font-size: 20px; }

.verdict__name {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 24px;
  margin: 0 0 4px;
}
.verdict__team { color: var(--ink); font-size: 15px; margin: 0 0 10px; }
.verdict__meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  color: var(--ink-dim);
  margin: 0;
}
.verdict__name:empty, .verdict__team:empty, .verdict__meta:empty { display: none; }
