:root {
  --purple-1: #c24fe6; /* верх — яркий пурпур */
  --purple-2: #8e2fd6; /* середина — фиолетовый */
  --purple-3: #531a93; /* низ — глубокий тёмно-фиолетовый */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', Inter, Roboto, sans-serif;
  color: #fff;
  background: linear-gradient(160deg, var(--purple-1) 0%, var(--purple-2) 52%, var(--purple-3) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar { text-align: center; padding: 10px 0 8px; color: rgba(255, 255, 255, .95); }
.title { font-weight: 700; font-size: 18px; }
.subtitle { font-size: 13px; opacity: .65; margin-top: -2px; }

.card {
  margin-top: 8px;
  border-radius: 26px;
  padding: 18px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.group { display: flex; align-items: center; gap: 12px; }
.group-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; font-size: 22px;
  background: rgba(255, 255, 255, .25);
}
.group-name { font-weight: 700; font-size: 20px; color: #fff; }
.group-desc { font-size: 13px; color: rgba(255, 255, 255, .85); }

.screen { display: flex; flex-direction: column; gap: 14px; animation: fade .25s ease; }
.hidden { display: none !important; }

.quiz-head {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .05em; text-transform: uppercase;
}
.counter { opacity: .85; text-transform: none; letter-spacing: 0; font-weight: 500; }

.progress { display: flex; gap: 6px; }
.seg { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); transition: background .3s ease; }
.seg.on { background: #fff; }

.question {
  color: #fff; text-align: center; font-size: 24px; line-height: 1.25;
  margin: 6px 0 4px; font-weight: 700;
}

.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
  color: #fff; font-size: 17px;
  padding: 16px 18px; border-radius: 999px; text-align: left; cursor: pointer;
  transition: transform .1s ease, background .15s ease, border-color .15s ease;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.option:active { transform: scale(.98); }
.option:disabled { cursor: default; }
.option.correct { background: #43c463; border-color: #43c463; }
.option.wrong { background: #e0594b; border-color: #e0594b; animation: shake .3s; }
.option .mark { font-weight: 700; }

.hint { text-align: center; color: #f6e784; font-size: 14px; min-height: 18px; font-weight: 600; }

.check {
  width: 74px; height: 74px; margin: 24px auto 6px; border-radius: 50%;
  display: grid; place-items: center; font-size: 38px; color: #fff;
  background: rgba(255, 255, 255, .25);
}
.success-title { color: #fff; text-align: center; font-size: 30px; margin: 6px 0 2px; }
.success-sub { color: rgba(255, 255, 255, .85); text-align: center; margin: 0 0 8px; }

.primary {
  margin-top: auto;
  background: #fff; color: #7b2fd6; border: none; border-radius: 999px;
  padding: 18px; font-size: 18px; font-weight: 700; cursor: pointer;
}
.primary:active { transform: scale(.99); }

.loading { color: #fff; text-align: center; padding: 30px; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
