:root {
  --color-bg: #FAF9F6;
  --color-text: #2C2C2C;
  --color-text-light: #7A7A7A;
  --color-border: #E0DDD8;
  --color-pink: #C98E8E;
  --color-blue: #8EA8C9;
  --color-pink-soft: #F5ECEA;
  --color-blue-soft: #ECF0F5;
  --color-error: #B85C5C;
  --color-success: #5C8A5C;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Password Gate ---- */

#gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.gate-inner {
  text-align: center;
  max-width: 320px;
  width: 100%;
}

#gate h1 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 2.5rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.gate-subtitle {
  color: var(--color-text-light);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

#password-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#password-input {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

#password-input:focus {
  border-color: var(--color-text-light);
}

#password-form button {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-text);
  background: var(--color-text);
  color: var(--color-bg);
  cursor: pointer;
  transition: opacity 0.2s;
}

#password-form button:hover {
  opacity: 0.85;
}

/* ---- Main Content ---- */

main {
  max-width: 540px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

header {
  text-align: center;
  margin-bottom: 4rem;
}

header h1 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 3rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.subtitle {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--color-text-light);
  margin-bottom: 0.25rem;
}

.announcement {
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

/* ---- Vote Section ---- */

.vote-section {
  text-align: center;
  margin-bottom: 4rem;
}

.vote-section h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}

.vote-prompt {
  color: var(--color-text-light);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}

#voter-name {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  text-align: center;
  width: 100%;
  max-width: 280px;
  outline: none;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

#voter-name:focus {
  border-color: var(--color-text-light);
}

.vote-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.vote-btn {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.75rem 2.5rem;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.vote-btn.vote-boy:hover {
  background: var(--color-blue-soft);
  border-color: var(--color-blue);
}

.vote-btn.vote-girl:hover {
  background: var(--color-pink-soft);
  border-color: var(--color-pink);
}

.vote-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Results ---- */

.results-section {
  text-align: center;
}

.results-section h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.tally {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2rem;
}

.tally-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tally-count {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.tally-boy .tally-count {
  color: var(--color-blue);
}

.tally-girl .tally-count {
  color: var(--color-pink);
}

.tally-label {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

.vote-list {
  list-style: none;
  max-width: 300px;
  margin: 0 auto;
  border-top: 1px solid var(--color-border);
}

.vote-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9375rem;
}

.vote-list .voter-name {
  color: var(--color-text);
}

.vote-list .voter-pick {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.voter-pick.pick-boy {
  color: var(--color-blue);
}

.voter-pick.pick-girl {
  color: var(--color-pink);
}

.voter-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.delete-vote-btn {
  font-size: 0.875rem;
  line-height: 1;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-text-light);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.vote-list li:hover .delete-vote-btn {
  opacity: 1;
}

.delete-vote-btn:hover {
  color: var(--color-error);
}

/* ---- Messages ---- */

.error {
  color: var(--color-error);
  font-size: 0.875rem;
  margin-top: 1rem;
}

.success {
  color: var(--color-success);
  font-size: 0.875rem;
  margin-top: 1rem;
}

/* ---- Responsive ---- */

@media (max-width: 480px) {
  header h1 {
    font-size: 2.25rem;
  }

  .tally {
    gap: 2rem;
  }

  .vote-btn {
    padding: 0.75rem 1.5rem;
  }
}
