﻿:root {
  --bg-1: #f4efe5;
  --bg-2: #ece4d5;
  --ink: #201a13;
  --muted: #6d604e;
  --line: #c8b89d;
  --paper: #fbf7ef;
  --paper-strong: #f7f1e6;
  --accent: #8b5e3c;
  --accent-2: #b4875f;
  --success: #1f7a57;
  --danger: #9b2d2d;
  --shadow-lg: 0 24px 60px rgba(45, 32, 19, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at 12% 16%, rgba(180, 140, 90, 0.18), transparent 35%),
    radial-gradient(circle at 88% 82%, rgba(136, 93, 56, 0.18), transparent 34%),
    linear-gradient(120deg, var(--bg-1), var(--bg-2));
  overflow-x: hidden;
}

.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: radial-gradient(circle at 1px 1px, rgba(48, 35, 22, 0.16) 1px, transparent 0);
  background-size: 4px 4px;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

.bg-glow-a {
  width: 300px;
  height: 300px;
  top: -100px;
  right: -80px;
  background: rgba(174, 131, 89, 0.32);
}

.bg-glow-b {
  width: 260px;
  height: 260px;
  bottom: -90px;
  left: -70px;
  background: rgba(117, 77, 45, 0.25);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 24px auto;
  padding: 16px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
  text-align: center;
}

.brand-mark {
  width: 16px;
  height: 64px;
  background: linear-gradient(180deg, #5c3d22, #b0885c 48%, #5c3d22);
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(255, 244, 222, 0.32);
}

.brand-kicker {
  margin: 0;
  letter-spacing: 2px;
  font-size: 0.74rem;
  color: var(--muted);
}

.brand h1 {
  margin: 4px 0 0;
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  letter-spacing: 0.6px;
}

.screen {
  display: none;
  background: linear-gradient(180deg, rgba(252, 247, 238, 0.96), rgba(246, 238, 224, 0.94));
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  animation: floatIn 0.48s ease;
}

.screen.active {
  display: block;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-eyebrow {
  margin: 0 0 8px;
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: var(--muted);
}

h2,
h3 {
  margin-top: 0;
}

h2 {
  margin-bottom: 8px;
  font-family: "Noto Serif SC", serif;
  letter-spacing: 0.3px;
}

.subtext {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.7;
}

.code-form {
  display: grid;
  gap: 10px;
  max-width: 460px;
}

label {
  font-weight: 600;
  color: #32261a;
}

input[type="text"] {
  width: 100%;
  border: 1px solid #baa789;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  background: #fffdf9;
  color: #2b2118;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.15);
}

button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 0.97rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #fdf8f0;
  background: linear-gradient(130deg, #6c4a2d, #a47a53 58%, #6a472b);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.ghost {
  background: rgba(255, 250, 241, 0.82);
  color: #5f4228;
  border-color: #b9a181;
}

.feedback {
  min-height: 24px;
  font-weight: 600;
  margin-top: 10px;
}

.hint {
  color: var(--muted);
  margin: 2px 0 0;
}

.hint code {
  padding: 2px 8px;
  border-radius: 8px;
  background: #f2e9da;
  border: 1px solid #dcc9ab;
}

.quiz-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.quiz-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

#question-counter {
  color: #4f4131;
  font-weight: 700;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 1rem;
  font-variant-numeric: proportional-nums;
}

#timer-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: #ede0cb;
  border: 1px solid #cab08b;
  color: #5c4329;
  font-weight: 700;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.96rem;
  letter-spacing: 0;
  font-variant-numeric: proportional-nums;
  min-width: 86px;
  text-align: center;
}

#timer-pill.warn {
  color: #fff7ef;
  background: #9b2d2d;
  border-color: #7f1f1f;
}

.progress-wrap {
  width: 100%;
  height: 12px;
  margin: 14px 0 20px;
  border-radius: 999px;
  overflow: hidden;
  background: #e6d8c2;
  box-shadow: inset 0 2px 6px rgba(78, 56, 31, 0.12);
}

.progress-wrap.wide {
  height: 14px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #7b522d, #b88a56);
  transition: width 0.3s ease;
}

.question-card {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid #c9b69b;
  background: linear-gradient(160deg, #fffdfa, #f7f0e2);
  max-width: 760px;
  margin: 0 auto;
}

#question-text {
  font-size: 1.12rem;
  line-height: 1.6;
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-width: 700px;
}

.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #cfbda2;
  background: rgba(255, 252, 245, 0.95);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.option:hover {
  border-color: #a47a53;
}

.option.selected {
  border-color: #7d5734;
  background: #f5ecdd;
}

.option input {
  margin-top: 3px;
  accent-color: #7d5734;
}

.quiz-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.subtle-tip {
  margin: 0;
  color: #6e5e4a;
  font-size: 0.88rem;
}

#loading-percent {
  text-align: right;
  margin-top: 0;
  color: var(--muted);
  font-weight: 700;
}

.result-card {
  background:
    linear-gradient(145deg, rgba(255, 252, 245, 0.98), rgba(245, 236, 223, 0.96));
  border: 1px solid #bca887;
  border-radius: 16px;
  padding: 22px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.report-head {
  border-bottom: 1px dashed #b79f7e;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.report-kicker {
  margin: 0;
  color: #72583f;
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 1.7px;
  font-size: 0.9rem;
}

.report-head h2 {
  margin: 2px 0 8px;
  font-size: 1.8rem;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #5e4b37;
  font-size: 0.88rem;
}

.report-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f0e4d0;
  border: 1px solid #cdb897;
}

.report-meta strong {
  font-family: "Noto Sans SC", sans-serif;
  font-size: 1.02rem;
  letter-spacing: 0;
  font-variant-numeric: proportional-nums;
}

.report-block {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #d4c0a0;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.75);
}

.report-block h3 {
  margin-bottom: 8px;
  font-family: "Noto Serif SC", serif;
}

.radar-wrap {
  border: 1px solid #cdb793;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbf7ef, #f5ead6);
  padding: 8px;
  overflow: hidden;
  max-width: 460px;
  margin: 0 auto;
}

#radar-chart {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.insight-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.insight-item {
  border: 1px solid #ccb292;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff8ed, #f4e8d3);
  padding: 10px 12px;
}

.insight-item h4 {
  margin: 0 0 4px;
  color: #4d3319;
  font-size: 1rem;
  font-family: "Noto Serif SC", serif;
}

.insight-item p {
  margin: 0;
  color: #463728;
  line-height: 1.62;
  font-size: 0.95rem;
}

.insight-item p + p {
  margin-top: 4px;
  color: #6a5a47;
  font-size: 0.86rem;
}

.persona-name {
  margin: 0 0 6px;
  color: #5e3f20;
  font-size: 1.14rem;
  font-weight: 800;
}

.persona-desc,
.report-text {
  margin: 0;
  line-height: 1.78;
  color: #33271c;
}

.report-text + .report-text {
  margin-top: 8px;
}

.trait-list,
.fortune-list {
  display: grid;
  gap: 8px;
}

.metric-row {
  display: grid;
  grid-template-columns: 96px 1fr 50px;
  align-items: center;
  gap: 10px;
}

.metric-row .bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #ebdcc2;
}

.metric-row .bar > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #7b542f, #c19866);
}

.metric-row strong {
  font-family: "Noto Sans SC", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.2px;
  font-variant-numeric: proportional-nums;
}

.result-footer {
  margin: 6px 0 0;
  font-size: 0.84rem;
  color: #6a5b49;
}

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 760px) {
  .app-shell {
    margin: 12px auto;
    padding: 12px;
  }

  .screen {
    padding: 16px;
    border-radius: 14px;
  }

  .quiz-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .quiz-meta {
    width: 100%;
    justify-content: space-between;
  }

  .quiz-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  #question-text {
    font-size: 1.03rem;
  }

  .metric-row {
    grid-template-columns: 72px 1fr 40px;
    font-size: 0.93rem;
  }

  .result-actions {
    flex-direction: column;
  }

  .report-head h2 {
    font-size: 1.45rem;
  }

  .question-card {
    max-width: 100%;
  }

  .options {
    max-width: 100%;
  }
}
