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

body {
  font-family: Inter, -apple-system, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #1e293b;
  padding: 1rem;
}

#app { max-width: 900px; margin: 0 auto; }

.screen { display: none; animation: fadeIn 0.4s; }
.screen.active { display: block; }

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

/* Hero */
.hero {
  text-align: center;
  color: white;
  padding: 3rem 1rem;
  margin-bottom: 2rem;
}

.hero-icon {
  font-size: 5rem;
  margin-bottom: 1rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero h1 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.95;
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.category-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  border: 3px solid transparent;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.category-card.selected {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.05));
}

.category-card .icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.category-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.category-card p {
  color: #64748b;
  font-size: 0.875rem;
}

/* Difficulty Grid */
.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.diff-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  border: 3px solid transparent;
}

.diff-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.diff-card.selected {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.05));
}

.diff-card .icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.diff-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.diff-card p {
  color: #64748b;
  font-size: 0.875rem;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(102,126,234,0.4);
}

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

.btn-ghost {
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: #64748b;
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-ghost:hover {
  border-color: #667eea;
  color: #667eea;
}

/* Game Screen */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.progress {
  font-weight: 700;
  color: #667eea;
}

.timer {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
}

.riddle-card {
  background: white;
  border-radius: 1.5rem;
  padding: 3rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.riddle-question {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.6;
  color: #1e293b;
  margin-bottom: 2rem;
  min-height: 100px;
}

.hints-section {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.hint-btn {
  flex: 1;
  min-width: 150px;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.hint-btn:hover:not(.revealed):not(:disabled) {
  border-color: #667eea;
  background: #f1f5f9;
}

.hint-btn.revealed {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #92400e;
}

.answer-section {
  display: flex;
  gap: 1rem;
  flex-direction: column;
}

#answer-input {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 1.125rem;
  transition: border-color 0.3s;
}

#answer-input:focus {
  outline: none;
  border-color: #667eea;
}

.feedback {
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  text-align: center;
  margin-top: 1rem;
}

.feedback.success {
  background: #d1fae5;
  color: #065f46;
}

.feedback.error {
  background: #fee2e2;
  color: #991b1b;
}

/* Results Screen */
.results-hero {
  text-align: center;
  color: white;
  padding: 2rem 1rem;
}

.grade-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  box-shadow: 0 10px 30px rgba(16,185,129,0.3);
  animation: scaleIn 0.5s;
}

@keyframes scaleIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.grade {
  font-size: 4rem;
  font-weight: 900;
  color: white;
}

.results-hero h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

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

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #1e293b;
}

.stat-label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .riddle-card { padding: 2rem 1.5rem; }
  .riddle-question { font-size: 1.25rem; }
  .hints-section { flex-direction: column; }
  .hint-btn { min-width: 100%; }
}
