:root {
  color-scheme: light;
  --paper: #211713;
  --surface: #fffaf1;
  --surface-strong: #f4e7cf;
  --ink: #221713;
  --muted: #7a6356;
  --line: #caa764;
  --accent: #7b1732;
  --accent-dark: #4d0e21;
  --emerald: #1f6a5b;
  --gold: #d8b46a;
  --gold-soft: #f3dfaa;
  --rose: #b84f5f;
  --sky: #355f7b;
  --shadow: 0 28px 90px rgba(10, 6, 4, 0.48);
  --inner-glow: inset 0 0 0 1px rgba(255, 250, 241, 0.18), inset 0 0 42px rgba(216, 180, 106, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(20, 9, 13, 0.38), rgba(13, 12, 9, 0.72)),
    url("assets/luxury-background.png"),
    linear-gradient(45deg, rgba(216, 180, 106, 0.08) 25%, transparent 25%, transparent 75%, rgba(216, 180, 106, 0.08) 75%),
    linear-gradient(45deg, rgba(255, 250, 241, 0.04) 25%, transparent 25%, transparent 75%, rgba(255, 250, 241, 0.04) 75%),
    radial-gradient(circle at 50% -20%, rgba(123, 23, 50, 0.55), transparent 42%),
    linear-gradient(135deg, #251511 0%, #111817 45%, #2d1420 100%);
  background-attachment: fixed;
  background-position: center, center, 0 0, 18px 18px, 0 0, 0 0;
  background-size: cover, cover, 36px 36px, 36px 36px, auto, auto;
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
}

body::before {
  inset: 18px;
  border: 1px solid rgba(216, 180, 106, 0.32);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 241, 0.06);
}

body::after {
  inset: 0;
  background:
    radial-gradient(circle at 16% 18%, rgba(243, 223, 170, 0.16), transparent 24%),
    radial-gradient(circle at 82% 28%, rgba(123, 23, 50, 0.34), transparent 28%),
    radial-gradient(circle at 72% 86%, rgba(31, 106, 91, 0.18), transparent 28%);
}

button {
  font: inherit;
}

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

.intro {
  display: block;
  min-height: 174px;
  color: var(--surface);
  text-align: center;
}

.kicker {
  margin: 0 0 8px;
  color: var(--gold-soft);
  font-size: 0.95rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 4.75rem);
  line-height: 1;
  letter-spacing: 0;
  color: #fff7e8;
  font-family: Georgia, "Times New Roman", "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-weight: 700;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.34), 0 16px 42px rgba(216, 180, 106, 0.42);
}

.lead {
  max-width: 620px;
  margin: 16px auto 0;
  color: rgba(255, 250, 241, 0.78);
  font-size: 1.05rem;
  line-height: 1.8;
  text-align: center;
}

.picker-view,
.result-view {
  display: none;
}

.picker-view.is-active,
.result-view.is-active {
  display: block;
}

.picker-panel,
.result-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(216, 180, 106, 0.76);
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.2), transparent 34%, rgba(216, 180, 106, 0.16) 55%, transparent 72%),
    linear-gradient(180deg, rgba(255, 250, 241, 0.96), rgba(244, 231, 207, 0.92)),
    var(--surface);
  box-shadow: var(--shadow), var(--inner-glow);
}

.picker-panel::before,
.result-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: 1px solid rgba(216, 180, 106, 0.52);
}

.picker-panel::after,
.result-card::after {
  content: "";
  position: absolute;
  inset: 18px;
  pointer-events: none;
  border: 1px solid rgba(123, 23, 50, 0.16);
}

.picker-panel {
  max-width: 760px;
  margin: 0 auto;
  padding: 30px;
}

.step-block + .step-block {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid rgba(202, 167, 100, 0.46);
}

.step-block,
.actions,
.result-card > * {
  position: relative;
  z-index: 1;
}

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

.step-heading h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--accent-dark);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
}

.step-number {
  display: grid;
  place-items: center;
  width: 30px;
  aspect-ratio: 1;
  border: 1px solid #9c7833;
  background: linear-gradient(145deg, #4d0e21, #7b1732);
  color: #fff7e8;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 241, 0.16);
}

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

.number-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  gap: 10px;
  max-width: 360px;
  margin: 0 auto;
}

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

.choice {
  border: 1px solid rgba(202, 167, 100, 0.62);
  background:
    linear-gradient(135deg, rgba(216, 180, 106, 0.18), transparent 46%, rgba(255, 250, 241, 0.44) 48%, transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(243, 223, 170, 0.22)),
    var(--surface);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(77, 14, 33, 0.08);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.choice:hover {
  transform: translateY(-2px);
  border-color: #9c7833;
  box-shadow: 0 13px 26px rgba(77, 14, 33, 0.14);
}

.choice[aria-checked="true"] {
  border-color: var(--accent-dark);
  background:
    linear-gradient(135deg, rgba(216, 180, 106, 0.34), transparent 46%, rgba(255, 250, 241, 0.7) 48%, transparent 55%),
    linear-gradient(180deg, rgba(255, 247, 232, 0.86), rgba(243, 223, 170, 0.46)),
    var(--surface);
  box-shadow: inset 0 0 0 2px var(--accent-dark), 0 15px 32px rgba(77, 14, 33, 0.18);
}

.color-choice {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px;
  text-align: left;
}

.swatch {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(77, 14, 33, 0.28);
  box-shadow: inset 0 0 0 2px rgba(255, 250, 241, 0.45);
}

.choice-name {
  display: block;
  font-weight: 700;
  letter-spacing: 0;
}

.number-choice {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-height: 76px;
  padding: 8px 4px;
  text-align: center;
  border-radius: 50%;
}

.number-value {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1;
  color: var(--accent-dark);
  text-shadow: 0 1px 0 rgba(255, 250, 241, 0.85);
}

.word-choice {
  display: grid;
  place-items: center;
  min-height: 58px;
  padding: 12px 10px;
  text-align: center;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  border: 1px solid #9c7833;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  background:
    linear-gradient(135deg, rgba(243, 223, 170, 0.26), transparent 42%),
    linear-gradient(145deg, #4d0e21, #8d1e3b);
  color: #fff7e8;
  box-shadow: 0 16px 34px rgba(77, 14, 33, 0.32), inset 0 0 0 1px rgba(255, 250, 241, 0.18);
}

.primary-button:disabled {
  border-color: var(--line);
  background: var(--surface-strong);
  color: #9a9186;
  cursor: not-allowed;
}

.secondary-button {
  background: linear-gradient(180deg, #fffaf1, #f3dfaa);
  color: var(--accent-dark);
}

.result-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 52px;
  animation: rise 220ms ease-out;
}

.result-date {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-weight: 700;
}

.result-card h2 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.35;
  color: var(--accent-dark);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", Georgia, serif;
}

.result-text {
  margin: 24px 0 0;
  color: var(--muted);
  line-height: 2;
}

.result-details {
  display: grid;
  gap: 16px;
  margin: 34px 0 0;
}

.result-details div {
  border: 1px solid rgba(202, 167, 100, 0.66);
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.78), rgba(243, 223, 170, 0.42)),
    var(--surface-strong);
  padding: 18px 20px;
}

.result-details dt {
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

.result-details dd {
  margin: 8px 0 0;
  line-height: 1.75;
}

.result-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  body {
    background-attachment: scroll;
  }

  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  .intro {
    min-height: auto;
    padding-bottom: 16px;
  }

  .kicker {
    margin-bottom: 7px;
    font-size: 0.82rem;
  }

  h1 {
    font-size: 2.65rem;
    line-height: 1.08;
  }

  .lead {
    max-width: 18rem;
    margin-top: 12px;
    font-size: 0.93rem;
    line-height: 1.65;
  }

  .picker-panel,
  .result-card {
    padding: 34px 24px 28px;
  }

  .picker-panel::before,
  .result-card::before {
    inset: 7px;
  }

  .picker-panel::after,
  .result-card::after {
    inset: 13px;
  }

  .result-card {
    padding: 42px 26px 30px;
  }

  .step-block,
  .actions,
  .result-card > * {
    position: relative;
    z-index: 1;
  }

  .color-grid,
  .word-grid {
    grid-template-columns: 1fr;
  }

  .number-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 320px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .result-date {
    font-size: 0.9rem;
  }

  .result-card h2 {
    font-size: 1.38rem;
    line-height: 1.45;
  }

  .result-text {
    margin-top: 18px;
    font-size: 0.94rem;
    line-height: 1.85;
  }

  .result-details {
    gap: 12px;
    margin-top: 24px;
  }

  .result-details div {
    padding: 15px 14px;
  }

  .result-details dt {
    font-size: 0.84rem;
  }

  .result-details dd {
    font-size: 0.94rem;
    line-height: 1.65;
  }

  .result-actions {
    display: grid;
    margin-top: 18px;
  }
}
