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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

header {
  text-align: center;
  color: white;
  margin-bottom: 40px;
}

header h1 {
  font-size: 3rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.section {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hidden {
  display: none;
}

/* Landing Page */
#landing {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

#landing h2 {
  margin-bottom: 30px;
  color: #333;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

input[type="text"] {
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s;
}

input[type="text"]:focus {
  outline: none;
  border-color: #667eea;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-small {
  padding: 6px 12px;
  font-size: 14px;
}

.or-text {
  color: #999;
  margin: 20px 0;
}

/* Room */
.room-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  flex-wrap: wrap;
  gap: 20px;
}

.room-header h2 {
  color: #333;
  margin-bottom: 10px;
}

.share-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.share-link input {
  flex: 1;
  min-width: 300px;
}

.controls {
  display: flex;
  gap: 10px;
}

/* Users Grid */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.user-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  border: 3px solid transparent;
  transition: all 0.3s;
}

.user-card.voted {
  border-color: #28a745;
  background: #d4edda;
}

.user-card.revealed {
  background: white;
}

.user-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.user-vote {
  font-size: 2rem;
  font-weight: bold;
  color: #667eea;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-vote.hidden-vote {
  color: #28a745;
}

/* Statistics */
.statistics {
  background: #f0f4ff;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
  border: 2px solid #667eea;
}

.statistics h3 {
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

.stats-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.average-section {
  text-align: center;
  background: white;
  border-radius: 8px;
  padding: 20px;
}

.stat-label {
  font-weight: 600;
  color: #666;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: #667eea;
}

.votes-breakdown {
  background: white;
  border-radius: 8px;
  padding: 20px;
}

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

.distribution-item {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
  text-align: center;
  border: 2px solid #e0e0e0;
}

.vote-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #667eea;
  display: block;
  margin-bottom: 5px;
}

.vote-count {
  color: #666;
  font-size: 0.9rem;
}

/* Cards Section */
.cards-section {
  margin-top: 30px;
}

.cards-section h3 {
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

.cards {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.card {
  width: 70px;
  height: 100px;
  background: white;
  border: 3px solid #667eea;
  border-radius: 8px;
  font-size: 24px;
  font-weight: bold;
  color: #667eea;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(102, 126, 234, 0.3);
}

.card.selected {
  background: #667eea;
  color: white;
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

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

  .room-header {
    flex-direction: column;
  }

  .share-link input {
    min-width: 200px;
  }

  .controls {
    width: 100%;
    flex-direction: column;
  }

  .card {
    width: 60px;
    height: 85px;
    font-size: 20px;
  }

  .distribution-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }

  .stat-value {
    font-size: 2rem;
  }
}
