/* Страницы голосования поверх темы «Хэллоуин-нуар» (noir.css). */
* { box-sizing: border-box; }
body { padding: max(20px, env(safe-area-inset-top)) 16px 140px; text-align: center; }
.wrap { max-width: 720px; margin: 0 auto; }
.hidden { display: none !important; }
.sub { color: var(--muted); margin: 0 0 18px; line-height: 1.45; }
.empty { color: var(--muted); font-style: italic; padding: 6px 0; }
.panel .empty { color: var(--paper-800); }
#err:empty { display: none; }
#err { margin: 14px 0; }

/* Шапка: надзаголовок, крупное название, вывеска. */
.hero { margin: 8px 0 26px; }
.hero .kicker { color: var(--pumpkin); }
.hero h1 { margin: 10px 0 18px; font-size: clamp(40px, 9vw, 72px); }
.hero h1 .accent { color: var(--pumpkin); }

input { font-size: 18px; padding: 12px 14px; }
button { font-size: 18px; padding: 12px 22px; }
button.danger { background: var(--red-deep); box-shadow: inset 0 -4px 0 #4a0f0c, inset 0 0 0 2px rgba(0, 0, 0, .25); }
button.small { font-size: 14px; padding: 7px 12px; --cut: 6px; }

/* Статус голосования: плашка с «лампочкой». */
.status {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-label); font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
  font-size: 15px; padding: 8px 16px;
  background: var(--night-900); box-shadow: inset 0 0 0 1px #2f3a4c, var(--shadow-hard-sm);
}
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.status.open { color: var(--green); }
.status.closed { color: #ff8a80; }

/* ---------- Вход голосующего: плакат с хозяином вечера и форма ---------- */
.login-card { display: grid; grid-template-columns: 42% 1fr; padding: 0; text-align: left; overflow: hidden; }
.login-art { position: relative; min-height: 300px; }
.noir-poster {
  position: absolute; inset: 0;
  background: var(--halftone), radial-gradient(ellipse at 60% 40%, #2b4566 0, transparent 60%), var(--navy);
}
.noir-host {
  position: absolute; bottom: 0; left: 55%; transform: translateX(-50%);
  height: 94%; width: auto; max-width: none;
  filter: drop-shadow(8px 6px 0 rgba(0, 0, 0, .55)) contrast(1.06);
}
.login-form { padding: 30px 26px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.login-form .kicker { color: var(--paper-800); }
.login-form h2 { color: var(--paper-ink); text-shadow: none; margin: 0 0 4px; }
.login-form p { margin: 0 0 6px; color: var(--paper-ink); line-height: 1.45; }
.login-form input { width: 100%; }

/* ---------- Бюллетень ---------- */
.ballot-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.hello { font-family: var(--font-display); font-size: clamp(24px, 5vw, 34px); text-transform: uppercase; text-shadow: 3px 3px 0 #000; }

/* Прогресс: эмблема каждой номинации загорается, когда голос отдан. */
.progress { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 28px 0 0; }
.progress .emblems { justify-content: center; flex-wrap: wrap; }
.progress .emblem { transition: opacity .3s, filter .3s; }
.progress .emblem.off { opacity: .35; filter: grayscale(1); }

/* Номинация — пергаментная панель с эмблемой и вывеской. */
.nom { margin: 0 0 26px; }
.nom .panel { text-align: left; padding: 22px 22px 20px; }
.nom-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.nom-head .emblem { flex: 0 0 auto; width: 52px; height: 52px; }
.nom-head h2 { margin: 0; color: var(--paper-ink); text-shadow: none; font-size: clamp(22px, 4.6vw, 30px); line-height: 1.05; flex: 1; }
.nom-done {
  flex: 0 0 auto; align-self: flex-start;
  font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 13px;
  color: #2f6b1a; border: 2px solid #2f6b1a; padding: 2px 8px; transform: rotate(6deg);
  background: rgba(243, 230, 207, .6);
}

/* Номинанты — тёмные плитки на пергаменте, выбранный — в золотой рамке. */
.nominees { display: grid; gap: 10px; }
button.nominee {
  --cut: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; text-transform: none; letter-spacing: .02em;
  font-family: var(--font-label); font-weight: 600; font-size: 20px; padding: 14px 16px;
  background: var(--night-800); color: var(--cream);
  box-shadow: inset 0 -4px 0 #000, inset 0 0 0 2px #2f3a4c;
}
button.nominee .pick { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
button.nominee:hover:not(:disabled) .pick { color: var(--gold); }
button.nominee.chosen {
  background: var(--night-900); color: var(--gold);
  box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 0 5px #000;
}
button.nominee.chosen .pick, button.nominee.chosen:hover .pick { color: var(--paper-ink); background: var(--gold); padding: 3px 8px; }
button.nominee.fresh { animation: stamp-in var(--stamp); }
button.nominee:disabled { cursor: default; color: var(--muted); }
button.nominee.chosen:disabled { color: var(--gold); }
@keyframes stamp-in { from { transform: scale(1.04); } to { transform: none; } }

/* Итоги подведены — плашка-ссылка над бюллетенем. */
.results-link {
  display: flex; flex-direction: column; gap: 4px; align-items: center; margin: 0 0 22px; padding: 16px;
  text-decoration: none; background: var(--night-800); border: 2px solid var(--gold);
  outline: 1px solid var(--gold); outline-offset: -7px; box-shadow: var(--shadow-hard);
}
.results-link .kicker { color: var(--gold); }
.results-title { font-family: var(--font-display); font-size: 26px; color: var(--cream); text-transform: uppercase; text-shadow: 3px 3px 0 #000; }
.results-link:hover .results-title { color: var(--gold); }

/* ---------- Админка ---------- */
.admin-bar { display: grid; gap: 14px; justify-items: center; margin-bottom: 26px; }
.voter-link { font-family: var(--font-label); letter-spacing: .04em; word-break: break-all; }
.voter-link .link { color: var(--amber); }
.toolbar { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; align-items: center; }
#toggle, #results, #openResults { font-size: 20px; padding: 14px 26px; }

.admin-nom { text-align: left; margin-bottom: 22px; }
.admin-nom .nom-head { padding-right: 0; }
.admin-nom .nom-head h2 { color: var(--cream); text-shadow: 3px 3px 0 #000; }
.total { font-family: var(--font-label); color: var(--muted); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }

.row { display: grid; grid-template-columns: 1fr 170px auto; align-items: center; gap: 10px; margin: 10px 0; }
.row input { width: 100%; min-width: 0; font-size: 17px; padding: 9px 12px; }
.row.add { grid-template-columns: 1fr auto; margin-top: 16px; }
.votes { font-family: var(--font-label); font-size: 14px; color: var(--muted); }
.votes b { color: var(--mint); font-size: 18px; text-shadow: 0 0 8px rgba(124, 255, 214, .45); margin-right: 4px; }
.bar { height: 8px; background: var(--night-900); margin-top: 5px; box-shadow: inset 0 0 0 1px #2f3a4c; overflow: hidden; }
.bar > div { height: 100%; background: var(--acc); transition: width .4s; }
.leader input { border-color: var(--gold); box-shadow: inset 3px 3px 0 rgba(0, 0, 0, .45), 0 0 12px rgba(227, 179, 65, .35); }
.leader .votes::after { content: "  ♛ лидер"; color: var(--gold); letter-spacing: .06em; }

.voters { display: flex; flex-wrap: wrap; gap: 10px; }
.voter {
  display: flex; gap: 10px; align-items: center; padding: 5px 5px 5px 12px;
  background: var(--night-900); box-shadow: inset 0 0 0 1px #2f3a4c, var(--shadow-hard-sm);
  font-family: var(--font-label); letter-spacing: .03em;
}
.voter .n { color: var(--mint); font-size: 14px; }

@media (max-width: 600px) {
  body { padding-bottom: 110px; }
  .login-card { grid-template-columns: 1fr; }
  .login-art { min-height: 220px; }
  .login-form { padding: 22px 18px; }
  .nom .panel { padding: 18px 16px 16px; }
  button.nominee { font-size: 18px; padding: 12px 14px; }
  .row { grid-template-columns: 1fr auto; }
  .row .votes { grid-column: 1 / -1; grid-row: 2; }
  .ballot-head { justify-content: center; }
}
