.anime-quiz {
  --aq-bg: #f8fafc;
  --aq-card: #ffffff;
  --aq-card-soft: #f1f5f9;
  --aq-text: #0f172a;
  --aq-muted: #64748b;
  --aq-line: rgba(148, 163, 184, .35);
  --aq-accent: #ef476f;
  --aq-accent-2: #8b5cf6;
  --aq-blue: #4f8ce8;
  --aq-green: #22c55e;
  --aq-red: #ef4444;
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 16px 72px;
  color: var(--aq-text);
}

.dark .anime-quiz {
  --aq-bg: #111827;
  --aq-card: #18181f;
  --aq-card-soft: #202231;
  --aq-text: #f8fafc;
  --aq-muted: #94a3b8;
  --aq-line: rgba(148, 163, 184, .18);
}

.aq-hero {
  text-align: center;
  margin-bottom: 18px;
}

.aq-hero span {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--aq-accent);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
}

.aq-hero h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.05;
  font-weight: 900;
}

.aq-hero p {
  max-width: 680px;
  margin: 12px auto 0;
  color: var(--aq-muted);
  line-height: 1.7;
}

.aq-modes {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 22px 0;
}

.aq-mode {
  border: 0;
  background: transparent;
  color: var(--aq-muted);
  font-weight: 800;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.aq-mode.is-active {
  color: var(--aq-text);
  border-color: var(--aq-accent);
}

.aq-scoreboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 26px;
}

.aq-scoreboard span {
  display: block;
  text-align: center;
  color: var(--aq-muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.aq-scoreboard strong {
  display: grid;
  place-items: center;
  min-width: 104px;
  min-height: 64px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--aq-blue), var(--aq-accent-2));
  font-size: 42px;
  line-height: 1;
  box-shadow: 0 16px 40px rgba(79, 140, 232, .25);
}

.aq-scoreboard em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  color: #fff;
  background: rgba(79, 140, 232, .72);
  font-style: normal;
  font-weight: 700;
}

.aq-stage {
  position: relative;
  min-height: 520px;
  padding: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 10%, rgba(239, 71, 111, .16), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(139, 92, 246, .16), transparent 30%),
    var(--aq-card);
  border: 1px solid var(--aq-line);
  box-shadow: 0 24px 80px rgba(15, 23, 42, .08);
}

.aq-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(760px, 100%);
  height: clamp(240px, 42vw, 430px);
  margin: 0 auto 22px;
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--aq-card-soft), rgba(79, 140, 232, .12));
  border: 1px solid var(--aq-line);
}

.aq-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050816;
}

.aq-loader {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 7px solid rgba(79, 140, 232, .18);
  border-top-color: var(--aq-blue);
  animation: aqSpin .85s linear infinite;
}

.anime-quiz:not(.is-loading) .aq-loader {
  display: none;
}

@keyframes aqSpin {
  to { transform: rotate(360deg); }
}

.aq-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 26px;
  margin-bottom: 20px;
  color: var(--aq-muted);
  font-size: 13px;
  font-weight: 800;
}

.aq-round-counter {
  color: var(--aq-text);
}

.aq-mistake-text {
  text-transform: uppercase;
  letter-spacing: .06em;
}

.aq-mistake-dots {
  display: inline-flex;
  gap: 6px;
}

.aq-mistake-dots i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--aq-line);
}

.aq-mistake-dots i.is-lost {
  background: var(--aq-red);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .12);
}

.aq-dots em {
  color: var(--aq-muted);
  font-style: normal;
}

.aq-result {
  min-height: 26px;
  margin-bottom: 12px;
  text-align: center;
  font-weight: 800;
}

.aq-result.is-success { color: var(--aq-green); }
.aq-result.is-error { color: var(--aq-red); }

.aq-options {
  display: grid;
  gap: 14px;
}

.aq-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid var(--aq-line);
  background: var(--aq-card);
  color: var(--aq-text);
  text-align: left;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.aq-option::before {
  content: "";
  width: 22px;
  height: 22px;
  margin-right: 12px;
  border-radius: 4px;
  border: 2px solid var(--aq-line);
  background: var(--aq-card);
}

.aq-option:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 140, 232, .55);
}

.aq-option.is-correct {
  border-color: rgba(34, 197, 94, .65);
  background: rgba(34, 197, 94, .1);
}

.aq-option.is-wrong {
  border-color: rgba(239, 68, 68, .65);
  background: rgba(239, 68, 68, .09);
}

.aq-restart {
  display: flex;
  margin: 18px auto 0;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--aq-accent), var(--aq-accent-2));
  font-weight: 800;
  cursor: pointer;
}

.aq-top {
  margin-top: 42px;
}

.aq-top h2 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 900;
}

.aq-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 48px;
}

.aq-top-user {
  display: grid;
  grid-template-columns: 28px 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  border-bottom: 1px solid var(--aq-line);
}

.aq-rank {
  color: var(--aq-muted);
  font-weight: 700;
}

.aq-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--aq-card-soft);
  text-decoration: none;
}

.aq-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.aq-avatar span {
  color: var(--aq-accent);
  font-weight: 900;
}

.aq-user-info {
  min-width: 0;
}

.aq-user-info a {
  display: block;
  color: var(--aq-text);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aq-user-info span,
.aq-user-score span {
  display: block;
  color: var(--aq-muted);
  font-size: 12px;
}

.aq-user-score {
  text-align: right;
}

.aq-user-score strong {
  display: block;
  color: var(--aq-text);
  font-size: 28px;
  line-height: 1;
}

.aq-empty {
  padding: 28px;
  border-radius: 18px;
  border: 1px dashed var(--aq-line);
  color: var(--aq-muted);
  text-align: center;
  background: var(--aq-card);
}

@media (max-width: 768px) {
  .anime-quiz {
    padding-top: 28px;
  }

  .aq-stage {
    padding: 14px;
    border-radius: 20px;
  }

  .aq-top-grid {
    grid-template-columns: 1fr;
  }

  .aq-option {
    min-height: 54px;
    font-size: 15px;
  }
}
