:root {
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --color-bg: #F7EFE4;
  --color-primary: #EF5930;
  --color-secondary: #279DC8;
  --color-accent: #F5B032;
  --color-dark: #1B1B19;
  --color-panel: #FFFFFF;
  --color-text: #1B1B19;
  --color-text-muted: #555555;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  padding: 2rem 1rem;
}

.main-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  z-index: 1;
}

/* Header */
.header {
  text-align: center;
  padding: 1rem 0;
}

.hero-image {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  margin-bottom: 2rem;
  border: 4px solid var(--color-dark);
  box-shadow: 8px 8px 0 var(--color-dark);
}

.badge {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-dark);
  border: 2px solid var(--color-dark);
  box-shadow: 4px 4px 0 var(--color-dark);
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--color-dark);
  text-transform: uppercase;
}

.subtitle {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  font-weight: 500;
}

/* Solid Panels */
.solid-panel {
  background: var(--color-panel);
  border: 4px solid var(--color-dark);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 12px 12px 0 var(--color-dark);
}

/* Matchup Arena */
.matchup-arena {
  position: relative;
  margin-bottom: 3rem;
  text-align: center;
}

.selection-counter {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 2rem;
  text-transform: uppercase;
  background: var(--color-panel);
  border: 3px solid var(--color-dark);
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--color-dark);
}

.choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  position: relative;
  text-align: left;
}

.vs-badge {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: var(--color-secondary);
  border: 4px solid var(--color-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--color-panel);
  box-shadow: 6px 6px 0 var(--color-dark);
  z-index: 10;
}

.choice-card {
  background: var(--color-bg);
  border: 4px solid var(--color-dark);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  outline: none;
  box-shadow: 8px 8px 0 var(--color-dark);
}

.choice-card:hover, .choice-card:focus-visible {
  transform: translate(-4px, -4px);
  box-shadow: 12px 12px 0 var(--color-dark);
}

.choice-card.is-selected {
  border-color: var(--color-primary);
  background: #FFEBE5;
  box-shadow: 8px 8px 0 var(--color-primary);
}

.choice-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #E5E5E5;
  background-size: cover;
  background-position: center;
  position: relative;
  border-bottom: 4px solid var(--color-dark);
}

.choice-card.is-selected .choice-image {
  border-bottom-color: var(--color-primary);
}

.choice-title {
  padding: 1.25rem 1rem;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-dark);
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.choice-card.is-selected .choice-title {
  color: var(--color-primary);
}

/* Voter Details Form */
.voter-details {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.input-group {
  margin-bottom: 1.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.form-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-dark);
  background: var(--color-panel);
  border: 3px solid var(--color-dark);
  border-radius: 12px;
  transition: all 0.2s ease;
  outline: none;
  box-shadow: 4px 4px 0 var(--color-dark);
}

.form-input:focus {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--color-secondary);
  border-color: var(--color-secondary);
}

.form-input::placeholder {
  color: var(--color-text-muted);
  font-weight: 400;
}

.btn-primary, .btn-secondary {
  width: 100%;
  padding: 1.125rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  border: 4px solid var(--color-dark);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  text-transform: uppercase;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-panel);
  box-shadow: 6px 6px 0 var(--color-dark);
}

.btn-primary:not(:disabled):hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--color-dark);
  background: #ff6a40;
}

.btn-primary:disabled {
  background: #ccc;
  border-color: #999;
  color: #666;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--color-accent);
  color: var(--color-dark);
  box-shadow: 4px 4px 0 var(--color-dark);
}

.btn-secondary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--color-dark);
  background: #ffc247;
}

.error-msg {
  color: #D63031;
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 600;
  background: #FFEAA7;
  padding: 1rem;
  border-radius: 8px;
  border: 3px solid var(--color-dark);
  box-shadow: 4px 4px 0 var(--color-dark);
}

/* Results Section */
.results-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--color-dark);
  text-transform: uppercase;
}

.results-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
  font-weight: 500;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.result-item {
  background: var(--color-bg);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
  border: 4px solid var(--color-dark);
  box-shadow: 6px 6px 0 var(--color-dark);
}

.result-item.is-user-pick {
  border-color: var(--color-secondary);
  background: #EAF6FA;
  box-shadow: 6px 6px 0 var(--color-secondary);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

.result-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-dark);
}

.pick-badge {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  background: var(--color-secondary);
  color: var(--color-panel);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  border: 2px solid var(--color-dark);
}

.result-stats {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-primary);
}

.progress-track {
  width: 100%;
  height: 16px;
  background: var(--color-panel);
  border: 3px solid var(--color-dark);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-right: 3px solid var(--color-dark);
  border-radius: 999px 0 0 999px;
  transition: width 1s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.result-item.is-user-pick .progress-fill {
  background: var(--color-secondary);
}

/* Share Panel */
.share-panel {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 4px dashed var(--color-dark);
  text-align: center;
}

.share-panel h3 {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.75rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.share-panel p {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  font-size: 1rem;
  font-weight: 500;
}

.share-input-group {
  display: flex;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

.share-input-group input {
  flex: 1;
}

.share-input-group button {
  width: auto;
  padding: 0 2rem;
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }

#wbx-powered-by-slot {
  margin-top: auto;
  padding-top: 2rem;
  width: 100%;
}

/* Responsive */
@media (max-width: 600px) {
  .solid-panel { padding: 1.5rem; border-width: 3px; box-shadow: 6px 6px 0 var(--color-dark); }
  .choices-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .vs-badge {
    top: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    font-size: 1.1rem;
    border-width: 3px;
  }
  .choice-image { aspect-ratio: 1 / 1; }
  .choice-title { font-size: 1rem; padding: 1rem 0.5rem; }
  .share-input-group { flex-direction: column; }
  .share-input-group button { width: 100%; padding: 1rem; }
  .title { font-size: 2.25rem; }
}