:root {
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --secondary: #ec4899;
  --background: #0f0f23;
  --surface: #1a1a2e;
  --surface-light: #252545;
  --text: #e5e7eb;
  --text-dim: #9ca3af;
  --border: #374151;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--background) 0%, #1a0b2e 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

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

header h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.phase-indicator {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: var(--surface-light);
  border-radius: 2rem;
  border: 2px solid var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.card {
  background: var(--surface);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.card h2 {
  color: var(--primary);
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
}

.theme-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 2rem;
  text-align: center;
  font-size: 1.2rem;
}

.theme-label {
  font-weight: 600;
  margin-right: 0.5rem;
}

.theme-text {
  font-size: 1.5rem;
  font-weight: 700;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--surface-light);
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group small {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-dim);
  font-size: 0.875rem;
}

.btn {
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

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

.btn-phase {
  background: var(--surface-light);
  color: var(--text);
  border: 2px solid var(--primary);
  margin: 0.5rem;
}

.btn-phase:hover {
  background: var(--primary);
  color: white;
}

.btn-danger {
  background: var(--error);
  color: white;
  margin: 0.5rem;
}

.btn-danger:hover {
  background: #dc2626;
}

.hidden {
  display: none !important;
}

.waiting-message {
  text-align: center;
  padding: 4rem 2rem;
}

.waiting-message h2 {
  color: var(--primary);
  margin-bottom: 1rem;
}

.status-message {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
  font-weight: 500;
}

.status-message.success {
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid var(--success);
  color: var(--success);
}

.status-message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid var(--error);
  color: var(--error);
}

.voting-instructions {
  background: var(--surface-light);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primary);
}

.songs-list {
  margin-bottom: 2rem;
}

.song-item {
  background: var(--surface-light);
  padding: 1.5rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  border: 2px solid var(--border);
  transition: all 0.2s;
}

.song-item.selected {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.1);
}

.song-info {
  margin-bottom: 1rem;
}

.song-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.song-artist {
  color: var(--text-dim);
  font-size: 1rem;
}

.song-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  word-break: break-all;
}

.song-link:hover {
  text-decoration: underline;
}

.vote-points {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.point-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.point-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.2);
}

.point-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.point-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

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

.result-item {
  background: var(--surface-light);
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.result-rank {
  font-size: 2rem;
  font-weight: 700;
  min-width: 3rem;
  text-align: center;
}

.result-rank.first {
  color: #fbbf24;
}

.result-rank.second {
  color: #c0c0c0;
}

.result-rank.third {
  color: #cd7f32;
}

.result-info {
  flex: 1;
}

.result-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.result-submitter {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.result-points {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 4rem;
  text-align: right;
}

footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.admin-link,
.back-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.admin-link:hover,
.back-link:hover {
  color: var(--primary);
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
}

.version {
  color: var(--text-dim);
  font-size: 0.75rem;
  opacity: 0.6;
  margin-left: 1rem;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.status-item {
  background: var(--surface-light);
  padding: 1rem;
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary);
}

.status-label {
  display: block;
  color: var(--text-dim);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.status-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.phase-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.submissions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.submission-item {
  background: var(--surface-light);
  padding: 1rem;
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary);
}

.submission-info {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.submission-details h4 {
  color: var(--text);
  margin-bottom: 0.25rem;
}

.submission-details p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0.125rem 0;
}

.submission-submitter {
  color: var(--secondary);
  font-weight: 600;
  white-space: nowrap;
}

.error-message {
  color: var(--error);
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 0.5rem;
  border: 1px solid var(--error);
}

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

  .card {
    padding: 1.5rem;
  }

  .result-item {
    flex-direction: column;
    text-align: center;
  }

  .result-points {
    text-align: center;
  }

  .phase-buttons {
    flex-direction: column;
  }

  .btn-phase,
  .btn-danger {
    width: 100%;
    margin: 0.25rem 0;
  }
}
