/* ========================================
   DOTA 2 QUIZ — Dark Red Theme
   ======================================== */

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

:root {
  --dota-red: #e74c3c;
  --dota-red-dark: #c0392b;
  --dota-red-deeper: #8b0000;
  --dota-red-glow: #ff4444;
  --dota-red-light: #ff6b6b;
  --dota-bg: #0d0a0a;
  --dota-bg-card: #1a1010;
  --dota-bg-card-hover: #2a1515;
  --dota-gold: #ffd700;
  --dota-gold-dark: #b8960f;
  --dota-text: #e8d5c4;
  --dota-text-dim: #8a7565;
  --dota-text-bright: #fff5ee;
  --dota-border: #3a1a1a;
  --dota-border-glow: rgba(231, 76, 60, 0.3);
  --font-title: 'Cinzel', 'Georgia', serif;
  --font-body: 'Play', 'Segoe UI', sans-serif;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--dota-text);
  background: var(--dota-bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(139, 0, 0, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(139, 0, 0, 0.1) 0%, transparent 60%),
    radial-gradient(circle at 50% 100%, rgba(231, 76, 60, 0.08) 0%, transparent 50%);
}

/* ---- Background Particles ---- */
.bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--dota-red);
  opacity: 0;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: translateY(-10vh) scale(1);
  }
}

/* ---- Screens ---- */
.screen {
  display: none;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}
.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   START SCREEN
   ======================================== */
.start-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  text-align: center;
  position: relative;
}

.logo-glow {
  position: absolute;
  top: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(231,76,60,0.25) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulseGlow 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 1; }
}

.dota-emblem {
  position: relative;
  margin-bottom: 1.5rem;
  animation: emblemFloat 4s ease-in-out infinite;
}

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

.start-title {
  font-family: var(--font-title);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  color: var(--dota-red);
  text-shadow:
    0 0 20px rgba(231, 76, 60, 0.5),
    0 0 40px rgba(231, 76, 60, 0.2);
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.start-subtitle {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--dota-text-dim);
  max-width: 500px;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.hero-preview {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}

.hero-silhouette {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: var(--dota-bg-card);
  border: 1px solid var(--dota-border);
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: default;
  animation: heroReveal 0.5s ease backwards;
}
.hero-silhouette:nth-child(1) { animation-delay: 0.05s; }
.hero-silhouette:nth-child(2) { animation-delay: 0.1s; }
.hero-silhouette:nth-child(3) { animation-delay: 0.15s; }
.hero-silhouette:nth-child(4) { animation-delay: 0.2s; }
.hero-silhouette:nth-child(5) { animation-delay: 0.25s; }
.hero-silhouette:nth-child(6) { animation-delay: 0.3s; }
.hero-silhouette:nth-child(7) { animation-delay: 0.35s; }
.hero-silhouette:nth-child(8) { animation-delay: 0.4s; }
.hero-silhouette:nth-child(9) { animation-delay: 0.45s; }
.hero-silhouette:nth-child(10) { animation-delay: 0.5s; }
.hero-silhouette:nth-child(11) { animation-delay: 0.55s; }
.hero-silhouette:nth-child(12) { animation-delay: 0.6s; }
.hero-silhouette:nth-child(13) { animation-delay: 0.65s; }
.hero-silhouette:nth-child(14) { animation-delay: 0.7s; }
.hero-silhouette:nth-child(15) { animation-delay: 0.75s; }
.hero-silhouette:nth-child(16) { animation-delay: 0.8s; }
.hero-silhouette:nth-child(17) { animation-delay: 0.85s; }
.hero-silhouette:nth-child(18) { animation-delay: 0.9s; }
.hero-silhouette:nth-child(19) { animation-delay: 0.95s; }
.hero-silhouette:nth-child(20) { animation-delay: 1.0s; }
.hero-silhouette:nth-child(21) { animation-delay: 1.05s; }
.hero-silhouette:nth-child(22) { animation-delay: 1.1s; }
.hero-silhouette:nth-child(23) { animation-delay: 1.15s; }
.hero-silhouette:nth-child(24) { animation-delay: 1.2s; }
.hero-silhouette:nth-child(25) { animation-delay: 1.25s; }
.hero-silhouette:nth-child(26) { animation-delay: 1.3s; }
.hero-silhouette:nth-child(27) { animation-delay: 1.35s; }
.hero-silhouette:nth-child(28) { animation-delay: 1.4s; }

@keyframes heroReveal {
  from { opacity: 0; transform: scale(0.5) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.hero-silhouette:hover {
  border-color: var(--dota-red);
  background: var(--dota-bg-card-hover);
  transform: scale(1.15);
  box-shadow: 0 0 15px rgba(231,76,60,0.3);
}

/* Атрибутные цвета иконок */
.hero-str { border-color: rgba(231,76,60,0.3); }
.hero-agi { border-color: rgba(46,204,113,0.3); }
.hero-uni { border-color: rgba(243,156,18,0.3); }
.hero-int { border-color: rgba(52,152,219,0.3); }
.hero-str:hover { border-color: #e74c3c; box-shadow: 0 0 12px rgba(231,76,60,0.4); }
.hero-agi:hover { border-color: #2ecc71; box-shadow: 0 0 12px rgba(46,204,113,0.4); }
.hero-uni:hover { border-color: #f39c12; box-shadow: 0 0 12px rgba(243,156,18,0.4); }
.hero-int:hover { border-color: #3498db; box-shadow: 0 0 12px rgba(52,152,219,0.4); }

/* Легенда атрибутов */
.attr-legend {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
  font-size: 0.8rem;
  color: var(--dota-text-dim);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.btn-start {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dota-text-bright);
  background: linear-gradient(135deg, var(--dota-red-dark), var(--dota-red-deeper));
  border: 2px solid var(--dota-red);
  padding: 1rem 3rem;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn-start:hover {
  background: linear-gradient(135deg, var(--dota-red), var(--dota-red-dark));
  box-shadow:
    0 0 20px rgba(231,76,60,0.4),
    0 0 40px rgba(231,76,60,0.2);
  transform: translateY(-2px);
}

.btn-start:active {
  transform: translateY(0);
}

.start-hint {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--dota-text-dim);
  letter-spacing: 0.05em;
}

/* ========================================
   QUIZ SCREEN
   ======================================== */
.quiz-container {
  width: 100%;
  max-width: 700px;
  padding: 1.5rem;
}

.quiz-header {
  margin-bottom: 1.5rem;
}

.quiz-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--dota-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dota-red-deeper), var(--dota-red), var(--dota-red-light));
  border-radius: 3px;
  transition: width 0.5s ease;
  width: 0%;
  box-shadow: 0 0 8px rgba(231,76,60,0.5);
}

.quiz-counter {
  text-align: right;
  font-size: 0.85rem;
  color: var(--dota-text-dim);
  font-family: var(--font-title);
  letter-spacing: 0.1em;
}

.question-card {
  background: linear-gradient(145deg, var(--dota-bg-card), #150c0c);
  border: 1px solid var(--dota-border);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  animation: cardSlideIn 0.4s ease;
}

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

.question-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--dota-red), transparent);
}

.question-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.question-text {
  font-family: var(--font-title);
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 700;
  color: var(--dota-text-bright);
  line-height: 1.5;
}

/* ---- Answer Buttons ---- */
.answers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.answer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1rem 0.75rem;
  border: 2px solid var(--dota-border);
  border-radius: 12px;
  background: var(--dota-bg-card);
  color: var(--dota-text);
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-body);
}

.answer-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.answer-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Цвета кнопок */
.answer-yes { border-color: #27ae60; }
.answer-yes .answer-icon { color: #27ae60; }
.answer-yes:hover {
  background: rgba(39, 174, 96, 0.15);
  border-color: #2ecc71;
  box-shadow: 0 0 15px rgba(39, 174, 96, 0.3);
  transform: translateY(-3px);
}

.answer-partial-yes { border-color: #f39c12; }
.answer-partial-yes .answer-icon { color: #f39c12; }
.answer-partial-yes:hover {
  background: rgba(243, 156, 18, 0.15);
  border-color: #f1c40f;
  box-shadow: 0 0 15px rgba(243, 156, 18, 0.3);
  transform: translateY(-3px);
}

.answer-dontknow { border-color: #7f8c8d; }
.answer-dontknow .answer-icon { color: #95a5a6; }
.answer-dontknow:hover {
  background: rgba(127, 140, 141, 0.15);
  border-color: #95a5a6;
  box-shadow: 0 0 15px rgba(127, 140, 141, 0.2);
  transform: translateY(-3px);
}

.answer-partial-no { border-color: #e67e22; }
.answer-partial-no .answer-icon { color: #e67e22; }
.answer-partial-no:hover {
  background: rgba(230, 126, 34, 0.15);
  border-color: #e67e22;
  box-shadow: 0 0 15px rgba(230, 126, 34, 0.3);
  transform: translateY(-3px);
}

.answer-no { border-color: var(--dota-red-dark); }
.answer-no .answer-icon { color: var(--dota-red); }
.answer-no:hover {
  background: rgba(231, 76, 60, 0.15);
  border-color: var(--dota-red);
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.3);
  transform: translateY(-3px);
}

.answer-btn:active {
  transform: translateY(0) scale(0.97);
}

/* ---- Confidence Bar ---- */
.confidence-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--dota-bg-card);
  border: 1px solid var(--dota-border);
  border-radius: 10px;
}

.confidence-label {
  font-size: 0.8rem;
  color: var(--dota-text-dim);
  white-space: nowrap;
}

.confidence-track {
  flex: 1;
  height: 8px;
  background: var(--dota-border);
  border-radius: 4px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dota-red-dark), var(--dota-red-light));
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

.confidence-value {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--dota-red-light);
  min-width: 36px;
  text-align: right;
}

/* ========================================
   RESULT SCREEN
   ======================================== */
.result-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  text-align: center;
  position: relative;
  max-width: 600px;
}

.result-glow {
  position: absolute;
  top: -20px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulseGlow 3s ease-in-out infinite;
  pointer-events: none;
}

.result-badge {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  animation: badgePop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

@keyframes badgePop {
  from { opacity: 0; transform: scale(0.3) rotate(-20deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

.result-title {
  font-family: var(--font-title);
  font-size: clamp(1.3rem, 4vw, 2rem);
  color: var(--dota-gold);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  margin-bottom: 1rem;
  letter-spacing: 0.08em;
}

.result-hero-card {
  background: linear-gradient(145deg, #1f1212, #2a1818);
  border: 2px solid var(--dota-red);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
  animation: resultCardSlide 0.5s ease 0.2s backwards;
  width: 100%;
}

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

.result-hero-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--dota-gold-dark), var(--dota-gold), var(--dota-gold-dark));
}

.result-hero-emoji {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.result-hero-name {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 900;
  color: var(--dota-red-light);
  text-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
  margin-bottom: 0.25rem;
}

.result-hero-title {
  font-size: 1rem;
  color: var(--dota-gold);
  font-style: italic;
  margin-bottom: 0.75rem;
}

.result-hero-desc {
  font-size: 0.95rem;
  color: var(--dota-text);
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

.result-confidence {
  font-size: 1rem;
  color: var(--dota-text-dim);
  margin-bottom: 1rem;
}

.result-conf-value {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--dota-gold);
}

.result-top3 {
  width: 100%;
  margin-bottom: 1.5rem;
}

.result-top3 h3 {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--dota-text-dim);
  margin-bottom: 0.75rem;
  letter-spacing: 0.08em;
}

.top3-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.top3-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--dota-bg-card);
  border: 1px solid var(--dota-border);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.top3-item:first-child {
  border-color: var(--dota-gold-dark);
  background: rgba(255, 215, 0, 0.05);
}

.top3-rank {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--dota-gold);
  min-width: 28px;
}

.top3-emoji {
  font-size: 1.5rem;
}

.top3-info {
  flex: 1;
  text-align: left;
}

.top3-name {
  font-weight: 700;
  color: var(--dota-text-bright);
  font-size: 0.95rem;
}

.top3-score {
  font-size: 0.8rem;
  color: var(--dota-text-dim);
}

.top3-bar {
  width: 60px;
  height: 6px;
  background: var(--dota-border);
  border-radius: 3px;
  overflow: hidden;
}

.top3-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dota-red-dark), var(--dota-red));
  border-radius: 3px;
}

/* ---- Result Actions ---- */
.result-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-play-again, .btn-back-home {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.8rem 2rem;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.3s ease;
}

.btn-play-again {
  background: linear-gradient(135deg, var(--dota-red-dark), var(--dota-red-deeper));
  border: 2px solid var(--dota-red);
  color: var(--dota-text-bright);
}

.btn-play-again:hover {
  background: linear-gradient(135deg, var(--dota-red), var(--dota-red-dark));
  box-shadow: 0 0 20px rgba(231,76,60,0.4);
  transform: translateY(-2px);
}

.btn-back-home {
  background: transparent;
  border: 2px solid var(--dota-border);
  color: var(--dota-text-dim);
}

.btn-back-home:hover {
  border-color: var(--dota-text-dim);
  color: var(--dota-text);
  transform: translateY(-2px);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 500px) {
  .answers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .answer-btn {
    padding: 0.75rem 0.5rem;
  }
  .result-hero-card {
    padding: 1.5rem 1rem;
  }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--dota-bg); }
::-webkit-scrollbar-thumb { background: var(--dota-red-deeper); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--dota-red-dark); }

/* ---- Selection ---- */
::selection {
  background: var(--dota-red);
  color: white;
}
