:root {
  --ink: #181611;
  --muted: #6b655b;
  --paper: #f7f1e6;
  --panel: rgba(255, 251, 242, 0.88);
  --line: rgba(24, 22, 17, 0.14);
  --green: #18684f;
  --red: #b33f2f;
  --blue: #265f92;
  --gold: #bd8b2c;
  --shadow: 0 22px 70px rgba(39, 32, 20, 0.17);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Georgia", "Noto Serif SC", "Songti SC", serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(179, 63, 47, 0.22), transparent 28rem),
    radial-gradient(circle at 86% 18%, rgba(38, 95, 146, 0.18), transparent 30rem),
    linear-gradient(135deg, #f8f0e1 0%, #ece5d7 46%, #e5edf0 100%);
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  min-height: 100vh;
  padding: clamp(16px, 3vw, 34px);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.test-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - clamp(32px, 6vw, 68px));
  padding: clamp(18px, 3vw, 34px);
}

.topbar,
.progress-meta,
.nav-row,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-family: "Trebuchet MS", "Noto Sans SC", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 72px);
  line-height: 0.96;
}

.icon-button {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: #fff8eb;
  cursor: pointer;
}

.progress-wrap {
  margin: 26px 0 24px;
}

.progress-meta {
  color: var(--muted);
  font-family: "Trebuchet MS", "Noto Sans SC", sans-serif;
  font-size: 14px;
}

.progress-track {
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(24, 22, 17, 0.1);
  border-radius: 999px;
  background: rgba(24, 22, 17, 0.08);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green), var(--blue));
  transition: width 220ms ease;
}

.question-card {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-height: 430px;
  padding: clamp(20px, 4vw, 58px);
  border: 1px solid rgba(24, 22, 17, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.72), rgba(255, 248, 235, 0.5)),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(24, 22, 17, 0.035) 32px);
}

.question-index {
  position: absolute;
  top: 20px;
  right: 24px;
  color: rgba(24, 22, 17, 0.14);
  font-size: clamp(48px, 8vw, 108px);
  font-weight: 700;
  line-height: 1;
}

.question-card h2 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(25px, 4vw, 52px);
  line-height: 1.12;
}

.question-card p {
  max-width: 640px;
  margin: 16px 0 28px;
  color: var(--muted);
  font-family: "Trebuchet MS", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.answer-option {
  min-height: 92px;
  padding: 13px 10px;
  border: 1px solid rgba(24, 22, 17, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 252, 244, 0.74);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.answer-option:hover {
  transform: translateY(-2px);
  border-color: rgba(24, 22, 17, 0.38);
}

.answer-option[aria-checked="true"] {
  border-color: var(--green);
  background: rgba(24, 104, 79, 0.13);
  box-shadow: inset 0 0 0 1px rgba(24, 104, 79, 0.2);
}

.answer-option strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Trebuchet MS", "Noto Sans SC", sans-serif;
  font-size: 13px;
}

.answer-option span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.nav-row {
  margin-top: 18px;
}

.ghost-button,
.primary-button {
  min-width: 120px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  cursor: pointer;
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 251, 242, 0.78);
}

.primary-button {
  border: 1px solid #122d23;
  color: #fffaf0;
  background: #193c30;
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
}

.type-orbit {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background:
    conic-gradient(from 25deg, rgba(179, 63, 47, 0.18), rgba(38, 95, 146, 0.2), rgba(24, 104, 79, 0.18), rgba(189, 139, 44, 0.2), rgba(179, 63, 47, 0.18)),
    rgba(255, 251, 242, 0.72);
}

.type-orbit span {
  position: absolute;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #fffaf0;
  background: var(--ink);
  font-family: "Trebuchet MS", "Noto Sans SC", sans-serif;
  font-weight: 700;
}

.type-orbit span:nth-child(1) { top: 18px; }
.type-orbit span:nth-child(2) { right: 18px; }
.type-orbit span:nth-child(3) { bottom: 18px; }
.type-orbit span:nth-child(4) { left: 18px; }

.type-orbit strong {
  font-size: clamp(36px, 5vw, 54px);
}

.score-board {
  display: grid;
  gap: 12px;
}

.axis-row {
  display: grid;
  gap: 7px;
}

.axis-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: "Trebuchet MS", "Noto Sans SC", sans-serif;
  font-size: 13px;
}

.axis-track {
  position: relative;
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 22, 17, 0.1);
}

.axis-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-radius: 999px;
  background: var(--blue);
}

.axis-fill.left {
  right: 50%;
  left: auto;
  background: var(--red);
}

.note {
  margin: auto 0 0;
  color: var(--muted);
  font-family: "Trebuchet MS", "Noto Sans SC", sans-serif;
  font-size: 13px;
  line-height: 1.65;
}

.result-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(18, 16, 12, 0.54);
  backdrop-filter: blur(14px);
}

.result-screen[hidden] {
  display: none;
}

.result-card {
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: #fff8eb;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.result-card h2 {
  margin: 0;
  color: var(--green);
  font-size: clamp(54px, 10vw, 110px);
  line-height: 0.86;
}

.result-card h3 {
  margin: 14px 0 10px;
  font-size: clamp(22px, 3vw, 34px);
}

.result-card p {
  color: var(--muted);
  line-height: 1.75;
}

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

.result-item {
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.result-item strong {
  display: block;
  margin-bottom: 8px;
  font-family: "Trebuchet MS", "Noto Sans SC", sans-serif;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    order: -1;
  }

  .type-orbit {
    max-width: 280px;
    margin: 0 auto;
  }
}

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

  .question-card {
    min-height: auto;
  }

  .topbar {
    align-items: flex-start;
  }

  .nav-row,
  .action-row {
    flex-direction: column;
  }

  .ghost-button,
  .primary-button {
    width: 100%;
  }
}
