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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  min-height: 100vh;
}

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

/* Header */
.header {
  text-align: center;
  padding: 40px 20px 20px;
}

.header h1 {
  font-size: 2rem;
  background: linear-gradient(135deg, #f7b733, #fc4a1a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.header .subtitle {
  color: #888;
  font-size: 0.95rem;
}

/* Steps */
.step { display: none; }
.step.active { display: block; }

/* Intro */
.intro-card {
  max-width: 600px;
  margin: 40px auto;
  background: #1a1a2e;
  border-radius: 16px;
  padding: 40px;
  border: 1px solid #2a2a4a;
}

.intro-card h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: #f7b733;
}

.intro-card p {
  line-height: 1.7;
  margin-bottom: 16px;
  color: #bbb;
}

.intro-card .steps-list {
  list-style: none;
  margin: 20px 0;
}

.intro-card .steps-list li {
  padding: 8px 0;
  padding-left: 28px;
  position: relative;
  color: #ccc;
}

.intro-card .steps-list li::before {
  content: attr(data-step);
  position: absolute;
  left: 0;
  width: 20px;
  height: 20px;
  background: #f7b733;
  color: #0f0f1a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

.name-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #2a2a4a;
  border-radius: 10px;
  background: #12122a;
  color: #e0e0e0;
  font-size: 1rem;
  margin: 12px 0 20px;
  outline: none;
  transition: border-color 0.2s;
}

.name-input:focus {
  border-color: #f7b733;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  background: linear-gradient(135deg, #f7b733, #fc4a1a);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  width: 100%;
  text-align: center;
}

.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: #2a2a4a;
  color: #ccc;
}

/* Reference gallery */
.ref-description {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 30px;
  color: #999;
  line-height: 1.6;
}

.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 30px;
}

.ref-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #2a2a4a;
}

/* Voting */
.voting-header {
  text-align: center;
  margin-bottom: 24px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #1a1a2e;
  border-radius: 3px;
  margin: 16px 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f7b733, #fc4a1a);
  border-radius: 3px;
  transition: width 0.3s;
}

.scene-description {
  font-size: 1.1rem;
  color: #ccc;
  margin-bottom: 8px;
}

.vote-instruction {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 20px;
}

.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.vote-card {
  position: relative;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid transparent;
  transition: border-color 0.2s, transform 0.15s;
  background: #1a1a2e;
}

.vote-card:hover {
  transform: scale(1.02);
  border-color: #333;
}

.vote-card.selected {
  border-color: #f7b733;
  box-shadow: 0 0 20px rgba(247, 183, 51, 0.3);
}

.vote-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.vote-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: #f7b733;
  color: #0f0f1a;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.vote-card.selected .vote-badge {
  display: flex;
}

.vote-label {
  padding: 6px 8px;
  font-size: 0.75rem;
  color: #666;
  text-align: center;
  display: none;
}

.show-labels .vote-label {
  display: block;
}

/* Settings toggle */
.settings-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
  gap: 12px;
  align-items: center;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #777;
}

.toggle-label input {
  accent-color: #f7b733;
}

/* Results */
.results-card {
  max-width: 700px;
  margin: 40px auto;
  background: #1a1a2e;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  border: 1px solid #2a2a4a;
}

.results-card h2 {
  font-size: 1.8rem;
  color: #f7b733;
  margin-bottom: 8px;
}

.results-card .thanks {
  color: #999;
  margin-bottom: 30px;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  text-align: left;
}

.ranking-table th {
  padding: 10px 12px;
  border-bottom: 2px solid #2a2a4a;
  color: #888;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.ranking-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #1f1f3a;
}

.ranking-table tr:first-child td {
  color: #f7b733;
  font-weight: bold;
}

.medal { font-size: 1.2rem; }

@media (max-width: 600px) {
  .container { padding: 12px; }
  .header h1 { font-size: 1.5rem; }
  .intro-card { padding: 24px; margin: 20px auto; }
  .vote-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .ref-grid { grid-template-columns: repeat(3, 1fr); }
  .vote-card img { border-radius: 6px; }
}
