:root {
  --ink: #11111c;
  --muted: #5c5870;
  --paper: #f8f0d8;
  --panel: #fff8e8;
  --red: #e9473f;
  --green: #66c6a4;
  --yellow: #f2c14e;
  --blue: #5b7cfa;
  --line: #11111c;
  --pixel-shadow: 8px 8px 0 #11111c;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    "Courier New", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "PingFang SC", "Microsoft YaHei", monospace;
  background: #efe6d0;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
  display: flex;
  align-items: stretch;
}

.screen {
  width: 100%;
  min-height: calc(100vh - 36px);
  display: none;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

.intro-card {
  margin: 70px 0 0;
  padding: 24px;
  display: flex;
  min-height: 548px;
  flex-direction: column;
  background: var(--panel);
  border: 5px solid var(--line);
  box-shadow: var(--pixel-shadow);
}

.brand-row,
.result-header,
.quiz-topbar,
.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-row {
  justify-content: flex-start;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--green);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
  font-size: 13px;
  font-weight: 900;
}

.pixel-person {
  position: relative;
  width: 28px;
  height: 30px;
  display: block;
  background:
    linear-gradient(#2c211a 0 0) 7px 0 / 14px 6px,
    linear-gradient(#2c211a 0 0) 4px 5px / 20px 4px,
    linear-gradient(#f0bd86 0 0) 5px 8px / 18px 12px,
    linear-gradient(#11111c 0 0) 9px 12px / 3px 3px,
    linear-gradient(#11111c 0 0) 17px 12px / 3px 3px,
    linear-gradient(#b85b4b 0 0) 12px 17px / 5px 2px,
    linear-gradient(#5b7cfa 0 0) 4px 21px / 20px 9px,
    linear-gradient(#11111c 0 0) 1px 24px / 5px 6px,
    linear-gradient(#11111c 0 0) 22px 24px / 5px 6px;
  background-repeat: no-repeat;
}

.hero-copy {
  padding: 82px 0 22px;
  color: var(--ink);
}

.eyebrow,
.question-kicker,
.mini-brand {
  margin: 0 0 14px;
  color: var(--yellow);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  color: var(--ink);
  font-family: "Arial Black", Impact, "PingFang SC", sans-serif;
  font-size: clamp(34px, 9.8vw, 50px);
  line-height: 1.08;
  letter-spacing: 0;
  white-space: nowrap;
  text-shadow: none;
}

.hero-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.intro-panel {
  padding: 16px;
  display: grid;
  gap: 4px;
  margin: auto 0 18px;
  background: #fff8e8;
  border: 4px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
}

.intro-panel strong {
  font-size: 16px;
}

.intro-panel span {
  color: var(--muted);
  font-size: 14px;
}

.intro-footnote {
  margin: 22px 0 0;
  color: rgba(17, 17, 28, 0.56);
  font-size: 12px;
  line-height: 1.65;
}

.primary-button {
  width: 100%;
  min-height: 58px;
  border: 4px solid var(--line);
  color: var(--ink);
  background: var(--yellow);
  box-shadow: var(--pixel-shadow);
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
}

.intro-card .primary-button {
  margin-top: auto;
}

.access-card .hero-copy {
  padding-bottom: 30px;
}

.access-form {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.access-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.access-form input {
  width: 100%;
  min-height: 58px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  border: 4px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
}

.access-form .primary-button {
  margin-top: 10px;
}

.access-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.5;
}

.primary-button:active,
.option-button:active,
.ghost-button:active {
  transform: translate(4px, 4px);
  box-shadow: 2px 2px 0 var(--line);
}

.ghost-button {
  width: 44px;
  height: 44px;
  border: 4px solid var(--line);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--line);
  cursor: pointer;
  font-weight: 900;
}

.ghost-button.text {
  width: auto;
  height: 42px;
  padding: 0 14px;
  font-size: 14px;
}

.ghost-button:disabled {
  opacity: 0.45;
}

.quiz-topbar {
  padding: 4px 0 22px;
}

.progress-wrap {
  flex: 1;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.progress-track {
  height: 14px;
  margin-top: 8px;
  overflow: hidden;
  background: #2b2a3f;
  border: 3px solid var(--line);
}

.progress-fill {
  width: 0;
  height: 100%;
  background:
    repeating-linear-gradient(
      90deg,
      var(--green) 0,
      var(--green) 12px,
      #48a88a 12px,
      #48a88a 24px
    );
  transition: width 180ms steps(4);
}

.question-card {
  min-height: 548px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 5px solid var(--line);
  box-shadow: var(--pixel-shadow);
}

.question-card h2 {
  margin-bottom: 12px;
  font-family: "Arial Black", Impact, "PingFang SC", sans-serif;
  font-size: 31px;
  line-height: 1.12;
  letter-spacing: 0;
}

.question-hint {
  margin-bottom: 16px;
  padding: 12px;
  color: var(--ink);
  background: #efe2c4;
  border: 3px solid var(--line);
  line-height: 1.6;
  font-size: 14px;
}

.question-hint[hidden] {
  display: none;
}

.answer-area {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.option-button {
  width: 100%;
  min-height: 62px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border: 4px solid var(--line);
  color: var(--ink);
  background: white;
  box-shadow: 5px 5px 0 var(--line);
  text-align: left;
  cursor: pointer;
}

.option-button:hover {
  background: #fff0bb;
}

.option-button strong {
  font-size: 15px;
  line-height: 1.35;
}

.slider-panel {
  padding: 18px;
  background: white;
  border: 4px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
}

.slider-value {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.slider-value strong {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(44px, 14vw, 58px);
  line-height: 0.9;
}

.slider-value span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  text-align: right;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

.range-labels {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.next-button {
  margin-top: 16px;
}

.result-actions {
  margin-bottom: 16px;
}

.result-card {
  padding: 24px;
  background: var(--paper);
  border: 5px solid var(--line);
  box-shadow: var(--pixel-shadow);
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

.result-header {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.result-badge {
  margin: 20px 0 18px;
  padding: 16px;
  display: none;
  color: var(--ink);
  background: var(--red);
  border: 4px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 30px;
  line-height: 1.1;
}

.result-card h2 {
  display: none;
  margin-bottom: 12px;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 44px;
  line-height: 1.04;
  letter-spacing: 0;
}

.score-line {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  background: transparent;
  border: 0;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 900;
}

.score-line strong {
  font: inherit;
}

.result-illustration {
  width: min(100%, 360px);
  display: block;
  margin: 22px auto 18px;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  image-rendering: auto;
}

.result-outcome {
  margin-top: 14px;
  padding: 18px;
  background: #fff8e8;
  border: 4px solid var(--line);
  box-shadow: 6px 6px 0 var(--line);
}

.score-details {
  margin-top: 18px;
  padding: 16px;
  background: rgba(255, 248, 232, 0.72);
  border: 3px dashed var(--line);
}

.score-details > span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

#scoreDetails {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.score-detail-item {
  min-height: 34px;
  padding: 7px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border: 3px solid var(--line);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.score-detail-item strong {
  color: var(--red);
  font-size: 14px;
}

.result-source {
  margin: 18px 0 0;
  color: rgba(17, 17, 28, 0.62);
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

#resultSummary {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.35;
  font-weight: 900;
}

.advice-box {
  margin-top: 22px;
  padding: 18px;
  background: var(--green);
  border: 4px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
}

.advice-box span,
.share-footer span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.advice-box p {
  margin: 8px 0 0;
  line-height: 1.65;
  font-weight: 900;
}

.share-footer {
  margin-top: 24px;
  padding: 16px;
  display: grid;
  gap: 5px;
  background: #fff;
  border: 4px dashed var(--line);
}

#posterCanvas {
  display: none;
}

@media (max-width: 420px) {
  .app-shell {
    padding: 14px;
  }

  .screen {
    min-height: calc(100vh - 28px);
  }

  .intro-card {
    min-height: 520px;
    margin-top: 70px;
    padding: 20px;
  }

  .question-card {
    min-height: 520px;
    padding: 20px;
  }

  .question-card h2 {
    font-size: 27px;
  }

  .result-card h2 {
    font-size: 40px;
  }

  .result-badge {
    font-size: 26px;
  }
}
