/* Сцены-анимации к вопросам, счётчик автоперехода и предупреждения (v7.0) */

/* ------------------------------------------------------------- сцена */
.q-anim {
  position: relative;
  height: clamp(160px, 23vw, 246px);
  margin: 0 0 20px;
  border-radius: 22px;
  overflow: hidden;
  isolation: isolate;
  color: #e9f5ff;
  border: 1px solid rgba(255, 255, 255, .10);
  background:
    radial-gradient(120% 130% at 12% 0%, rgba(11, 180, 170, .20), transparent 62%),
    radial-gradient(120% 130% at 92% 110%, rgba(6, 147, 227, .20), transparent 62%),
    linear-gradient(180deg, rgba(9, 22, 46, .52), rgba(6, 14, 30, .30));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 12px 30px rgba(0, 0, 0, .22);
}

.q-anim::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 34%, rgba(255, 255, 255, .10) 47%, transparent 60%);
  transform: translateX(-70%);
  animation: aqshine 8s ease-in-out infinite;
}

[data-theme="light"] .q-anim {
  color: #12374f;
  border-color: rgba(13, 42, 68, .09);
  background:
    radial-gradient(120% 130% at 12% 0%, rgba(11, 180, 170, .14), transparent 62%),
    radial-gradient(120% 130% at 92% 110%, rgba(6, 147, 227, .12), transparent 62%),
    linear-gradient(180deg, #f7fcff, #eef7ff);
  box-shadow: inset 0 1px 0 #fff, 0 12px 30px rgba(13, 42, 68, .10);
}

[data-theme="light"] .q-anim::after {
  background: linear-gradient(105deg, transparent 34%, rgba(255, 255, 255, .75) 47%, transparent 60%);
}

.q-anim svg { display: block; width: 100%; height: 100%; }
.q-anim.is-flip svg { transform: scaleX(-1); }
.q-anim[class*="anim-in"] svg { animation: aqpop .45s ease-out both; }

.q-anim [class^="an-"],
.q-anim [class*=" an-"] {
  transform-box: fill-box;
  transform-origin: center;
}

@media (max-width: 640px) {
  .q-anim { height: 152px; border-radius: 16px; margin-bottom: 14px; }
}

/* --------------------------------------------------------- анимации */
@keyframes aqpop   { 0% { transform: scale(.94); opacity: .3; } 100% { transform: scale(1); opacity: 1; } }
@keyframes aqbob   { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
@keyframes aqfloat { 0%, 100% { transform: translateY(-6px) rotate(-.7deg); } 50% { transform: translateY(6px) rotate(.7deg); } }
@keyframes aqswing { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(6deg); } }
@keyframes aqdash  { to { stroke-dashoffset: -44; } }
@keyframes aqfade  { 0%, 100% { opacity: .32; } 50% { opacity: 1; } }
@keyframes aqpulse { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.16); opacity: 1; } }
@keyframes aqswim  { 0% { transform: translate(-20px, 3px); } 50% { transform: translate(8px, -5px); } 100% { transform: translate(-20px, 3px); } }
@keyframes aqrise  { 0% { transform: translateY(2px); opacity: 0; } 30% { opacity: .85; } 100% { transform: translateY(-34px); opacity: 0; } }
@keyframes aqwave  { 0%, 100% { opacity: .22; transform: scale(.84); } 50% { opacity: .95; transform: scale(1); } }
@keyframes aqblink { 0%, 45% { opacity: 1; } 55%, 100% { opacity: .22; } }
@keyframes aqcoin  { 0% { transform: translateY(-30px) rotate(0deg); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(30px) rotate(200deg); opacity: 0; } }
@keyframes aqscan  { 0%, 100% { transform: translateY(-30px); } 50% { transform: translateY(30px); } }
@keyframes aqlift  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes aqspin  { to { transform: rotate(360deg); } }
@keyframes aqbug   { 0% { transform: translate(0, 0); } 25% { transform: translate(12px, -5px); } 50% { transform: translate(26px, 3px); } 75% { transform: translate(13px, 7px); } 100% { transform: translate(0, 0); } }
@keyframes aqheart { 0% { transform: translateY(6px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(-24px); opacity: 0; } }
@keyframes aqshake { 0%, 100% { transform: rotate(0deg); } 20% { transform: rotate(-7deg); } 40% { transform: rotate(7deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(5deg); } }
@keyframes aqtyping{ 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

@keyframes aqshine { 0%, 62% { transform: translateX(-70%); opacity: 0; } 72% { opacity: 1; } 100% { transform: translateX(70%); opacity: 0; } }
@keyframes aqdrift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(0, -4px); } }
@keyframes aqpopin { 0% { transform: scale(.86); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.an-bob   { animation: aqbob 3.4s ease-in-out infinite; }
.an-float { animation: aqfloat 4.6s ease-in-out infinite; }
.an-swing { animation: aqswing 3.8s ease-in-out infinite; }
.an-dash  { animation: aqdash 1.6s linear infinite; }
.an-fade  { animation: aqfade 3s ease-in-out infinite; }
.an-pulse { animation: aqpulse 2s ease-in-out infinite; }
.an-swim  { animation: aqswim 5.5s ease-in-out infinite; }
.an-rise  { animation: aqrise 3.6s ease-out infinite; }
.an-wave  { animation: aqwave 2.2s ease-in-out infinite; }
.an-blink { animation: aqblink 1.8s steps(1, end) infinite; }
.an-coin  { animation: aqcoin 3.2s ease-in infinite; }
.an-scan  { animation: aqscan 2.4s ease-in-out infinite; }
.an-lift  { animation: aqlift 2.6s ease-in-out infinite; }
.an-spin  { animation: aqspin 7s linear infinite; }
.an-bug   { animation: aqbug 4.4s ease-in-out infinite; }
.an-heart { animation: aqheart 3s ease-out infinite; }
.an-shake { animation: aqshake 1.6s ease-in-out infinite; }
.an-typing{ animation: aqtyping 1.2s ease-in-out infinite; }
.an-pop { animation: aqpopin .7s cubic-bezier(.2, .8, .2, 1) both; }
.an-drift { animation: aqdrift 9s ease-in-out infinite; }

/* ----------------------------------------------- кнопка ответа и автопереход */
.q-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 22px;
}

/* кнопка «Ответить» / «Далее» — во всю ширину карточки */
.q-actions > .btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 16px;
}

.autonext {
  position: relative;
  display: none;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 13px 16px 17px;
  border-radius: 14px;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.3;
  cursor: pointer;
  border: 1px solid rgba(11, 180, 170, .38);
  background: linear-gradient(90deg, rgba(11, 180, 170, .14), rgba(6, 147, 227, .14));
  color: #d9f6ff;
  animation: aqin .26s ease both;
}

.autonext.on { display: flex; }
.autonext[hidden] { display: none; }

@keyframes aqin { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.autonext .an-count {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: #04121f;
  background: linear-gradient(135deg, #0bb4aa, #0693e3);
  animation: aqring 1s ease-out infinite;
}

@keyframes aqring {
  0% { box-shadow: 0 0 0 0 rgba(11, 180, 170, .55); }
  70% { box-shadow: 0 0 0 11px rgba(11, 180, 170, 0); }
  100% { box-shadow: 0 0 0 0 rgba(11, 180, 170, 0); }
}

.autonext .an-label { font-weight: 600; }
.autonext .an-skip { margin-left: auto; font-size: 12px; opacity: .55; white-space: nowrap; }

.autonext .an-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, .14);
}

.autonext .an-progress i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 0 99px 99px 0;
  background: linear-gradient(90deg, #0bb4aa, #0693e3);
  box-shadow: 0 0 12px rgba(11, 180, 170, .65);
}

[data-theme="light"] .autonext {
  color: #0c3550;
  border-color: rgba(6, 147, 227, .32);
  background: linear-gradient(90deg, #e6fbf8, #e8f4ff);
}

[data-theme="light"] .autonext .an-progress { background: rgba(13, 42, 68, .10); }

@media (max-width: 560px) {
  .autonext { padding: 11px 13px 16px; font-size: 12.5px; }
  .autonext .an-skip { display: none; }
}

/* ------------------------------------------------------- предупреждения */
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  padding: 13px 15px;
  margin: 0 0 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
}

.notice-ico { font-size: 17px; line-height: 1.1; flex: 0 0 auto; }
.notice b { font-weight: 800; }

.notice-warn { color: #ffe6b8; background: rgba(255, 176, 32, .12); border: 1px solid rgba(255, 176, 32, .38); }
.notice-ok   { color: #c8ffe2; background: rgba(28, 200, 120, .13); border: 1px solid rgba(28, 200, 120, .40); }

[data-theme="light"] .notice-warn { color: #6b4a12; background: #fff6e3; border-color: #f0c88a; }
[data-theme="light"] .notice-ok   { color: #14512f; background: #e9fbf1; border-color: #9fe0bb; }

@media (prefers-reduced-motion: reduce) {
  .q-anim [class^="an-"],
  .q-anim [class*=" an-"],
  .q-anim svg,
  .q-anim::after,
  .autonext,
  .autonext .an-count { animation: none !important; }
}
