/* Мобильный экран — основной: пятиминутку проходят с телефона, стоя. */
:root {
  --fg: #16181d;
  --muted: #6b7280;
  --line: #e3e6ea;
  --bg: #ffffff;
  --accent: #1f6feb;
  --ok: #1a7f37;
  --bad: #b42318;
  --warn: #9a6700;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6e8eb; --muted: #9aa3ad; --line: #2c313a; --bg: #14161a;
    --accent: #5a9dff; --ok: #4ac26b; --bad: #ff7b72; --warn: #d4a72c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 64px; }
.wide { max-width: 1180px; }

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 28px 0 10px; }
.muted { color: var(--muted); font-size: 14px; }
a { color: var(--accent); }

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 14px 0;
}

.prompt { font-weight: 600; margin-bottom: 10px; white-space: pre-wrap; }

label.opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
}
label.opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
label.opt input { margin-top: 3px; }

textarea, input[type=text], input[type=password], input[type=number] {
  width: 100%;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { min-height: 110px; resize: vertical; }

button, .btn {
  font: inherit;
  font-weight: 600;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.ghost, .btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button[disabled] { opacity: .5; cursor: default; }

.timer {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
  font-variant-numeric: tabular-nums;
}
.timer strong { font-size: 26px; }
.timer.low strong { color: var(--bad); }

.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 13px; border: 1px solid var(--line); }

table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }

.bars { display: flex; gap: 3px; align-items: flex-end; height: 60px; }
.bars span { flex: 1; background: var(--accent); opacity: .75; border-radius: 2px 2px 0 0; min-height: 2px; }

form.row { display: flex; gap: 8px; margin: 12px 0; }
form.row input { flex: 1; }

/* Панель управления пятиминуткой: кнопки в ряд, на телефоне — в столбик. */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.controls form { display: flex; gap: 6px; align-items: center; margin: 0; }

select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}

label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
label.opt { display: flex; color: inherit; font-size: inherit; }

/* Коды свободных билетов — плитками, каждый ведёт на вид студента. */
.tickets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tickets a {
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 9px;
  text-decoration: none;
  font-size: 14px;
}
