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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.page {
  display: none;
  min-height: 100vh;
}

.page.active {
  display: block;
}

.header {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 20px;
  text-align: center;
  color: white;
  position: relative;
}

.header .logo {
  font-size: 48px;
  margin-bottom: 10px;
}

.header h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 5px;
}

.header p {
  font-size: 14px;
  opacity: 0.9;
}

.back-btn {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.container {
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 15px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.activity-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s;
}

.activity-card:hover:not(.disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.activity-card.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.activity-card .activity-name {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.activity-card .activity-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.activity-card .activity-type {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 12px;
}

.activity-card .badge {
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 500;
}

.badge.active {
  background: #52c41a;
  color: white;
}

.badge.ended {
  background: #999;
  color: white;
}

.activity-card .activity-deadline {
  font-size: 13px;
  color: #666;
  margin-top: 8px;
}

.activity-info {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.info-item {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
  border-bottom: none;
}

.info-item .label {
  width: 100px;
  color: #999;
  font-size: 14px;
}

.info-item .value {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.groups-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.group-card {
  background: white;
  border-radius: 16px;
  padding: 18px;
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.group-name {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.group-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-count {
  font-size: 13px;
  color: #666;
}

.seed-badge {
  background: linear-gradient(135deg, #ffd700 0%, #ffb300 100%);
  color: #8b4513;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.group-members {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.member-item {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
}

.member-item.seed {
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  color: #8b4513;
  border: 1px solid #ffd700;
}

.member-item.normal {
  background: #e6f7ff;
  color: #1890ff;
}

.member-item.placeholder {
  background: #f5f5f5;
  color: #999;
  border: 1px dashed #ddd;
}

.draw-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.draw-btn:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(238, 90, 36, 0.4);
}

.draw-btn.disabled {
  background: #ccc;
  cursor: not-allowed;
}

.draw-animation {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.wheel {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
  animation: spin 0.5s linear infinite;
}

.wheel-number {
  font-size: 48px;
  font-weight: 700;
  color: white;
}

.wheel-label {
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.result-card {
  display: none;
  background: white;
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 20px;
}

.result-header {
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: #52c41a;
  margin-bottom: 20px;
}

.result-item {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.result-item:last-child {
  border-bottom: none;
}

.result-item .label {
  width: 80px;
  color: #999;
  font-size: 14px;
}

.result-item .value {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.result-item .value.highlight {
  font-weight: 600;
  color: #667eea;
  font-size: 16px;
}

.opponent-list {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.opponent-item {
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 12px;
}

.opponent-item.seed {
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  color: #8b4513;
  border: 1px solid #ffd700;
}

.opponent-item.normal {
  background: #e6f7ff;
  color: #1890ff;
}

.opponent-item.placeholder {
  background: #f5f5f5;
  color: #999;
  border: 1px dashed #ddd;
}

.result-actions {
  display: flex;
  gap: 15px;
}

.btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

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

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

.btn-full {
  width: 100%;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 450px;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0 10px;
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 14px;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  font-size: 15px;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.form-group input::placeholder {
  color: #ccc;
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  display: none;
  z-index: 2000;
}

.toast.show {
  display: block;
  animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.loading {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  padding: 40px;
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 20px;
  }
  
  .container {
    padding: 15px;
  }
  
  .activity-card {
    padding: 16px;
  }
  
  .result-actions {
    flex-direction: column;
  }
}