:root {
  --bg: #091a24;
  --bg-soft: #102b3b;
  --ink: #eaf4ff;
  --muted: #9bc1d9;
  --gold: #f0c66e;
  --mint: #4bc0b4;
  --danger: #ff7761;
  --card: rgba(11, 30, 42, 0.74);
  --border: rgba(173, 219, 255, 0.22);
  --shadow: 0 20px 60px rgba(3, 13, 19, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, #15435c 0%, transparent 38%),
    radial-gradient(circle at 80% 15%, #2a6b6b 0%, transparent 30%),
    linear-gradient(140deg, var(--bg), #0c2230 45%, #071620);
  font-family: "Lexend", sans-serif;
  overflow-x: hidden;
}

.aurora {
  position: fixed;
  inset: -10% -20%;
  background:
    conic-gradient(from 180deg at 50% 50%, rgba(240, 198, 110, 0.12), rgba(75, 192, 180, 0.12), transparent 45%),
    radial-gradient(circle at 65% 20%, rgba(240, 198, 110, 0.15), transparent 35%);
  filter: blur(30px);
  pointer-events: none;
  animation: drift 16s ease-in-out infinite alternate;
}

@keyframes drift {
  from {
    transform: translateY(-2%) scale(1);
  }
  to {
    transform: translateY(2%) scale(1.08);
  }
}

.hero {
  max-width: 1000px;
  margin: 0 auto;
  padding: 52px 20px 12px;
  position: relative;
  z-index: 1;
}

.tag {
  color: var(--mint);
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Noto Serif TC", serif;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4.2vw, 3.8rem);
  margin-top: 8px;
}

.subtitle {
  max-width: 760px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.6;
}

.shell {
  max-width: 1000px;
  margin: 14px auto 60px;
  padding: 0 20px;
  display: grid;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(10px);
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: reveal 540ms ease forwards;
}

.reveal:nth-child(2) { animation-delay: 120ms; }
.reveal:nth-child(3) { animation-delay: 200ms; }
.reveal:nth-child(4) { animation-delay: 280ms; }
.reveal:nth-child(5) { animation-delay: 360ms; }

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  margin-bottom: 12px;
  font-size: 1.34rem;
}

.form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.field-note {
  color: var(--muted);
  line-height: 1.5;
}

input,
select {
  border-radius: 10px;
  border: 1px solid rgba(173, 219, 255, 0.25);
  background: rgba(6, 22, 31, 0.8);
  color: var(--ink);
  padding: 10px 11px;
  font: inherit;
}

input:focus,
select:focus {
  border-color: var(--gold);
  outline: none;
}

.btn {
  border: 1px solid rgba(240, 198, 110, 0.45);
  background: rgba(240, 198, 110, 0.15);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn.primary {
  grid-column: 1 / -1;
  background: linear-gradient(90deg, rgba(240, 198, 110, 0.3), rgba(75, 192, 180, 0.27));
}

.btn.ghost {
  border-color: rgba(173, 219, 255, 0.3);
  background: rgba(173, 219, 255, 0.08);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.meta {
  color: var(--muted);
  margin-bottom: 8px;
}

.candidates {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.candidates li {
  background: rgba(5, 18, 26, 0.6);
  border: 1px solid rgba(173, 219, 255, 0.18);
  border-radius: 12px;
  padding: 10px;
}

.name-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.name {
  font-family: "Noto Serif TC", serif;
  font-size: 1.25rem;
}

.score {
  color: var(--gold);
}

.hint {
  color: var(--muted);
}

#log {
  margin: 0;
  min-height: 90px;
  white-space: pre-wrap;
  color: #c8e8ff;
  font-size: 0.85rem;
}

a {
  color: #9ce6ff;
}

@media (max-width: 760px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 32px;
  }
}
