:root {
  --bg: #06110b;
  --panel: rgba(8, 25, 16, .9);
  --panel-2: rgba(12, 34, 22, .84);
  --green: #b8ff45;
  --mint: #d9ff9d;
  --white: #f4f7f1;
  --muted: #93a097;
  --line: rgba(184, 255, 69, .2);
  --dark: #041008;
}

html,
body {
  background-color: var(--bg);
}

body {
  color: var(--white);
  background-image:
    linear-gradient(rgba(3, 13, 8, .65), rgba(3, 13, 8, .67)),
    repeating-linear-gradient(90deg, #0a2416 0 9vw, #10301d 9vw 18vw);
  background-attachment: fixed;
}

.screen,
.hero,
.quiz,
.result,
.share {
  color: var(--white);
  background: transparent;
}

.topbar {
  color: var(--white);
  border-bottom: 1px solid rgba(184, 255, 69, .18);
  background: rgba(4, 16, 9, .88);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .18);
}

.brand,
.top-tag {
  color: var(--white);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  min-width: 72px;
  padding: 8px 11px;
  color: var(--green);
  border: 1px solid rgba(184, 255, 69, .3);
  border-radius: 999px;
  background: rgba(184, 255, 69, .045);
  font: 700 10px/1 sans-serif;
  letter-spacing: .5px;
  cursor: pointer;
}

.theme-toggle:hover {
  background: rgba(184, 255, 69, .1);
}

.brand-ball,
.eyebrow,
.q-kicker {
  color: var(--green);
}

.hero,
.quiz,
.result,
.share {
  position: relative;
}

.hero::before,
.quiz::before,
.result::before,
.share::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .45;
  background:
    linear-gradient(115deg, transparent 0 72%, rgba(184, 255, 69, .035) 72.1% 72.35%, transparent 72.45%),
    radial-gradient(circle at 85% 18%, rgba(184, 255, 69, .08), transparent 28%);
}

.hero-copy,
.quiz-shell,
.result-shell,
.share-layout {
  position: relative;
  z-index: 2;
}

.match-status,
.option,
.result-hero,
.profile-card,
.detail-card,
.relationship-grid > div,
.dim-card,
.poster,
.poster-center,
.poster-profile,
.poster-match > div,
.poster-relations > div {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(15, 39, 25, .91), rgba(5, 18, 11, .93));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

.primary {
  color: #061008;
  background: var(--green);
}

.secondary,
.share-copy .secondary,
.result .secondary {
  color: var(--white);
  border-color: rgba(184, 255, 69, .24);
  background: rgba(4, 16, 9, .32);
}

.intro,
.section-lead,
.share-copy > p:not(.eyebrow),
.method-note {
  color: #aeb9b1 !important;
}

.option:hover {
  border-color: var(--green);
  background: rgba(184, 255, 69, .07);
}

.progress-track i,
.dim-card .scale i {
  background: var(--green);
}

/* Independent transparent PNGs, never atlas cropping. */
.character-art,
.poster-character {
  background-image: none;
  background-color: transparent;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  image-rendering: auto;
  filter: drop-shadow(0 18px 22px rgba(0, 0, 0, .22));
}

/* Result identity card */
.result-shell {
  max-width: 1120px;
}

.result-hero {
  min-height: 570px;
  padding: 40px 42px;
  column-gap: 34px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 30%, rgba(184, 255, 69, .085), transparent 31%),
    linear-gradient(145deg, rgba(13, 35, 22, .96), rgba(4, 16, 9, .96));
}

.result-hero > div:first-child {
  max-width: 600px;
}

.result-hero .code {
  color: #819087;
  border-color: rgba(184, 255, 69, .2);
  background: rgba(184, 255, 69, .035);
}

.english-name {
  color: var(--green) !important;
}

.chinese-name,
.result .section-title h3 {
  color: var(--white);
}

.english-note {
  color: #d6ded8;
  border-left-color: var(--green);
}

.result-visual {
  flex: 0 0 430px;
}

.character-frame {
  width: 410px;
  height: 470px;
  border: 1px solid rgba(184, 255, 69, .19);
  border-radius: 22px;
  background:
    linear-gradient(rgba(184, 255, 69, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 255, 69, .03) 1px, transparent 1px),
    linear-gradient(155deg, rgba(184, 255, 69, .125), rgba(4, 16, 9, .3));
  background-size: 38px 38px, 38px 38px, auto;
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .18);
}

.hero-catchphrase {
  display: grid;
  gap: 9px;
  left: 20px;
  right: 40px;
  top: auto;
  bottom: 18px;
  width: auto;
  padding: 17px 19px 18px;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, .11);
  border-left: 2px solid var(--green);
  border-radius: 10px;
  background: rgba(3, 15, 8, .78);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.hero-catchphrase::after {
  display: none;
}

.hero-catchphrase small,
.section-title span,
.detail-card dt,
.relationship-grid span,
.dim-code {
  color: var(--green);
}

.hero-catchphrase small {
  display: block;
  margin: 0;
  font: 800 9px/1.2 monospace;
  letter-spacing: 1px;
}

.hero-catchphrase strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.65;
}

.profile-card,
.detail-card,
.relationship-grid > div,
.dim-card {
  color: var(--white);
}

.profile-card p,
.detail-card dd,
.relationship-grid strong,
.dim-card p {
  color: #d5ddd7 !important;
}

.card-head {
  border-bottom-color: rgba(184, 255, 69, .14);
}

.card-index {
  color: var(--dark);
  background: var(--green);
}

.card-label,
.dim-card small {
  color: var(--muted);
}

.detail-card dl {
  background: rgba(184, 255, 69, .16);
}

.detail-card dl > div {
  background: rgba(5, 18, 11, .95);
}

.dim-card .scale {
  background: rgba(255, 255, 255, .1);
}

/* H5-first share screen and complete vertical poster. */
.share {
  padding: 104px 24px 54px;
}

.share-layout {
  max-width: 1040px;
  align-items: flex-start;
}

.share-copy h2 {
  color: var(--white);
}

.share-copy .eyebrow {
  color: var(--green);
}

.poster {
  width: 390px;
  min-height: 0;
  aspect-ratio: auto;
  padding: 20px;
  color: var(--white);
  border: 1px solid rgba(184, 255, 69, .28);
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(rgba(4, 17, 9, .78), rgba(4, 17, 9, .9)),
    repeating-linear-gradient(90deg, #10301d 0 44px, #0b2617 44px 88px);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .34);
}

.poster::before {
  border-color: rgba(184, 255, 69, .12);
}

.poster::after {
  inset: 10px;
  border-color: rgba(184, 255, 69, .08);
  border-radius: 17px;
}

.poster-score {
  margin-bottom: 9px;
  padding-bottom: 9px;
  border-bottom-color: rgba(184, 255, 69, .18);
  color: #809086;
}

.poster-score b {
  color: var(--dark);
  background: var(--green);
}

.poster-top {
  padding-bottom: 10px;
  border-bottom-color: rgba(184, 255, 69, .14);
}

.poster-top span,
.poster-bottom > span {
  color: var(--green);
}

.poster-top small,
.poster-bottom small {
  color: #819087;
}

.poster-center {
  display: grid;
  grid-template-columns: 1fr 174px;
  grid-template-areas:
    "eyebrow character"
    "english character"
    "name character"
    "code character"
    "line line";
  min-height: 330px;
  margin: 10px 0 8px;
  padding: 15px;
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(16, 43, 27, .93), rgba(5, 20, 12, .95));
}

.poster-center > p:first-child {
  grid-area: eyebrow;
  align-self: end;
  margin: 0 0 5px;
  color: var(--green);
}

.poster-center b {
  grid-area: english;
  align-self: end;
  color: var(--green);
  font-size: 29px;
  line-height: .95;
  letter-spacing: -1.7px;
}

.poster-center h3 {
  grid-area: name;
  margin: 6px 0 3px;
  color: var(--white);
  font-size: 18px;
}

.poster-code {
  grid-area: code;
  position: static;
  align-self: start;
  justify-self: start;
  color: #819087;
  border-color: rgba(184, 255, 69, .17);
}

.poster-character {
  grid-area: character;
  position: static;
  width: 190px;
  height: 230px;
  margin: -4px -10px -2px -6px;
  border: 0;
  box-shadow: none;
}

.poster-center blockquote {
  grid-area: line;
  width: 100%;
  margin: 5px 0 0;
  padding: 9px 0 0;
  color: #e5ebe6;
  border-top: 1px solid rgba(184, 255, 69, .14);
  font-size: 10px;
  line-height: 1.45;
}

.poster-english-note {
  grid-area: note;
  margin: 5px 0 0 !important;
  color: #9eaaa1 !important;
  font-size: 8px !important;
  line-height: 1.45;
  letter-spacing: 0 !important;
}

.poster-profile {
  position: relative;
  z-index: 1;
  padding: 11px 12px;
  border-radius: 12px;
}

.poster-profile small,
.poster-match small,
.poster-relations small {
  display: block;
  margin-bottom: 5px;
  color: var(--green);
  font: 800 7px/1.2 monospace;
  letter-spacing: 1px;
}

.poster-profile p {
  margin: 0;
  color: #cbd4cd;
  font-size: 8px;
  line-height: 1.48;
}

.poster-match {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  margin-top: 6px;
  border: 0;
  background: transparent;
}

.poster-match > div {
  min-height: 0;
  padding: 12px 13px;
  border-radius: 10px;
}

.poster-match strong,
.poster-relations strong {
  display: block;
  color: #dce4de;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.58;
}

.poster-relations {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 6px;
}

.poster-relations > div {
  padding: 9px 10px;
  border-radius: 10px;
}

.poster-bottom {
  margin-top: 12px;
  padding-top: 10px;
  border-top-color: rgba(184, 255, 69, .15);
}

@media (max-width: 760px) {
  body {
    background-attachment: scroll;
    background-image:
      linear-gradient(rgba(3, 13, 8, .65), rgba(3, 13, 8, .69)),
      repeating-linear-gradient(90deg, #0a2416 0 72px, #10301d 72px 144px);
  }

  .result-hero {
    min-height: auto;
    padding: 24px 18px 28px;
  }

  .result-visual {
    width: 100%;
    margin: 22px auto 12px;
  }

  .character-frame {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1.08;
  }

  .hero-catchphrase {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .share {
    padding: 82px 12px 34px;
  }

  .share-layout {
    width: 100%;
    gap: 28px;
  }

  .share-copy {
    padding: 0 8px;
  }

  .top-actions {
    gap: 8px;
  }

  .theme-toggle {
    min-width: 66px;
    padding: 7px 9px;
  }

  .poster {
    width: 100%;
    max-width: 390px;
    min-height: 0;
    margin: 0 auto;
  }
}
