#hgsv-root {
  --sv-bg: #0d1410;
  --sv-opt: #15211a;
  --sv-text: #f4efe6;
  --sv-muted: #b0c0b5;
  --sv-gold: #dfb152;
  --sv-gold-hi: #ecc36c;
  --sv-gold-ink: #0b110e;
  --sv-border: rgba(223, 177, 82, 0.24);
  --res-bg: #0d1410;
  --res-glow: rgba(223, 177, 82, 0.16);
  --res-accent: #dfb152;
  --res-accent-soft: rgba(223, 177, 82, 0.2);

  border-radius: 18px;
  border: 1px solid var(--sv-border);
  background:
    radial-gradient(ellipse 75% 340px at 50% 0%, rgba(223, 177, 82, 0.12), rgba(45, 125, 82, 0.08) 52%, transparent 78%),
    var(--sv-bg);
  color: var(--sv-text);
  overflow: hidden;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.5);
  transition: background 0.4s ease, border-color 0.4s ease;
}

#hgsv-root[data-active-view="result"] {
  background:
    radial-gradient(ellipse 80% 360px at 50% 0%, var(--res-glow), transparent 76%),
    var(--res-bg);
  border-color: var(--res-accent-soft);
}

#hgsv-root [hidden] { display: none !important; }
.hgsv-view { padding: 28px 24px 32px; }

.hgsv-cover {
  min-height: 330px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; max-width: 560px; margin-inline: auto;
}
.hgsv-emblem { width: 54px; height: 54px; margin-bottom: 16px; color: var(--sv-gold); }
.hgsv-title {
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(26px, 4.2vw, 36px); font-weight: 700; line-height: 1.16;
  color: var(--sv-text); margin-bottom: 12px;
}
.hgsv-sub { font-size: 16px; line-height: 1.58; color: var(--sv-muted); max-width: 46ch; margin: 0 0 22px; }
.hgsv-cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 30px; border-radius: 12px;
  border: 1px solid var(--sv-gold); background: var(--sv-gold); color: var(--sv-gold-ink);
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 24px rgba(223, 177, 82, 0.22);
  transition: background-color 0.16s ease, transform 0.14s ease;
}
.hgsv-cta:hover { background: var(--sv-gold-hi); transform: translateY(-1px); }
.hgsv-meta { margin-top: 16px; font-size: 13px; color: var(--sv-muted); }

.hgsv-quiz-wrap { max-width: 620px; margin-inline: auto; }
.hgsv-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hgsv-counter {
  font-family: var(--font-mono, monospace); font-size: 13px; font-weight: 600;
  letter-spacing: 0.1em; color: var(--sv-gold);
}
.hgsv-phase {
  font-family: var(--font-mono, monospace); font-size: 12px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--sv-gold); margin-bottom: 12px;
}
.hgsv-track {
  width: 100%; height: 3px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); overflow: hidden; margin-bottom: 26px;
}
.hgsv-fill {
  height: 100%; width: 10%; background: var(--sv-gold); border-radius: 999px;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.hgsv-q-stage { transition: opacity 0.2s ease, transform 0.22s ease; }
.hgsv-q-stage.is-leaving { opacity: 0; transform: translateY(-6px); }
.hgsv-prompt {
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(20px, 3vw, 24px); font-weight: 600; line-height: 1.38;
  color: var(--sv-text); margin-bottom: 22px;
}
.hgsv-options { display: flex; flex-direction: column; gap: 11px; margin-bottom: 20px; }
.hgsv-opt {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px;
  padding: 14px 18px; border-radius: 12px;
  border: 1px solid rgba(223, 177, 82, 0.22); background: var(--sv-opt); color: var(--sv-text);
  font: inherit; font-size: 15px; font-weight: 500; line-height: 1.4; text-align: left; cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}
.hgsv-opt:hover { background: #1c2c23; border-color: var(--sv-gold); transform: translateY(-1px); }
.hgsv-opt.is-selected {
  background: rgba(223, 177, 82, 0.16); border-color: var(--sv-gold-hi);
  box-shadow: 0 0 0 1px rgba(223, 177, 82, 0.45);
}
.hgsv-key {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 8px; border: 1px solid rgba(223, 177, 82, 0.36); background: rgba(223, 177, 82, 0.08);
  color: var(--sv-gold); font-family: var(--font-mono, monospace); font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.hgsv-opt.is-selected .hgsv-key { background: var(--sv-gold); border-color: var(--sv-gold); color: var(--sv-gold-ink); }
.hgsv-foot { display: flex; align-items: center; justify-content: space-between; min-height: 36px; }
.hgsv-back {
  min-height: 36px; padding: 0 12px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16); background: transparent; color: var(--sv-text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.hgsv-back:hover { border-color: var(--sv-gold); }
.hgsv-hint { font-size: 12px; color: var(--sv-muted); margin-left: auto; }

.hgsv-result-wrap { max-width: 620px; margin-inline: auto; animation: hgsvFade 0.4s ease; }
@keyframes hgsvFade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.hgsv-shared-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; margin-bottom: 22px; border-radius: 12px;
  border: 1px solid var(--res-accent-soft); background: rgba(255, 255, 255, 0.04); font-size: 13px;
}
.hgsv-poster { text-align: center; padding: 8px 0 26px; }
.hgsv-res-eyebrow {
  font-family: var(--font-mono, monospace); font-size: 12px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--res-accent); margin-bottom: 10px;
}
.hgsv-res-fate {
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(28px, 5vw, 44px); font-weight: 700; line-height: 1.12;
  color: var(--sv-text); margin-bottom: 10px;
}
.hgsv-res-tag { font-size: 16px; color: var(--sv-muted); max-width: 48ch; margin: 0 auto 26px; }
.hgsv-metrics {
  display: grid; grid-template-columns: 1fr 1fr; max-width: 420px; margin: 0 auto 28px;
  padding: 16px 0; border-top: 1px solid rgba(255, 255, 255, 0.12); border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.hgsv-mcell:first-child { border-right: 1px solid rgba(255, 255, 255, 0.12); }
.hgsv-mnum {
  font-family: var(--font-display, Georgia, serif); font-size: clamp(28px, 4.6vw, 38px);
  font-weight: 700; color: var(--res-accent); margin-bottom: 4px;
}
.hgsv-mlabel {
  font-family: var(--font-mono, monospace); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--sv-muted);
}
.hgsv-bars { max-width: 460px; margin: 0 auto 26px; display: flex; flex-direction: column; gap: 11px; text-align: left; }
.hgsv-brow { display: grid; grid-template-columns: 102px 1fr 44px; align-items: center; gap: 12px; }
.hgsv-bname { font-size: 13px; font-weight: 600; color: var(--sv-muted); }
.hgsv-btrack { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.hgsv-bfill { height: 100%; width: 0; border-radius: 999px; background: var(--res-accent); transition: width 0.6s ease; }
.hgsv-bpct { font-family: var(--font-mono, monospace); font-size: 12px; font-weight: 600; text-align: right; }

.hgsv-traits {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12); border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 20px;
}
.hgsv-tk {
  font-family: var(--font-mono, monospace); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--sv-muted); margin-bottom: 4px;
}
.hgsv-tv { font-size: 14px; font-weight: 700; color: var(--res-accent); }
.hgsv-narrative { font-size: 15px; line-height: 1.66; max-width: 54ch; margin: 0 auto; }

.hgsv-dock { padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.12); display: flex; flex-direction: column; gap: 12px; }
.hgsv-name-in {
  width: 100%; min-height: 44px; padding: 0 14px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.05);
  color: var(--sv-text); font: inherit; font-size: 14px;
}
.hgsv-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hgsv-dbtn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04); color: var(--sv-text);
  font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.hgsv-dbtn:hover { border-color: var(--res-accent); background: rgba(255, 255, 255, 0.08); color: var(--sv-text); }
.hgsv-dprim { background: var(--res-accent); border-color: var(--res-accent); color: #0b110e; font-weight: 700; }
.hgsv-dprim:hover { filter: brightness(1.08); color: #0b110e; }
.hgsv-status { font-size: 13px; font-weight: 600; color: var(--res-accent); min-height: 18px; }

@media (max-width: 640px) {
  .hgsv-view { padding: 22px 16px 26px; }
  .hgsv-cover { min-height: 290px; }
  .hgsv-traits { grid-template-columns: 1fr; gap: 10px; }
  .hgsv-brow { grid-template-columns: 88px 1fr 40px; gap: 8px; }
  .hgsv-actions { flex-direction: column; align-items: stretch; }
  .hgsv-dbtn, .hgsv-cta { width: 100%; }
}