:root {
  --color-1: #0A100D;
  --color-2: #B9BAA3;
  --color-3: #D6D5C9;
  --color-4: #A22C29;
  --color-5: #902923;
  --bg: var(--color-1);
  --text: var(--color-3);
  --card: rgba(214, 213, 201, 0.05);
  --line: var(--color-2);
  --btn-bg: var(--color-4);
  --btn-hover: var(--color-5);
  --correct: var(--color-2);
  --wrong: var(--color-5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  overflow-x: hidden;
  direction: rtl;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.bg i {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: drift 15s ease-in-out infinite alternate;
}

.bg i:nth-child(1) { width: 380px; height: 380px; background: var(--color-4); top: -50px; left: -50px; }
.bg i:nth-child(2) { width: 320px; height: 320px; background: var(--color-2); bottom: -50px; right: -50px; animation-delay: -3s; }
.bg i:nth-child(3) { width: 250px; height: 250px; background: var(--color-5); top: 30%; left: 40%; animation-delay: -6s; }
.bg i:nth-child(4) { width: 200px; height: 200px; background: var(--color-3); bottom: 10%; left: 10%; opacity: 0.1; animation-delay: -9s; }
.bg i:nth-child(5) { width: 16px; height: 16px; border-radius: 4px; filter: none; opacity: 0.8; background: var(--color-2); bottom: -30px; left: 15%; animation: rise 10s linear infinite; }
.bg i:nth-child(6) { width: 16px; height: 16px; border-radius: 4px; filter: none; opacity: 0.8; background: var(--color-4); bottom: -30px; left: 65%; animation: rise 13s linear infinite; animation-delay: -5s; }
.bg i:nth-child(7) { width: 16px; height: 16px; border-radius: 4px; filter: none; opacity: 0.8; background: var(--color-3); bottom: -30px; left: 88%; animation: rise 11s linear infinite; animation-delay: -2s; }

@keyframes drift {
  to { transform: translate(60px, 40px) scale(1.1); }
}

@keyframes rise {
  to { transform: translateY(-115vh) rotate(540deg); }
}

.none { display: none !important; }
.block { display: block !important; }
.hide { display: none !important; }

header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: rgba(10, 16, 13, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 1px;
}

.logo b {
  color: var(--color-4);
}

.coins {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-radius: 30px;
  background: var(--card);
  border: 1px solid var(--color-2);
  font-weight: 700;
  font-size: 1.2rem;
}

.coins.bump {
  animation: bump 0.5s;
}

.coin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff3b0, var(--color-2) 60%, #8a8b75);
  animation: spin 2.5s linear infinite;
}

@keyframes spin {
  to { transform: rotateY(360deg); }
}

@keyframes bump {
  40% { transform: scale(1.3); }
}

.screen {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px 70px;
  text-align: center;
  animation: enter 0.6s both;
}

@keyframes enter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--color-3);
  margin-bottom: 10px;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 15px;
  color: var(--color-2);
}

.lead {
  max-width: 650px;
  margin: 10px auto 30px;
  opacity: 0.9;
  line-height: 1.7;
  font-size: 1.1rem;
}

.how {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 30px 0 40px;
}

.how div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 20px;
  text-align: right;
  line-height: 1.6;
}

.how span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 35px;
  height: 35px;
  margin-bottom: 15px;
  border-radius: 50%;
  background: var(--btn-bg);
  color: #fff;
  font-weight: bold;
}

button.go, button#nextBtn {
  border: 0;
  cursor: pointer;
  color: #fff;
  font-size: 1.2rem;
  font-weight: bold;
  padding: 16px 45px;
  border-radius: 50px;
  background: var(--btn-bg);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(162, 44, 41, 0.4);
}

button.go:hover, button#nextBtn:hover {
  background: var(--btn-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(144, 41, 35, 0.6);
}

.levels {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  margin-top: 30px;
}

.level {
  color: var(--text);
  cursor: pointer;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 25px;
  width: 100%;
  max-width: 600px;
  transition: all 0.3s ease;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.level:hover:not(:disabled) {
  border-color: var(--color-3);
  transform: translateX(-5px);
  background: rgba(214, 213, 201, 0.1);
}

.level .num {
  display: grid;
  place-items: center;
  min-width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--line);
  color: var(--color-1);
  font-size: 1.5rem;
  font-weight: bold;
  margin-left: 20px;
}

.level h3 { font-size: 1.6rem; color: var(--color-3); margin-bottom: 5px; }
.level p { opacity: 0.8; margin-bottom: 10px; }
.level small { color: var(--color-4); font-weight: bold; }

.level.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.meta {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 15px;
  font-weight: bold;
}

.track {
  height: 8px;
  border-radius: 10px;
  background: var(--card);
  overflow: hidden;
  margin-bottom: 40px;
}

#bar {
  height: 100%;
  width: 0;
  border-radius: 10px;
  background: var(--line);
  transition: width 0.4s ease;
}

.question-text {
  font-size: 1.8rem;
  margin-bottom: 40px;
  color: var(--color-3);
  line-height: 1.5;
}

.options {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 40px;
}

.text-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 15px;
  padding: 30px;
  font-size: 1.3rem;
  font-weight: bold;
  text-align: center;
  line-height: 1.6;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 450px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-card:hover {
  border-color: var(--color-3);
  transform: translateY(-5px);
  background: rgba(214, 213, 201, 0.1);
}

.text-card.right {
  border-color: var(--correct);
  background: rgba(185, 186, 163, 0.2);
}

.text-card.wrong {
  border-color: var(--wrong);
  background: rgba(144, 41, 35, 0.2);
}

#feedback {
  min-height: 40px;
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 25px;
}

#feedback.good { color: var(--correct); }
#feedback.bad { color: var(--wrong); }

.stats {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 40px 0;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 25px;
}

.stat b {
  display: block;
  font-size: 2.5rem;
  color: var(--line);
  margin-bottom: 10px;
}

.stat span {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--color-3);
}

#message {
  font-size: 1.5rem;
  margin-bottom: 40px;
  font-weight: bold;
  color: var(--color-4);
}

@media (max-width: 768px) {
  .options { flex-direction: column; align-items: center; }
  .text-card { max-width: 100%; }
  .level { flex-direction: column; text-align: center; }
  .level .num { margin: 0 auto 15px; }
}