/* ================= HACKER / TERMINAL STYLE ================= */
:root {
  --bg: #010409;
  --panel: rgba(0, 24, 11, .8);
  --panel-strong: rgba(0, 36, 16, .92);
  --border: rgba(0, 255, 65, .25);
  --border-strong: rgba(0, 255, 65, .65);
  --green: #00ff41;
  --green-soft: #9dffc0;
  --text: #c8ffd8;
  --muted: #4f9e6d;
  --bad: #ff3b3b;
  --bad-soft: #ff9c9c;
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, 'Courier New', monospace;

  /* тайминги плавности — единые для всего сайта */
  --t-fast: .55s;
  --t-med: .95s;
  --t-slow: 1.6s;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; color-scheme: dark; }
body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---- matrix rain canvas ---- */
.matrix-canvas { position: fixed; inset: 0; z-index: 0; opacity: .13; pointer-events: none; }

/* ---- CRT scanlines ---- */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 255, 65, .03) 0 1px, transparent 1px 3px);
  animation: flicker 6s steps(60) infinite;
}
@keyframes flicker { 0%, 97% { opacity: 1; } 98% { opacity: .85; } 100% { opacity: 1; } }

::selection { background: rgba(0, 255, 65, .35); color: #eafff0; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #020805; }
::-webkit-scrollbar-thumb { background: #0a5c2b; transition: background var(--t-med) ease; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* ================= ПЛАВНЫЕ ПЕРЕХОДЫ МЕЖДУ СТРАНИЦАМИ ================= */
.page-exit-overlay {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(0, 255, 65, .12), rgba(1, 4, 9, .97) 68%);
  opacity: 0;
  transition: opacity 1.25s var(--ease-soft);
}
body.page-exit .page-exit-overlay { opacity: 1; }
body.page-exit .container { opacity: .0; transform: translateY(26px) scale(.975); transition: all 1.15s var(--ease-soft); }
body.page-exit .nav { opacity: .25; transform: translateY(-14px); transition: opacity .9s ease, transform .9s var(--ease-soft); }

/* появление содержимого страницы */
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.container > * { animation: riseIn var(--t-slow) var(--ease) both; }
.container > *:nth-child(2) { animation-delay: .22s; }
.container > *:nth-child(3) { animation-delay: .44s; }
.container > *:nth-child(4) { animation-delay: .66s; }

/* появление блоков при прокрутке (классы ставит main.js) */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 1.7s var(--ease), transform 1.7s var(--ease); will-change: opacity, transform; }
.reveal.shown { opacity: 1; transform: none; }

/* ---- layout ---- */
.container { position: relative; z-index: 2; max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; transition: opacity 1.15s var(--ease-soft), transform 1.15s var(--ease-soft); }
.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 0 20px rgba(0, 255, 65, .08), inset 0 0 30px rgba(0, 255, 65, .03);
  backdrop-filter: blur(2px);
  transition: border-color var(--t-med) var(--ease-soft),
              box-shadow var(--t-med) var(--ease-soft),
              background var(--t-med) var(--ease-soft),
              transform var(--t-med) var(--ease);
}
.glass:hover { border-color: rgba(0, 255, 65, .38); box-shadow: 0 0 26px rgba(0, 255, 65, .14), inset 0 0 30px rgba(0, 255, 65, .04); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
code {
  background: rgba(0, 255, 65, .08); border: 1px solid var(--border); color: var(--green-soft);
  padding: 2px 7px; border-radius: 3px; font-size: .85em; word-break: break-all;
  transition: border-color var(--t-fast) ease;
}

/* ---- nav (только строчка >_ для красоты) ---- */
.nav {
  position: sticky; top: 14px; z-index: 50;
  max-width: 1080px; margin: 18px auto 0; padding: 12px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  animation: riseIn var(--t-slow) var(--ease) both;
}
.brand {
  color: var(--green); font-size: 1.3rem; font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 255, 65, .7); letter-spacing: 2px;
  animation: brandGlow 4.6s ease-in-out infinite;
}
.brand::after { content: '▌'; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes brandGlow {
  0%, 100% { text-shadow: 0 0 10px rgba(0, 255, 65, .45); }
  50% { text-shadow: 0 0 20px rgba(0, 255, 65, .95), 0 0 34px rgba(0, 255, 65, .35); }
}

/* ---- buttons ---- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(0, 255, 65, .05); color: var(--green);
  border: 1px solid var(--border-strong); border-radius: 4px;
  padding: 11px 20px; font-size: .85rem; font-weight: 700; cursor: pointer;
  text-decoration: none; font-family: inherit;
  text-transform: uppercase; letter-spacing: 1.5px;
  transition: background var(--t-med) var(--ease-soft), color var(--t-med) var(--ease-soft),
              border-color var(--t-med) var(--ease-soft), box-shadow var(--t-med) var(--ease-soft),
              transform var(--t-fast) var(--ease), filter var(--t-med) ease;
}
.btn::after {
  content: ''; position: absolute; top: 0; left: -130%; width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(0, 255, 65, .3), transparent);
  transform: skewX(-18deg); transition: left 1.4s var(--ease-soft); pointer-events: none;
}
.btn:hover::after { left: 135%; }
.btn:hover {
  background: rgba(0, 255, 65, .12);
  box-shadow: 0 0 18px rgba(0, 255, 65, .35);
  text-shadow: 0 0 8px rgba(0, 255, 65, .7);
  transform: translateY(-2px);
}
.btn:active { transform: translateY(0) scale(.975); transition-duration: .08s; }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.btn:disabled::after { display: none; }
.btn-primary { background: rgba(0, 255, 65, .16); color: #e6ffef; box-shadow: 0 0 14px rgba(0, 255, 65, .25); }
.btn-primary:hover { background: rgba(0, 255, 65, .3); box-shadow: 0 0 26px rgba(0, 255, 65, .5); }
.btn-danger { background: rgba(255, 59, 59, .07); border-color: rgba(255, 59, 59, .6); color: var(--bad-soft); }
.btn-danger::after { background: linear-gradient(100deg, transparent, rgba(255, 80, 80, .32), transparent); }
.btn-danger:hover { background: rgba(255, 59, 59, .18); box-shadow: 0 0 18px rgba(255, 59, 59, .4); text-shadow: none; }
.btn-big { padding: 14px 30px; font-size: .95rem; }
.btn-small { padding: 6px 12px; font-size: .75rem; }
.btn-block { width: 100%; }
.btn-glow { animation: pulse 3.6s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 65, .25); }
  50% { box-shadow: 0 0 28px rgba(0, 255, 65, .55); }
}

/* ---- badges & flashes ---- */
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 3px; font-size: .75rem; font-weight: 700;
  background: rgba(0, 255, 65, .08); border: 1px solid var(--border); color: var(--green-soft);
  text-transform: uppercase; letter-spacing: 1px; white-space: nowrap;
  transition: background var(--t-med) ease, box-shadow var(--t-med) ease;
}
.badge:hover { background: rgba(0, 255, 65, .16); box-shadow: 0 0 12px rgba(0, 255, 65, .3); }
.flashes { margin-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 12px 18px; border-radius: 4px; font-weight: 700; font-size: .9rem;
  animation: flashIn 1.25s var(--ease) both;
  transition: opacity 1.3s ease, transform 1.3s var(--ease);
  border: 1px solid;
}
.flash-ok { background: rgba(0, 255, 65, .08); border-color: rgba(0, 255, 65, .55); color: var(--green-soft); }
.flash-error { background: rgba(255, 59, 59, .08); border-color: rgba(255, 59, 59, .55); color: var(--bad-soft); }
.flash.fade-out { opacity: 0; transform: translateY(-10px) scale(.98); }
@keyframes flashIn { from { transform: translateY(-14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- формы: все поля чёрные и крупные ---- */
.field {
  display: flex; flex-direction: column; gap: 8px; font-size: .8rem; color: var(--muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.field > span { transition: color var(--t-med) ease, text-shadow var(--t-med) ease; }
.field:focus-within > span { color: var(--green); text-shadow: 0 0 10px rgba(0, 255, 65, .5); }
input, textarea, select {
  background: #020a05;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--green-soft);
  padding: 15px 18px;
  font-size: 1.05rem;
  font-family: inherit;
  transition: border-color var(--t-med) var(--ease-soft), box-shadow var(--t-med) var(--ease-soft),
              background var(--t-med) ease, transform var(--t-fast) var(--ease);
  width: 100%;
}
input[type="checkbox"], input[type="radio"] {
  width: 18px; height: 18px; padding: 0;
  background: none; border: none;
  accent-color: var(--green); flex-shrink: 0; cursor: pointer;
  transition: transform var(--t-fast) var(--ease);
}
input[type="checkbox"]:hover, input[type="radio"]:hover { transform: scale(1.15); }
input[type="checkbox"]:active, input[type="radio"]:active { transform: scale(.92); }
input[type="file"] {
  padding: 12px;
  background: rgba(0, 255, 65, .04);
  color: var(--muted);
  font-size: .9rem;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 14px rgba(0, 255, 65, .35);
  background: #03120a;
}
input::placeholder, textarea::placeholder { color: rgba(79, 158, 109, .6); transition: opacity var(--t-med) ease; }
input:focus::placeholder, textarea:focus::placeholder { opacity: .45; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 8px; transition: color var(--t-med) ease; }
.check {
  display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer;
  color: var(--text); font-size: .9rem;
  transition: color var(--t-med) ease;
}
.check:hover { color: var(--green); }
.check input { width: 18px; height: 18px; accent-color: var(--green); }

/* ---- hero (главная) ---- */
.hero { padding: 46px 40px; text-align: center; margin-top: 26px; position: relative; overflow: hidden; }
.hero::before {
  content: '// system access';
  position: absolute; top: 10px; left: 14px;
  font-size: .72rem; color: var(--muted); letter-spacing: 2px; text-transform: uppercase;
}
.hero::after {
  content: ''; position: absolute; top: 0; left: -40%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(0, 255, 65, .07), transparent);
  transform: skewX(-14deg); animation: heroSheen 10s ease-in-out infinite;
  pointer-events: none;
}
@keyframes heroSheen {
  0%, 65% { left: -40%; }
  100% { left: 130%; }
}
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 3px; font-size: .72rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  background: rgba(0, 255, 65, .07); border: 1px solid var(--border); color: var(--green);
  margin-bottom: 18px; box-shadow: 0 0 12px rgba(0, 255, 65, .15);
  animation: riseIn 1.6s .32s var(--ease) both, badgePulse 5s 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 12px rgba(0, 255, 65, .15); }
  50% { box-shadow: 0 0 22px rgba(0, 255, 65, .45); }
}
.hero-title {
  font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; letter-spacing: 1px; margin-bottom: 12px;
  color: var(--green); text-transform: uppercase;
  text-shadow: 0 0 6px rgba(0, 255, 65, .9), 0 0 28px rgba(0, 255, 65, .45),
               2px 0 0 rgba(255, 0, 80, .35), -2px 0 0 rgba(0, 200, 255, .35);
  animation: riseIn 1.8s .5s var(--ease) both, glitch 5.5s 2.6s steps(1) infinite;
}
@keyframes glitch {
  0%, 92%, 100% { transform: none; }
  93% { transform: translate(-2px, 1px); }
  94% { transform: translate(2px, -1px); }
  95% { transform: translate(-1px, 0); }
  96% { transform: none; }
}
.hero-sub { color: var(--muted); max-width: 640px; margin: 0 auto 28px; font-size: .95rem; animation: riseIn 1.8s .8s var(--ease) both; }
.form-card { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; text-align: left; animation: riseIn 1.8s 1.05s var(--ease) both; }
.form-card input { padding: 17px 20px; font-size: 1.1rem; }
.form-card input:hover { border-color: rgba(0, 255, 65, .45); }

/* логотип ЛПК на главной */
.hero-logo {
  display: block;
  width: min(240px, 52vw);
  height: auto;
  margin: 4px auto 14px;
  filter: drop-shadow(0 0 24px rgba(0, 255, 65, .35));
  animation: logoIn 2s var(--ease) both, floaty 9s 2s ease-in-out infinite;
  transition: filter var(--t-slow) var(--ease-soft), transform var(--t-slow) var(--ease);
}
.hero-logo:hover { filter: drop-shadow(0 0 40px rgba(0, 255, 65, .75)); transform: scale(1.03); }
@keyframes logoIn { from { opacity: 0; transform: translateY(-14px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.hero .hero-title { font-size: clamp(1.5rem, 4vw, 2.4rem); }

/* ---- login (в едином стиле с главной) ---- */
.login-wrap { display: flex; justify-content: center; margin-top: 60px; }
.login-card {
  position: relative;
  padding: 46px 40px; width: 100%; max-width: 560px;
  display: flex; flex-direction: column; gap: 18px; text-align: center;
}
.login-corner {
  position: absolute; top: 10px; left: 14px;
  font-size: .72rem; color: var(--muted); letter-spacing: 2px; text-transform: uppercase;
}
.login-ico { font-size: 2.6rem; filter: drop-shadow(0 0 12px rgba(0, 255, 65, .7)); margin-top: 6px; animation: riseIn 1.6s .18s var(--ease) both; }
.login-title {
  font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800; letter-spacing: 1px;
  color: var(--green); text-transform: uppercase;
  text-shadow: 0 0 6px rgba(0, 255, 65, .9), 0 0 24px rgba(0, 255, 65, .4),
               2px 0 0 rgba(255, 0, 80, .3), -2px 0 0 rgba(0, 200, 255, .3);
  animation: riseIn 1.6s .4s var(--ease) both;
}
.login-card .field { text-align: left; }

/* ---- test ---- */
.test-head { margin: 26px 0 0; text-align: center; }
.test-title {
  color: var(--green); text-transform: uppercase; letter-spacing: 2px;
  text-shadow: 0 0 14px rgba(0, 255, 65, .55); font-size: 1.7rem;
  animation: riseIn .9s var(--ease) both;
}
.test-desc { color: var(--muted); margin-top: 6px; font-size: .9rem; }
.quiz-top { padding: 14px 20px; margin: 18px 0; }
.quiz-progress {
  height: 10px; border-radius: 2px; background: #020a05;
  border: 1px solid var(--border); overflow: hidden;
}
.quiz-progress-fill {
  position: relative; overflow: hidden;
  height: 100%; width: 0;
  background: linear-gradient(90deg, #005c26, var(--green));
  box-shadow: 0 0 12px rgba(0, 255, 65, .8);
  transition: width 1.7s var(--ease);
}
.quiz-progress-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: translateX(-100%);
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.quiz-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.quiz-counter { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.quiz-timer { font-size: .85rem; font-weight: 700; color: var(--green); letter-spacing: 1px; transition: color var(--t-med) ease; }
.quiz-timer.low { color: var(--bad); text-shadow: 0 0 10px rgba(255, 59, 59, .7); animation: blink .5s steps(1) infinite; }

/* карточка вопроса: ДВУХФАЗНАЯ плавная смена (старый уходит → новый приезжает) */
.question-card { padding: 34px; min-height: 260px; position: relative; overflow: hidden; }
.q-body { will-change: opacity, transform; }
.q-body.slide-out-next, .q-body.slide-out-prev {
  transition: opacity .9s var(--ease-soft), transform .9s var(--ease-soft), filter .9s linear;
  filter: blur(3.5px); pointer-events: none;
}
.q-body.slide-out-next { opacity: 0; transform: translateX(-95px) scale(.95); }
.q-body.slide-out-prev { opacity: 0; transform: translateX(95px) scale(.95); }
@keyframes qBodyNext { from { opacity: 0; transform: translateX(110px) scale(.955); filter: blur(4px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes qBodyPrev { from { opacity: 0; transform: translateX(-110px) scale(.955); filter: blur(4px); } to { opacity: 1; transform: none; filter: blur(0); } }
.q-body.slide-in-next { animation: qBodyNext 1.65s var(--ease) both; }
.q-body.slide-in-prev { animation: qBodyPrev 1.65s var(--ease) both; }

/* сканирующая полоса, пробегающая по карточке при смене вопроса */
.question-card.wiping::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -45%; width: 38%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 65, .16), transparent);
  animation: wipeAcross 1.9s var(--ease-soft) both; pointer-events: none;
}
@keyframes wipeAcross { to { left: 118%; } }
.q-text { font-size: 1.25rem; font-weight: 700; margin-bottom: 22px; animation: riseIn 1.25s .25s var(--ease) both; }
.q-text::before { content: '> '; color: var(--green); }
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px; cursor: pointer;
  background: rgba(0, 20, 10, .55); border: 1px solid var(--border); border-radius: 4px;
  font-size: .95rem;
  animation: riseIn 1.15s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 240ms + 420ms);
  transition: border-color var(--t-med) var(--ease-soft), background var(--t-med) var(--ease-soft),
              box-shadow var(--t-med) var(--ease-soft), transform var(--t-fast) var(--ease);
}
.option:hover { border-color: var(--border-strong); background: rgba(0, 255, 65, .05); transform: translateX(5px); }
.option:active { transform: translateX(5px) scale(.99); }
.option input { display: none; }
.option-dot {
  width: 18px; height: 18px; border-radius: 2px; flex-shrink: 0;
  border: 1px solid var(--muted); position: relative;
  transition: border-color var(--t-med) var(--ease-soft), box-shadow var(--t-med) ease, background var(--t-med) ease;
}
.option.checked {
  border-color: var(--green); background: rgba(0, 255, 65, .09);
  box-shadow: 0 0 14px rgba(0, 255, 65, .25);
}
.option.checked .option-dot { border-color: var(--green); box-shadow: 0 0 8px rgba(0, 255, 65, .6); }
.option.checked .option-dot::after {
  content: ''; position: absolute; inset: 3px; background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: dotPop .85s var(--ease) both;
}
@keyframes dotPop { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
.text-answer { font-size: 1.05rem; animation: riseIn 1.15s .55s var(--ease) both; }
.q-points-hint { margin-top: 18px; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; animation: riseIn 1.25s .95s var(--ease) both; }
.quiz-nav { display: flex; justify-content: space-between; margin-top: 18px; }

/* ---- интерактивный вопрос внутри теста (сопоставление) ---- */
.q-match { display: flex; flex-direction: column; gap: 14px; }
.q-match .chip-pool {
  min-height: 70px; padding: 14px;
  display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px; align-items: flex-start;
  border-style: dashed; border-radius: 6px;
  transition: border-color var(--t-med) var(--ease-soft), background var(--t-med) var(--ease-soft),
              box-shadow var(--t-med) var(--ease-soft);
}
.q-match .chip-pool.drag-over {
  border-color: var(--green); background: rgba(0, 255, 65, .07);
  box-shadow: 0 0 20px rgba(0, 255, 65, .25);
}
.q-match .targets { display: flex; flex-direction: column; gap: 10px; }
.q-match .target { min-height: 56px; padding: 12px 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: grab;
  background: rgba(0, 255, 65, .07); border: 1px solid var(--border-strong); border-radius: 4px;
  font-weight: 700; user-select: none; color: var(--green-soft); font-size: .92rem;
  width: fit-content; max-width: 100%;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease-soft),
              opacity var(--t-med) ease, background var(--t-med) ease;
}
.chip:hover { transform: translateY(-2px); box-shadow: 0 0 16px rgba(0, 255, 65, .4); }
.chip:active { cursor: grabbing; }
.chip.dragging { opacity: .4; transform: scale(.97); }
.chip.drop-in { animation: chipDrop 1.2s var(--ease) both; }
@keyframes chipDrop {
  0% { transform: scale(.86) translateY(-8px); opacity: .55; box-shadow: 0 0 0 rgba(0, 255, 65, 0); }
  60% { transform: scale(1.04); box-shadow: 0 0 22px rgba(0, 255, 65, .55); }
  100% { transform: none; opacity: 1; }
}
.chip.selected {
  outline: 1px solid var(--green);
  box-shadow: 0 0 0 3px rgba(0, 255, 65, .2), 0 0 16px rgba(0, 255, 65, .4);
  animation: chipPulse 3.4s ease-in-out infinite;
}
@keyframes chipPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(0, 255, 65, .18), 0 0 14px rgba(0, 255, 65, .35); }
  50% { box-shadow: 0 0 0 5px rgba(0, 255, 65, .28), 0 0 24px rgba(0, 255, 65, .6); }
}
.chip-grip { opacity: .6; font-size: .85rem; color: var(--green); transition: opacity var(--t-fast) ease; }
.chip:hover .chip-grip { opacity: 1; }
.target {
  padding: 16px 18px; min-height: 74px;
  display: flex; flex-direction: column; gap: 10px;
  border: 1px dashed var(--border); border-radius: 6px;
  animation: riseIn 1.15s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 260ms + 520ms);
  transition: border-color var(--t-med) var(--ease-soft), background var(--t-med) var(--ease-soft),
              box-shadow var(--t-med) var(--ease-soft), transform var(--t-med) var(--ease);
}
.target-label { font-weight: 700; font-size: .95rem; }
.target-label::before { content: '▸ '; color: var(--green); }
.target.drag-over {
  border-color: var(--green); background: rgba(0, 255, 65, .1);
  box-shadow: 0 0 24px rgba(0, 255, 65, .35); transform: scale(1.02);
}
.target.filled { border-style: solid; border-color: var(--border-strong); }
.target .chip { width: 100%; }

/* ---- result ---- */
.result-wrap { margin-top: 26px; }
.result-card { padding: 44px 40px; text-align: center; max-width: 760px; margin: 0 auto; }
.result-card.pop { animation: pop 1.7s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result-emoji { font-size: 3.6rem; margin-bottom: 8px; filter: drop-shadow(0 0 14px rgba(0, 255, 65, .6)); animation: emojiPop 1.9s .4s var(--ease) both; }
@keyframes emojiPop {
  0% { opacity: 0; transform: scale(.4) rotate(-14deg); }
  60% { opacity: 1; transform: scale(1.14) rotate(5deg); }
  100% { transform: none; }
}
.result-card h2 { color: var(--green); text-transform: uppercase; letter-spacing: 1px; }
.result-score {
  font-size: 2.2rem; font-weight: 800; margin: 10px 0 4px;
  color: var(--green); text-shadow: 0 0 18px rgba(0, 255, 65, .6);
  animation: scoreGlow 5.5s ease-in-out infinite;
  transition: text-shadow var(--t-slow) ease;
}
@keyframes scoreGlow {
  0%, 100% { text-shadow: 0 0 14px rgba(0, 255, 65, .45); }
  50% { text-shadow: 0 0 30px rgba(0, 255, 65, .9), 0 0 48px rgba(0, 255, 65, .3); }
}
.review-title {
  margin: 26px 0 12px; text-align: left; color: var(--green);
  text-transform: uppercase; letter-spacing: 1px; font-size: 1rem;
}
.result-review {
  display: flex; flex-direction: column; gap: 10px; text-align: left;
  max-height: 380px; overflow-y: auto; padding-right: 6px;
}
.review-item {
  padding: 12px 16px; border-radius: 4px; border-left: 3px solid var(--muted);
  background: rgba(0, 15, 7, .6); font-size: .9rem;
  animation: riseIn 1.15s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 140ms);
  transition: transform var(--t-med) var(--ease), background var(--t-med) ease, border-color var(--t-med) ease;
}
.review-item:hover { transform: translateX(4px); background: rgba(0, 25, 12, .7); }
.review-item.ok { border-left-color: var(--green); }
.review-item.bad { border-left-color: var(--bad); }
.review-q { font-weight: 700; margin-bottom: 4px; }
.review-a { color: var(--muted); }
.review-a b { color: var(--text); }
.review-a .correct { color: var(--green); }
.result-actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; animation: riseIn 1.5s 1.05s var(--ease) both; }

/* ---- admin ---- */
.admin-layout { display: grid; grid-template-columns: 230px 1fr; gap: 22px; margin-top: 26px; align-items: start; }
.admin-side { padding: 18px; display: flex; flex-direction: column; gap: 8px; position: sticky; top: 90px; }
.admin-user {
  font-weight: 700; padding: 8px 10px 16px; border-bottom: 1px solid var(--border);
  margin-bottom: 8px; word-break: break-all; color: var(--green);
}
.tab-btn {
  background: transparent; border: 1px solid transparent; color: var(--muted); text-align: left;
  padding: 11px 14px; border-radius: 4px; font-size: .85rem; font-weight: 700; cursor: pointer;
  font-family: inherit;
  transition: color var(--t-med) var(--ease-soft), background var(--t-med) var(--ease-soft),
              border-color var(--t-med) var(--ease-soft), box-shadow var(--t-med) var(--ease-soft),
              transform var(--t-fast) var(--ease), text-shadow var(--t-med) ease;
}
.tab-btn:hover { color: var(--green); background: rgba(0, 255, 65, .06); transform: translateX(4px); }
.tab-btn:active { transform: translateX(4px) scale(.985); }
.tab-btn.active {
  background: rgba(0, 255, 65, .14); color: var(--green); border-color: var(--border-strong);
  box-shadow: 0 0 14px rgba(0, 255, 65, .25); text-shadow: 0 0 8px rgba(0, 255, 65, .6);
}
.admin-content h2 {
  margin: 6px 0 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  color: var(--green); text-transform: uppercase; letter-spacing: 1px; font-size: 1.2rem;
}
@keyframes paneIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: paneIn 1.15s var(--ease) both; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  padding: 20px; text-align: center;
  animation: riseIn 1.25s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 230ms);
}
.stat-card:hover { transform: translateY(-3px); }
.stat-val { font-size: 1.8rem; font-weight: 800; color: var(--green); text-shadow: 0 0 14px rgba(0, 255, 65, .6); }
.stat-label { color: var(--muted); font-size: .75rem; margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }
.chart-card { padding: 22px; margin-bottom: 18px; }
.chart-card:hover { transform: translateY(-2px); }
.chart-card h3 { margin-bottom: 14px; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 2px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row {
  display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; font-size: .85rem;
  animation: riseIn 1.15s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 165ms);
}
.bar-label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--t-med) ease; }
.bar-row:hover .bar-label { color: var(--green); }
.bar { height: 10px; border-radius: 2px; background: #020a05; border: 1px solid var(--border); overflow: hidden; }
.bar-fill {
  height: 100%; min-width: 4px;
  background: linear-gradient(90deg, #005c26, var(--green));
  box-shadow: 0 0 10px rgba(0, 255, 65, .7);
  animation: growBar 2.3s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 165ms + 300ms);
  transition: box-shadow var(--t-med) ease, filter var(--t-med) ease;
}
.bar-row:hover .bar-fill { box-shadow: 0 0 18px rgba(0, 255, 65, 1); filter: brightness(1.2); }
@keyframes growBar { from { width: 0 !important; } }
.bar-val { text-align: right; font-weight: 700; font-size: .8rem; color: var(--green-soft); }

.table-wrap { padding: 10px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th {
  text-align: left; color: var(--green); font-size: .7rem; text-transform: uppercase; letter-spacing: 1.5px;
  padding: 12px; border-bottom: 1px solid var(--border-strong);
}
.table td { padding: 12px; border-bottom: 1px solid rgba(0, 255, 65, .1); vertical-align: middle; transition: background var(--t-med) ease; }
.table tbody tr { animation: riseIn .65s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms); transition: background var(--t-med) ease, transform var(--t-med) var(--ease); }
.table tbody tr:hover { background: rgba(0, 255, 65, .05); }
.table tbody tr:hover td { border-bottom-color: rgba(0, 255, 65, .28); }
.row-actions { display: flex; gap: 6px; }
.row-actions form { display: inline; }

.q-item { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.q-card { padding: 22px; }
.q-card.q-new { border-color: rgba(0, 255, 65, .55); }
.q-card.q-import { border-color: rgba(0, 224, 255, .45); margin-top: 22px; }
.q-card h3 { color: var(--green); margin-bottom: 12px; font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; }
.q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.q-num { font-weight: 800; font-size: 1rem; color: var(--green); text-transform: uppercase; letter-spacing: 1px; }
.q-id { color: var(--muted); font-size: .75rem; }
.q-row { display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.q-type, .q-points {
  display: flex; flex-direction: column; gap: 6px; color: var(--muted);
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.q-points input { width: 90px; }
.q-text { margin-bottom: 12px; resize: vertical; }
.opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.opt-row {
  display: flex; align-items: center; gap: 10px;
}
.opt-row input[type="text"] { flex: 1; }
@keyframes rowIn { from { opacity: 0; transform: translateY(-8px); max-height: 0; } to { opacity: 1; transform: none; max-height: 120px; } }
@keyframes rowOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(24px); } }
.opt-row.row-enter, .pair-row.row-enter { animation: rowIn .95s var(--ease) both; overflow: hidden; }
.opt-row.row-leave, .pair-row.row-leave { animation: rowOut .8s ease both; pointer-events: none; overflow: hidden; }
.opt-del {
  background: rgba(255, 59, 59, .08); border: 1px solid rgba(255, 59, 59, .5); color: var(--bad-soft);
  border-radius: 4px; width: 36px; height: 40px; cursor: pointer; font-size: .85rem; flex-shrink: 0;
  transition: background var(--t-med) ease, color var(--t-med) ease, transform var(--t-fast) var(--ease), box-shadow var(--t-med) ease;
}
.opt-del:hover { background: rgba(255, 59, 59, .22); color: #fff; transform: scale(1.06); box-shadow: 0 0 14px rgba(255, 59, 59, .35); }
.opt-del:active { transform: scale(.94); }
.correct-text { margin-top: 4px; }
.q-delete { align-self: flex-end; }

/* плавное переключение блоков типа вопроса (варианты / свободный / пары) */
.swap { transition: opacity .85s var(--ease-soft), transform .85s var(--ease-soft); }
.swap.swap-hidden { opacity: 0; transform: translateY(-8px); }

.pairs-editor { margin: 6px 0 4px; }
.pairs-box { display: flex; flex-direction: column; }
.pair-row { display: grid; grid-template-columns: 1fr 36px 1fr 36px; gap: 10px; align-items: center; margin-bottom: 10px; }
.pair-arrow { text-align: center; color: var(--green); font-weight: 800; text-shadow: 0 0 8px rgba(0, 255, 65, .6); }

.settings-form { padding: 26px; display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.settings-form h3 {
  margin-top: 8px; color: var(--green); font-size: .9rem; text-transform: uppercase;
  letter-spacing: 2px; border-bottom: 1px solid var(--border); padding-bottom: 8px;
  transition: border-color var(--t-med) ease;
}
.settings-form h3:hover { border-bottom-color: var(--border-strong); }
.proxy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 6px; }

.result-detail { padding: 30px; margin-top: 26px; }
.result-detail h2 { color: var(--green); }
.detail-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin: 18px 0 26px;
  background: rgba(0, 15, 7, .6); border: 1px solid var(--border); border-radius: 4px;
  padding: 18px; font-size: .88rem;
}
.detail-meta > div { animation: riseIn 1.25s var(--ease) both; }
.detail-meta .ua-line { grid-column: 1 / -1; }
.review { display: flex; flex-direction: column; gap: 10px; }

/* ---- admin: правка таблицы результатов ---- */
.add-person { margin: 16px 0 18px; padding: 16px 20px; }
.add-person summary {
  cursor: pointer; color: var(--green); font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; font-size: .85rem; list-style: none;
  transition: color var(--t-med) ease, text-shadow var(--t-med) ease;
}
.add-person summary:hover { text-shadow: 0 0 12px rgba(0, 255, 65, .7); }
.add-person summary::-webkit-details-marker { display: none; }
.add-person summary::before { content: '➕ '; }
.add-person[open] summary { margin-bottom: 16px; }
.add-person form { display: flex; flex-direction: column; gap: 14px; max-width: 760px; animation: riseIn 1.25s var(--ease) both; }
.badge-manual { background: rgba(0, 224, 255, .1); border-color: rgba(0, 224, 255, .5); color: #9beaff; margin-left: 6px; }
.edit-form { margin: 0 0 26px; padding: 22px; display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.edit-form h3 {
  color: var(--green); font-size: .9rem; text-transform: uppercase;
  letter-spacing: 2px; border-bottom: 1px solid var(--border); padding-bottom: 8px;
}

/* ---- animations ---- */
.fade-in { animation: riseIn 1.6s var(--ease) both; }

/* ---- прогресс чтения страницы (ставит main.js) ---- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 200;
  background: linear-gradient(90deg, #005c26, var(--green));
  box-shadow: 0 0 12px rgba(0, 255, 65, .8);
  transition: width .45s linear, opacity .9s ease;
  opacity: 0;
}
.scroll-progress.on { opacity: 1; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin-user { border: none; margin: 0; padding: 4px 10px 4px 0; width: 100%; }
  .chart-grid { grid-template-columns: 1fr; }
  .form-grid, .proxy-grid, .detail-meta { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero { padding: 30px 20px; }
  .question-card, .result-card { padding: 24px 18px; }
  .login-card { padding: 34px 20px; }
  .pair-row { grid-template-columns: 1fr 1fr; }
  .pair-arrow { display: none; }
  .bar-row { grid-template-columns: 90px 1fr 36px; }
}

/* ---- уважение к системной настройке «уменьшить движение» ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero-logo { animation: none !important; }
}

/* ================= ПЛАВНОСТЬ: тест → результат, вкладки, уход страницы ================= */
.quiz-wrap { transition: opacity 1.15s var(--ease-soft), transform 1.15s var(--ease-soft); }
.quiz-wrap.quiz-leave { opacity: 0; transform: translateY(-18px) scale(.99); }

.q-text.loading { color: var(--muted); animation: loadingPulse 2s ease-in-out infinite; }
@keyframes loadingPulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }

.quiz-counter.tick { animation: tickIn 1.25s var(--ease) both; }
@keyframes tickIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.tab-pane.pane-leave { display: block; animation: paneOut .7s var(--ease-soft) both; pointer-events: none; }
@keyframes paneOut { to { opacity: 0; transform: translateY(-10px) scale(.995); } }

.page-exit-overlay.sweep::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -30%; width: 26%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 65, .5), transparent);
  animation: exitSweep 1.8s var(--ease-soft) both;
}
@keyframes exitSweep { to { left: 118%; } }

/* плавная смена высоты карточки вопроса (высоты разных вопросов различаются) */
.question-card.morph { transition: height 1.35s var(--ease); }

/* ================= Управление администраторами ================= */
.badge-super {
  background: rgba(255, 208, 70, .12); border-color: rgba(255, 208, 70, .55);
  color: #ffd866; margin-left: 6px;
  box-shadow: 0 0 12px rgba(255, 208, 70, .18);
}
.pw-form { display: flex; gap: 6px; align-items: center; }
.pw-form input {
  width: 150px; padding: 8px 10px; font-size: .9rem;
  transition: width var(--t-med) var(--ease-soft);
}
.pw-form input:focus { width: 190px; }
.admin-user .badge { font-size: .62rem; padding: 2px 8px; vertical-align: middle; }

/* ================= Telegram: найденные Chat ID ================= */
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 2px; }
.chat-chip {
  font-size: .8rem; padding: 9px 14px; cursor: pointer;
  animation: riseIn .5s var(--ease) both;
}
.chat-chip:hover { transform: translateY(-2px); }
.settings-actions .hint { flex-basis: 100%; }

/* ── персонаж в главном меню (static/js/mascot.js) ─────────────────────────── */
.mascot {
  position: absolute; top: 18px; right: 18px; z-index: 3;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .55));
}
@media (max-width: 560px) {
  .mascot { position: static; display: flex; justify-content: center; margin: 2px 0 10px; }
}
