:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #162033;
  --muted: #5f6b7a;
  --line: #d8dee8;
  --accent: #1267d8;
  --accent-dark: #0f4f9f;
  --accent-soft: #e9f2ff;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --success: #16875d;
  --shadow: 0 18px 42px rgba(22, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(18, 103, 216, 0.08), rgba(244, 246, 248, 0) 42%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.survey-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px 18px 38px;
  display: flex;
  align-items: center;
}

.survey-panel {
  width: 100%;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.vote-panel {
  margin: 18px 0;
}

.panel-heading {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
}

.compact-heading {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2.6rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.lead {
  max-width: 560px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.survey-form {
  display: grid;
  gap: 18px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  font-size: 0.94rem;
  font-weight: 800;
}

.field-group input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.field-group input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(18, 103, 216, 0.18);
}

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

.errorlist {
  margin: 0;
  padding: 0;
  color: var(--danger);
  font-size: 0.9rem;
  line-height: 1.5;
  list-style: none;
}

.form-alert {
  padding: 13px 14px;
  border: 1px solid rgba(180, 35, 24, 0.28);
  border-radius: 8px;
  color: var(--danger);
  background: var(--danger-bg);
  font-size: 0.94rem;
  line-height: 1.55;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.choice-card {
  position: relative;
  min-height: 116px;
  padding: 16px 16px 16px 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.choice-card:hover {
  border-color: rgba(18, 103, 216, 0.48);
  box-shadow: 0 10px 24px rgba(22, 32, 51, 0.08);
}

.choice-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-mark {
  position: absolute;
  top: 18px;
  left: 16px;
  width: 24px;
  height: 24px;
  border: 2px solid #aeb8c6;
  border-radius: 6px;
  background: #fff;
}

.choice-input:checked + .choice-mark {
  border-color: var(--accent);
  background: var(--accent);
}

.choice-input:checked + .choice-mark::after {
  position: absolute;
  top: 2px;
  left: 7px;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.choice-input:focus-visible + .choice-mark {
  outline: 3px solid rgba(18, 103, 216, 0.2);
  outline-offset: 3px;
}

.choice-card:has(.choice-input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice-card:has(.choice-input:disabled:not(:checked)) {
  cursor: not-allowed;
  opacity: 0.52;
}

.choice-copy {
  display: grid;
  gap: 8px;
}

.choice-title {
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.35;
}

.choice-description {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.48;
}

.rank-list {
  display: grid;
  gap: 28px;
}

.rank-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 18px;
  align-items: center;
  min-height: 86px;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(22, 32, 51, 0.05);
}

.rank-copy {
  display: grid;
  gap: 12px;
  line-height: 1.7;
}

.rank-control {
  position: relative;
  display: grid;
  gap: 6px;
}

.rank-control::after {
  position: absolute;
  top: 18px;
  right: 16px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent-dark);
  border-bottom: 2px solid var(--accent-dark);
  content: "";
  pointer-events: none;
  transform: rotate(45deg);
}

.rank-select {
  appearance: none;
  width: 100%;
  min-height: 48px;
  padding: 0 42px 0 14px;
  border: 1px solid #c7d4e5;
  border-radius: 8px;
  color: var(--muted);
  background:
    linear-gradient(180deg, #ffffff, #f7fbff),
    #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(22, 32, 51, 0.05);
  cursor: pointer;
  font-weight: 850;
  transition: border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, background 160ms ease;
}

.rank-select:hover {
  border-color: rgba(18, 103, 216, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 22px rgba(22, 32, 51, 0.08);
}

.rank-select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(18, 103, 216, 0.2);
}

.rank-select:valid {
  color: var(--ink);
  border-color: rgba(22, 135, 93, 0.46);
  background:
    linear-gradient(180deg, #ffffff, #f3fff9),
    #fff;
}

.rank-card:has(.rank-select:valid) {
  border-color: rgba(22, 135, 93, 0.28);
  background: linear-gradient(180deg, #ffffff, #f8fffc);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  min-width: 148px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 12px 24px rgba(18, 103, 216, 0.24);
}

.primary-action:hover {
  background: var(--accent-dark);
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.secondary-action {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.danger-action {
  background: var(--danger);
  box-shadow: 0 12px 24px rgba(180, 35, 24, 0.24);
}

.danger-action:hover {
  background: #8f1d14;
}

.primary-action:focus-visible,
.secondary-action:focus-visible {
  outline: 3px solid rgba(18, 103, 216, 0.24);
  outline-offset: 3px;
}

.control-status {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(22, 135, 93, 0.28);
  border-radius: 8px;
  background: #eefaf5;
}

.control-status.is-closed {
  border-color: rgba(180, 35, 24, 0.28);
  background: var(--danger-bg);
}

.control-status span,
.control-status small {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.control-status strong {
  font-size: 1.6rem;
  line-height: 1;
}

.result-list {
  display: grid;
  gap: 10px;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 14px;
  border: 1px solid rgba(22, 135, 93, 0.28);
  border-radius: 8px;
  background: #eefaf5;
}

.number {
  color: var(--success);
  font-size: 0.86rem;
  font-weight: 850;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.results-body .empty-state {
  background: rgba(15, 23, 42, 0.72);
}

.results-body {
  --bg: #05070b;
  --panel: #0b0f16;
  --ink: #f7f9fc;
  --muted: #a9b3c1;
  --line: rgba(226, 232, 240, 0.16);
  --accent: #38bdf8;
  --accent-dark: #7dd3fc;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --shadow: 0 22px 52px rgba(0, 0, 0, 0.46);
  color-scheme: dark;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(5, 7, 11, 0) 180px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 92px),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 72px),
    var(--bg);
}

.results-shell {
  width: min(100%, 1040px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 18px 42px;
}

.results-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 18px;
  align-items: end;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 15, 22, 0.94);
  box-shadow: var(--shadow);
}

.results-body .eyebrow {
  color: #7dd3fc;
}

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

.score-tile {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
}

.score-tile span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.score-tile strong {
  color: #f8fafc;
  font-size: 2.2rem;
  line-height: 1;
}

.results-body .secondary-action {
  color: #e5e7eb;
  border-color: rgba(226, 232, 240, 0.2);
  background: #10151f;
}

.results-body .secondary-action:hover {
  border-color: rgba(125, 211, 252, 0.48);
  background: #172033;
}

.winner-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  padding: 18px 20px;
  border-radius: 8px;
  color: #1f2937;
  background: linear-gradient(90deg, #fff7d6, #effaf5);
  border: 1px solid #ead27d;
}

.winner-rank,
.winner-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  color: #7a4b00;
  background: #fff;
  font-weight: 900;
}

.winner-strip p {
  color: #6b7280;
  font-size: 0.88rem;
  font-weight: 800;
}

.winner-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 1.38rem;
}

.race-board {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.race-row {
  --row-color: #1267d8;
  display: grid;
  grid-template-columns: minmax(220px, 0.88fr) minmax(260px, 1fr) 92px;
  gap: 18px;
  align-items: center;
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(22, 32, 51, 0.06);
}

.race-row:nth-child(2) {
  --row-color: #16875d;
}

.race-row:nth-child(3) {
  --row-color: #c2410c;
}

.race-row:nth-child(4) {
  --row-color: #7c3aed;
}

.race-row:nth-child(5) {
  --row-color: #be123c;
}

.race-row:nth-child(6) {
  --row-color: #0f766e;
}

.race-row:nth-child(7) {
  --row-color: #475569;
}

.race-meta {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.race-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  background: var(--row-color);
  font-weight: 900;
}

.race-meta h2 {
  font-size: 1.08rem;
  line-height: 1.35;
}

.race-meta p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.race-track {
  position: relative;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      90deg,
      #e8edf3 0,
      #e8edf3 18px,
      #f7f9fb 18px,
      #f7f9fb 36px
    );
}

.race-fill {
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--row-color), #f5c542);
  animation: race-grow 720ms ease-out both;
}

.race-fill::after {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  content: "";
  animation: shine 1500ms ease-in-out infinite;
}

.race-marker {
  position: absolute;
  top: 50%;
  left: clamp(20px, var(--bar-width), calc(100% - 20px));
  min-width: 30px;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 12px rgba(22, 32, 51, 0.15);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
  transform: translate(-50%, -50%);
}

.race-count {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.race-count strong {
  font-size: 2rem;
  line-height: 1;
}

.race-count span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.results-actions {
  margin-top: 18px;
}

.reveal-shell {
  width: min(100%, 1120px);
}

.reveal-hero {
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
}

.reveal-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reveal-stage {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.reveal-step-action {
  display: flex;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  margin: 6px 0;
}

.reveal-action {
  min-width: 180px;
  border-color: rgba(255, 255, 255, 0.16);
}

.reveal-action[data-show-group="lower"] {
  background: linear-gradient(90deg, #475569, #c2410c, #be123c);
  box-shadow: 0 12px 24px rgba(148, 69, 83, 0.24);
}

.reveal-action[data-show-group="lower"]:hover {
  background: linear-gradient(90deg, #334155, #9a3412, #9f1239);
}

.reveal-action[data-show-group="fourth"] {
  background: #0f766e;
  box-shadow: 0 12px 24px rgba(15, 118, 110, 0.24);
}

.reveal-action[data-show-group="fourth"]:hover {
  background: #115e59;
}

.reveal-action[data-show-group="third"] {
  background: #7c3aed;
  box-shadow: 0 12px 24px rgba(124, 58, 237, 0.22);
}

.reveal-action[data-show-group="third"]:hover {
  background: #6d28d9;
}

.reveal-action[data-show-group="candidates"] {
  background: linear-gradient(90deg, #2563eb, #b45309);
  box-shadow: 0 12px 24px rgba(77, 91, 145, 0.24);
}

.reveal-action[data-show-group="candidates"]:hover {
  background: linear-gradient(90deg, #1d4ed8, #92400e);
}

.reveal-action[data-show-group="final"] {
  background: #b45309;
  box-shadow: 0 12px 24px rgba(180, 83, 9, 0.24);
}

.reveal-action[data-show-group="final"]:hover {
  background: #92400e;
}

.final-action {
  background: #b45309;
  box-shadow: 0 12px 24px rgba(180, 83, 9, 0.24);
}

.final-action:hover {
  background: #92400e;
}

.reveal-group {
  scroll-margin-top: 24px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.reveal-group:focus {
  outline: none;
}

.reveal-group.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-group.is-focused .score-reveal-card,
.reveal-group.is-focused .candidate-card {
  animation: reveal-focus-pulse 1200ms ease-out;
}

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

.single-result-grid {
  grid-template-columns: minmax(0, 420px);
  justify-content: center;
}

.final-result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.score-reveal-card {
  --rank-color: var(--accent);
  --rank-border: var(--line);
  --rank-soft: #111827;
  --rank-card-bg: #0c111b;
  --rank-shadow: rgba(0, 0, 0, 0.42);
  position: relative;
  display: grid;
  gap: 16px;
  min-height: 278px;
  padding: 20px;
  border: 1px solid var(--rank-border);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--rank-card-bg), #080b11 78%);
  box-shadow: 0 16px 34px var(--rank-shadow);
  overflow: hidden;
}

.score-reveal-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: var(--rank-color);
  content: "";
}

.score-reveal-card > * {
  position: relative;
}

.score-reveal-card[data-final-rank="1"],
.candidate-card[data-final-rank="1"] {
  --rank-color: #f59e0b;
  --rank-border: rgba(245, 158, 11, 0.52);
  --rank-soft: rgba(245, 158, 11, 0.12);
  --rank-card-bg: #211707;
  --rank-shadow: rgba(245, 158, 11, 0.18);
}

.score-reveal-card[data-final-rank="2"],
.candidate-card[data-final-rank="2"] {
  --rank-color: #60a5fa;
  --rank-border: rgba(96, 165, 250, 0.52);
  --rank-soft: rgba(96, 165, 250, 0.12);
  --rank-card-bg: #0a1830;
  --rank-shadow: rgba(96, 165, 250, 0.15);
}

.score-reveal-card[data-final-rank="3"],
.candidate-card[data-final-rank="3"] {
  --rank-color: #c084fc;
  --rank-border: rgba(192, 132, 252, 0.52);
  --rank-soft: rgba(192, 132, 252, 0.12);
  --rank-card-bg: #1b1030;
  --rank-shadow: rgba(192, 132, 252, 0.15);
}

.score-reveal-card[data-final-rank="4"],
.candidate-card[data-final-rank="4"] {
  --rank-color: #2dd4bf;
  --rank-border: rgba(45, 212, 191, 0.5);
  --rank-soft: rgba(45, 212, 191, 0.12);
  --rank-card-bg: #071d1b;
  --rank-shadow: rgba(45, 212, 191, 0.14);
}

.score-reveal-card[data-final-rank="5"],
.candidate-card[data-final-rank="5"] {
  --rank-color: #fb7185;
  --rank-border: rgba(251, 113, 133, 0.5);
  --rank-soft: rgba(251, 113, 133, 0.12);
  --rank-card-bg: #2a0b14;
  --rank-shadow: rgba(251, 113, 133, 0.13);
}

.score-reveal-card[data-final-rank="6"],
.candidate-card[data-final-rank="6"] {
  --rank-color: #fb923c;
  --rank-border: rgba(251, 146, 60, 0.5);
  --rank-soft: rgba(251, 146, 60, 0.12);
  --rank-card-bg: #281207;
  --rank-shadow: rgba(251, 146, 60, 0.13);
}

.score-reveal-card[data-final-rank="7"],
.candidate-card[data-final-rank="7"] {
  --rank-color: #94a3b8;
  --rank-border: rgba(148, 163, 184, 0.48);
  --rank-soft: rgba(148, 163, 184, 0.12);
  --rank-card-bg: #151b25;
  --rank-shadow: rgba(148, 163, 184, 0.12);
}

.podium-card {
  background: linear-gradient(180deg, var(--rank-card-bg), #080b11 78%);
}

.final-result-card {
  min-height: 304px;
  align-content: center;
}

.winner-card {
  background: linear-gradient(180deg, var(--rank-card-bg), #080b11 78%);
}

.final-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--rank-color);
  font-size: 1rem;
  font-weight: 900;
}

.winner-card .final-rank-badge {
  background: var(--rank-color);
}

.score-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.reveal-score-box {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--rank-border);
  border-radius: 8px;
  background: var(--rank-soft);
}

.reveal-score-box span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.total-score-box {
  grid-column: 1 / -1;
  min-height: 108px;
  border-color: var(--rank-border);
  background: linear-gradient(180deg, var(--rank-soft), rgba(8, 11, 17, 0.96));
}

.total-score-box span {
  color: var(--rank-color);
}

.total-score-box .score-value {
  font-size: 2.4rem;
}

.score-value {
  font-size: 2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.score-value.is-spinning {
  color: var(--rank-color);
}

.score-value.is-settled {
  color: var(--ink);
}

.team-reveal {
  display: grid;
  align-items: center;
  min-height: 68px;
  padding: 14px;
  border: 1px dashed rgba(226, 232, 240, 0.24);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.06) 0,
      rgba(255, 255, 255, 0.06) 10px,
      rgba(15, 23, 42, 0.86) 10px,
      rgba(15, 23, 42, 0.86) 20px
    );
}

.team-mask {
  color: var(--muted);
  font-weight: 900;
  text-align: center;
}

.team-name,
.final-team-name {
  display: none;
  overflow-wrap: anywhere;
  font-size: 1.42rem;
  line-height: 1.25;
  font-weight: 900;
  text-align: center;
}

.score-reveal-card.is-name-visible .team-reveal {
  border-style: solid;
  border-color: var(--rank-border);
  background: var(--rank-soft);
}

.score-reveal-card.is-name-visible .team-mask {
  display: none;
}

.score-reveal-card.is-name-visible .team-name {
  display: block;
  color: var(--rank-color);
}

.final-team-name {
  display: block;
  min-height: 72px;
  align-content: center;
  padding: 14px;
  border-radius: 8px;
  background: #111827;
}

.compact-action {
  min-height: 44px;
  width: 100%;
}

.score-reveal-card .compact-action {
  color: var(--rank-color);
  border-color: var(--rank-border);
  background: rgba(8, 11, 17, 0.72);
}

.score-reveal-card .compact-action:hover {
  color: #05070b;
  background: var(--rank-color);
}

.candidate-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.candidate-card {
  --rank-color: var(--accent);
  --rank-border: var(--line);
  --rank-soft: #111827;
  --rank-card-bg: #0c111b;
  --rank-shadow: rgba(0, 0, 0, 0.42);
  position: relative;
  display: grid;
  gap: 12px;
  align-content: center;
  min-height: 180px;
  padding: 26px;
  border: 1px solid var(--rank-border);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--rank-card-bg), #080b11 78%);
  box-shadow: 0 16px 34px var(--rank-shadow);
  text-align: center;
  overflow: hidden;
}

.candidate-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: var(--rank-color);
  content: "";
}

.candidate-card > * {
  position: relative;
}

.candidate-card span {
  color: var(--rank-color);
  font-size: 0.9rem;
  font-weight: 900;
}

.candidate-card strong {
  overflow-wrap: anywhere;
  color: var(--rank-color);
  font-size: 2rem;
  line-height: 1.2;
}

@keyframes race-grow {
  from {
    width: 0;
  }
}

@keyframes shine {
  0% {
    transform: translateX(-100%);
  }

  60%,
  100% {
    transform: translateX(100%);
  }
}

@keyframes reveal-focus-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(18, 103, 216, 0.34), 0 16px 34px rgba(22, 32, 51, 0.08);
  }

  55% {
    box-shadow: 0 0 0 7px rgba(18, 103, 216, 0.12), 0 18px 38px rgba(22, 32, 51, 0.12);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(18, 103, 216, 0), 0 16px 34px rgba(22, 32, 51, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .race-fill,
  .race-fill::after,
  .reveal-group.is-focused .score-reveal-card,
  .reveal-group.is-focused .candidate-card {
    animation: none;
  }
}

@media (max-width: 680px) {
  .survey-shell {
    padding: 16px;
    align-items: stretch;
  }

  .survey-panel {
    padding: 22px 18px;
  }

  h1 {
    font-size: 2.1rem;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .rank-card {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .results-shell {
    padding: 16px;
  }

  .results-hero {
    grid-template-columns: 1fr;
    padding: 22px 18px;
  }

  .score-summary {
    grid-template-columns: 1fr;
  }

  .score-tile {
    min-height: auto;
  }

  .winner-strip {
    grid-template-columns: 1fr;
  }

  .race-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .race-count {
    grid-template-columns: auto auto;
    justify-content: space-between;
    justify-items: start;
  }

  .reveal-summary,
  .reveal-grid,
  .final-result-grid,
  .candidate-strip,
  .score-pair {
    grid-template-columns: 1fr;
  }

  .reveal-step-action {
    flex-direction: column;
  }

  .reveal-action {
    width: 100%;
  }
}
