:root {
  color-scheme: light;
  --ink: #11110f;
  --paper: #f4f0e8;
  --bone: #fbfaf6;
  --muted: #6b665d;
  --line: #d8d0c2;
  --charcoal: #171817;
  --moss: #38483d;
  --brick: #8d3f2f;
  --blue: #284f6c;
  --signal: #d8b35a;
  --shadow: 0 18px 48px rgba(17, 17, 15, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Sans", "Meiryo", system-ui, sans-serif;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.finder-shell {
  min-height: 100vh;
}

.finder-stage {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: var(--bone);
}

.stage-photo,
.stage-veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage-photo {
  object-fit: cover;
}

.stage-veil {
  background:
    linear-gradient(90deg, rgba(14, 14, 12, 0.9), rgba(14, 14, 12, 0.55) 48%, rgba(14, 14, 12, 0.18)),
    linear-gradient(0deg, rgba(14, 14, 12, 0.68), rgba(14, 14, 12, 0.08) 42%);
}

.topbar {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(251, 250, 246, 0.52);
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.78rem;
}

.stage-count {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  color: rgba(251, 250, 246, 0.78);
}

.stage-layout {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(520px, 1.14fr);
  gap: 36px;
  align-items: center;
  padding: 28px 0 58px;
}

.manifesto {
  align-self: end;
  padding-bottom: 20px;
}

.kicker,
.mini-label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 800;
  font-size: 0.78rem;
}

.kicker {
  color: var(--signal);
}

h1,
h2,
h3,
legend,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: 5.25rem;
  line-height: 0.98;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.manifesto-copy {
  max-width: 560px;
  margin-bottom: 0;
  color: rgba(251, 250, 246, 0.86);
  font-size: 1.08rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.speed-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 16px;
}

.speed-proof span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(251, 250, 246, 0.54);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--bone);
  background: rgba(17, 17, 15, 0.28);
  font-size: 0.76rem;
  font-weight: 800;
}

.duel-panel {
  min-width: 0;
  background: rgba(251, 250, 246, 0.94);
  color: var(--ink);
  border: 1px solid rgba(251, 250, 246, 0.6);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.duel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.duel-head h2,
.section-copy h2,
.result-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: 2.2rem;
  line-height: 1.1;
}

.mini-label {
  color: var(--moss);
}

.icon-button,
.text-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}

.icon-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.progress-track {
  height: 6px;
  background: #e5ded1;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-track span {
  display: block;
  height: 100%;
  width: 12.5%;
  background: var(--charcoal);
  transition: width 0.32s ease;
}

.duel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.duel-card {
  min-width: 0;
  aspect-ratio: 4 / 5;
  min-height: 0;
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: var(--charcoal);
  color: var(--bone);
  isolation: isolate;
}

.duel-card::before,
.duel-card::after {
  content: "";
  position: absolute;
  inset: 0;
  transition: transform 0.34s ease, opacity 0.34s ease;
}

.duel-card::before {
  background-image: var(--image), var(--photo-url);
  background-size: cover, cover;
  background-position: center, center;
  opacity: 0.98;
}

.duel-card::after {
  background: linear-gradient(0deg, rgba(9, 9, 8, 0.76), rgba(9, 9, 8, 0.08) 42%, rgba(9, 9, 8, 0) 68%);
  z-index: 1;
}

.duel-card:hover::before,
.duel-card:focus-visible::before {
  transform: scale(1.035);
}

.duel-card:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
}

.duel-card__content {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 18px;
  text-align: left;
}

.duel-card__number {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--signal);
  font-size: 1.15rem;
}

.duel-card h3 {
  margin: 8px 0 10px;
  font-size: 1.55rem;
  line-height: 1.2;
}

.duel-card p {
  margin: 0;
  color: rgba(251, 250, 246, 0.86);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.duel-card.is-picked {
  animation: pickPulse 0.34s ease;
}

.adjust-section,
.result-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0;
}

.adjust-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.74fr) minmax(520px, 1.26fr);
  gap: 42px;
}

.section-copy {
  position: sticky;
  top: 28px;
  align-self: start;
}

.section-copy p {
  color: var(--muted);
  line-height: 1.9;
}

.adjust-grid {
  display: grid;
  gap: 18px;
}

.choice-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: rgba(251, 250, 246, 0.72);
}

legend {
  padding: 0;
  margin-bottom: 14px;
  font-weight: 800;
  font-size: 1.05rem;
}

.pill-grid,
.frequency-row {
  display: grid;
  gap: 10px;
}

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

.frequency-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pill-choice input,
.frequency-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill-choice,
.frequency-choice {
  position: relative;
  display: grid;
}

.pill-choice span,
.frequency-choice span {
  min-height: 64px;
  display: grid;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: var(--bone);
  font-weight: 800;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.pill-choice input:checked + span,
.frequency-choice input:checked + span {
  border-color: var(--charcoal);
  background: var(--charcoal);
  color: var(--bone);
}

.pill-choice:hover span,
.frequency-choice:hover span {
  transform: translateY(-1px);
}

.range-field {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

input[type="range"] {
  accent-color: var(--charcoal);
}

.result-button {
  min-height: 54px;
  border: 0;
  border-radius: 6px;
  background: var(--brick);
  color: var(--bone);
  font-weight: 900;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, background 0.18s ease;
}

.result-button:hover {
  transform: translateY(-1px);
  background: #753326;
}

.result-section {
  display: none;
}

.result-section.is-visible {
  display: block;
}

.result-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 24px;
}

.text-button {
  min-height: 42px;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--bone);
  font-weight: 800;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.system-card {
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.system-card__visual {
  aspect-ratio: 4 / 5;
  min-height: 0;
  position: relative;
  background-image: var(--image), var(--photo-url);
  background-size: cover, cover;
  background-position: center, center;
}

.system-card__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(12, 12, 10, 0.62), rgba(12, 12, 10, 0.02));
}

.match-score {
  position: absolute;
  z-index: 1;
  left: 14px;
  bottom: 12px;
  color: var(--bone);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.15rem;
}

.system-card__body {
  padding: 18px;
}

.system-card h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

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

.system-guide-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 16px;
  padding: 11px 15px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.system-guide-link::after {
  content: "→";
  margin-left: 18px;
}

.system-guide-link:hover {
  color: var(--bone);
  background: var(--ink);
}

.result-actions {
  margin-top: 24px;
  text-align: center;
}

.share-button {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  padding: 0 24px;
  color: var(--bone);
  background: var(--brick);
  font-weight: 900;
}

.share-status {
  max-width: 720px;
  margin: 12px auto 0;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.styles-hub-link {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 54px;
  text-align: center;
}

.styles-hub-link a {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.match-explain {
  border-left: 3px solid var(--signal);
  padding-left: 12px;
  color: var(--ink) !important;
  font-weight: 700;
}

.feedback-message {
  display: none;
  border: 1px solid #d8a09a;
  border-radius: 6px;
  background: #fff6f3;
  color: #7a2d24;
  padding: 12px 14px;
  line-height: 1.6;
}

.feedback-message.is-visible {
  display: block;
}

.item-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.item-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.item-list strong {
  display: block;
}

.item-detail-link {
  display: inline-flex;
  align-items: center;
  margin-top: 7px;
  color: var(--ink);
  font-size: .72rem;
  font-weight: 900;
  text-underline-offset: 4px;
}

.item-detail-link::after {
  content: "→";
  margin-left: 7px;
}

.item-list span {
  color: var(--muted);
  font-size: 0.9rem;
}

.buy-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--bone);
  background: var(--moss);
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.buy-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

.amazon-link {
  background: #232f3e;
}

.rakuten-link {
  background: #bf0000;
}

@keyframes pickPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.985);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 980px) {
  .stage-layout,
  .adjust-section {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 3.6rem;
  }

  .manifesto {
    align-self: start;
  }

  .section-copy {
    position: static;
  }

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

@media (max-width: 680px) {
  .finder-stage {
    min-height: 100svh;
  }

  .topbar {
    min-height: 56px;
  }

  .stage-layout {
    min-height: calc(100svh - 56px);
    padding: 8px 0 16px;
    gap: 12px;
    align-content: center;
  }

  h1 {
    margin-bottom: 10px;
    font-size: 1.75rem;
    line-height: 1.06;
  }

  .manifesto-copy {
    font-size: 0.86rem;
    line-height: 1.5;
    max-width: 38ch;
  }

  .manifesto {
    padding-bottom: 0;
  }

  .manifesto .kicker {
    margin-bottom: 6px;
    font-size: 0.66rem;
  }

  .speed-proof {
    gap: 5px;
    margin-bottom: 8px;
  }

  .speed-proof span {
    min-height: 24px;
    padding: 2px 8px;
    font-size: 0.68rem;
  }

  .duel-panel {
    padding: 10px;
  }

  .duel-head {
    margin-bottom: 8px;
  }

  .duel-head .mini-label {
    display: none;
  }

  .progress-track {
    margin-bottom: 8px;
  }

  .duel-head h2,
  .section-copy h2,
  .result-heading h2 {
    font-size: 1.22rem;
  }

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

  .duel-card {
    height: clamp(190px, 30svh, 250px);
    aspect-ratio: auto;
  }

  .duel-card__content {
    padding: 10px;
  }

  .duel-card h3 {
    margin: 5px 0 0;
    font-size: 1rem;
  }

  .duel-card p {
    display: none;
  }

  .duel-card__number {
    font-size: 0.84rem;
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .pill-grid,
  .frequency-row,
  .range-field {
    grid-template-columns: 1fr;
  }

  .result-heading {
    display: grid;
    align-items: start;
  }

  .item-list li {
    grid-template-columns: 1fr;
  }

  .buy-link {
    justify-content: center;
  }

  .buy-actions {
    justify-content: stretch;
  }

  .buy-actions .buy-link {
    flex: 1;
  }

  .share-button {
    min-height: 44px;
    width: 100%;
  }
}
