:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #5f6b7a;
  --paper: #f5f7f9;
  --panel: #ffffff;
  --line: #dbe2ea;
  --blue: #005bac;
  --blue-deep: #003f82;
  --red: #d71920;
  --green: #1c7c54;
  --gold: #b6811f;
  --wrong-bg: #fff1f1;
  --right-bg: #edf9f2;
  --focus: #f0b429;
  --shadow: 0 18px 40px rgba(17, 24, 39, 0.14);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(0, 91, 172, 0.08), rgba(215, 25, 32, 0.04) 360px, var(--paper) 680px);
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: #142238;
}

.hero__image,
.hero__shade {
  position: absolute;
  inset: 0;
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__shade {
  background:
    linear-gradient(90deg, rgba(2, 11, 24, 0.92), rgba(2, 11, 24, 0.62) 48%, rgba(2, 11, 24, 0.28)),
    linear-gradient(180deg, rgba(0, 91, 172, 0.18), rgba(215, 25, 32, 0.14));
}

.hero__content {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  padding: 54px 46px;
  color: #ffffff;
}

.eyebrow,
.question-count,
.status-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.45;
}

.hero .eyebrow {
  color: #ffd3d6;
}

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

h1 {
  margin: 12px 0 16px;
  font-size: 2.75rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.hero__lead {
  width: min(560px, 100%);
  margin: 0;
  color: #eef5ff;
  font-size: 1.04rem;
  line-height: 1.8;
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.status-panel,
.quiz-card,
.result-card,
.note-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.status-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border-color: #cfd9e6;
}

.status-panel > div {
  min-height: 82px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #f7fafc);
}

.status-value {
  margin: 7px 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
}

.quiz-card,
.result-card {
  min-height: 540px;
  padding: 28px;
}

.quiz-card__top {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 22px;
}

.question-count {
  flex: 0 0 auto;
  color: var(--blue-deep);
}

.progress-track {
  flex: 1 1 auto;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #e9eef4;
}

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

.quiz-card h2,
.result-card h2 {
  margin: 20px 0 22px;
  font-size: 1.55rem;
  line-height: 1.55;
  letter-spacing: 0;
}

.choices {
  display: grid;
  gap: 12px;
}

.choice {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 66px;
  padding: 11px 14px;
  color: var(--ink);
  text-align: left;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.choice:hover:not(:disabled) {
  border-color: var(--blue);
  background: #f4f9ff;
  transform: translateY(-1px);
}

.choice:disabled {
  cursor: default;
}

.choice__letter {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #ffffff;
  font-weight: 800;
  border-radius: 50%;
  background: var(--blue);
}

.choice__text {
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.55;
}

.choice.is-correct {
  border-color: rgba(28, 124, 84, 0.55);
  background: var(--right-bg);
}

.choice.is-correct .choice__letter {
  background: var(--green);
}

.choice.is-wrong {
  border-color: rgba(215, 25, 32, 0.5);
  background: var(--wrong-bg);
}

.choice.is-wrong .choice__letter {
  background: var(--red);
}

.feedback {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #cfd9e6;
  border-radius: 8px;
  background: #fbfcfe;
}

.feedback__result {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.4;
}

.feedback__body,
.note-panel p,
.result-copy,
.copy-status {
  margin: 0;
  color: #334155;
  font-size: 0.98rem;
  line-height: 1.75;
}

.feedback__sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--blue-deep);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #cdddf0;
  border-radius: 999px;
  background: #f4f9ff;
}

.source-link:hover {
  border-color: var(--blue);
  background: #eaf3ff;
}

.actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.button {
  min-width: 124px;
  min-height: 46px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 800;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.button--primary {
  color: #ffffff;
  background: var(--blue);
}

.button--primary:hover:not(:disabled) {
  background: var(--blue-deep);
}

.button--secondary {
  color: var(--blue-deep);
  border-color: #cdddf0;
  background: #ffffff;
}

.button--secondary:hover:not(:disabled) {
  background: #f4f9ff;
}

.button:disabled {
  color: #9aa6b2;
  cursor: not-allowed;
  background: #eef2f6;
}

.note-panel {
  padding: 20px;
}

.note-panel p + p {
  margin-top: 14px;
}

.result-score {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.1;
}

.copy-status {
  min-height: 28px;
  margin-top: 12px;
  color: var(--green);
  font-weight: 700;
}

.review-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.review-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.review-item__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--blue-deep);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.4;
}

.review-item__question,
.review-item__answer {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.7;
}

.review-item__answer {
  margin-top: 8px;
  color: #475569;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 22px, 720px);
    padding-top: 12px;
  }

  .hero {
    min-height: 300px;
  }

  .hero__content {
    padding: 42px 26px;
  }

  h1 {
    font-size: 2.05rem;
  }

  .quiz-layout {
    grid-template-columns: 1fr;
  }

  .status-panel {
    grid-template-columns: 1fr;
  }

  .status-panel > div {
    min-height: 72px;
  }

  .quiz-card,
  .result-card {
    min-height: auto;
    padding: 22px;
  }
}

@media (max-width: 520px) {
  .hero {
    min-height: 270px;
  }

  .hero__shade {
    background:
      linear-gradient(180deg, rgba(2, 11, 24, 0.86), rgba(2, 11, 24, 0.62)),
      linear-gradient(180deg, rgba(0, 91, 172, 0.16), rgba(215, 25, 32, 0.14));
  }

  h1 {
    font-size: 1.78rem;
  }

  .hero__lead {
    font-size: 0.98rem;
  }

  .quiz-card__top {
    display: grid;
    gap: 10px;
  }

  .quiz-card h2,
  .result-card h2 {
    font-size: 1.22rem;
  }

  .choice {
    grid-template-columns: 36px minmax(0, 1fr);
    min-height: 62px;
  }

  .choice__letter {
    width: 36px;
    height: 36px;
  }

  .button {
    width: 100%;
  }
}
