:root {
  --bg: #14161a;
  --surface: #1b1e24;
  --field: #171a1f;
  --border: #2a2f38;
  --text: #e8eaed;
  --muted: #9aa3b2;
  --faint: #7b8494;
  --accent: #4f9cf9;
  --accent-hover: #6cadff;
  --accent-ink: #0b1220;
  --alert: #f2777a;
  --radius: 12px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: clamp(1rem, 4vw, 3rem);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.card {
  width: 100%;
  max-width: 640px;
  margin: auto;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.head {
  margin-bottom: 1.5rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.25rem, 3.5vw, 1.5rem);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0.375rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.names {
  display: block;
  width: 100%;
  min-height: 12rem;
  padding: 0.875rem 1rem;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.6;
  resize: vertical;
  tab-size: 4;
}

.names::placeholder {
  color: var(--faint);
}

.names:hover {
  border-color: #343b46;
}

.names:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.status {
  margin: 0.625rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.status[data-tone="alert"] {
  color: var(--alert);
}

.draw {
  display: block;
  width: 100%;
  margin-top: 1.125rem;
  padding: 0.875rem 1.25rem;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 650;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 140ms ease, transform 120ms ease;
}

.draw:hover:not(:disabled) {
  background: var(--accent-hover);
}

.draw:active:not(:disabled) {
  transform: translateY(1px);
}

.draw:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.draw:disabled {
  color: #8a93a3;
  background: #262b33;
  cursor: not-allowed;
}

.result {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.result-label {
  margin: 0 0 0.625rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.winner {
  margin: 0;
  color: var(--accent);
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.result.reveal {
  animation: reveal 260ms ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  .result.reveal {
    animation: none;
  }

  .draw {
    transition: none;
  }
}
