.jsd-app {
  color-scheme: light;
  --ink: #241c17;
  --muted: #6c5b4f;
  --line: #ead9bf;
  --surface: #fffaf1;
  --surface-strong: #ffffff;
  --red: #b9392f;
  --red-dark: #7f241f;
  --gold: #d4a43a;
  --green: #2e7356;
  --blue: #386f9c;
  --shadow: 0 22px 56px rgba(64, 36, 18, 0.14);
}

.jsd-app,
.jsd-app * {
  box-sizing: border-box;
}

.jsd-app {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 9%, rgba(212, 164, 58, 0.28), transparent 30%),
    radial-gradient(circle at 88% 16%, rgba(185, 57, 47, 0.16), transparent 28%),
    linear-gradient(135deg, #fff4df 0%, #fffaf1 48%, #f1f8ed 100%);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Hiragino Sans",
    "Yu Gothic",
    sans-serif;
}

.jsd-app button,
.jsd-app select,
.jsd-app a {
  font: inherit;
}

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

.jsd-app .hero-panel,
.jsd-app .diagnosis-panel,
.jsd-app .result-section,
.jsd-app .seo-section {
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.jsd-app .hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 22px;
  align-items: center;
  margin-bottom: 18px;
  padding: clamp(22px, 5vw, 42px);
  overflow: hidden;
}

.jsd-app .eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 12px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 900;
}

.jsd-app h1,
.jsd-app h2,
.jsd-app h3,
.jsd-app p {
  margin-top: 0;
}

.jsd-app h1 {
  margin-bottom: 12px;
  font-size: clamp(2.25rem, 6vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.jsd-app .hero-lead {
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  font-weight: 800;
  line-height: 1.7;
}

.jsd-app .hero-mark {
  display: block;
  width: 100%;
  max-width: 160px;
  justify-self: end;
  filter: drop-shadow(0 14px 24px rgba(92, 48, 18, 0.18));
}

.jsd-app .diagnosis-panel {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 4vw, 34px);
}

.jsd-app .progress-box {
  display: grid;
  gap: 8px;
}

.jsd-app .progress-label {
  color: var(--muted);
  font-weight: 900;
  text-align: right;
}

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

.jsd-app .progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transition: width 0.2s ease;
}

.jsd-app .question-card,
.jsd-app .result-box,
.jsd-app .shrine-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.jsd-app .question-card {
  padding: clamp(18px, 3vw, 26px);
}

.jsd-app .question-card.is-muted {
  opacity: 0.74;
}

.jsd-app .step-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.jsd-app .step-heading span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--green);
  color: #ffffff;
  font-weight: 900;
}

.jsd-app .step-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  line-height: 1.35;
  letter-spacing: 0;
}

.jsd-app .question-text {
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.7;
}

.jsd-app .choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.jsd-app .choice-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.jsd-app .choice-button {
  min-height: 58px;
  padding: 12px 14px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  line-height: 1.45;
  text-align: left;
  box-shadow: 0 10px 20px rgba(57, 37, 22, 0.06);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.jsd-app .choice-button:hover,
.jsd-app .choice-button:focus-visible {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 14px 28px rgba(57, 37, 22, 0.11);
  transform: translateY(-1px);
}

.jsd-app .choice-button.is-selected {
  border-color: var(--red);
  background: #fff3ec;
}

.jsd-app .choice-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.jsd-app .select-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.jsd-app .select-label select {
  width: min(100%, 420px);
  min-height: 52px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
}

.jsd-app .select-label select:focus-visible {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 164, 58, 0.18);
}

.jsd-app .result-section {
  margin-top: 20px;
  padding: clamp(18px, 4vw, 34px);
}

.jsd-app .result-section[hidden],
.jsd-app [hidden] {
  display: none;
}

.jsd-app .result-card {
  padding: clamp(20px, 5vw, 36px);
  border: 2px solid rgba(212, 164, 58, 0.46);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 241, 0.92)),
    var(--surface);
}

.jsd-app .result-label {
  margin-bottom: 8px;
  color: var(--red);
  font-weight: 900;
}

.jsd-app .result-card h2 {
  margin-bottom: 12px;
  font-size: clamp(1.7rem, 4.8vw, 3rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.jsd-app .result-summary {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 1.04rem;
  line-height: 1.9;
}

.jsd-app .result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.jsd-app .result-box {
  padding: 16px;
}

.jsd-app .main-deity-visual {
  display: flex;
  justify-content: center;
  margin: 8px 0 18px;
}

.jsd-app .main-deity-visual img {
  width: min(220px, 70vw);
  aspect-ratio: 1;
  border: 4px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  box-shadow: 0 18px 42px rgba(89, 54, 16, 0.18);
  object-fit: cover;
}

.jsd-app .result-box h3,
.jsd-app .shrine-section h3 {
  margin-bottom: 12px;
  font-size: 1.08rem;
  line-height: 1.4;
  letter-spacing: 0;
}

.jsd-app .benefit-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jsd-app .benefit-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #fff0d1;
  color: #6e4310;
  font-size: 0.92rem;
  font-weight: 900;
}

.jsd-app .support-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.jsd-app .support-list li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
  line-height: 1.65;
}

.jsd-app .support-list strong {
  color: var(--red-dark);
}

.jsd-app .support-deity-image {
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(89, 54, 16, 0.14);
  object-fit: cover;
}

.jsd-app .shrine-section {
  margin-top: 18px;
}

.jsd-app .national-shrines {
  display: grid;
  gap: 12px;
}

.jsd-app .shrine-card {
  padding: 16px;
  background: #ffffff;
}

.jsd-app .shrine-card + .shrine-card {
  margin-top: 12px;
}

.jsd-app .shrine-card h4 {
  margin: 0 0 8px;
  font-size: clamp(1.16rem, 3vw, 1.55rem);
  line-height: 1.35;
}

.jsd-app .match-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f7e4b7;
  color: #6b4612;
  font-size: 0.86rem;
  font-weight: 900;
}

.jsd-app .shrine-card p {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.8;
}

.jsd-app .shrine-link {
  display: inline-flex;
  align-items: center;
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.jsd-app .shrine-link:hover,
.jsd-app .shrine-link:focus-visible {
  text-decoration: underline;
}

.jsd-app .seo-section {
  margin-top: 24px;
  padding: clamp(20px, 4vw, 34px);
}

.jsd-app .seo-section h2 {
  margin-bottom: 12px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.35;
  letter-spacing: 0;
}

.jsd-app .seo-section p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.85;
}

.jsd-app .seo-section p:last-child {
  margin-bottom: 0;
}

@media (max-width: 860px) {
  .jsd-app .hero-panel {
    grid-template-columns: 1fr;
  }

  .jsd-app .hero-mark {
    max-width: 118px;
    justify-self: start;
  }

  .jsd-app .choice-grid,
.jsd-app .choice-grid.compact,
.jsd-app .result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .jsd-app {
    width: min(100% - 18px, 1120px);
    padding-top: 12px;
  }

  .jsd-app .hero-panel,
.jsd-app .diagnosis-panel,
.jsd-app .result-section,
.jsd-app .seo-section {
    border-radius: 12px;
  }

  .jsd-app .choice-button {
    min-height: 54px;
  }
}
