/* --- Exam map (Phase 1) --- */
.exam-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  min-width: 0;
}
.exam-hero {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 2px solid rgba(255, 138, 76, 0.28);
  border-radius: var(--radius-card);
  background:
    radial-gradient(circle at 95% 5%, rgba(255, 202, 128, 0.38) 0 22%, transparent 23%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 224, 190, 0.72));
  box-shadow: var(--card-shadow);
}
.exam-hero__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.exam-hero__avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  overflow: hidden;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(255, 138, 76, 0.26);
}
.exam-hero__avatar img,
.exam-marker__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.exam-hero__eyebrow {
  display: block;
  color: #a84e20;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.exam-hero__name {
  overflow-wrap: anywhere;
  margin: 1px 0 0;
  color: var(--fg);
  font-size: 21px;
  line-height: 1.3;
}
.exam-hero__level {
  margin-top: 15px;
  color: var(--fg);
  font-size: 16px;
  font-weight: 800;
}
.exam-hero__progress {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 7px;
  color: var(--fg-soft);
  font-size: 14px;
}
.exam-hero__progress strong {
  color: var(--accent);
  font-size: 20px;
}
.exam-hero__bar {
  width: 100%;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(107, 90, 74, 0.13);
}
.exam-hero__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ffbb68);
  transition: width 0.5s ease;
}
.exam-hero__next {
  margin: 12px 0 0;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
}
.exam-map {
  position: relative;
  min-width: 0;
  padding: 10px 2px 24px;
}
.exam-map__start {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 184px;
  margin: 0 auto 54px;
  padding: 10px 14px;
  border: 2px solid #ca8548;
  border-radius: 18px;
  background: #fff7e8;
  box-shadow: 0 4px 10px rgba(91, 58, 28, 0.13);
}
.exam-map__start--current {
  margin-bottom: 82px;
  border-color: var(--accent);
  box-shadow: 0 0 0 5px rgba(255, 138, 76, 0.15), var(--card-shadow);
}
.exam-map__start-icon {
  font-size: 28px;
}
.exam-map__start strong,
.exam-map__start small,
.exam-map__summit strong,
.exam-map__summit small {
  display: block;
}
.exam-map__start strong {
  font-size: 15px;
}
.exam-map__start small {
  color: var(--fg-soft);
  font-size: 10px;
}
.exam-map__start .exam-marker {
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
}
.exam-map__stages {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.exam-map__stages::before {
  position: absolute;
  z-index: 2;
  top: -62px;
  bottom: -55px;
  left: 50%;
  width: 7px;
  border-radius: 999px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(204, 135, 71, 0.52) 0 12px,
    transparent 12px 21px
  );
  content: "";
  transform: translateX(-50%);
}
.exam-map__region {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 58px;
  overflow: hidden;
  padding: 48px 8px 36px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 34px;
  background-position: center;
  background-size: cover;
  box-shadow:
    inset 0 0 70px rgba(255, 248, 231, 0.36),
    0 5px 16px rgba(84, 52, 22, 0.1);
}
.exam-map__region--1 {
  background-image:
    linear-gradient(rgba(255, 248, 231, 0.35), rgba(255, 248, 231, 0.48)),
    url("../assets/images/exam-map-l1-01.png");
}
.exam-map__region--2 {
  background-image:
    linear-gradient(rgba(255, 248, 231, 0.38), rgba(255, 248, 231, 0.5)),
    url("../assets/images/exam-map-l1-02.png");
}
.exam-map__region--3 {
  background-image:
    linear-gradient(rgba(247, 252, 255, 0.34), rgba(255, 248, 231, 0.46)),
    url("../assets/images/exam-map-l1-03.png");
}
.exam-map__region--4 {
  background-image:
    linear-gradient(rgba(255, 248, 231, 0.3), rgba(255, 248, 231, 0.44)),
    url("../assets/images/exam-map-l1-04.png");
}
.exam-map__region-title {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 50%;
  padding: 4px 11px;
  border: 1px solid rgba(120, 75, 30, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 7px rgba(84, 52, 22, 0.12);
  color: #74431f;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  transform: translateX(-50%);
}
.exam-stage-row {
  position: relative;
  z-index: 3;
  display: flex;
  width: 100%;
  min-width: 0;
}
.exam-stage-row::before {
  position: absolute;
  z-index: 0;
  top: 50%;
  border-top: 5px dashed rgba(204, 135, 71, 0.52);
  content: "";
}
.exam-stage-row--left {
  justify-content: flex-start;
  padding-left: 5px;
}
.exam-stage-row--left::before {
  right: 50%;
  left: 156px;
  border-radius: 0 999px 0 0;
}
.exam-stage-row--right {
  justify-content: flex-end;
  padding-right: 5px;
}
.exam-stage-row--right::before {
  right: 156px;
  left: 50%;
  border-radius: 999px 0 0;
}
.exam-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 156px;
  min-height: 142px;
  padding: 11px 9px 10px;
  border: 3px solid #dd8a45;
  border-radius: 28px;
  background: linear-gradient(160deg, #fff, #ffe1bd);
  box-shadow: 0 6px 14px rgba(107, 70, 35, 0.17);
  color: var(--fg);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.exam-stage:hover,
.exam-stage:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 9px 18px rgba(107, 70, 35, 0.22);
}
.exam-stage:focus-visible {
  outline: 3px solid #246f9e;
  outline-offset: 3px;
}
.exam-stage[aria-expanded="true"] {
  transform: translateY(-2px);
}
.exam-stage__type {
  font-size: 12px;
  font-weight: 800;
}
.exam-stage__number {
  display: grid;
  place-items: center;
  width: 51px;
  height: 51px;
  margin: 5px 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
}
.exam-stage__need {
  color: var(--fg-soft);
  font-size: 11px;
  font-weight: 700;
}
.exam-stage__status {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 800;
}
.exam-stage--locked {
  border-style: dashed;
  border-color: #9b8a7a;
  background: linear-gradient(160deg, #fff, #e9e2d8);
}
.exam-stage--locked .exam-stage__number {
  background: #8d8176;
}
.exam-stage--coming-soon {
  border-style: dashed;
  border-color: #6e9db4;
  background: linear-gradient(160deg, #f8fcff, #dceef4);
}
.exam-stage--coming-soon .exam-stage__number {
  background: #5b8ea7;
}
.exam-stage--review {
  border-color: #5fa886;
  background: linear-gradient(160deg, #fff, #d7f0e6);
}
.exam-stage--review .exam-stage__number {
  background: #438d6d;
}
.exam-stage--review.exam-stage--locked {
  border-color: #9b8a7a;
  background: linear-gradient(160deg, #fff, #e9e2d8);
}
.exam-stage--review.exam-stage--locked .exam-stage__number {
  background: #8d8176;
}
.exam-stage--review.exam-stage--coming-soon {
  border-color: #6e9db4;
  background: linear-gradient(160deg, #f8fcff, #dceef4);
}
.exam-stage--review.exam-stage--coming-soon .exam-stage__number {
  background: #5b8ea7;
}
.exam-stage--boss {
  width: 174px;
  min-height: 158px;
  border-width: 4px;
  border-color: #a77a21;
  background: linear-gradient(145deg, #fffef4, #ffe19a);
  box-shadow: 0 7px 18px rgba(126, 83, 13, 0.24);
}
.exam-stage--boss .exam-stage__number {
  width: 60px;
  height: 60px;
  background: #b77b16;
  font-size: 28px;
}
.exam-stage--boss.exam-stage--locked {
  border-color: #9b8a7a;
  background: linear-gradient(160deg, #fff, #e9e2d8);
}
.exam-stage--boss.exam-stage--locked .exam-stage__number {
  background: #8d8176;
}
.exam-stage--boss.exam-stage--coming-soon {
  border-color: #6e9db4;
  background: linear-gradient(160deg, #f8fcff, #dceef4);
}
.exam-stage--boss.exam-stage--coming-soon .exam-stage__number {
  background: #5b8ea7;
}
.exam-stage--current {
  box-shadow: 0 0 0 6px rgba(255, 138, 76, 0.2), 0 8px 18px rgba(107, 70, 35, 0.24);
}
.exam-stage--selected {
  outline: 3px solid rgba(58, 42, 26, 0.52);
  outline-offset: 3px;
}
.exam-marker {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 78px;
  filter: drop-shadow(0 5px 5px rgba(80, 45, 18, 0.2));
  pointer-events: none;
}
.exam-stage-row--left > .exam-marker {
  top: 25px;
  left: 172px;
}
.exam-stage-row--right > .exam-marker {
  top: 25px;
  right: 172px;
}
.exam-marker__label {
  position: relative;
  z-index: 1;
  margin-bottom: -3px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ad421f;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}
.exam-marker__avatar {
  display: block;
  width: 62px;
  height: 62px;
  overflow: hidden;
  border: 4px solid var(--accent);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(255, 138, 76, 0.36);
  animation: exam-marker-float 2.6s ease-in-out infinite;
}
@keyframes exam-marker-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.exam-stage-info {
  position: relative;
  z-index: 5;
  width: 100%;
  margin: -36px 0 0;
  padding: 14px 16px;
  border: 2px solid rgba(221, 138, 69, 0.5);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--card-shadow);
  color: var(--fg);
  font-size: 13px;
}
.exam-stage-info[hidden] {
  display: none;
}
.exam-stage-info strong {
  display: block;
  font-size: 15px;
}
.exam-stage-info p {
  margin: 7px 0 0;
  color: var(--fg-soft);
}
.exam-stage-info--locked {
  border-color: #9b8a7a;
}
.exam-stage-info--coming-soon {
  border-color: #6e9db4;
  background: #f5fbfd;
}
.exam-stage-info__facts {
  display: grid;
  gap: 5px;
  margin: 9px 0 0;
}
.exam-stage-info__facts div {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 8px;
}
.exam-stage-info__facts dt {
  color: var(--fg-soft);
  font-weight: 700;
}
.exam-stage-info__facts dd {
  margin: 0;
  font-weight: 700;
}
.exam-stage-info .exam-stage-info__notice {
  color: #a84e20;
  font-weight: 800;
}
.exam-stage-info__start {
  width: 100%;
  margin-top: 12px;
  padding: 11px 18px;
  font-size: 15px;
}
.exam-map__summit {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 210px;
  margin: 62px auto 0;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(150deg, #fff, #e8f4f4);
  box-shadow: var(--card-shadow);
  text-align: center;
}
.exam-map__summit > span {
  font-size: 42px;
  line-height: 1;
}
.exam-map__summit strong {
  margin-top: 5px;
  font-size: 15px;
}
.exam-map__summit small {
  margin-top: 2px;
  color: var(--fg-soft);
  font-size: 10px;
}

/* --- Exam question runner --- */
.exam-runner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.exam-runner__topbar {
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  gap: 8px;
}
.exam-runner__topbar > div {
  display: flex;
  flex-direction: column;
  text-align: center;
}
.exam-runner__topbar strong {
  font-size: 14px;
}
.exam-runner__topbar span {
  color: var(--fg-soft);
  font-size: 11px;
}
.exam-runner__exit {
  padding: 7px 9px;
  border: 1px solid rgba(58, 42, 26, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--fg);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.exam-runner__progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(58, 42, 26, 0.1);
}
.exam-runner__progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ffc15e);
  transition: width 0.25s ease;
}
.exam-question {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 18px;
  border: 2px solid rgba(255, 138, 76, 0.26);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.67);
  box-shadow: var(--card-shadow);
}
.exam-question__type {
  align-self: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 138, 76, 0.14);
  color: #a84e20;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
}
.exam-question__prompt {
  margin: 0;
  font-size: 19px;
  line-height: 1.45;
  text-align: center;
}
.exam-question__image {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 5px 14px rgba(58, 42, 26, 0.16);
}
.exam-question__stem {
  padding: 18px 14px;
  border-radius: 16px;
  background: #fff8ea;
  color: var(--fg);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
}
.exam-question__hint {
  padding: 6px 14px;
  border-radius: 12px;
  background: rgba(58, 42, 26, 0.06);
  color: var(--fg-soft);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}
.exam-answer-list,
.exam-audio-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.exam-answer {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 13px 14px;
  border: 2px solid rgba(58, 42, 26, 0.13);
  border-radius: 14px;
  background: #fff;
  color: var(--fg);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.exam-answer:hover:not(:disabled),
.exam-answer:focus-visible {
  border-color: var(--accent);
}
.exam-answer:disabled {
  color: var(--fg);
  cursor: default;
  opacity: 1;
}
.exam-answer--correct {
  border-color: #3e9565;
  background: #e6f6ec;
}
.exam-answer--wrong {
  border-color: #c45a4c;
  background: #fbe9e6;
}
.exam-answer--muted {
  opacity: 0.54;
}
.exam-audio-choice {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 8px;
  padding: 9px;
  border: 2px solid rgba(58, 42, 26, 0.12);
  border-radius: 15px;
  background: #fff;
}
.exam-audio-choice__play,
.exam-audio-choice__pick {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}
.exam-audio-choice__play {
  background: rgba(255, 138, 76, 0.15);
  color: #9a481f;
}
.exam-audio-choice__play[aria-busy="true"] {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.exam-audio-choice__pick {
  background: var(--accent);
  color: #fff;
}
.exam-audio-choice__pick:disabled {
  background: rgba(58, 42, 26, 0.11);
  color: var(--fg-soft);
  cursor: default;
}
.exam-audio-choice__text {
  grid-column: 1 / -1;
  padding: 2px 4px;
  color: var(--fg);
  font-size: 12px;
  font-weight: 700;
}
.exam-audio-choice.exam-answer--correct {
  border-color: #3e9565;
  background: #e6f6ec;
}
.exam-audio-choice.exam-answer--wrong {
  border-color: #c45a4c;
  background: #fbe9e6;
}
.exam-audio-status {
  min-height: 18px;
  color: var(--fg-soft);
  font-size: 11px;
  text-align: center;
}
.exam-question__feedback {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
}
.exam-question__feedback strong {
  display: block;
  font-size: 16px;
}
.exam-question__feedback p {
  margin: 4px 0 0;
  line-height: 1.55;
}
.exam-question__feedback--correct {
  background: #e6f6ec;
  color: #286a45;
}
.exam-question__feedback--wrong {
  background: #fff0dc;
  color: #8b4a20;
}
.exam-question__next {
  width: 100%;
}
.exam-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 18px;
  border: 2px solid rgba(255, 138, 76, 0.28);
  border-radius: var(--radius-card);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.84), rgba(255, 226, 190, 0.72));
  box-shadow: var(--card-shadow);
  text-align: center;
}
.exam-result__icon {
  font-size: 58px;
  line-height: 1;
}
.exam-result h1 {
  margin: 0;
  font-size: 25px;
}
.exam-result__stars {
  color: #e69a13;
  font-size: 34px;
  letter-spacing: 3px;
}
.exam-result__score {
  color: var(--accent);
  font-size: 38px;
  font-weight: 900;
  line-height: 1.1;
}
.exam-result__score small {
  display: block;
  margin-top: 4px;
  color: var(--fg-soft);
  font-size: 12px;
}
.exam-result > p {
  margin: 2px 0 8px;
  color: var(--fg-soft);
  font-size: 14px;
}
.exam-result__wrong {
  width: 100%;
  padding: 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  text-align: left;
}
.exam-result__wrong h2 {
  margin: 0 0 8px;
  font-size: 14px;
}
.exam-result__wrong ul {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.exam-result__wrong li {
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: #fff8ea;
}
.exam-result__wrong strong,
.exam-result__wrong span {
  display: block;
  overflow-wrap: anywhere;
}
.exam-result__wrong strong {
  font-size: 12px;
}
.exam-result__wrong span {
  color: var(--fg-soft);
  font-size: 11px;
}
.exam-result__actions {
  display: grid;
  gap: 9px;
  width: 100%;
  margin-top: 4px;
}
.exam-result__actions .btn {
  width: 100%;
  font-size: 15px;
}

@media (max-width: 360px) {
  .exam-stage {
    width: 142px;
  }
  .exam-stage--boss {
    width: 154px;
  }
  .exam-stage-row--left::before {
    left: 142px;
  }
  .exam-stage-row--right::before {
    right: 142px;
  }
  .exam-stage-row--left > .exam-marker {
    left: 148px;
  }
  .exam-stage-row--right > .exam-marker {
    right: 148px;
  }
  .exam-marker {
    width: 68px;
  }
  .exam-marker__avatar {
    width: 56px;
    height: 56px;
  }
}

