.avatar-page {
  background:
    radial-gradient(circle at 18% 12%, rgba(99, 215, 228, 0.16), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(66, 211, 146, 0.12), transparent 26%),
    #0d0f12;
}

.twin-hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 0.92fr) minmax(420px, 1.08fr);
  gap: clamp(24px, 5vw, 62px);
  align-items: center;
  max-width: 1220px;
  margin: 0 auto;
  padding: 112px clamp(18px, 4vw, 34px) 64px;
}

.twin-stage {
  min-height: 620px;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
    rgba(17, 20, 24, 0.72);
  background-size: 36px 36px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.avatar-shell {
  position: relative;
  width: min(420px, 88vw);
  height: 520px;
  display: grid;
  place-items: center;
}

.avatar-halo {
  position: absolute;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(99, 215, 228, 0.24);
  border-radius: 50%;
  animation: rotateHalo 16s linear infinite;
}

.avatar-halo::before,
.avatar-halo::after {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px dashed rgba(66, 211, 146, 0.28);
  border-radius: 50%;
}

.avatar-halo::after {
  inset: -28px;
  border-color: rgba(246, 184, 90, 0.18);
}

.anime-avatar {
  position: relative;
  width: 260px;
  height: 430px;
  animation: idleFloat 4.2s ease-in-out infinite;
}

.hair.back {
  position: absolute;
  left: 29px;
  top: 22px;
  width: 202px;
  height: 238px;
  background: linear-gradient(160deg, #18252e 0%, #233947 56%, #11171d 100%);
  border-radius: 48% 48% 44% 44%;
  box-shadow: inset 18px -18px 0 rgba(99, 215, 228, 0.08);
}

.head {
  position: absolute;
  left: 42px;
  top: 72px;
  width: 176px;
  height: 182px;
  background: linear-gradient(180deg, #ffe0d1 0%, #ffc8b7 100%);
  border-radius: 48% 48% 46% 46%;
  box-shadow: inset -10px -14px 0 rgba(160, 88, 86, 0.08);
}

.bang {
  position: absolute;
  top: -40px;
  background: linear-gradient(180deg, #284a59, #17242d);
  border-radius: 0 0 42px 42px;
  transform-origin: top center;
}

.bang-left {
  left: 10px;
  width: 62px;
  height: 102px;
  transform: rotate(22deg);
}

.bang-mid {
  left: 56px;
  width: 70px;
  height: 114px;
  transform: rotate(-4deg);
}

.bang-right {
  right: 8px;
  width: 58px;
  height: 98px;
  transform: rotate(-24deg);
}

.ear {
  position: absolute;
  top: 78px;
  width: 26px;
  height: 42px;
  background: #ffc9b8;
  border-radius: 50%;
}

.ear.left { left: -15px; }
.ear.right { right: -15px; }

.eye {
  position: absolute;
  top: 83px;
  width: 42px;
  height: 46px;
  background: #f8fbff;
  border-radius: 50% 50% 46% 46%;
  overflow: hidden;
  animation: blink 5.4s infinite;
}

.eye.left { left: 38px; }
.eye.right { right: 38px; }

.eye span {
  position: absolute;
  left: 10px;
  top: 8px;
  width: 22px;
  height: 30px;
  background: radial-gradient(circle at 55% 36%, #ffffff 0 10%, transparent 11%), linear-gradient(180deg, #51e0df, #206c8f 62%, #102c4f);
  border-radius: 50%;
}

.blush {
  position: absolute;
  top: 132px;
  width: 28px;
  height: 10px;
  background: rgba(255, 120, 145, 0.28);
  border-radius: 50%;
}

.blush.left { left: 28px; }
.blush.right { right: 28px; }

.mouth {
  position: absolute;
  left: 79px;
  top: 141px;
  width: 18px;
  height: 8px;
  border-bottom: 3px solid #9d4b55;
  border-radius: 0 0 16px 16px;
}

.anime-avatar[data-speaking="true"] .mouth {
  height: 18px;
  background: #7e3541;
  border: 0;
  border-radius: 50%;
  animation: talkMouth 460ms ease-in-out infinite;
}

.neck {
  position: absolute;
  left: 113px;
  top: 238px;
  width: 34px;
  height: 42px;
  background: #ffc7b8;
}

.body {
  position: absolute;
  left: 48px;
  top: 268px;
  width: 164px;
  height: 142px;
  background: linear-gradient(180deg, #1b2e36, #111820);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 44px 44px 22px 22px;
}

.collar {
  position: absolute;
  left: 45px;
  top: 0;
  width: 74px;
  height: 38px;
  background: #f5f2eb;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
}

.badge {
  position: absolute;
  left: 48px;
  top: 62px;
  padding: 6px 10px;
  border: 1px solid rgba(66, 211, 146, 0.35);
  color: var(--green);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.voice-wave {
  position: absolute;
  left: 50%;
  bottom: 28px;
  display: flex;
  gap: 6px;
  transform: translateX(-50%);
  opacity: 0.35;
}

.voice-wave span {
  width: 5px;
  height: 18px;
  background: var(--cyan);
  border-radius: 999px;
  animation: wave 980ms ease-in-out infinite;
}

.voice-wave span:nth-child(2) { animation-delay: 80ms; }
.voice-wave span:nth-child(3) { animation-delay: 160ms; }
.voice-wave span:nth-child(4) { animation-delay: 240ms; }
.voice-wave span:nth-child(5) { animation-delay: 320ms; }

.twin-status {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  border-radius: 8px;
  font-size: 12px;
}

.status-pill.online {
  color: var(--green);
  border-color: rgba(66, 211, 146, 0.26);
}

.twin-console h1 {
  margin: 12px 0 0;
  font-size: clamp(38px, 5vw, 66px);
  line-height: 1.02;
}

.console-lead {
  margin-top: 22px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.chat-window {
  display: grid;
  gap: 10px;
  margin-top: 28px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(23, 27, 32, 0.82);
  border-radius: 8px;
}

.message {
  max-width: 86%;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.6;
}

.message.user {
  justify-self: end;
  background: #f5f2eb;
  color: #111418;
}

.message.twin {
  justify-self: start;
  background: rgba(99, 215, 228, 0.1);
  border: 1px solid rgba(99, 215, 228, 0.18);
  color: #dffcff;
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.prompt {
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.055);
  color: var(--text);
  border-radius: 8px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.prompt.active,
.prompt:hover {
  border-color: rgba(66, 211, 146, 0.42);
  background: rgba(66, 211, 146, 0.09);
}

.answer-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  background: #15191e;
  border-radius: 8px;
  overflow: hidden;
}

.answer-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.answer-card header span {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.answer-card .answer-body {
  padding: 16px;
  color: var(--muted);
  line-height: 1.72;
}

.source-list {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
  margin: 0;
  list-style: none;
}

.source-list li {
  padding: 10px;
  background: rgba(255,255,255,0.045);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}

.twin-evidence {
  max-width: 1220px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 clamp(18px, 4vw, 34px) 72px;
}

.evidence-tile {
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  background: #15191e;
  border-radius: 8px;
}

.evidence-tile span {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
}

.evidence-tile strong {
  display: block;
  margin-top: 26px;
  font-size: 22px;
}

.evidence-tile p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.ability-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 34px;
}

.ability {
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
}

.ability b {
  color: var(--text);
}

.ability p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.62;
}

.twin-safe {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) 1fr;
  gap: 34px;
  align-items: start;
  border-top: 1px solid var(--line);
}

.twin-safe ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.twin-safe li {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border-radius: 8px;
  line-height: 1.55;
}

.avatar-promo {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items: stretch;
  padding-top: 20px;
}

.avatar-promo-copy {
  padding: 32px;
  border: 1px solid var(--line);
  background: #15191e;
  border-radius: 8px;
}

.avatar-promo-copy h2 {
  margin-top: 12px;
}

.avatar-promo-copy p {
  max-width: 720px;
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.72;
}

.avatar-promo-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  min-height: 250px;
  border: 1px solid rgba(99, 215, 228, 0.25);
  background: linear-gradient(160deg, rgba(99,215,228,0.12), rgba(66,211,146,0.06)), #15191e;
  border-radius: 8px;
}

.mini-avatar {
  width: 78px;
  height: 78px;
  background: radial-gradient(circle at 50% 58%, #ffd5c5 0 36%, transparent 37%), radial-gradient(circle at 50% 28%, #23404d 0 46%, transparent 47%);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.avatar-promo-card strong {
  font-size: 22px;
}

.avatar-promo-card small {
  color: var(--muted);
}

@keyframes idleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  94%, 96% { transform: scaleY(0.08); }
}

@keyframes talkMouth {
  0%, 100% { transform: scaleY(0.72); }
  50% { transform: scaleY(1.18); }
}

@keyframes wave {
  0%, 100% { transform: scaleY(0.45); opacity: 0.4; }
  50% { transform: scaleY(1.35); opacity: 1; }
}

@media (max-width: 980px) {
  .twin-hero,
  .twin-safe,
  .avatar-promo {
    grid-template-columns: 1fr;
  }

  .twin-stage {
    min-height: 560px;
  }

  .twin-evidence,
  .ability-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .twin-hero {
    padding-top: 92px;
  }

  .twin-stage {
    min-height: 500px;
  }

  .anime-avatar {
    transform: scale(0.86);
  }

  .prompt-grid,
  .twin-evidence,
  .ability-grid {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 96%;
  }
}
