:root {
  --navy: #17345c;
  --blue: #2f75b5;
  --sky: #eaf4fb;
  --gold: #c69a38;
  --green: #5c8d7c;
  --ink: #1f2933;
  --muted: #637083;
  --line: #d9e3ec;
  --paper: #ffffff;
  --soft: #f7f9fb;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Hiragino Sans", "Yu Gothic", "YuGothic", "Noto Sans JP", system-ui, sans-serif;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.9) 44%, rgba(247, 250, 247, 0.86) 100%),
    url("./assets/miracle-background.png") center top / cover fixed no-repeat,
    #f7faf7;
  line-height: 1.75;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

.app-shell {
  width: min(100%, 920px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 16px 56px;
  position: relative;
}

.hero,
.question-card,
.result-hero,
.lucky-card,
.score-card,
.cta-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 50px rgba(25, 52, 92, 0.08);
}

.hero {
  padding: 34px 22px 28px;
}

.hero__mark,
.result-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 3px 12px;
  border: 1px solid rgba(198, 154, 56, 0.45);
  border-radius: 999px;
  color: #7a5b17;
  background: #fff9e8;
  font-size: 0.86rem;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 12px;
  color: var(--navy);
  font-size: clamp(2rem, 8vw, 3.5rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.question-card h1,
.result-hero h1 {
  font-size: clamp(1.55rem, 6vw, 2.7rem);
}

h2 {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: 1.12rem;
  line-height: 1.45;
  letter-spacing: 0;
}

.lead {
  margin-bottom: 6px;
  color: var(--navy);
  font-size: clamp(1.18rem, 5vw, 1.8rem);
  font-weight: 800;
  line-height: 1.45;
}

.sublead {
  margin-bottom: 18px;
  color: var(--blue);
  font-weight: 700;
}

.intro,
.cta-panel p,
.detail-card p {
  color: #354455;
}

.view-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.view-grid span {
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  background: var(--soft);
  font-weight: 700;
}

.lucky-preview {
  margin: 18px 0 0;
  padding: 16px;
  border: 1px solid rgba(198, 154, 56, 0.42);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 249, 232, 0.88) 0%, rgba(239, 248, 255, 0.88) 100%);
}

.lucky-preview h2 {
  margin-bottom: 12px;
  font-size: 1.08rem;
}

.lucky-preview__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.lucky-preview__grid span {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 8px;
  border: 1px solid rgba(217, 227, 236, 0.9);
  border-radius: 8px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
  line-height: 1.35;
}

.home-form {
  margin: 22px 0 16px;
  padding: 16px;
  border: 1px solid rgba(198, 154, 56, 0.38);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 249, 232, 0.86) 0%, rgba(239, 248, 255, 0.86) 100%);
}

.home-form h2 {
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.primary-button,
.secondary-button,
.text-button,
.option-button {
  cursor: pointer;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 12px 18px;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  line-height: 1.45;
  white-space: normal;
}

.primary-button {
  border: 1px solid var(--navy);
  color: #fff;
  background: var(--navy);
}

.primary-button:hover {
  background: #102845;
}

.attention-button {
  animation: gentlePulse 2.4s ease-in-out infinite;
  border-color: #d85f12;
  background: linear-gradient(135deg, #ff8a1f 0%, #f06b16 58%, #d94c0b 100%);
  box-shadow: 0 12px 28px rgba(216, 95, 18, 0.24), 0 0 0 0 rgba(255, 138, 31, 0.3);
  transform-origin: center;
}

.attention-button:hover {
  animation-play-state: paused;
  background: linear-gradient(135deg, #ff9838 0%, #f36f18 58%, #c94309 100%);
  transform: scale(1.03);
}

.primary-button--small {
  width: auto;
  min-width: 132px;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--navy);
  background: #fff;
}

.secondary-button:hover {
  border-color: var(--blue);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.flow__item {
  min-height: 100px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flow__item span {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
}

.flow__item strong {
  color: var(--navy);
  font-size: 0.92rem;
  line-height: 1.5;
}

.question-card,
.result-hero,
.lucky-card,
.score-card,
.cta-panel {
  padding: 22px;
}

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

.form-field {
  display: grid;
  gap: 8px;
}

.form-field span {
  color: var(--navy);
  font-weight: 900;
}

.form-field input,
.form-field select {
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.form-field input:focus,
.form-field select:focus {
  outline: 3px solid rgba(47, 117, 181, 0.18);
  border-color: var(--blue);
}

.birthdate-selects {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 8px;
}

.birthdate-selects label {
  display: block;
}

.form-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(190, 71, 71, 0.35);
  border-radius: 8px;
  color: #8d2f2f;
  background: #fff4f4;
  font-weight: 800;
}

.top-row,
.nav-row,
.restart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.question-count {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.progress {
  height: 10px;
  margin: 10px 0 24px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--gold));
}

.options {
  display: grid;
  gap: 12px;
  margin: 18px 0 24px;
}

.option-button {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  width: 100%;
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.option-button span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--navy);
  background: var(--sky);
  font-weight: 900;
}

.option-button strong {
  line-height: 1.55;
}

.option-button:hover,
.option-button.is-selected {
  border-color: var(--blue);
  background: #f5fbff;
}

.option-button.is-selected span {
  color: #fff;
  background: var(--blue);
}

.result-hero {
  margin-bottom: 14px;
}

.result-name {
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 1.22rem;
  font-weight: 900;
}

.result-cta {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid rgba(198, 154, 56, 0.55);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff9e8 0%, #eef8ff 100%);
}

.result-cta p {
  margin-bottom: 10px;
  color: var(--navy);
  font-weight: 900;
  text-align: center;
}

.score-card,
.cta-panel {
  margin-top: 14px;
}

.lucky-card {
  margin-top: 14px;
  border-color: rgba(198, 154, 56, 0.45);
  background:
    linear-gradient(135deg, rgba(255, 249, 232, 0.96) 0%, rgba(239, 248, 255, 0.96) 62%, rgba(245, 252, 247, 0.96) 100%);
}

.lucky-card--inline {
  grid-column: 1 / -1;
  margin-top: 0;
}

.lucky-card h2 {
  margin-top: 12px;
  font-size: 1.35rem;
}

.lucky-source {
  margin-bottom: 0;
  color: var(--blue);
  font-weight: 900;
}

.lucky-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.lucky-item {
  min-height: 160px;
  padding: 16px;
  border: 1px solid rgba(217, 227, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.lucky-item span,
.fortune-message span {
  display: block;
  margin-bottom: 8px;
  color: #7a5b17;
  font-size: 0.84rem;
  font-weight: 900;
}

.lucky-item strong {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 1.35rem;
  line-height: 1.3;
}

.lucky-item p,
.fortune-message p {
  margin-bottom: 0;
  color: #354455;
  font-size: 0.94rem;
  line-height: 1.65;
}

.fortune-message {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(198, 154, 56, 0.48);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.score-list {
  display: grid;
  gap: 12px;
}

.score-row {
  display: grid;
  grid-template-columns: 112px 1fr 44px;
  align-items: center;
  gap: 10px;
}

.score-row span,
.score-row strong {
  color: var(--navy);
  font-size: 0.92rem;
  font-weight: 800;
}

.score-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.score-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.detail-card {
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-card:last-child {
  grid-column: 1 / -1;
  min-height: auto;
  border-color: rgba(198, 154, 56, 0.45);
  background: #fffdf6;
}

.cta-panel h2 {
  font-size: 1.35rem;
}

.restart-row {
  justify-content: center;
  margin-top: 18px;
}

.text-button {
  min-height: 44px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 800;
  text-decoration: underline;
}

@keyframes gentlePulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 12px 28px rgba(216, 95, 18, 0.24), 0 0 0 0 rgba(255, 138, 31, 0.3);
  }

  45% {
    transform: scale(1.045);
    box-shadow: 0 18px 36px rgba(216, 95, 18, 0.32), 0 0 0 8px rgba(255, 138, 31, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .attention-button {
    animation: none;
  }
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0%, rgba(255, 255, 255, 0.92) 46%, rgba(247, 250, 247, 0.9) 100%),
      url("./assets/miracle-background.png") center top / auto 1000px no-repeat,
      #f7faf7;
  }

  .app-shell {
    padding: 12px 10px 36px;
  }

  .hero,
  .question-card,
  .result-hero,
  .lucky-card,
  .score-card,
  .cta-panel {
    padding: 18px 14px;
    box-shadow: 0 12px 34px rgba(25, 52, 92, 0.1);
  }

  .hero {
    padding-top: 22px;
  }

  h1 {
    font-size: clamp(1.72rem, 9vw, 2.35rem);
    line-height: 1.28;
  }

  .question-card h1,
  .result-hero h1 {
    font-size: clamp(1.36rem, 6.6vw, 1.82rem);
  }

  .lead {
    font-size: clamp(1.05rem, 5.4vw, 1.35rem);
  }

  .intro,
  .cta-panel p,
  .detail-card p,
  .note {
    font-size: 0.95rem;
  }

  .hero__mark,
  .result-label {
    max-width: 100%;
    min-height: 28px;
    font-size: 0.8rem;
  }

  .flow,
  .detail-grid,
  .form-grid,
  .lucky-grid,
  .lucky-preview__grid {
    grid-template-columns: 1fr;
  }

  .flow__item {
    min-height: auto;
    padding: 12px 14px;
  }

  .nav-row {
    flex-direction: column-reverse;
  }

  .primary-button--small,
  .nav-row .secondary-button {
    width: 100%;
  }

  .score-row {
    grid-template-columns: 1fr 40px;
    gap: 8px;
  }

  .score-row span,
  .score-row strong {
    font-size: 0.9rem;
  }

  .score-row span {
    grid-column: 1 / -1;
  }

  .score-bar {
    height: 10px;
  }

  .result-cta {
    margin-top: 16px;
    padding: 14px 12px;
  }

  .lucky-card h2 {
    font-size: 1.22rem;
    line-height: 1.45;
  }

  .lucky-item {
    min-height: auto;
    padding: 14px;
  }

  .lucky-item strong {
    font-size: 1.28rem;
  }

  .lucky-item p,
  .fortune-message p {
    font-size: 0.96rem;
  }

  .fortune-message {
    padding: 14px;
  }

  .attention-button {
    animation-name: gentlePulseMobile;
  }

  .detail-card {
    min-height: auto;
    padding: 18px 15px;
  }

  .detail-card h2 {
    margin-bottom: 8px;
    font-size: 1.08rem;
  }

  .detail-card p {
    line-height: 1.78;
  }

  .cta-panel h2 {
    font-size: 1.18rem;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding-inline: 8px;
  }

  .view-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 18px 0;
  }

  .view-grid span {
    min-height: 46px;
    padding: 10px 12px;
  }

  .lucky-preview {
    margin-top: 16px;
    padding: 14px 12px;
  }

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

  .home-form {
    margin: 18px 0 14px;
    padding: 14px 12px;
  }

  .primary-button,
  .secondary-button {
    min-height: 52px;
    padding: 11px 14px;
    font-size: 0.96rem;
  }

  .option-button {
    grid-template-columns: 36px 1fr;
    min-height: 70px;
    padding: 10px;
  }

  .option-button span {
    width: 30px;
    height: 30px;
    font-size: 0.88rem;
  }

  .option-button strong {
    font-size: 0.94rem;
    line-height: 1.5;
  }

  .score-row {
    grid-template-columns: 1fr 34px;
  }

  .score-row span {
    grid-column: 1 / -1;
  }

  .score-bar {
    height: 10px;
  }

  .birthdate-selects {
    grid-template-columns: 1fr;
  }

  .form-field select {
    min-height: 50px;
  }
}

@keyframes gentlePulseMobile {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 10px 24px rgba(216, 95, 18, 0.22), 0 0 0 0 rgba(255, 138, 31, 0.26);
  }

  45% {
    transform: scale(1.025);
    box-shadow: 0 14px 28px rgba(216, 95, 18, 0.3), 0 0 0 5px rgba(255, 138, 31, 0.12);
  }
}
