:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5c6875;
  --paper: #f6f7f4;
  --panel: #ffffff;
  --line: #d9dfd8;
  --blue: #1769aa;
  --green: #18825f;
  --red: #d95c4b;
  --yellow: #f0b84d;
  --shadow: 0 20px 60px rgba(23, 32, 42, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(240, 184, 77, .22), transparent 28rem),
    linear-gradient(145deg, #f7f7f0 0%, #e9f1ef 46%, #f6ece7 100%);
}

button, a {
  font: inherit;
}

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

.top-band {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  min-height: 220px;
  padding: 30px;
}

.brand-mark {
  width: 124px;
  height: 124px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.brand-mark span {
  border: 3px solid var(--ink);
  background: var(--panel);
  box-shadow: 8px 8px 0 rgba(23, 32, 42, .08);
}

.brand-mark span:nth-child(1) {
  border-radius: 50%;
  background: var(--yellow);
}

.brand-mark span:nth-child(2) {
  background: var(--blue);
  transform: rotate(45deg) scale(.72);
}

.brand-mark span:nth-child(3) {
  background: repeating-linear-gradient(90deg, var(--green) 0 8px, #fff 8px 15px);
}

.brand-mark span:nth-child(4) {
  border-radius: 50% 50% 4px 4px;
  background: var(--red);
}

.intro h1 {
  margin: 4px 0 12px;
  max-width: 720px;
  font-size: clamp(2rem, 5vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  font-weight: 800;
  color: var(--green);
}

.lead {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.8;
}

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

.stats div {
  width: 112px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}

.stats strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.stats span {
  color: var(--muted);
  font-size: .88rem;
}

.test-panel {
  min-height: 540px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.start-view,
.quiz-view,
.result-view {
  padding: clamp(24px, 5vw, 54px);
}

.start-view {
  display: grid;
  grid-template-columns: minmax(280px, 440px) 1fr;
  gap: 44px;
  align-items: center;
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 14px;
  aspect-ratio: 1;
}

.tile {
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.tile.circle::after {
  content: "";
  position: absolute;
  inset: 22%;
  border: 16px solid var(--blue);
  border-radius: 50%;
}

.tile.bars {
  background: repeating-linear-gradient(135deg, var(--yellow) 0 16px, #fff 16px 28px);
}

.tile.diamond::after {
  content: "";
  position: absolute;
  width: 52%;
  height: 52%;
  left: 24%;
  top: 24%;
  background: var(--green);
  transform: rotate(45deg);
}

.tile.dots {
  background-image: radial-gradient(circle, var(--red) 0 9px, transparent 10px);
  background-size: 38px 38px;
}

.start-copy h2,
.quiz-view h2,
.result-view h2 {
  margin: 0 0 16px;
  font-size: clamp(1.55rem, 3vw, 2.65rem);
  line-height: 1.22;
  letter-spacing: 0;
}

.start-copy p,
.result-view p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.8;
}

.primary-button,
.ghost-button,
.share-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--ink);
}

.ghost-button,
.share-link {
  color: var(--ink);
  background: #fff;
}

.progress-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 26px;
  color: var(--muted);
  font-weight: 700;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: #e7ebe5;
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width .25s ease;
}

.question-visual {
  min-height: 150px;
  margin-bottom: 26px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.visual-card {
  width: 104px;
  height: 104px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  font-weight: 900;
}

.visual-shape {
  width: 54px;
  height: 54px;
  background: var(--blue);
}

.shape-circle {
  border-radius: 50%;
}

.shape-diamond {
  transform: rotate(45deg);
  background: var(--green);
}

.shape-triangle {
  width: 0;
  height: 0;
  border-left: 32px solid transparent;
  border-right: 32px solid transparent;
  border-bottom: 58px solid var(--red);
  background: transparent;
}

.shape-stripes {
  background: repeating-linear-gradient(90deg, var(--yellow) 0 10px, var(--ink) 10px 14px);
}

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

.answer-button {
  min-height: 64px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.answer-button:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: 0 10px 24px rgba(23, 105, 170, .14);
}

.answer-button.selected {
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px var(--green);
}

.back-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.back-button:disabled {
  color: #9aa3aa;
  cursor: not-allowed;
  opacity: .55;
}

.result-view {
  text-align: center;
}

.score-ring {
  width: 180px;
  height: 180px;
  margin: 10px auto 22px;
  border: 14px solid var(--green);
  border-left-color: var(--yellow);
  border-bottom-color: var(--blue);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
}

.score-ring span {
  display: block;
  font-size: 3.4rem;
  font-weight: 900;
  line-height: .9;
}

.score-ring small {
  color: var(--muted);
  font-weight: 800;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 22px 0 14px;
}

.hidden {
  display: none;
}

@media (max-width: 820px) {
  .top-band,
  .start-view {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    width: 96px;
    height: 96px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats div {
    width: auto;
  }

  .answers {
    grid-template-columns: 1fr;
  }

  .progress-row {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
  }

  .question-visual {
    min-height: 120px;
  }

  .visual-card {
    width: 78px;
    height: 78px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding: 10px 0;
  }

  .top-band {
    padding: 18px 4px 24px;
  }

  .test-panel {
    min-height: 520px;
  }

  .stats {
    gap: 8px;
  }

  .stats div {
    padding: 10px;
  }

  .share-row > * {
    width: 100%;
  }
}
