:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #16181c;
  --muted: #6b7280;
  --accent: #00a850;      /* авитовский зелёный, приглушённый для текста */
  --accent-bright: #04e061;
  --danger: #e5484d;
  --radius: 18px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); font-size: 18px; }
.topbar nav a { color: var(--muted); text-decoration: none; margin-left: 16px; }
.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px 40px; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.hero h1 { margin: 8px 0 4px; font-size: 26px; }
.center { text-align: center; }
h2 { font-size: 17px; margin: 20px 0 10px; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1em; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: #eceef1; font-size: 13px; font-weight: 600;
}
.badge-live { background: #d8f8e4; color: var(--accent); }
.badge-win { background: #fff3cd; color: #8a6d00; }
.badge-theme { background: #e8f0fe; color: #3b5bcc; }

.startform { display: flex; gap: 8px; margin-top: 16px; }
.startform input {
  flex: 1; padding: 12px 14px; border: 1.5px solid #d9dce1;
  border-radius: 12px; font-size: 16px;
}
.startform input:focus { outline: none; border-color: var(--accent-bright); }

.btn {
  display: inline-block; padding: 10px 16px; border-radius: 12px;
  border: 1.5px solid #d9dce1; background: #fff; color: var(--text);
  font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--text); border-color: var(--text); color: #fff; }
.btn-primary:active { transform: scale(.98); }

.qmeta { display: flex; gap: 8px; align-items: center; }
.timer { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.timerbar { height: 6px; background: #eceef1; border-radius: 3px; margin: 12px 0; overflow: hidden; }
#timerfill {
  height: 100%; width: 100%; background: var(--accent-bright);
  border-radius: 3px; transition: width 1s linear;
}
#timerfill.low { background: var(--danger); }
.qtext { font-size: 20px; line-height: 1.35; margin: 8px 0 18px; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  text-align: left; padding: 14px 16px; font-size: 16px; line-height: 1.3;
  border: 1.5px solid #d9dce1; border-radius: 14px; background: #fff; cursor: pointer;
}
.option:hover:not(:disabled) { border-color: var(--text); }
.option:disabled { cursor: default; opacity: .85; }
.option.right { border-color: var(--accent); background: #d8f8e4; opacity: 1; }
.option.wrong { border-color: var(--danger); background: #ffe5e6; opacity: 1; }

.feedback { margin-top: 18px; }
.verdict { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.verdict.ok { color: var(--accent); }
.verdict.bad { color: var(--danger); }
.feedback p { color: var(--muted); }

.scorebig { font-size: 56px; font-weight: 800; color: var(--accent); }

.board { width: 100%; border-collapse: collapse; font-size: 15px; }
.board th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; }
.board td { padding: 8px; border-top: 1px solid #eceef1; }
.board tr.me td { background: #d8f8e4; font-weight: 700; }

.plainlist { list-style: none; padding: 0; margin: 0; }
.plainlist li { padding: 8px 0; border-bottom: 1px solid #eceef1; }
.plainlist a { color: var(--text); }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack label, .row label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.stack input, .stack select, .row input {
  padding: 10px 12px; border: 1.5px solid #d9dce1; border-radius: 10px; font-size: 15px;
}

@media (max-width: 480px) {
  .startform { flex-direction: column; }
  .card { padding: 18px; }
}
