/* ===== RUST QUIZ — STYLES ===== */

@import url('https://fonts.googleapis.com/css2?family=Russo+One&family=Rajdhani:wght@400;600;700&display=swap');

:root {
  --rust-orange: #c45c1c;
  --rust-dark: #1a0e07;
  --rust-brown: #3d1c0a;
  --rust-amber: #e8832a;
  --rust-red: #a83219;
  --rust-gold: #f0a030;
  --rust-cream: #f5e6d3;
  --rust-sand: #d4a574;
  --rust-green: #4caf50;
  --rust-wrong: #c0392b;
  --glow: rgba(232, 131, 42, 0.4);
}

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

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--rust-dark);
  color: var(--rust-cream);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

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

.particle {
  position: absolute;
  border-radius: 50%;
  animation: floatUp linear forwards;
  opacity: 0;
}

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

/* ===== SCREENS ===== */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.screen.active {
  display: flex;
  animation: screenIn 0.6s ease-out;
}

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

/* ===== START SCREEN ===== */
.logo-container {
  position: relative;
  margin-bottom: 2rem;
}

.rust-logo {
  font-family: 'Russo One', sans-serif;
  font-size: clamp(4rem, 12vw, 8rem);
  color: var(--rust-orange);
  text-shadow:
    0 0 40px var(--glow),
    0 0 80px rgba(196, 92, 28, 0.3),
    0 4px 0 var(--rust-brown),
    0 8px 0 rgba(0,0,0,0.4);
  letter-spacing: 0.15em;
  animation: logoGlow 3s ease-in-out infinite alternate;
  position: relative;
}

.rust-drip {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 6px;
  background: linear-gradient(90deg, transparent, var(--rust-orange), var(--rust-amber), var(--rust-orange), transparent);
  border-radius: 3px;
  animation: drip 2s ease-in-out infinite;
}

@keyframes logoGlow {
  from { text-shadow: 0 0 40px var(--glow), 0 0 80px rgba(196, 92, 28, 0.3), 0 4px 0 var(--rust-brown); }
  to { text-shadow: 0 0 60px var(--glow), 0 0 120px rgba(232, 131, 42, 0.4), 0 4px 0 var(--rust-brown); }
}

@keyframes drip {
  0%, 100% { width: 60%; opacity: 0.6; }
  50% { width: 80%; opacity: 1; }
}

.subtitle {
  font-size: 1.3rem;
  color: var(--rust-sand);
  margin-bottom: 2.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 0.8s 0.4s ease-out forwards;
}

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

.btn-start, .btn-restart {
  position: relative;
  background: linear-gradient(135deg, var(--rust-orange), var(--rust-red));
  color: white;
  border: none;
  padding: 1rem 3rem;
  font-family: 'Russo One', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
  opacity: 0;
  animation: fadeUp 0.8s 0.6s ease-out forwards;
}

.btn-start:hover, .btn-restart:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 30px var(--glow), 0 0 60px rgba(196, 92, 28, 0.3);
}

.btn-start:active, .btn-restart:active {
  transform: scale(0.97);
}

.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

.start-stats {
  display: flex;
  gap: 3rem;
  margin-top: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.8s ease-out forwards;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-size: 2rem;
  font-weight: 700;
  color: var(--rust-amber);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--rust-sand);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===== QUIZ SCREEN ===== */
.quiz-header {
  width: 100%;
  max-width: 700px;
  margin-bottom: 2rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--rust-brown);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.8rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rust-orange), var(--rust-amber));
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 10%;
  box-shadow: 0 0 10px var(--glow);
}

.quiz-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.question-counter {
  font-size: 1.1rem;
  color: var(--rust-sand);
  font-weight: 600;
}

.score-display {
  font-size: 1.1rem;
  color: var(--rust-gold);
  font-weight: 700;
}

/* ===== QUESTION AREA ===== */
.question-area {
  width: 100%;
  max-width: 700px;
  text-align: center;
}

.question-text {
  font-family: 'Russo One', sans-serif;
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  color: var(--rust-cream);
  margin-bottom: 2.5rem;
  line-height: 1.4;
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

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

.answer-btn {
  position: relative;
  background: linear-gradient(135deg, rgba(61, 28, 10, 0.8), rgba(26, 14, 7, 0.9));
  border: 2px solid rgba(196, 92, 28, 0.3);
  color: var(--rust-cream);
  padding: 1.1rem 1.5rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  text-align: left;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
}

.answer-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--rust-orange), var(--rust-amber));
  opacity: 0;
  transition: opacity 0.3s;
}

.answer-btn:hover {
  border-color: var(--rust-orange);
  transform: translateX(8px);
  box-shadow: -4px 0 20px var(--glow), 0 4px 15px rgba(0,0,0,0.3);
}

.answer-btn:hover::before {
  opacity: 0.15;
}

.answer-btn .letter {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--rust-orange);
  color: white;
  border-radius: 50%;
  font-family: 'Russo One', sans-serif;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: all 0.3s;
}

.answer-btn .text {
  position: relative;
  z-index: 1;
}

/* Answer states */
.answer-btn.correct {
  border-color: var(--rust-green) !important;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(76, 175, 80, 0.05)) !important;
  animation: correctPulse 0.6s ease-out;
}

.answer-btn.correct .letter {
  background: var(--rust-green);
}

.answer-btn.wrong {
  border-color: var(--rust-wrong) !important;
  background: linear-gradient(135deg, rgba(192, 57, 43, 0.2), rgba(192, 57, 43, 0.05)) !important;
  animation: wrongShake 0.5s ease-out;
}

.answer-btn.wrong .letter {
  background: var(--rust-wrong);
}

.answer-btn.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.answer-btn.correct-highlight {
  border-color: var(--rust-green) !important;
  opacity: 1 !important;
}

@keyframes correctPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.quiz-footer {
  margin-top: 2rem;
}

.rust-coins {
  font-size: 1.2rem;
  color: var(--rust-gold);
  font-weight: 700;
  transition: all 0.3s;
}

.rust-coins.bump {
  animation: coinBump 0.4s ease-out;
}

@keyframes coinBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ===== RESULTS SCREEN ===== */
.results-container {
  text-align: center;
  max-width: 650px;
  width: 100%;
}

.result-badge {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  animation: badgePop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-badge.gold {
  background: radial-gradient(circle, var(--rust-gold), var(--rust-orange));
  box-shadow: 0 0 40px rgba(240, 160, 48, 0.5);
}

.result-badge.silver {
  background: radial-gradient(circle, #c0c0c0, #808080);
  box-shadow: 0 0 40px rgba(192, 192, 192, 0.4);
}

.result-badge.bronze {
  background: radial-gradient(circle, #cd7f32, #8b4513);
  box-shadow: 0 0 40px rgba(205, 127, 50, 0.4);
}

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

.result-icon {
  font-size: 3rem;
}

.result-title {
  font-family: 'Russo One', sans-serif;
  font-size: 2rem;
  color: var(--rust-amber);
  margin-bottom: 0.5rem;
}

.result-subtitle {
  color: var(--rust-sand);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.score-circle {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 2.5rem;
}

.score-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-bg {
  fill: none;
  stroke: var(--rust-brown);
  stroke-width: 8;
}

.score-progress {
  fill: none;
  stroke: var(--rust-orange);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 8px var(--glow));
}

.score-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-num {
  font-family: 'Russo One', sans-serif;
  font-size: 2.8rem;
  color: var(--rust-orange);
}

.score-total {
  font-size: 1rem;
  color: var(--rust-sand);
}

/* ===== REVIEW SECTION ===== */
.review-section {
  width: 100%;
  text-align: left;
  margin-bottom: 2rem;
}

.review-item {
  background: rgba(61, 28, 10, 0.5);
  border: 1px solid rgba(196, 92, 28, 0.2);
  border-radius: 10px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  animation: reviewSlide 0.5s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

.review-item.correct-item {
  border-left: 4px solid var(--rust-green);
}

.review-item.wrong-item {
  border-left: 4px solid var(--rust-wrong);
}

@keyframes reviewSlide {
  to { opacity: 1; transform: translateY(0); }
}

.review-q {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
  color: var(--rust-cream);
}

.review-q .q-num {
  color: var(--rust-amber);
}

.review-answer {
  font-size: 0.95rem;
  color: var(--rust-sand);
  margin-bottom: 0.3rem;
}

.review-answer .label {
  font-weight: 700;
}

.review-answer .label.your-wrong {
  color: var(--rust-wrong);
}

.review-answer .label.your-correct {
  color: var(--rust-green);
}

.review-answer .label.correct-val {
  color: var(--rust-green);
}

.btn-restart {
  margin-top: 1rem;
  opacity: 1;
  animation: none;
}

/* ===== SHARE SECTION ===== */
.share-section {
  margin-bottom: 2.5rem;
  text-align: center;
}

.share-title {
  font-size: 1.15rem;
  color: var(--rust-sand);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  animation: fadeUp 0.6s 0.5s ease-out both;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  color: white;
  border: none;
  position: relative;
  overflow: hidden;
}

.share-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.share-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.share-btn:hover::after {
  opacity: 1;
}

.share-btn:active {
  transform: scale(0.97);
}

.share-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.share-btn.telegram {
  background: linear-gradient(135deg, #2AABEE, #229ED9);
}

.share-btn.whatsapp {
  background: linear-gradient(135deg, #25D366, #128C7E);
}

.share-btn.vk {
  background: linear-gradient(135deg, #4C75A3, #3B5998);
}

.share-btn.discord {
  background: linear-gradient(135deg, #5865F2, #4752C4);
}

.share-btn.copy-link {
  background: linear-gradient(135deg, var(--rust-orange), var(--rust-red));
}

.share-btn.copied {
  background: linear-gradient(135deg, var(--rust-green), #388E3C) !important;
}

.share-btn.copied span::after {
  content: '✓';
  margin-left: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .screen { padding: 1rem; }
  .answer-btn { padding: 0.9rem 1.1rem; font-size: 1rem; }
  .start-stats { gap: 2rem; }
  .score-circle { width: 120px; height: 120px; }
  .score-num { font-size: 2.2rem; }
}

/* ===== BG GRADIENT ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(196, 92, 28, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(168, 50, 25, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(26, 14, 7, 1) 0%, rgba(15, 8, 4, 1) 100%);
  z-index: -1;
}

/* ===== CONFETTI CANVAS ===== */
#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}
