:root {
  --bg: #16302E;
  --bg-deep: #0F2321;
  --surface: #FBF7EF;
  --surface-dim: #F0EADC;
  --ink: #1C2624;
  --muted: #5E6E67;
  --gold: #D9A441;
  --gold-deep: #B9862F;
  --brick: #914e4e;
  --line: rgba(28, 38, 36, 0.16);
  --line-light: rgba(251, 247, 239, 0.25);
  --radius: 14px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,0.04), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(255,255,255,0.03), transparent 45%);
  color: var(--surface);
  font-family: var(--font-body);
  line-height: 1.5;
}

h1, h2 { font-family: var(--font-display); margin: 0; }

/* ---------- Header (luggage tag) ---------- */
.tag-header {
  padding: 56px 20px 40px;
  display: flex;
  justify-content: center;
}

.tag-header__inner {
  position: relative;
  max-width: 640px;
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  border-radius: 18px;
  padding: 36px 40px 40px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  border: 1px solid rgba(28,38,36,0.08);
}

.tag-header__inner::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -14px;
  width: 2px;
  height: 24px;
  background: var(--line-light);
  transform: translateX(-50%);
}

.tag-hole {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--gold-deep);
  margin: 18px 0 8px;
}

.tag-header h1 {
  font-size: clamp(28px, 4.5vw, 42px);
  font-weight: 700;
  color: var(--ink);
}

.subtitle {
  margin: 14px auto 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

section { margin-bottom: 52px; }

.step-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.step-label h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--surface);
}

/* ---------- Postcards ---------- */
.postcards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.postcard {
  position: relative;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 20px 18px 22px;
  text-align: left;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

.postcard:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(0,0,0,0.25); }

.postcard:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(217,164,65,0.35);
}

.postcard[aria-checked="true"] {
  border-color: var(--brick);
  box-shadow: 0 10px 24px rgba(181,83,60,0.35);
}

.postcard[aria-checked="true"] .postcard__stamp { opacity: 1; transform: rotate(-6deg) scale(1); }

.postcard__icon {
  width: 44px;
  height: 44px;
  color: var(--gold-deep);
  margin-bottom: 10px;
}

.postcard__icon svg { width: 100%; height: 100%; }

.postcard__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  margin: 0 0 2px;
}

.postcard__place {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brick);
  font-weight: 600;
  margin: 0 0 10px;
}

.postcard__blurb {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
}

.postcard__stamp {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 2px dashed var(--brick);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brick);
  font-size: 18px;
  opacity: 0;
  transform: rotate(-6deg) scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

/* ---------- Season stubs ---------- */
.stubs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.stub {
  position: relative;
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  border: 2px solid transparent;
  padding: 16px 14px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.stub::before,
.stub::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
}
.stub::before { left: -6px; }
.stub::after { right: -6px; }

.stub:hover { transform: translateY(-2px); }

.stub:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(217,164,65,0.35);
}

.stub[aria-checked="true"] {
  border-color: var(--gold-deep);
  background: var(--gold);
}

.stub__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  display: block;
}

.stub__sub {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

/* ---------- Boarding pass ---------- */
.boarding-pass {
  display: grid;
  grid-template-columns: 1fr auto;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0,0,0,0.25);
}

.bp-main {
  padding: 24px 26px;
  border-right: 2px dashed var(--line);
}

.bp-field-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}

#voter-name {
  width: 100%;
  max-width: 320px;
  font-family: var(--font-display);
  font-size: 20px;
  border: none;
  border-bottom: 2px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 4px 2px 8px;
  margin-bottom: 20px;
}

#voter-name:focus {
  outline: none;
  border-bottom-color: var(--brick);
}

.bp-row {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.bp-field { display: flex; flex-direction: column; }

.bp-value {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--brick);
}

.bp-stub {
  background: var(--bg-deep);
  color: var(--surface);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 140px;
}

.bp-stub-icon {
  font-size: 22px;
  color: var(--gold);
  transform: rotate(45deg);
}

.bp-button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  background: var(--gold);
  color: var(--bg-deep);
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.bp-button:hover { background: var(--gold-deep); }
.bp-button:active { transform: scale(0.97); }
.bp-button:disabled { opacity: 0.5; cursor: not-allowed; }

.form-msg {
  margin: 12px 4px 0;
  font-size: 14px;
  min-height: 20px;
  color: var(--gold);
}
.form-msg[data-state="error"] { color: #E8877A; }

/* ---------- Results ---------- */
.results {
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 24px 26px 26px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.2);
}

.results__total {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
}

.results h3 {
  font-family: var(--font-display);
  font-size: 15px;
  margin: 0 0 10px;
  color: var(--brick);
}

.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 28px;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13.5px;
}

.bar-track {
  height: 10px;
  background: var(--surface-dim);
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 6px;
  transition: width 0.4s ease;
}

.voters-list {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.voters-list ul { list-style: none; margin: 8px 0 0; padding: 0; columns: 2; }
.voters-list li { margin-bottom: 4px; break-inside: avoid; }
.voters-list strong { color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 30px 20px 50px;
  color: rgba(251,247,239,0.5);
  font-size: 12.5px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .boarding-pass { grid-template-columns: 1fr; }
  .bp-main { border-right: none; border-bottom: 2px dashed var(--line); }
  .bar-row { grid-template-columns: 90px 1fr 24px; font-size: 12.5px; }
  .voters-list ul { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
