:root {
  --canvas: #ffffff;
  --ink: #212121;
  --primary: #17171c;
  --green: #003c33;
  --navy: #071829;
  --blue: #1863dc;
  --coral: #ff7759;
  --stone: #eeece7;
  --stone-2: #fafafa;
  --hairline: #d9d9dd;
  --border-light: #f2f2f2;
  --muted: #6f6f78;
  --muted-2: #93939f;
  --white: #ffffff;
  --radius-card: 22px;
  --radius-soft: 16px;
  --radius-pill: 32px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

strong {
  color: inherit;
  font-weight: 650;
}

code,
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: .02em;
}

.hidden {
  display: none !important;
}

.page-shell {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 0 24px;
}

.hero-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(440px, 560px);
  align-items: center;
  gap: clamp(36px, 6vw, 92px);
  padding: clamp(44px, 7vw, 88px) 0;
}

.hero-copy {
  max-width: 760px;
}

.hero-title {
  margin: 0;
  color: var(--primary);
  font-size: clamp(48px, 7.4vw, 96px);
  font-weight: 500;
  line-height: .97;
  letter-spacing: -.02em;
}

.hero-copy p {
  max-width: 690px;
  margin: 28px 0 0;
  color: var(--ink);
  font-size: clamp(17px, 1.45vw, 21px);
  line-height: 1.45;
}

.hero-footnote {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 13px;
}

.tool-board {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 119, 89, .2), transparent 34%),
    linear-gradient(145deg, var(--green), var(--navy));
  color: var(--white);
}

.draw-card,
.result-card,
.participants-card,
.toast-card {
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
}

.draw-card {
  padding: 22px;
}

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

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

.field-label,
.field-help,
.endpoint-line,
.result-kicker,
.table-kicker,
.badge,
.version-chip {
  font-size: 12px;
  line-height: 1.4;
}

.field-label,
.result-kicker,
.table-kicker {
  color: var(--muted);
  font-weight: 500;
}

.field-help {
  color: var(--muted);
}

.control {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: var(--stone-2);
  color: var(--primary);
  padding: 12px 15px;
  outline: none;
}

.control::placeholder {
  color: var(--muted-2);
}

.control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24, 99, 220, .14);
}

.primary-button,
.secondary-button {
  min-height: 48px;
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, opacity .18s ease;
}

.primary-button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--white);
}

.primary-button:hover {
  background: var(--blue);
  border-color: var(--blue);
}

.primary-button:disabled {
  opacity: .58;
  cursor: progress;
}

.secondary-button {
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--primary);
}

.secondary-button:hover {
  color: var(--blue);
  border-color: rgba(24, 99, 220, .45);
}

.endpoint-row,
.action-row,
.badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-row,
.badge-row {
  flex-wrap: wrap;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.spinner-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: var(--coral);
}

@media (prefers-reduced-motion: no-preference) {
  .spinner-dot {
    animation: pulseDot 1s ease-in-out infinite;
  }

  @keyframes pulseDot {
    0%,
    100% {
      opacity: .35;
      transform: scale(.85);
    }
    50% {
      opacity: 1;
      transform: scale(1);
    }
  }
}

.endpoint-line {
  color: var(--muted);
}

.endpoint-line span {
  color: var(--primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(255, 119, 89, .48);
  border-radius: 9999px;
  background: rgba(255, 119, 89, .12);
  color: var(--primary);
  padding: 6px 12px;
}

.results-panel {
  display: grid;
  gap: 14px;
}

.results-panel:not(:has(#resultBlock:not(.hidden), #participantsBlock:not(.hidden), #toast:not(.hidden))) {
  display: none;
}

.result-card,
.participants-card,
.toast-card {
  padding: 22px;
}

.result-head,
.participants-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.result-head h2,
.participants-head h2 {
  margin: 0;
  color: var(--primary);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}

.result-kicker,
.table-kicker,
.version-chip {
  color: var(--muted);
}

.winner-grid {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.winner-field {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-soft);
  background: var(--stone);
  padding: 16px;
}

.winner-field-label {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.winner-value {
  color: var(--primary);
  font-weight: 500;
  white-space: pre-wrap;
}

.table-wrap {
  margin-top: 18px;
  overflow: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-soft);
  background: var(--stone-2);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--hairline);
}

thead {
  color: var(--muted);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td {
  color: var(--ink);
}

.toast-card {
  border-color: rgba(255, 119, 89, .42);
  background: #fff5f1;
}

.content-flow {
  display: grid;
  gap: 0;
}

.content-section {
  padding: clamp(64px, 8vw, 112px) 24px;
}

.content-section.stone {
  background: var(--stone);
}

.content-section.white {
  background: var(--canvas);
}

.content-section.dark {
  background: var(--green);
  color: var(--white);
}

.section-inner {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.section-heading {
  max-width: 840px;
  margin: 0 0 32px;
  color: var(--primary);
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -.01em;
}

.content-section.dark .section-heading {
  color: var(--white);
}

.copy-stack {
  max-width: 880px;
  display: grid;
  gap: 18px;
}

.copy-stack p,
.step-copy,
.usecase-card p,
.trust-row p,
.faq-answer {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.58;
}

.content-section.dark .trust-row p {
  color: rgba(255, 255, 255, .72);
}

.content-section.dark code {
  color: var(--white);
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.trust-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--hairline);
  border-radius: 9999px;
  background: var(--canvas);
  color: var(--primary);
  padding: 8px 14px;
  font-size: 14px;
}

.steps-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 20px;
  align-items: start;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  background: var(--stone-2);
  padding: 20px;
}

.step-number {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  background: var(--coral);
  color: var(--primary);
  font-size: 20px;
  font-weight: 600;
}

.step-title,
.usecase-card h3,
.trust-row h3 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
}

.section-note {
  max-width: 780px;
  margin: 28px 0 0;
  border-left: 3px solid var(--coral);
  padding-left: 18px;
  color: var(--muted);
  font-size: 15px;
}

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

.usecase-card {
  min-height: 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  background: var(--stone);
  padding: 24px;
}

.usecase-icon {
  display: block;
  margin-bottom: 22px;
  font-size: 30px;
}

.trust-list-panel,
.faq-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, .18);
}

.trust-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  align-items: start;
  background: rgba(255, 255, 255, .06);
  padding: 24px;
}

.trust-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .1);
  font-size: 22px;
}

.content-section.dark .trust-row h3 {
  color: var(--white);
}

.faq-list {
  border-color: var(--hairline);
  background: var(--hairline);
}

.faq-item {
  background: var(--canvas);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-plus {
  color: var(--blue);
  font-size: 24px;
  line-height: 1;
}

.faq-item[open] .faq-plus {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 24px 24px;
}

.site-footer {
  border-top: 1px solid var(--hairline);
  background: var(--canvas);
  padding: 28px 24px 36px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.site-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (min-width: 1180px) {
  .hero-shell:has(#resultBlock:not(.hidden), #participantsBlock:not(.hidden)) {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hero-shell:has(#resultBlock:not(.hidden), #participantsBlock:not(.hidden)) .hero-copy {
    max-width: 920px;
  }

  .hero-shell:has(#resultBlock:not(.hidden), #participantsBlock:not(.hidden)) .tool-board {
    grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  }
}

@media (max-width: 1024px) {
  .hero-shell {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 48px 0 64px;
  }

  .hero-title {
    max-width: 900px;
  }

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

@media (max-width: 640px) {
  .page-shell {
    padding: 0 16px;
  }

  .hero-shell {
    gap: 30px;
    padding-top: 34px;
  }

  .hero-title {
    font-size: clamp(40px, 13vw, 58px);
  }

  .hero-copy p {
    font-size: 16px;
  }

  .tool-board {
    margin-inline: -4px;
    padding: 10px;
    border-radius: 24px;
  }

  .draw-card,
  .result-card,
  .participants-card,
  .toast-card {
    border-radius: 18px;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  .content-section {
    padding: 56px 16px;
  }

  .section-heading {
    font-size: clamp(30px, 10vw, 42px);
  }

  .step-item,
  .trust-row {
    grid-template-columns: 1fr;
  }

  .result-head,
  .participants-head {
    flex-direction: column;
  }
}
