:root {
  --black: #0a0a0a;
  --charcoal: #171717;
  --gray: #737373;
  --line: #d7d7d7;
  --snow: #f4f4f2;
  --white: #fff;
  --accent: #d9ff43;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--black);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--black);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 35%),
    var(--black);
  font-family: Arial, "Helvetica Neue", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
}

.app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 14px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  color: var(--white);
}

.brand {
  color: inherit;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.header-label {
  color: #9b9b9b;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.diagnosis-card {
  position: relative;
  flex: 1;
  overflow: hidden;
  border-radius: 3px;
  background: var(--snow);
}

#questionView,
.result-view,
.flow-view {
  min-height: calc(100vh - 124px);
  padding: 28px 20px 22px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.progress-track {
  width: 100%;
  height: 4px;
  overflow: hidden;
  background: var(--line);
}

.progress-bar {
  width: 11.1111%;
  height: 100%;
  background: var(--black);
  transition: width 240ms ease;
}

.park-progress {
  width: 55.5556%;
}

.question-content {
  animation: appear 220ms ease both;
}

.eyebrow {
  margin: 48px 0 10px;
  color: var(--gray);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 7vw, 2.65rem);
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.question-guide {
  margin: 10px 0 28px;
  color: var(--gray);
  font-size: 0.78rem;
}

.options {
  display: grid;
  gap: 10px;
}

.number-entry-form {
  display: grid;
  gap: 12px;
}

.number-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 76px;
  border: 1px solid #c4c4c4;
  border-radius: 2px;
  background: var(--white);
  transition: border-color 150ms ease;
}

.number-field:focus-within {
  border-color: var(--black);
  box-shadow: 0 0 0 1px var(--black);
}

.number-field input {
  width: 100%;
  min-width: 0;
  height: 74px;
  padding: 12px 8px 12px 18px;
  border: 0;
  outline: 0;
  color: var(--black);
  background: transparent;
  font: inherit;
  font-size: 1.65rem;
  font-weight: 800;
}

.number-field input::placeholder {
  color: #b7b7b7;
}

.number-unit {
  padding: 0 20px 0 10px;
  color: var(--gray);
  font-size: 0.95rem;
  font-weight: 800;
}

.input-error {
  margin: 0;
  color: #a00000;
  font-size: 0.76rem;
  font-weight: 700;
}

.input-error[hidden] {
  display: none;
}

.number-submit {
  margin-top: 4px;
}

.option-button {
  position: relative;
  width: 100%;
  min-height: 62px;
  padding: 14px 48px 14px 17px;
  border: 1px solid #c4c4c4;
  border-radius: 2px;
  color: var(--black);
  background: var(--white);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.option-button::after {
  position: absolute;
  top: 50%;
  right: 17px;
  content: "→";
  transform: translateY(-50%);
}

.option-button:hover,
.option-button:focus-visible {
  border-color: var(--black);
  outline: none;
  background: var(--black);
  color: var(--white);
}

.option-button.selected {
  border-color: var(--black);
  background: var(--black);
  color: var(--white);
}

.navigation {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.text-button {
  padding: 8px 0;
  border: 0;
  color: #3e3e3e;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.text-button:disabled {
  opacity: 0.3;
  cursor: default;
}

.result-view {
  position: relative;
  overflow: hidden;
  animation: appear 320ms ease both;
}

.result-view[hidden],
.flow-view[hidden] {
  display: none;
}

.flow-view {
  position: relative;
  overflow: hidden;
  animation: appear 260ms ease both;
}

.flow-view .eyebrow {
  margin-top: 46px;
}

.flow-kicker {
  margin: 0 0 8px;
  color: var(--gray);
  font-size: 0.75rem;
  font-weight: 800;
}

.highlight-type {
  background: linear-gradient(transparent 62%, var(--accent) 62%);
}

.action-stack {
  display: grid;
  gap: 11px;
  margin-top: 28px;
}

.button-reset {
  border: 0;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 62px;
  padding: 15px 18px;
  border: 1px solid var(--black);
  border-radius: 0;
  color: var(--black);
  background: var(--white);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  color: var(--white);
  background: var(--black);
  outline: none;
}

.summary-heading {
  margin: 0 0 14px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.answer-summary {
  margin: 0;
  border-top: 1px solid var(--line);
}

.answer-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.answer-row dt {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--gray);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.answer-row dd {
  align-self: center;
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.5;
}

.change-button {
  align-self: center;
  padding: 6px 0 6px 10px;
  border: 0;
  color: var(--black);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.compact-summary .answer-row {
  padding: 12px 0;
}

.coming-soon {
  margin: 22px 0 0;
  padding: 15px;
  border-left: 4px solid var(--black);
  background: var(--white);
  font-size: 0.82rem;
  font-weight: 800;
}

.size-preview {
  margin: 0 0 24px;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 0.8rem;
  line-height: 1.7;
}

.size-preview strong {
  display: block;
  color: var(--gray);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.product-results {
  display: grid;
  gap: 12px;
  margin: 26px 0;
}

.product-card {
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--white);
}

.product-rank,
.product-meta {
  margin: 0 0 7px;
  color: var(--gray);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.product-card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.product-score {
  margin: 10px 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.product-reasons {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #424242;
  font-size: 0.76rem;
  line-height: 1.65;
}

.product-link {
  display: inline-block;
  margin-top: 15px;
  color: var(--black);
  font-size: 0.74rem;
  font-weight: 800;
  text-underline-offset: 4px;
}

.confirm-actions {
  margin-top: 24px;
}

.result-view .eyebrow {
  margin-top: 60px;
}

.result-view h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.8rem, 7.4vw, 3rem);
}

#resultType {
  display: inline;
  background: linear-gradient(transparent 62%, var(--accent) 62%);
}

.result-mark {
  position: absolute;
  top: 20px;
  right: -16px;
  color: rgba(0, 0, 0, 0.045);
  font-size: clamp(4.3rem, 21vw, 8rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  transform: rotate(-4deg);
  pointer-events: none;
}

.result-divider {
  width: 44px;
  height: 4px;
  margin: 28px 0 20px;
  background: var(--black);
}

.result-reason {
  max-width: 540px;
  margin: 0 0 34px;
  color: #424242;
  font-size: 0.93rem;
  line-height: 1.9;
  white-space: pre-line;
}

.primary-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 66px;
  padding: 16px 18px;
  color: var(--white);
  background: var(--black);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.primary-link:hover,
.primary-link:focus-visible {
  opacity: 0.8;
  outline: none;
}

.result-restart {
  display: block;
  margin: 20px auto 0;
}

footer {
  display: flex;
  justify-content: space-between;
  min-height: 52px;
  padding-top: 13px;
  color: #777;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

footer p {
  margin: 0;
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 640px) {
  .app-shell {
    padding: 0 24px;
  }

  .site-header {
    min-height: 88px;
  }

  #questionView,
  .result-view,
  .flow-view {
    min-height: 650px;
    padding: 40px 54px 34px;
  }

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

  .number-entry-form {
    grid-column: 1 / -1;
  }

  .option-button:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .mobile-break {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
