:root {
  --ink: #1c2b3a;
  --navy: #16324f;
  --navy-deep: #0e2033;
  --parchment: #f6f2e9;
  --parchment-dim: #ece5d4;
  --brick: #b3492c;
  --brick-dim: #8f3a22;
  --gold: #c99a3c;
  --line: #d8cfba;
  --white: #ffffff;
  --radius: 3px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Georgia", serif;
  --sans: "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

body {
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--navy-deep);
  margin: 0 0 0.4em 0;
}

a { color: var(--brick); }

.masthead {
  background: var(--navy-deep);
  color: var(--parchment);
  padding: 18px 28px;
  border-bottom: 4px solid var(--brick);
  display: flex;
  align-items: center;
  gap: 16px;
}

.masthead-logo-wrap {
  background: var(--white);
  border-radius: 4px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.masthead-logo-wrap img {
  height: 36px;
  display: block;
}

.masthead .eyebrow {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--gold);
  margin-bottom: 2px;
}

.masthead h1 {
  color: var(--white);
  font-size: 26px;
  margin: 0;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin: 14px 0 4px;
}

label:first-child { margin-top: 0; }

input[type="text"], input[type="email"], input[type="tel"], select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #b9b09a;
  border-radius: var(--radius);
  font-size: 15px;
  font-family: var(--sans);
  background: var(--parchment);
  color: var(--ink);
}

input:focus, select:focus, button:focus, .action-btn:focus {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
}

.hint {
  font-size: 12px;
  color: #766f5c;
  margin-top: 6px;
}

.btn {
  display: inline-block;
  background: var(--brick);
  color: var(--white);
  border: none;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--sans);
}

.btn:hover { background: var(--brick-dim); }
.btn:disabled { background: #a99; cursor: default; opacity: 0.6; }

.btn-block { width: 100%; margin-top: 18px; }

.error-text {
  color: var(--brick-dim);
  font-size: 14px;
  margin-top: 10px;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--sans);
}

.status-none { background: #ece2e2; color: #7a3030; }
.status-proposed { background: #f4e7c9; color: #7a5a12; }
.status-enacted { background: #dbe8dc; color: #1f5a2c; }

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.action-btn {
  display: block;
  text-align: left;
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  cursor: pointer;
  font-family: var(--sans);
}

.action-btn.done {
  background: #dbe8dc;
  border-color: #1f5a2c;
}

.action-btn .action-name {
  font-weight: 700;
  color: var(--navy-deep);
  display: block;
  margin-bottom: 3px;
}

.action-btn .action-check {
  font-size: 12px;
  color: #1f5a2c;
  font-weight: 600;
}

.rep-card {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.rep-card:first-of-type { border-top: none; }

.rep-photo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--parchment-dim);
}

.rep-name { font-weight: 700; color: var(--navy-deep); }
.rep-title { font-size: 13px; color: #766f5c; }
.rep-contact { font-size: 13px; margin-top: 4px; }
.rep-contact a { display: inline-block; margin-right: 10px; }

.content-box {
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.55;
  margin-top: 12px;
}

.copy-btn {
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 10px;
}
.copy-btn:hover { background: var(--navy-deep); }

.progress-tracker {
  display: flex;
  gap: 6px;
  margin: 16px 0;
}
.progress-dot {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.progress-dot.done { background: var(--brick); }

/* ---------- Dashboard (big screen) ---------- */
body.dashboard {
  background: var(--navy-deep);
  color: var(--parchment);
}

.dash-wrap {
  padding: 28px 40px;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--gold);
  padding-bottom: 14px;
  margin-bottom: 28px;
}

.dash-header h1 {
  color: var(--parchment);
  font-size: 34px;
}

.dash-header .eyebrow {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 16px;
}

.dash-big-numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.big-stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 20px 24px;
  text-align: center;
}

.big-stat .num {
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

@keyframes statPulse {
  0% { transform: scale(1); color: var(--gold); }
  35% { transform: scale(1.18); color: #ffe8a3; }
  100% { transform: scale(1); color: var(--gold); }
}

.stat-pulse {
  animation: statPulse 0.6s ease-out;
}

.big-stat .label {
  margin-top: 8px;
  font-size: 15px;
  color: var(--parchment-dim);
}

.dash-columns {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
}

.action-tally { display: flex; flex-direction: column; gap: 10px; }

.tally-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tally-label { width: 160px; font-size: 16px; color: var(--parchment-dim); }
.tally-bar-track {
  flex: 1;
  height: 22px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.tally-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brick), var(--gold));
  transition: width 0.6s ease;
}
.tally-count { width: 40px; text-align: right; font-weight: 700; font-size: 18px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 15px;
  color: var(--parchment-dim);
}
.feed li strong { color: var(--parchment); }

.states-lit {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.state-chip {
  background: var(--brick);
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
}

#countdown {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--gold);
}

/* ---------- Full-screen celebration ---------- */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
}

#celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(14, 32, 51, 0);
  opacity: 0;
  transition: opacity 0.4s ease, background 0.4s ease;
}

#celebration-overlay.show {
  opacity: 1;
  background: rgba(14, 32, 51, 0.55);
}

#celebration-text {
  text-align: center;
  transform: scale(0.85);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#celebration-overlay.show #celebration-text {
  transform: scale(1);
}

.celebration-emoji {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 8px;
}

.celebration-headline {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 64px;
  color: var(--gold);
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
  letter-spacing: 0.02em;
}

.celebration-name {
  font-family: var(--serif);
  font-size: 32px;
  color: var(--parchment);
  margin-top: 14px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

#timer-controls { text-align: right; }
#timer-buttons { margin-top: 6px; display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
#timer-minutes-input {
  width: 60px;
  padding: 6px 8px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--parchment);
  font-size: 13px;
}
#timer-buttons .copy-btn { margin-top: 0; padding: 6px 12px; font-size: 12px; }

/* ---------- Prize winner reveal (dashboard) ---------- */
#winner-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(14, 32, 51, 0);
  opacity: 0;
  transition: opacity 0.5s ease, background 0.5s ease;
}
#winner-overlay.show { opacity: 1; background: rgba(14, 32, 51, 0.82); }
#winner-text { text-align: center; transform: scale(0.85); transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
#winner-overlay.show #winner-text { transform: scale(1); }
.winner-headline { font-family: var(--serif); font-weight: 700; font-size: 44px; color: var(--gold); letter-spacing: 0.04em; text-transform: uppercase; }
.winner-name { font-family: var(--serif); font-weight: 700; font-size: 96px; color: var(--parchment); margin-top: 18px; text-shadow: 0 4px 24px rgba(0,0,0,0.6); }
.winner-detail { font-family: var(--serif); font-size: 36px; color: var(--parchment-dim); margin-top: 12px; }

/* ---------- Timer states + big-screen banner ---------- */
#countdown.low { color: #ff8a65; }
#countdown.paused { opacity: 0.55; }
#screen-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9990;
  padding: 18px 32px;
  text-align: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 40px;
  color: var(--navy-deep);
  background: var(--gold);
  box-shadow: 0 -6px 24px rgba(0,0,0,0.35);
  transform: translateY(110%);
  transition: transform 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}
#screen-banner.show { transform: translateY(0); }

/* ---------- Rep contact lines (clean copy buttons) ---------- */
.contact-item { margin: 3px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.copy-btn.mini { margin: 0; padding: 2px 10px; font-size: 12px; }
.mini-link { font-size: 12px; }
#contact-line { margin: 10px 0 4px; }
#contact-line .copy-btn.mini { margin-left: 10px; }
