:root {
  --bg: #050505;
  --surface: #0d0d0d;
  --surface-2: #141414;
  --line: rgba(212, 175, 55, 0.16);
  --line-soft: rgba(255, 255, 255, 0.08);
  --gold: #d4af37;
  --gold-light: #f1d27a;
  --text: #f7f3e8;
  --muted: #a6a092;
  --muted-2: #706b60;
  --green: #4ade80;
  --amber: #f59e0b;
  --red: #ef4444;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}

body {
  width: 100%;
  height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 12% 8%, rgba(212, 175, 55, 0.12), transparent 32rem),
    radial-gradient(circle at 88% 92%, rgba(241, 210, 122, 0.08), transparent 30rem),
    #050505;
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(1120px, calc(100% - 32px));
  height: 100vh;
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@supports (height: 100dvh) {
  .app {
    height: 100dvh;
  }
}

.header {
  flex: 0 0 54px;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.logo {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.18));
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.58);
}

.main {
  flex: 1;
  min-height: 0;
  display: grid;
  align-items: center;
  padding: 14px 0 0;
  overflow: hidden;
}

.shell {
  width: 100%;
  height: min(100%, 620px);
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: stretch;
}

.card,
.context-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(20, 20, 20, 0.96), rgba(8, 8, 8, 0.96));
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.card {
  height: 100%;
  min-height: 0;
  padding: clamp(22px, 4vw, 42px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.context-panel {
  height: 100%;
  min-height: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.screen {
  display: none;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  animation: enter 0.28s ease;
}

.screen.active {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.4) transparent;
}

.screen.active::-webkit-scrollbar {
  width: 6px;
}

.screen.active::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.34);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eyebrow {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 12px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 999px;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.08);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

h1,
h2,
p {
  margin: 0;
}

.hero-title,
.result-title,
.question {
  max-width: 760px;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-title {
  margin-bottom: 18px;
  font-size: clamp(36px, 6vw, 62px);
  line-height: 0.98;
}

.gold {
  color: var(--gold);
}

.description,
.result-text {
  max-width: 680px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
}

.metric,
.result-box,
.principle {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.metric {
  padding: 16px;
}

.metric strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gold-light);
  font-size: 20px;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.actions {
  width: 100%;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  flex: 1 1 220px;
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  color: #070707;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  box-shadow: 0 14px 32px rgba(212, 175, 55, 0.16);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  text-align: center;
  white-space: normal;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(212, 175, 55, 0.22);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.btn.secondary {
  border: 1px solid rgba(212, 175, 55, 0.22);
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.06);
  box-shadow: none;
}

.microcopy {
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.6;
}

.context-title {
  margin-bottom: 12px;
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.principles {
  display: grid;
  gap: 10px;
}

.principle {
  padding: 14px;
}

.principle strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.principle span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.quiz-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.label {
  margin-bottom: 6px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quiz-section {
  color: var(--gold-light);
  font-size: 14px;
  font-weight: 800;
}

.progress {
  height: 8px;
  margin-bottom: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 0.28s ease;
}

.question {
  margin-bottom: 12px;
  font-size: clamp(27px, 4.5vw, 44px);
  line-height: 1.08;
}

.hint {
  max-width: 640px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  width: 100%;
  min-height: 60px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.026);
  text-align: left;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.option:hover {
  border-color: rgba(212, 175, 55, 0.36);
  background: rgba(212, 175, 55, 0.07);
  transform: translateY(-1px);
}

.option-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.24);
  border-radius: 50%;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.07);
  font-size: 12px;
  font-weight: 900;
}

.option-text {
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.form {
  width: min(100%, 520px);
  display: grid;
  gap: 12px;
  margin: 22px 0 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.input {
  width: 100%;
  min-height: 54px;
  padding: 0 15px;
  border: 1px solid rgba(212, 175, 55, 0.16);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.input:focus {
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.09);
}

.input.invalid {
  border-color: rgba(239, 68, 68, 0.78);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.input::placeholder {
  color: #716d65;
}

.field-error {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.loading-wrap {
  margin: auto 0;
  text-align: center;
}

.loader {
  width: 78px;
  height: 78px;
  margin: 0 auto 24px;
  border: 4px solid rgba(212, 175, 55, 0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.loading-bar {
  width: min(100%, 480px);
  height: 9px;
  margin: 26px auto 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.loading-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 0.25s ease;
}

.result-title {
  margin-bottom: 14px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
}

.score-band {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 22px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.07);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.result-box {
  padding: 15px;
}

.result-box strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 13px;
}

.result-box span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.footnote {
  margin-top: 18px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .app {
    width: min(100% - 24px, 680px);
  }

  .main {
    align-items: stretch;
    padding-top: 12px;
  }

  .shell {
    grid-template-columns: 1fr;
    height: 100%;
    gap: 0;
  }

  .context-panel {
    display: none;
  }

  .card {
    height: 100%;
    min-height: 0;
  }
}

@media (max-height: 760px) and (min-width: 901px) {
  .app {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .header {
    flex-basis: 48px;
    min-height: 48px;
  }

  .logo {
    height: 30px;
  }

  .main {
    padding-top: 10px;
  }

  .shell {
    height: 100%;
  }

  .card {
    padding: 24px;
  }

  .context-panel {
    padding: 18px;
    gap: 16px;
  }

  .eyebrow {
    margin-bottom: 12px;
  }

  .hero-title {
    margin-bottom: 12px;
    font-size: 42px;
  }

  .description,
  .result-text {
    font-size: 13px;
    line-height: 1.5;
  }

  .intro-grid {
    margin: 16px 0;
  }

  .metric {
    padding: 12px;
  }

  .quiz-top {
    margin-bottom: 10px;
  }

  .progress {
    margin-bottom: 14px;
  }

  .question {
    font-size: 32px;
    line-height: 1.08;
  }

  .hint {
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.45;
  }

  .options {
    gap: 8px;
  }

  .option {
    min-height: 52px;
    padding: 10px 14px;
  }

  .result-title {
    font-size: 38px;
  }

  .result-grid {
    margin: 14px 0;
  }

  .result-box {
    padding: 12px;
  }

  .footnote {
    margin-top: 12px;
  }
}

@media (max-width: 620px) {
  .app {
    width: calc(100% - 18px);
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .header {
    flex-basis: 44px;
    min-height: 44px;
  }

  .logo {
    height: 26px;
  }

  .status {
    font-size: 9px;
    gap: 6px;
    letter-spacing: 0.06em;
  }

  .main {
    padding-top: 8px;
  }

  .card {
    padding: 14px;
    border-radius: 8px;
  }

  .intro-grid,
  .principles,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .context-panel {
    display: none;
  }

  .context-title {
    margin-bottom: 10px;
    font-size: 10px;
  }

  .principle {
    padding: 12px;
  }

  .principle strong {
    font-size: 13px;
  }

  .principle span,
  .microcopy,
  .metric span,
  .result-box span {
    font-size: 11px;
  }

  .eyebrow {
    margin-bottom: 10px;
    padding: 6px 9px;
    font-size: 9px;
    letter-spacing: 0.07em;
  }

  .hero-title {
    margin-bottom: 10px;
    font-size: clamp(26px, 8.2vw, 32px);
    line-height: 1.02;
  }

  .description,
  .result-text {
    font-size: 12px;
    line-height: 1.48;
  }

  .intro-grid {
    gap: 8px;
    margin: 14px 0;
  }

  .metric {
    padding: 10px;
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    align-items: center;
  }

  .metric strong {
    margin: 0;
    font-size: 18px;
  }

  .quiz-top {
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin-bottom: 9px;
  }

  .label {
    margin-bottom: 4px;
    font-size: 9px;
    letter-spacing: 0.1em;
  }

  .quiz-section {
    font-size: 12px;
  }

  .progress {
    height: 6px;
    margin-bottom: 12px;
  }

  .question {
    margin-bottom: 8px;
    font-size: clamp(20px, 6.5vw, 26px);
    line-height: 1.1;
  }

  .hint {
    margin-bottom: 10px;
    font-size: 11px;
    line-height: 1.42;
  }

  .options {
    gap: 8px;
  }

  .option {
    min-height: 52px;
    padding: 10px;
    grid-template-columns: 28px 1fr;
    gap: 10px;
  }

  .option-index {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .option-text {
    font-size: 12px;
    line-height: 1.32;
  }

  .result-title {
    margin-bottom: 10px;
    font-size: clamp(24px, 7.4vw, 30px);
    line-height: 1.05;
  }

  .score-band {
    margin-bottom: 12px;
    font-size: 10px;
  }

  .result-grid {
    gap: 8px;
    margin: 12px 0;
  }

  .result-box {
    padding: 10px;
  }

  .form {
    gap: 10px;
    margin: 16px 0 12px;
  }

  .input,
  .btn {
    min-height: 46px;
  }

  .btn {
    padding: 0 14px;
    font-size: 12px;
  }

  .actions,
  .btn {
    width: 100%;
  }

  .footnote {
    margin-top: 14px;
    font-size: 10px;
  }
}

@media (max-width: 380px) {
  .app {
    width: calc(100% - 14px);
  }

  .card {
    padding: 12px;
  }

  .hero-title {
    font-size: 25px;
  }

  .question {
    font-size: 19px;
  }

  .option-text {
    font-size: 11px;
  }
}

@media (max-height: 740px) and (max-width: 620px) {
  .context-panel {
    display: none;
  }

  .app {
    padding-bottom: 10px;
  }

  .main {
    padding-top: 10px;
  }

  .hero-title {
    font-size: 28px;
  }

  .description {
    font-size: 12px;
  }

  .intro-grid {
    margin: 16px 0;
  }

  .question {
    font-size: 21px;
  }

  .hint {
    display: none;
  }
}
