/* ITISCONF — фирстиль конференции "IT IS Conf, 19-20.06, эволюция сильных решений":
   жёлтый фон, чёрные брутальные плашки без скруглений, кубический техно-шрифт.
   Тест — вертикальный (телефон), результаты — горизонтальный (экран), админка — узкая. */

@import url('https://fonts.googleapis.com/css2?family=Tektur:wght@500;700;800;900&family=Inter:wght@500;600;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --yellow: #F2A100;
  --yellow-deep: #D88B00;
  --black: #0A0A0A;
  --black-soft: #161616;
  --white: #FFFFFF;
  --text-dim: rgba(255, 255, 255, 0.7);
  --text-on-yellow: #0A0A0A;
  --text-on-yellow-dim: rgba(10, 10, 10, 0.65);
  --font-display: "Tektur", "Inter", system-ui, sans-serif;
  --font-text: "Inter", "Segoe UI", system-ui, sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font-text);
  color: var(--text-on-yellow);
  background: var(--yellow);
}

body {
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  /* Декоративные «глитч-квадраты» по фону — почти невидимые на больших экранах,
     дают фирстилю воздуха. На телефоне отключены через медиа-запрос ниже. */
  background-image:
    linear-gradient(var(--black) 0 0),
    linear-gradient(var(--black) 0 0),
    linear-gradient(var(--white) 0 0),
    linear-gradient(var(--white) 0 0);
  background-size: 14px 14px, 22px 22px, 8px 8px, 12px 12px;
  background-position: 8% 12%, 92% 18%, 4% 88%, 96% 82%;
  background-repeat: no-repeat;
}

/* Чёрная плашка — основной фирменный элемент */
.slab {
  background: var(--black);
  color: var(--white);
  padding: 18px 20px;
  border: none;
  border-radius: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 0;
}

.status-line {
  color: var(--text-on-yellow-dim);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.slab .status-line { color: var(--text-dim); }

.hidden { display: none !important; }

/* ================ ЛОГО ================ */
/* Лого мини-версия для шапок: чёрная плашка с белым технотекстом. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand-logo {
  display: inline-block;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 6px 10px 4px;
  font-size: 18px;
  line-height: 1;
  text-transform: uppercase;
}
.brand-logo .lo-accent { color: var(--yellow); }
.brand-date {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-on-yellow);
}

/* ================= ТЕСТ — вертикально (телефон) ================= */

body.page-test {
  display: flex;
  justify-content: center;
  /* На телефоне декоративные квадраты убираем — мешают плашкам */
  background-image: none;
}

.test-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  padding: 22px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.test-header {
  text-align: center;
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.test-header .brand-logo { font-size: 26px; padding: 10px 14px 8px; }
.test-header .brand-date { font-size: 12px; }
.test-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}
.test-header .stage-badge {
  display: inline-block;
  padding: 6px 14px 5px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Вопрос — крупный чёрный текст прямо на жёлтом, без плашки */
.question-box {
  padding: 6px 2px 4px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: 0.01em;
  color: var(--text-on-yellow);
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Ответ — чёрная плашка с белым текстом, выбранный — жёлтая плашка с чёрным */
.answer-btn {
  width: 100%;
  padding: 20px 18px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: left;
  transition: transform 0.08s ease, background 0.15s ease, color 0.15s ease;
}
.answer-btn:active { transform: scale(0.98); }
.answer-btn:hover { background: var(--black-soft); }
.answer-btn.selected {
  background: var(--yellow);
  color: var(--text-on-yellow);
  outline: 3px solid var(--black);
  outline-offset: -3px;
}
.answer-btn:disabled { opacity: 0.55; cursor: default; }

.test-message {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 30px 20px;
  background: var(--black);
  color: var(--white);
}
.test-message .big {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.test-message .countdown {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.test-message .answer-btn {
  max-width: 280px;
  text-align: center;
  margin-top: 6px;
  background: var(--yellow);
  color: var(--text-on-yellow);
}

/* ================= РЕЗУЛЬТАТ — горизонтально (экран) ================= */

body.page-results {
  overflow: hidden;
}

.results-shell {
  width: 100vw;
  height: 100vh;
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.results-header .results-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}
.results-header .brand-logo { font-size: 22px; padding: 8px 12px 6px; }
.results-header h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.results-header .meta {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-on-yellow-dim);
}

.charts-row {
  flex: 1;
  display: flex;
  gap: 14px;
  align-items: stretch;
  min-height: 0;
}

.chart-card {
  flex: 1;
  min-width: 0;
  padding: 14px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--black);
  color: var(--white);
}
.chart-card.is-current {
  background: var(--yellow);
  color: var(--text-on-yellow);
  outline: 3px solid var(--black);
  outline-offset: -3px;
}
.chart-card.is-current .chart-sub { color: var(--text-on-yellow-dim); }

.chart-card .chart-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chart-card .chart-sub {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.chart-card canvas {
  flex: 1;
  width: 100%;
  min-height: 0;
}

.results-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-on-yellow);
  background: var(--black);
  color: var(--white);
}

/* ================= АДМИНКА ================= */

body.page-admin {
  display: flex;
  justify-content: center;
  padding: 26px 16px 40px;
}
.admin-shell {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-shell h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-on-yellow);
}

.admin-card {
  padding: 18px;
  background: var(--black);
  color: var(--white);
}

.admin-state-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  font-size: 15px;
}
.admin-state-grid .k {
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.admin-state-grid .v {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.admin-actions button {
  padding: 14px 12px;
  background: var(--yellow);
  color: var(--text-on-yellow);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.admin-actions button.ghost {
  background: transparent;
  color: var(--white);
  outline: 2px solid var(--white);
  outline-offset: -2px;
}
.admin-actions button.danger {
  background: #C8222B;
  color: var(--white);
}

.admin-gate {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10vh;
  text-align: center;
}
.admin-gate h1 { font-size: 22px; }
.admin-gate-row {
  display: flex;
  gap: 8px;
}
.admin-gate-row input {
  flex: 1;
  padding: 14px 16px;
  border: none;
  border-radius: 0;
  outline: 2px solid var(--white);
  outline-offset: -2px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 4px;
  text-align: center;
}
.admin-gate-row input::placeholder {
  color: var(--text-dim);
  letter-spacing: normal;
  text-transform: uppercase;
  font-size: 14px;
}
.admin-gate-row button {
  padding: 14px 22px;
  background: var(--yellow);
  color: var(--text-on-yellow);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.admin-gate-row button:disabled { opacity: 0.5; cursor: default; }

.admin-tallies { display: flex; flex-direction: column; gap: 6px; }
.admin-tally {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 8px 12px;
  background: var(--black-soft);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.admin-msg {
  font-size: 13px;
  min-height: 18px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.admin-msg.err {
  color: var(--yellow);
  font-weight: 700;
}

.nav-links {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-on-yellow);
}
.nav-links a {
  color: var(--text-on-yellow);
  text-decoration: underline;
  text-underline-offset: 3px;
}
