:root {
  --bg-dark: #0b101e;
  --bg-deep: #11182b;
  --parchment: #f4efe6;
  --parchment-strong: #efe4d0;
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.22);
  --blood: #7e1f27;
  --silver: #a7a7ad;
  --muted: rgba(244, 239, 230, 0.68);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.42);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.22);
  --radius: 24px;
  --radius-sm: 16px;
  --transition: 220ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--parchment);
  background:
    radial-gradient(circle at 20% 15%, rgba(76, 29, 149, 0.28), transparent 26%),
    radial-gradient(circle at 80% 10%, rgba(212, 175, 55, 0.12), transparent 18%),
    radial-gradient(circle at 50% 100%, rgba(126, 31, 39, 0.18), transparent 26%),
    linear-gradient(180deg, #12192c 0%, #0b101e 100%);
  font-family: "Georgia", "Times New Roman", serif;
  letter-spacing: 0.01em;
}

button,
input {
  font: inherit;
}

.background-orb {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.42;
}

.orb-one {
  top: 8%;
  left: 10%;
  width: 220px;
  height: 220px;
  background: rgba(212, 175, 55, 0.2);
}

.orb-two {
  top: 55%;
  right: 8%;
  width: 260px;
  height: 260px;
  background: rgba(76, 29, 149, 0.22);
}

.orb-three {
  bottom: 10%;
  left: 30%;
  width: 200px;
  height: 200px;
  background: rgba(126, 31, 39, 0.22);
}

.site-shell {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}

.topbar-eyebrow,
.section-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  color: rgba(212, 175, 55, 0.82);
}

.topbar-title {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
  font-weight: 600;
}

.topbar-meta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  backdrop-filter: blur(18px);
}

.topbar-divider {
  width: 1px;
  height: 16px;
  background: rgba(212, 175, 55, 0.2);
}

.view-stack {
  position: relative;
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

.hero-grid,
.result-grid {
  display: grid;
  gap: 22px;
}

.hero-grid {
  grid-template-columns: 1.45fr 1fr;
}

.magic-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius);
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    linear-gradient(135deg, rgba(244, 239, 230, 0.96), rgba(233, 224, 209, 0.9));
  color: var(--bg-dark);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.magic-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.08) 35%, transparent 65%),
    radial-gradient(circle at top right, rgba(212, 175, 55, 0.08), transparent 28%);
  pointer-events: none;
}

.entrance-card,
.testing-card,
.result-card,
.result-header,
.logic-details {
  min-height: 100%;
}

.hero-title,
.result-career-title {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.06;
}

.hero-text,
.small-note {
  margin: 0;
  color: rgba(11, 16, 30, 0.72);
  line-height: 1.75;
}

.entrance-form {
  margin-top: 28px;
  display: grid;
  gap: 20px;
}

.field,
.mode-fieldset {
  display: grid;
  gap: 10px;
}

.field-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(11, 16, 30, 0.78);
}

.field-input {
  width: 100%;
  border: 1px solid rgba(11, 16, 30, 0.14);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--bg-dark);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field-input:focus {
  outline: none;
  border-color: rgba(212, 175, 55, 0.85);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.mode-fieldset {
  border: 1px solid rgba(11, 16, 30, 0.08);
  border-radius: 18px;
  padding: 14px;
}

.mode-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background-color var(--transition), transform var(--transition);
}

.mode-option:hover {
  background: rgba(11, 16, 30, 0.05);
  transform: translateY(-1px);
}

.mode-option input {
  margin-top: 4px;
}

.mode-option strong {
  display: block;
  margin-bottom: 4px;
}

.mode-option small {
  color: rgba(11, 16, 30, 0.62);
}

.button-row,
.footer-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-ministry,
.btn-secondary,
.btn-ghost {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition), color var(--transition), border-color var(--transition);
}

.btn-ministry {
  background: linear-gradient(135deg, #8e252f 0%, #6f1820 100%);
  color: var(--parchment);
  box-shadow: 0 8px 24px rgba(126, 31, 39, 0.32);
}

.btn-ministry:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(126, 31, 39, 0.38);
}

.btn-ministry:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ministry:active {
  transform: translateY(1px) scale(0.99);
}

.btn-secondary {
  border: 1px solid rgba(11, 16, 30, 0.12);
  background: rgba(255, 255, 255, 0.55);
  color: var(--bg-dark);
}

.btn-secondary:hover,
.btn-ghost:hover {
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: rgba(11, 16, 30, 0.7);
}

.is-hidden {
  display: none !important;
}

.route-list,
.fact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-list {
  display: grid;
  gap: 18px;
}

.route-list li {
  display: grid;
  gap: 4px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(11, 16, 30, 0.08);
}

.route-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.route-list strong {
  font-size: 1rem;
}

.route-list span,
.fact-list li {
  color: rgba(11, 16, 30, 0.68);
  line-height: 1.65;
}

.fact-panel {
  margin-top: 24px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(11, 16, 30, 0.05);
}

.fact-label {
  margin: 0 0 10px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(11, 16, 30, 0.58);
}

.fact-list {
  display: grid;
  gap: 10px;
}

.progress-rail {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(11, 16, 30, 0.08);
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.55), rgba(212, 175, 55, 1));
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.42);
  transition: width 360ms ease;
}

.testing-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-top: 22px;
}

.testing-phase {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.testing-counts {
  display: grid;
  gap: 6px;
  text-align: right;
  color: rgba(11, 16, 30, 0.62);
}

.question-shell {
  margin-top: 36px;
}

.question-text {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.4;
}

.dimension-hint {
  margin: 0;
  color: rgba(11, 16, 30, 0.56);
}

.option-stack {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.option-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px 14px 18px;
  border: 1px solid rgba(11, 16, 30, 0.1);
  border-radius: 16px;
  text-align: left;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.46));
  color: var(--bg-dark);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}

.option-button::before,
.option-button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}

.option-button::before {
  background:
    linear-gradient(
      90deg,
      rgba(116, 0, 1, 0.16) 0%,
      rgba(116, 0, 1, 0.08) 11%,
      rgba(26, 71, 42, 0.13) 11%,
      rgba(26, 71, 42, 0.06) 22%,
      rgba(14, 26, 64, 0.12) 22%,
      rgba(14, 26, 64, 0.05) 33%,
      rgba(236, 185, 57, 0.12) 33%,
      rgba(236, 185, 57, 0.05) 44%,
      transparent 44%,
      transparent 56%,
      rgba(236, 185, 57, 0.05) 56%,
      rgba(236, 185, 57, 0.12) 67%,
      rgba(14, 26, 64, 0.05) 67%,
      rgba(14, 26, 64, 0.12) 78%,
      rgba(26, 71, 42, 0.06) 78%,
      rgba(26, 71, 42, 0.13) 89%,
      rgba(116, 0, 1, 0.08) 89%,
      rgba(116, 0, 1, 0.16) 100%
    );
  opacity: 0.26;
}

.option-button::after {
  inset: 10px 18%;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(212, 175, 55, 0.12) 0, rgba(212, 175, 55, 0.04) 28%, transparent 54%),
    radial-gradient(circle at center, transparent 0 50%, rgba(126, 31, 39, 0.12) 50.5%, transparent 53%),
    radial-gradient(circle at center, transparent 0 67%, rgba(11, 16, 30, 0.08) 67.5%, transparent 70%),
    linear-gradient(90deg, transparent 0 46%, rgba(212, 175, 55, 0.14) 46%, rgba(212, 175, 55, 0.14) 54%, transparent 54%),
    linear-gradient(0deg, transparent 0 46%, rgba(212, 175, 55, 0.14) 46%, rgba(212, 175, 55, 0.14) 54%, transparent 54%),
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(11, 16, 30, 0.05) 12px 13px),
    repeating-linear-gradient(-45deg, transparent 0 12px, rgba(212, 175, 55, 0.06) 12px 13px);
  opacity: 0.34;
  transform: scale(0.98);
}

.option-button > * {
  position: relative;
  z-index: 1;
}

.option-button:hover {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.72);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.6), rgba(212, 175, 55, 0.09));
}

.option-button:hover::before {
  opacity: 0.34;
}

.option-button:hover::after {
  opacity: 0.42;
  transform: scale(1);
}

.option-button.is-selected {
  border-color: rgba(126, 31, 39, 0.55);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.58), rgba(126, 31, 39, 0.1));
  box-shadow: 0 8px 20px rgba(126, 31, 39, 0.08);
}

.option-button.is-selected::before {
  opacity: 0.4;
}

.option-button.is-selected::after {
  opacity: 0.5;
  transform: scale(1.01);
}

.option-score {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: rgba(11, 16, 30, 0.75);
  font-weight: 700;
  font-size: 0.95rem;
}

.option-content strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.94rem;
  line-height: 1.35;
}

.option-content span {
  color: rgba(11, 16, 30, 0.62);
  font-size: 0.92rem;
  line-height: 1.45;
}

.testing-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 34px;
}

.result-header-grid {
  display: grid;
  grid-template-columns: 1.5fr auto;
  gap: 24px;
  align-items: center;
}

.result-nameplate,
.result-career-subtitle,
.match-label,
.match-score,
.result-nameplate {
  margin: 0;
}

.result-nameplate {
  color: rgba(11, 16, 30, 0.58);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.74rem;
}

.result-career-subtitle {
  max-width: 780px;
  color: rgba(11, 16, 30, 0.7);
  line-height: 1.7;
  font-size: 1.05rem;
}

.badge-block {
  display: flex;
  align-items: center;
  gap: 18px;
}

.career-badge {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--parchment);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), transparent 34%),
    linear-gradient(135deg, #1b2644 0%, #5c1626 100%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.match-score {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--blood);
  font-weight: 700;
}

.result-grid {
  grid-template-columns: 1.05fr 0.95fr;
  margin-top: 22px;
}

.result-card-wide {
  grid-column: 1 / -1;
}

.card-title {
  margin: 0 0 18px;
  font-size: 1.25rem;
}

.chart-container {
  border-radius: var(--radius-sm);
  background: rgba(11, 16, 30, 0.92);
  min-height: 360px;
  padding: 16px;
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.08);
}

.dimension-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.dimension-pill {
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(11, 16, 30, 0.06);
}

.dimension-pill strong {
  display: block;
  margin-bottom: 4px;
}

.dimension-pill span {
  color: rgba(11, 16, 30, 0.62);
}

.top-careers-list {
  display: grid;
  gap: 12px;
}

.career-rank {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(11, 16, 30, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.46);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.career-rank:hover,
.career-rank.is-active {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: var(--shadow-sm);
}

.career-rank-index {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--parchment);
  background: linear-gradient(135deg, #7e1f27, #4c1d95);
}

.career-rank-name {
  margin: 0;
  font-size: 1.05rem;
}

.career-rank-family {
  margin: 2px 0 0;
  color: rgba(11, 16, 30, 0.62);
}

.career-rank-score {
  font-weight: 700;
  color: var(--blood);
}

.explanation-list {
  display: grid;
  gap: 16px;
}

.explanation-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(11, 16, 30, 0.05);
}

.explanation-item strong {
  display: block;
  margin-bottom: 8px;
}

.explanation-item p {
  margin: 0;
  color: rgba(11, 16, 30, 0.68);
  line-height: 1.7;
}

.dossier-layout {
  display: grid;
  gap: 18px;
}

.dossier-panel {
  padding: 18px;
  border-radius: 18px;
  background: rgba(11, 16, 30, 0.05);
}

.dossier-panel h4 {
  margin: 0 0 10px;
  color: var(--blood);
}

.dossier-panel p {
  margin: 0;
  color: rgba(11, 16, 30, 0.72);
  line-height: 1.84;
  white-space: pre-line;
}

.result-actions {
  justify-content: center;
  margin-top: 22px;
}

.logic-details {
  margin-top: 22px;
}

.logic-details summary {
  cursor: pointer;
  font-weight: 700;
}

.logic-summary {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  color: rgba(11, 16, 30, 0.72);
  line-height: 1.78;
}

.radar-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.small-note {
  margin-top: 14px;
  font-size: 0.92rem;
}

.password-overlay {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  padding: 24px;
}

.password-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(76, 29, 149, 0.18), transparent 26%),
    rgba(7, 10, 20, 0.8);
  backdrop-filter: blur(10px);
}

.password-dialog {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.5);
}

.password-title {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.password-description {
  margin: 0 0 20px;
  color: rgba(11, 16, 30, 0.72);
  line-height: 1.75;
}

.lock-crest-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 20px;
  border-radius: 18px;
  background: rgba(11, 16, 30, 0.05);
}

.lock-crest {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--parchment);
  background: linear-gradient(135deg, #1b2644 0%, #7e1f27 100%);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.22);
}

.lock-meta {
  display: grid;
  gap: 4px;
}

.lock-meta span {
  color: rgba(11, 16, 30, 0.58);
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.password-input {
  letter-spacing: 0.1em;
}

.password-error {
  margin: 8px 0 0;
  color: var(--blood);
  font-size: 0.95rem;
  font-weight: 600;
}

.password-dialog .button-row {
  margin-top: 20px;
}

@media (max-width: 980px) {
  .hero-grid,
  .result-grid,
  .result-header-grid {
    grid-template-columns: 1fr;
  }

  .dimension-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-shell {
    padding: 18px 14px 36px;
  }

  .topbar {
    flex-direction: column;
  }

  .magic-card {
    padding: 20px;
    border-radius: 22px;
  }

  .testing-meta,
  .testing-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .testing-counts {
    text-align: left;
  }

  .button-row,
  .footer-actions,
  .result-actions {
    flex-direction: column;
  }

  .btn-ministry,
  .btn-secondary,
  .btn-ghost {
    width: 100%;
  }

  .dimension-summary {
    grid-template-columns: 1fr;
  }

  .career-rank {
    grid-template-columns: auto 1fr;
  }

  .career-rank-score {
    grid-column: 2;
    justify-self: start;
  }
}
