:root {
  color-scheme: dark;
  --bg: #101010;
  --text: #f4f4f4;
  --muted: #939393;
  --line: #363636;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}
main {
  max-width: 1200px;
  margin: auto;
  padding: 0 40px;
}
header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.brand {
  text-decoration: none;
  color: inherit;
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 14px;
}
.brand span {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
}
#account {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.hero {
  padding: 65px 0 40px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  line-height: 1.8;
}
h1 {
  font-size: clamp(36px, 7.7vw, 98px);
  line-height: 0.99;
  letter-spacing: -0.065em;
  margin: 28px 0 38px;
  font-weight: 900;
  overflow-wrap: anywhere;
}
h1 span {
  color: #aaa;
}
.hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}
.hero-bottom p {
  font-size: 17px;
  color: #aaa;
  line-height: 1.5;
}
.clock {
  text-align: right;
}
small {
  color: var(--muted);
  letter-spacing: 2px;
  font-size: 10px;
}
.clock strong {
  display: block;
  font-size: clamp(22px, 3.3vw, 42px);
  font-variant-numeric: tabular-nums;
  margin-top: 12px;
  letter-spacing: -1px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  margin: 30px 0;
  background: #151515;
}
#auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 42px;
}
h2 {
  font-size: 26px;
  letter-spacing: -0.7px;
  margin: 10px 0 16px;
}
p {
  line-height: 1.6;
}
label {
  display: block;
  font-size: 12px;
  color: #bbb;
  margin: 12px 0;
}
input,
textarea {
  display: block;
  width: 100%;
  background: #101010;
  border: 1px solid #444;
  color: #fff;
  padding: 14px;
  border-radius: 8px;
  margin: 8px 0;
  font: inherit;
}
input:focus,
textarea:focus {
  outline: 2px solid #aaa;
  outline-offset: 2px;
}
button {
  border: 1px solid #eee;
  background: #eee;
  color: #111;
  padding: 14px 22px;
  font: 700 13px Arial;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}
button:hover:enabled {
  background: #ccc;
  transform: translateY(-2px);
}
button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.secondary {
  color: #ddd;
  background: transparent;
  border-color: #555;
}
.secondary:hover:enabled {
  background: #303030;
}
.text-button {
  background: transparent;
  border: 0;
  color: #aaa;
  font-size: 12px;
}
.text-button:hover:enabled {
  background: #242424;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
#auth-form > button[type="submit"] {
  width: 100%;
  margin-top: 12px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-top: 48px;
}
.section-head strong {
  white-space: nowrap;
  font-size: 13px;
  border: 1px solid #444;
  border-radius: 24px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.privacy {
  font-size: 12px;
  color: #999;
  max-width: 720px;
  margin: 0 0 28px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.card {
  min-height: 140px;
  background: #181818;
  border: 1px solid #393939;
  color: #eee;
  text-align: left;
  padding: 20px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-wrap: anywhere;
}
.card:hover:enabled {
  background: #232323;
  border-color: #888;
}
.card[aria-pressed="true"] {
  background: #eee;
  color: #111;
  border-color: #fff;
}
.card:disabled {
  opacity: 1;
}
.card .top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 1px;
  color: #888;
}
.card[aria-pressed="true"] .top {
  color: #444;
}
.card .name {
  font-size: 19px;
  font-weight: 600;
}
.check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #777;
  text-align: center;
  line-height: 20px;
}
.vote-bar {
  position: sticky;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0;
  padding: 16px 20px;
  border: 1px solid #555;
  border-radius: 12px;
  background: #171717;
  box-shadow: 0 10px 30px #0008;
  gap: 16px;
}
.vote-bar p {
  font-size: 12px;
  color: #aaa;
}
.vote-bar button {
  white-space: nowrap;
}
#notice {
  color: #fff;
  font-size: 14px;
  padding: 10px 0;
  min-height: 35px;
}
.results {
  border: 1px solid #777;
  border-radius: 18px;
  padding: 30px;
  background: #ededed;
  color: #111;
}
.results .eyebrow {
  color: #555;
}
.ranking {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}
.ranking li {
  display: flex;
  justify-content: space-between;
  padding: 13px 0;
  border-top: 1px solid #bbb;
  gap: 12px;
}
.ranking li span {
  overflow-wrap: anywhere;
}
.admin {
  display: block;
}
.admin-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 25px 0;
}
.admin-tools label {
  width: 120px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
td,
th {
  text-align: left;
  border-bottom: 1px solid #444;
  padding: 14px;
  vertical-align: top;
}
td small {
  display: block;
  font-size: 10px;
  letter-spacing: 0;
  word-break: break-all;
  max-width: 250px;
}
.table-scroll {
  overflow: auto;
}
pre {
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 12px;
  background: #101010;
  padding: 16px;
  border-radius: 8px;
}
details {
  margin: 22px 0;
}
summary {
  cursor: pointer;
  color: #ccc;
}
footer {
  padding: 40px 0;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #333;
  font-size: 10px;
  color: #888;
}
dialog {
  max-width: 540px;
  width: calc(100% - 32px);
  background: #181818;
  color: #eee;
  border: 1px solid #777;
  border-radius: 18px;
  padding: 30px;
}
dialog::backdrop {
  background: #000b;
  backdrop-filter: blur(5px);
}
dialog li {
  padding: 8px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 26px;
}
[hidden] {
  display: none !important;
}
button:focus-visible {
  outline: 3px solid #999;
  outline-offset: 3px;
}
@media (max-width: 680px) {
  main {
    padding: 0 18px;
  }
  header {
    min-height: 76px;
    align-items: center;
  }
  .brand span {
    display: none;
  }
  .hero {
    padding-top: 44px;
  }
  .hero-bottom {
    align-items: start;
    flex-direction: column;
  }
  .clock {
    text-align: left;
  }
  #auth {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .panel {
    padding: 22px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card {
    min-height: 120px;
    padding: 15px;
  }
  .card .name {
    font-size: 16px;
  }
  .section-head {
    align-items: start;
  }
  .section-head h2 {
    font-size: 22px;
  }
  .section-head strong {
    font-size: 11px;
  }
  .vote-bar {
    padding: 12px;
  }
  .vote-bar p {
    font-size: 10px;
  }
  .vote-bar button {
    padding: 13px;
  }
  footer {
    flex-direction: column;
  }
  .dialog-actions {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Вход открывает экран голосования. */
body {
  background: radial-gradient(ellipse at 50% 0%, #272727 0%, #101010 60%);
  background-attachment: fixed;
}
.signed-out .hero-bottom {
  display: none;
}
.signed-out .hero {
  padding-bottom: 8px;
}
.signed-out .hero h1 {
  font-size: clamp(36px, 6.4vw, 78px);
  margin-bottom: 18px;
}
.signed-out #auth {
  max-width: 850px;
  margin: 28px auto 65px;
  border-color: #595959;
  box-shadow: 0 20px 80px #0006;
}
.signed-out footer {
  margin-top: 30px;
}
.hero h1 {
  animation: title-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero .eyebrow {
  animation: fade-in 0.7s both;
}
.panel,
#vote,
#results {
  animation: fade-in 0.6s ease both;
}
.candidate-item {
  min-width: 0;
  background: #181818;
  border: 1px solid #393939;
  border-radius: 14px;
  overflow: hidden;
  transition:
    transform 0.25s,
    box-shadow 0.25s,
    border-color 0.25s;
}
.candidate-item:hover {
  transform: translateY(-4px);
  border-color: #888;
  box-shadow: 0 15px 35px #0005;
}
.candidate-item .card {
  width: 100%;
  border: 0;
  border-radius: 0;
  min-height: 145px;
}
.candidate-item .card:hover:enabled {
  transform: none;
}
.comment-open {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid #393939;
  border-radius: 0;
  background: #181818;
  color: #aaa;
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.5px;
  font-weight: 400;
  padding: 13px 20px;
}
.comment-open:hover:enabled {
  background: #292929;
  color: white;
  transform: none;
}
.comments-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.comments-heading button {
  padding: 8px 13px;
  font-size: 22px;
}
.comment {
  padding: 18px 0;
  border-top: 1px solid #444;
}
.comment small {
  display: block;
  font-size: 10px;
  letter-spacing: 0;
  margin-top: 6px;
}
.comment p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-bottom: 0;
}
#comment-list {
  max-height: 340px;
  overflow: auto;
  margin-top: 25px;
}
#comment-error {
  font-size: 12px;
}
dialog[open] {
  animation: fade-in 0.25s ease both;
}
#comments-dialog {
  max-width: 600px;
}
@keyframes title-in {
  from {
    opacity: 0;
    transform: translateY(28px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Чистая форма входа и мягкие объёмные тени. */
#auth,.signed-out #auth{display:block;max-width:460px;margin:30px auto 70px;background:linear-gradient(145deg,#222,#141414);border-color:#555;box-shadow:0 24px 70px #0009,inset 0 1px 0 #ffffff0b}
.hero h1{text-shadow:0 12px 40px #0009}.candidate-item{box-shadow:0 8px 24px #0005,inset 0 1px 0 #ffffff08}.candidate-item:hover{box-shadow:0 18px 45px #0009,0 0 0 1px #ffffff13}.vote-bar{box-shadow:0 16px 45px #0009}dialog{box-shadow:0 30px 100px #000b}.panel{box-shadow:0 16px 45px #0005}#auth-form>button[type=submit]{box-shadow:0 6px 22px #0006}main{padding-bottom:35px}
