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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 30px;
  color: #1a1a1a;
  text-align: center;
  font-weight: 700;
}

h2 {
  font-size: 1.8rem;
  margin: 30px 0 20px 0;
  color: #0a0a0a;
  padding-bottom: 10px;
  border-bottom: 3px solid #0a66c2;
  font-weight: 600;
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: #1a1a1a;
  font-weight: 600;
}

/* Descriptions Section */
.descriptions {
  margin-bottom: 40px;
}

.role-group {
  margin-bottom: 50px;
}

.role-group h2 {
  margin-top: 0;
}

.role-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.role-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-color: #0a66c2;
}

.role-card ul {
  list-style: none;
  margin: 12px 0 16px 0;
}

.role-card li {
  margin-bottom: 8px;
  padding-left: 18px;
  position: relative;
  color: #444;
  font-size: 0.95rem;
}

.role-card li:before {
  content: "•";
  position: absolute;
  left: 0;
  color: #0a66c2;
  font-weight: bold;
}

.role-card ul ul {
  margin: 8px 0 8px 16px;
}

.role-card ul ul li:before {
  content: "◦";
}

/* Picks Section */
.picks {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.player-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.player-pill input {
  display: none;
}

.player-pill input + span {
  padding: 6px 12px;
  background: #f5f5f5;
  border: 1px solid #d0d0d0;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  user-select: none;
  -webkit-user-select: none;
  display: inline-block;
  min-height: 32px; /* Better touch target */
  display: flex;
  align-items: center;
  min-width: 32px;
}

.player-pill input:checked + span {
  background: #0a66c2;
  color: white;
  border-color: #0a66c2;
  box-shadow: 0 2px 6px rgba(10, 102, 194, 0.3);
}

.player-pill input:focus + span {
  outline: 2px solid #0a66c2;
  outline-offset: 2px;
}

/* Voting Setup at Top */
.voting-setup {
  background: white;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 40px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.voting-setup h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.4rem;
}

.instruction {
  margin-top: 12px;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
}

/* Voting Section */
.voting {
  background: white;
  border-radius: 8px;
  padding: 25px;
  margin-top: 40px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.voting h2 {
  border-bottom: 3px solid #0a66c2;
}

.voting h3 {
  margin-top: 24px;
  margin-bottom: 16px;
}

.vote-intro {
  color: #666;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.vote-setup {
  margin-bottom: 16px;
}

.select {
  width: 100%;
  max-width: 300px;
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  background: white;
  color: #333;
  transition: border-color 0.2s;
  min-height: 44px; /* Better touch target */
  -webkit-appearance: none; /* Remove iOS default styling */
  appearance: none;
}

.select:hover {
  border-color: #0a66c2;
}

.select:focus {
  outline: none;
  border-color: #0a66c2;
  box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.1);
}

.vote-actions {
  margin-bottom: 20px;
}

#submitVote {
  padding: 10px 24px;
  background: #0a66c2;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  min-height: 44px; /* Better touch target */
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

#submitVote:hover {
  background: #084fa1;
  box-shadow: 0 4px 12px rgba(10, 102, 194, 0.3);
}

#submitVote:active {
  transform: scale(0.98);
}

/* Tally */
.tally {
  margin-top: 20px;
}

.role-block {
  margin-bottom: 16px;
  padding: 12px;
  background: #f9f9f9;
  border-left: 4px solid #0a66c2;
  border-radius: 4px;
}

.role-block strong {
  display: block;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  background: #e8f0f8;
  color: #0a66c2;
  border-radius: 12px;
  margin-right: 6px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 500;
}

.tally .error {
  color: #d32f2f;
  background: #ffebee;
  border-left: 4px solid #d32f2f;
  padding: 12px;
  border-radius: 4px;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  color: #999;
  font-size: 0.85rem;
}

/* JS Error Banner */
.js-error {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ff6b6b;
  color: white;
  padding: 12px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  main {
    padding: 12px;
  }

  h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
  }

  h2 {
    font-size: 1.4rem;
    margin: 20px 0 15px 0;
  }

  h3 {
    font-size: 1rem;
  }

  .role-group {
    margin-bottom: 30px;
  }

  .role-card {
    padding: 12px;
    margin-bottom: 15px;
  }

  .role-card li {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .picks {
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
  }

  .player-pill input + span {
    padding: 5px 10px;
    font-size: 0.85rem;
  }

  .voting-setup {
    padding: 15px;
    margin-bottom: 30px;
  }

  .voting-setup h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
  }

  .instruction {
    font-size: 0.85rem;
    margin-top: 10px;
  }

  .select {
    max-width: 100%;
    padding: 12px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  #submitVote {
    padding: 12px 20px;
    font-size: 1rem;
    width: 100%;
    max-width: 400px;
  }

  .voting {
    padding: 15px;
    margin-top: 30px;
  }

  .voting h3 {
    margin-top: 15px;
  }

  .role-block {
    margin-bottom: 12px;
    padding: 10px;
  }

  .pill {
    padding: 3px 8px;
    font-size: 0.8rem;
    margin-right: 4px;
    margin-bottom: 4px;
  }

  footer {
    margin-top: 30px;
    padding-top: 15px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  main {
    padding: 8px;
  }

  h1 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }

  h2 {
    font-size: 1.2rem;
    margin: 15px 0 10px 0;
    padding-bottom: 8px;
  }

  .role-card {
    padding: 10px;
    margin-bottom: 12px;
  }

  .player-pill input + span {
    padding: 4px 8px;
    font-size: 0.8rem;
  }

  .voting-setup {
    padding: 12px;
    margin-bottom: 25px;
  }

  .voting-setup h2 {
    font-size: 1.1rem;
  }

  .select {
    padding: 12px;
    font-size: 16px;
  }

  #submitVote {
    padding: 12px 16px;
    font-size: 0.95rem;
    width: 100%;
  }
}
