/* ============================================================
   quiz4.css — голосование за одного участника из любой категории
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
  --bg:          #080808;
  --surface:     #111;
  --surface2:    #1a1a1a;
  --border:      rgba(255,255,255,.08);
  --border2:     rgba(255,255,255,.16);
  --gold:        #c9a84c;
  --gold-dim:    rgba(201,168,76,.15);
  --gold-glow:   rgba(201,168,76,.3);
  --text:        #f0ece4;
  --text-mid:    rgba(240,236,228,.6);
  --text-dim:    rgba(240,236,228,.3);
  --green:       #3da879;
  --green-dim:   rgba(61,168,121,.15);
  --red:         #e05252;
  --red-dim:     rgba(224,82,82,.15);
  --font:        'Roboto', sans-serif;
  --nav-h:       44px;    /* верхняя полоска */
  --steps-h:     0px;     /* динамически через JS */
  --instr-h:     0px;     /* высота строки инструкции */
  --sticky-total: calc(var(--nav-h) + var(--steps-h) + var(--instr-h));
  --radius:      6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── ВЕРХНЯЯ ПОЛОСКА ── */
#q4-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: #0a0a0a;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}
.q4-nav-left {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold);
}
.q4-nav-right {
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  text-align: right;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── ПАНЕЛЬ КАТЕГОРИЙ (sticky) ── */
#q4-steps-panel {
  position: sticky;
  top: var(--nav-h);
  z-index: 99;
  background: #0d0d0d;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.q4-step-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.q4-step-row:hover { background: rgba(255,255,255,.04); }
.q4-step-row.active {
  background: rgba(201,168,76,.06);
  border-bottom-color: var(--gold);
}
.q4-step-name {
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--text-mid);
}
.q4-step-row.active .q4-step-name { color: var(--gold); font-weight: 700; }
.q4-step-status {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.q4-step-status.chosen     { color: var(--green); }
.q4-step-status.not-chosen { display: none; }

/* ── СТРОКА ИНСТРУКЦИИ (sticky, вместо кнопки) ── */
#q4-instruction-wrap {
  position: sticky;
  top: calc(var(--nav-h) + var(--steps-h));
  z-index: 98;
  padding: 9px 16px;
  background: #080808;
  border-bottom: 1px solid var(--border);
}
#q4-instruction-text {
  /* легко редактируемый текст — просто меняйте содержимое в HTML */
  font-size: .8rem;
  font-weight: 400;
  color: var(--text-mid);
  letter-spacing: .03em;
  line-height: 1.45;
  text-align: center;
}

/* ── ОСНОВНОЙ КОНТЕНТ ── */
#q4-content {
  padding: 20px 16px 60px;
  max-width: 900px;
  margin: 0 auto;
}

/* ── ЗАГОЛОВОК КАТЕГОРИИ ── */
.q4-step-heading {
  margin-bottom: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gold);
}
.q4-step-intro {
  font-size: .85rem;
  color: var(--text-mid);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ── СЕТКА ВАРИАНТОВ ── */
.q4-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* ── КАРТОЧКА ВАРИАНТА ── */
.q4-option {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.q4-option:hover {
  border-color: var(--border2);
  transform: translateY(-1px);
}
.q4-option.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green), 0 4px 24px rgba(61,168,121,.25);
}

.q4-option-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.q4-option-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter .2s;
}
.q4-option.selected .q4-option-img { filter: brightness(.42) saturate(.5); }

/* Иконка выбора поверх картинки */
.q4-option-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.q4-option.selected .q4-option-check { opacity: 1; }
.q4-option-check svg {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,.8));
}

/* Кнопка зума */
.q4-zoom-btn {
  position: absolute;
  top: 8px; right: 8px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
  z-index: 2;
}
.q4-option:hover .q4-zoom-btn { opacity: 1; }
.q4-zoom-btn:hover { background: rgba(201,168,76,.7); }
@media (hover: none) {
  .q4-zoom-btn { opacity: .44; width: 34px; height: 34px; background: rgba(201,168,76,.7); border-color: var(--gold); }
}

.q4-option-info {
  padding: 10px 12px 12px;
}
.q4-option-title {
  font-size: .88rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.3;
}
.q4-option-desc {
  font-size: .75rem;
  color: var(--text-mid);
  margin-top: 3px;
  line-height: 1.5;
}

/* ── ЭКРАН БЛАГОДАРНОСТИ / УЖЕ ГОЛОСОВАЛ ── */
#q4-screen-done {
  display: none;
  min-height: 100vh;
  background: #000;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  flex-direction: column;
  gap: 20px;
}
.q4-done-title {
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.05;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.q4-done-sub {
  font-size: .95rem;
  color: var(--text-mid);
  line-height: 1.7;
  max-width: 380px;
}

/* ── МОДАЛКА ПОДТВЕРЖДЕНИЯ ВАРИАНТА ── */
.q4-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.q4-overlay.open { opacity: 1; visibility: visible; }
.q4-modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  transform: scale(.94);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 24px 80px rgba(0,0,0,.7);
  margin: auto;
  position: relative;
}
.q4-overlay.open .q4-modal { transform: scale(1); }

.q4-modal-thumb {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: 4px;
  margin: 0 auto 16px;
  display: block;
  border: 1px solid var(--border2);
}
.q4-modal-label {
  font-size: .65rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.q4-modal-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.2;
}
.q4-modal-subname {
  font-size: .82rem;
  color: var(--text-mid);
  margin-bottom: 22px;
  line-height: 1.4;
}
.q4-modal-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.q4-btn-no {
  padding: 12px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text-mid);
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .15s;
}
.q4-btn-no:hover { border-color: var(--text-mid); color: #fff; }
.q4-btn-yes {
  padding: 12px;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  color: #000;
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .15s;
}
.q4-btn-yes:hover { background: #d4b060; }

/* ── ЗУМ МОДАЛКА ── */
#q4-zoom-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.92);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
#q4-zoom-overlay.open { opacity: 1; visibility: visible; }
#q4-zoom-img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  object-fit: contain;
  border-radius: 4px;
  margin: auto;
  display: block;
}
.q4-zoom-close {
  position: fixed;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 601;
  transition: background .15s;
}
.q4-zoom-close:hover { background: rgba(255,255,255,.2); }

/* ── ПЛАНШЕТ ── */
@media (min-width: 600px) {
  #q4-content { padding: 24px 24px 60px; }
  .q4-options { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .q4-step-row { padding: 10px 24px; }
  #q4-nav { padding: 0 24px; }
  #q4-instruction-wrap { padding: 9px 24px; }
  #q4-instruction-text { font-size: .82rem; }
}
/* ── ДЕСКТОП ── */
@media (min-width: 960px) {
  .q4-options { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  #q4-content { padding: 28px 32px 60px; }
}
