/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #060f06; color: #b8e8b8; font-family: system-ui, -apple-system, sans-serif; }

canvas#cv { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

/* ── Screens ── */
.screen {
  position: fixed; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px; gap: 12px; overflow: hidden;
}
.hidden { display: none !important; }

/* ══════════════════════════════
   INTRO
══════════════════════════════ */
.villain-wrap {
  position: relative;
  display: flex; justify-content: center; align-items: center;
}
.glow-ring {
  position: absolute;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(30,140,30,0.28) 0%, transparent 70%);
  animation: pulse-ring 2.2s ease-in-out infinite;
}
.mosquito-big  { width: 160px; height: 280px; filter: drop-shadow(0 0 18px rgba(40,200,40,0.32)); }
.mosquito-chat { width: 90px;  height: 158px; filter: drop-shadow(0 0 8px rgba(40,200,40,0.22)); }
.mosquito-dead { width: 72px;  height: 126px; filter: grayscale(1) opacity(0.55); }

.intro-content { text-align: center; max-width: 340px; }

.danger-badge {
  font-size: 0.65rem; letter-spacing: 0.18em; color: #ff4444;
  font-weight: 800; text-transform: uppercase; margin-bottom: 4px;
  animation: danger-blink 1.2s step-end infinite;
}
.villain-title {
  font-size: 2.4rem; font-weight: 900; line-height: 1; letter-spacing: 0.04em;
  color: #c8f8c8; text-shadow: 0 0 30px rgba(80,220,80,0.35); margin: 4px 0 6px;
}
.villain-title em {
  color: #ff3333; font-style: normal;
  text-shadow: 0 0 22px rgba(255,50,50,0.55);
}
.villain-sub  { font-size: 0.88rem; color: #6ab86a; margin-bottom: 6px; }
.villain-quote {
  font-size: 0.8rem; color: #4a7a4a; font-style: italic;
  line-height: 1.55; margin-bottom: 18px;
  border-left: 2px solid #1a4a1a; padding-left: 10px; text-align: left;
}

.btn-fight {
  background: linear-gradient(135deg, #cc2000, #ee3800);
  color: #fff; border: none; border-radius: 14px;
  padding: 15px 36px; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; letter-spacing: 0.04em;
  box-shadow: 0 4px 22px rgba(200,40,0,0.45);
  transition: transform .15s, box-shadow .15s;
}
.btn-fight:hover  { transform: translateY(-2px); box-shadow: 0 7px 28px rgba(200,40,0,0.55); }
.btn-fight:active { transform: scale(0.97); }

.trust-row {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px 16px; font-size: 0.73rem; color: #4a7a4a; margin-top: 10px;
}
.avito-card {
  background: #0a1a0a; border: 1px dashed #2a5a2a;
  border-radius: 12px; padding: 10px 16px; text-align: center;
  font-size: 0.79rem; color: #7ab87a; line-height: 1.65;
  max-width: 290px; margin-top: 4px;
}
.avito-card strong { color: #44ff44; }
.avito-card em { color: #5a9a5a; font-style: normal; }
.avito-top {
  display: block; font-weight: 700; color: #ff5555;
  font-size: 0.82rem; margin-bottom: 4px;
}

/* ══════════════════════════════
   CHAT
══════════════════════════════ */
#chat {
  flex-direction: column; align-items: stretch;
  padding: 0; gap: 0; max-width: none; width: 100%; margin: 0;
}

.chat-top {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 14px; flex-shrink: 0;
  background: rgba(4,12,4,0.88); border-bottom: 1px solid #152515;
  z-index: 2;
}
.hp-label  { font-size: 0.55rem; letter-spacing: 0.12em; color: #3a7a3a; font-weight: 700; text-transform: uppercase; }
.hp-track  { width: 80px; height: 7px; background: #0c1c0c; border-radius: 4px; overflow: hidden; border: 1px solid #1a3a1a; }
.hp-fill   { height: 100%; width: 100%; border-radius: 4px; background: linear-gradient(90deg,#ff2200,#ff8000); transition: width .7s ease, background .5s; }
.hp-val    { font-size: 0.7rem; font-weight: 700; color: #ff4444; }
.v-sep     { color: #2a4a2a; font-size: 0.7rem; }
.v-name-top { font-size: 0.58rem; font-weight: 900; color: #6ab86a; letter-spacing: 0.05em; }
.v-mood    { font-size: 0.55rem; color: #3a6a3a; font-style: italic; }

.prog-bar   { height: 3px; background: #0c1c0c; flex-shrink: 0; z-index: 2; }
.prog-fill  { height: 100%; background: linear-gradient(90deg,#44ff44,#88ff44); transition: width .45s; width: 0%; }

.chat-body  { flex: 1; position: relative; overflow: hidden; }

.mosquito-hero {
  position: absolute; left: 50%; top: 48%;
  transform: translate(-50%, -50%);
  height: min(58vh, 350px); width: auto;
  opacity: 0.28; z-index: 0; pointer-events: none;
  filter: drop-shadow(0 0 28px rgba(40,180,40,0.15));
}

.messages {
  position: absolute; inset: 0; overflow-y: auto;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
  z-index: 1;
}
.messages::-webkit-scrollbar       { width: 3px; }
.messages::-webkit-scrollbar-thumb { background: #1a3a1a; border-radius: 2px; }

/* Bubbles */
.bubble {
  max-width: 88%; padding: 9px 13px; font-size: 0.87rem;
  line-height: 1.52; animation: fadeIn .28s ease;
}
.bubble-bot  { background: #0b1b0b; border: 1px solid #1a3a1a; color: #b8e8b8; border-radius: 14px 14px 14px 4px; align-self: flex-start; }
.bubble-user { background: #1a3a1a; color: #c8f8c8; border-radius: 14px 14px 4px 14px; align-self: flex-end; }

.typing { display: flex; gap: 4px; align-items: center; padding: 10px 14px !important; }
.typing span { width: 7px; height: 7px; background: #3a9a3a; border-radius: 50%; animation: tdot 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }

/* Options */
.options { display: flex; flex-wrap: wrap; gap: 7px; align-self: flex-start; max-width: 95%; }
.opt {
  background: #0b1b0b; border: 1px solid #2a6a2a; color: #88e888;
  border-radius: 20px; padding: 6px 14px; font-size: 0.81rem;
  cursor: pointer; transition: all .13s;
}
.opt:hover  { background: #1a3a1a; border-color: #44aa44; color: #c8f8c8; }
.opt.on     { background: #1a4a1a; border-color: #44ff44; color: #ffffff; cursor: default; }
.opt.off    { opacity: 0.38; cursor: default; }

/* ══════════════════════════════
   RESULT
══════════════════════════════ */
#result { justify-content: flex-start; padding-top: 22px; overflow-y: auto; gap: 10px; }

.victory-header { text-align: center; }
.v-icon         { font-size: 2.4rem; line-height: 1; animation: pop .5s cubic-bezier(.17,.67,.37,1.5) forwards; }
.victory-title  { font-size: 2rem; font-weight: 900; color: #44ff44; text-shadow: 0 0 28px rgba(68,255,68,0.5); }
.victory-sub    { font-size: 0.82rem; color: #5a9a5a; }

.dead-wrap { display: flex; justify-content: center; }

.price-card {
  background: #0b1b0b; border: 1px solid #1a481a;
  border-radius: 16px; padding: 16px 22px; text-align: center;
  width: 100%; max-width: 300px;
}
.price-lbl  { font-size: 0.75rem; color: #5a9a5a; letter-spacing: 0.1em; text-transform: uppercase; }
.price-num  { font-size: 2.5rem; font-weight: 900; color: #44ff44; margin: 5px 0; text-shadow: 0 0 18px rgba(68,255,68,0.4); }
.price-row  { font-size: 0.8rem; color: #6ab86a; padding: 4px 0; border-top: 1px solid #0f2a0f; }
.price-row:first-child { border-top: none; }

.action-btns { display: flex; flex-direction: column; gap: 9px; width: 100%; max-width: 300px; }
.btn-wa {
  background: #25d366; color: #fff; border: none; border-radius: 12px;
  padding: 13px 18px; font-size: 0.93rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter .13s;
}
.btn-wa:hover { filter: brightness(1.1); }
.btn-tg {
  background: #229ed9; color: #fff; border: none; border-radius: 12px;
  padding: 13px 18px; font-size: 0.93rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter .13s;
}
.btn-tg:hover { filter: brightness(1.1); }
.btn-back {
  background: transparent; border: 1px solid #254525; color: #5a9a5a;
  border-radius: 12px; padding: 9px; font-size: 0.83rem; cursor: pointer;
  transition: border-color .13s, color .13s;
}
.btn-back:hover { border-color: #44aa44; color: #88e888; }
.result-note { font-size: 0.7rem; color: #2a5a2a; text-align: center; }

/* ══════════════════════════════
   Animations
══════════════════════════════ */
@keyframes pulse-ring   { 0%,100%{transform:scale(1);opacity:.55} 50%{transform:scale(1.18);opacity:1} }
@keyframes danger-blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
@keyframes fadeIn       { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
@keyframes tdot         { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-6px)} }
@keyframes pop          { from{transform:scale(0.3)} to{transform:scale(1)} }
@keyframes confettiFall { to{transform:translateY(105vh) rotate(540deg);opacity:0} }

@keyframes mosquitoFly {
  0%   { transform: translateY(0px)   rotate(-1deg); }
  20%  { transform: translateY(-10px) rotate(1deg); }
  40%  { transform: translateY(-14px) rotate(-0.5deg); }
  60%  { transform: translateY(-8px)  rotate(1.5deg); }
  80%  { transform: translateY(-2px)  rotate(-1deg); }
  100% { transform: translateY(0px)   rotate(-1deg); }
}
@keyframes tiltDead {
  0%,100% { transform: rotate(-14deg) translateY(0); }
  50%      { transform: rotate(-18deg) translateY(3px); }
}

.fly-anim  { animation: mosquitoFly 2.8s ease-in-out infinite; }
.tilt-anim { animation: tiltDead 3.5s ease-in-out infinite; transform-origin: center bottom; }

/* ── Mobile ── */
@media (max-width: 500px) {
  .mosquito-big { width: 120px; height: 210px; }
  .villain-title { font-size: 1.8rem; }

  .mosquito-hero { height: min(50vh, 280px); }
  .hp-track { width: 55px; }
}
