:root {
  --bg: #0f1217;
  --panel: #171c23;
  --panel-2: #1d242d;
  --text: #f5f7fa;
  --muted: #aab3bf;
  --line: #2b3440;
  --blue: #0b84ff;
  --orange: #ff6a00;
  --white: #f5f5f5;
  --shadow: 0 18px 55px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(11, 132, 255, .14), transparent 34rem),
    radial-gradient(circle at 90% 20%, rgba(255, 106, 0, .10), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, textarea, input { font: inherit; }

.page-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 72px;
}

.hero {
  max-width: 850px;
  margin-bottom: 34px;
}

.brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--orange);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.brand-kicker::before {
  content: "";
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: var(--blue);
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -.035em;
}

.hero p {
  margin-bottom: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.6;
}

.poll fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.design-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.design-card:hover {
  transform: translateY(-3px);
  border-color: #536276;
}

.design-card:has(input:focus-visible) {
  outline: 3px solid rgba(11, 132, 255, .55);
  outline-offset: 3px;
}

.design-card:has(input:checked) {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 132, 255, .18), var(--shadow);
}

.design-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.design-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #101318;
}

.design-title {
  display: block;
  padding: 15px 18px 17px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: .01em;
}

.checkmark {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid rgba(255,255,255,.8);
  border-radius: 50%;
  background: rgba(15, 18, 23, .72);
  color: transparent;
  font-weight: 900;
  backdrop-filter: blur(8px);
}

.design-card:has(input:checked) .checkmark {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.comment-block {
  margin-top: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.comment-block label {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
}

.comment-block label span,
.comment-meta,
.privacy-note,
.stat-label,
.section-heading span {
  color: var(--muted);
  font-weight: 500;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 110px;
  padding: 14px;
  border: 1px solid #394656;
  border-radius: 10px;
  outline: none;
  background: #0f141a;
  color: var(--text);
}

textarea:focus { border-color: var(--blue); }

.comment-meta {
  margin-top: 6px;
  text-align: right;
  font-size: .85rem;
}

.submit-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
}

button,
.button-link {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  padding: 0 20px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button-link:hover { filter: brightness(1.08); }
button:disabled { opacity: .55; cursor: wait; }

.privacy-note {
  max-width: 700px;
  margin: 0;
  font-size: .9rem;
  line-height: 1.45;
}

.message {
  min-height: 24px;
  margin-top: 16px;
  font-weight: 700;
}

.message.success { color: #7ee2a8; }
.message.error { color: #ff9191; }

.admin-shell { max-width: 1040px; }
.admin-hero { margin-bottom: 26px; }

.admin-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 20px;
}

.stat-card,
.results-panel,
.comments-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px 20px;
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.8rem;
}

.button-link { align-self: center; }

.results-panel {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 28px;
}

.pie-wrap {
  display: grid;
  place-items: center;
}

.pie-chart {
  width: 230px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#313946 0deg 360deg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 16px 38px rgba(0,0,0,.24);
}

.legend {
  display: grid;
  gap: 14px;
}

.legend-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.legend-row:last-child { border-bottom: 0; }
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; }
.legend-label { font-weight: 800; }
.legend-value { color: var(--muted); font-variant-numeric: tabular-nums; }

.comments-panel {
  margin-top: 20px;
  padding: 24px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.section-heading h2 { margin-bottom: 0; }

.comments-list { display: grid; }

.comment-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.comment-item:last-child { border-bottom: 0; }

.comment-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.comment-design { font-weight: 850; }
.comment-time { color: var(--muted); font-size: .9rem; }
.comment-text { margin: 0; color: #e5e9ef; line-height: 1.55; white-space: pre-wrap; }
.empty { color: var(--muted); padding: 18px 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 880px) {
  .design-grid { grid-template-columns: 1fr; }
  .design-card { max-width: 720px; }
  .admin-summary { grid-template-columns: 1fr 1fr; }
  .button-link { grid-column: 1 / -1; }
  .results-panel { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .page-shell { width: min(100% - 20px, 1220px); padding-top: 32px; }
  .submit-row { align-items: stretch; flex-direction: column; }
  .admin-summary { grid-template-columns: 1fr; }
  .button-link { grid-column: auto; }
  .results-panel, .comments-panel, .comment-block { padding: 18px; }
  .pie-chart { width: min(230px, 70vw); }
}
