:root {
  --ink: #17141d;
  --paper: #fffdf9;
  --cream: #faf6ec;
  --violet-50: #f6f2ff;
  --violet-100: #efebfa;
  --violet-300: #c8bce8;
  --violet-500: #8371c9;
  --violet-700: #4b3fb5;
  --violet-900: #2f275f;
  --gold: #c6a45c;
  --gold-light: #ffe9a8;
  --blush: #f7dfe7;
  --line: rgba(23, 20, 29, 0.22);
  --shadow: 0 18px 60px rgba(59, 43, 111, 0.13);
  --serif: "Playfair Display", "Zen Old Mincho", YuMincho, serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --radius: 26px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 13% 8%, rgba(232, 221, 255, 0.75), transparent 25rem),
    radial-gradient(circle at 88% 30%, rgba(255, 233, 168, 0.34), transparent 22rem),
    #eceae6;
  font-family: var(--sans);
  font-feature-settings: "palt";
  letter-spacing: 0.04em;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: #fff;
  background: var(--violet-900);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.sr-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 17px max(16px, calc((100% - 1180px) / 2)) 13px;
  border-bottom: 0.5px solid var(--line);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  min-width: 0;
  text-decoration: none;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.08em;
}
.brand small {
  display: block;
  margin-top: -3px;
  font-family: var(--sans);
  font-size: 0.52rem;
  font-weight: 500;
  letter-spacing: 0.28em;
}

.header-nav { display: flex; flex: 0 0 auto; align-items: center; gap: 22px; }
.header-nav a {
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.header-nav a:hover { color: var(--violet-700); }

.page-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 72px;
  padding: 0 clamp(22px, 5vw, 58px);
  border: 1px solid rgba(23, 20, 29, 0.2);
  background: var(--paper);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--violet-700);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.eyebrow::before {
  width: 28px;
  height: 1px;
  background: currentColor;
  content: "";
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; }

.lead {
  max-width: 42rem;
  color: rgba(23, 20, 29, 0.7);
  font-family: "Zen Old Mincho", var(--serif);
  font-size: clamp(0.94rem, 2vw, 1.08rem);
  line-height: 2;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.primary-button { color: #fff; background: var(--ink); }
.secondary-button { color: var(--ink); background: rgba(255,255,255,.7); }
.primary-button:hover,
.secondary-button:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(23,20,29,.12); }
.primary-button:focus-visible,
.secondary-button:focus-visible,
.deck-card:focus-visible,
.jar-button:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 4px;
}

.fortune-home-hero {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(360px, 1.12fr);
  align-items: center;
  min-height: 0;
  padding: 52px 0 64px;
  gap: clamp(34px, 7vw, 90px);
}
.fortune-home-hero h1 {
  max-width: 10em;
  margin-bottom: 24px;
  font-size: clamp(2.25rem, 3.6vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}
.fortune-home-hero h1 span { color: var(--violet-700); }

.hero-visual {
  position: relative;
  justify-self: center;
  width: min(560px, 100%);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 0.5px solid var(--line);
  border-radius: 48% 48% 24px 24px;
  background: linear-gradient(180deg, #433a9b, #eee1fc 65%, #c4a4e5);
  box-shadow: var(--shadow);
}
.hero-visual img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-visual::after {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}
.hero-caption {
  position: absolute;
  right: 22px;
  bottom: 20px;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--violet-900);
  background: rgba(255,255,255,.86);
  font-family: var(--serif);
  font-size: 0.8rem;
  backdrop-filter: blur(8px);
}

.experience-section { padding: 30px 0 100px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 0.5px solid var(--line);
  gap: 20px;
}
.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.8vw, 3.2rem);
  line-height: 1;
}
.section-heading p { margin: 0 0 4px; color: rgba(23,20,29,.58); font-size: .74rem; }

.experience-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.experience-card {
  position: relative;
  display: grid;
  grid-template-columns: 41% 59%;
  min-height: 350px;
  overflow: hidden;
  border: 0.5px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  background: rgba(255,255,255,.78);
  box-shadow: 0 12px 40px rgba(59,43,111,.08);
  text-decoration: none;
}
.experience-image { overflow: hidden; background: var(--violet-100); }
.experience-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms ease; }
.experience-card:hover .experience-image img { transform: scale(1.035); }
.experience-card:first-child .experience-image img { object-position: center; }
.experience-card--omikuji .experience-image img { object-position: center 62%; }
.experience-card:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 4px; }
.experience-card-copy { display: flex; flex-direction: column; justify-content: center; padding: 30px; }
.experience-number { color: var(--gold); font-family: var(--serif); font-size: .8rem; letter-spacing: .18em; }
.experience-card h3 { margin: 12px 0; font-size: clamp(1.45rem, 3vw, 2.2rem); line-height: 1.25; }
.experience-card p { color: rgba(23,20,29,.68); font-size: .84rem; line-height: 1.9; }
.experience-link { margin-top: auto; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-decoration: none; }
.experience-link::after { margin-left: 8px; content: "↗"; }

.game-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  align-items: center;
  min-height: 0;
  padding: clamp(32px, 4vw, 52px) 0 34px;
  gap: clamp(28px, 5vw, 64px);
}
.game-hero h1 { margin-bottom: 20px; font-size: clamp(2.2rem, 4.2vw, 3.8rem); line-height: 1.1; letter-spacing: -.035em; }
.card-reading-hero-image,
.omikuji-hero-image {
  position: relative;
  justify-self: center;
  width: min(470px, 100%);
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  overflow: hidden;
  border: 0.5px solid var(--line);
  background: linear-gradient(180deg, #433a9b, #eee1fc 65%, #c4a4e5);
  box-shadow: var(--shadow);
}
.card-reading-hero-image {
  border-radius: 44% 18% 38% 24% / 32% 22% 46% 28%;
  transform: rotate(-.7deg);
}
.omikuji-hero-image {
  border-radius: 18% 46% 22% 42% / 40% 24% 46% 20%;
  transform: rotate(.7deg);
}
.card-reading-hero-image::after,
.omikuji-hero-image::after {
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(255, 233, 168, .62);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}
.card-reading-hero-image img,
.omikuji-hero-image img { width: 100%; height: 100%; object-fit: cover; }

.game-shell {
  position: relative;
  overflow: hidden;
  margin: 12px 0 90px;
  padding: clamp(28px, 6vw, 64px);
  border: 0.5px solid var(--line);
  border-radius: 34px;
  background: rgba(250,246,236,.88);
  box-shadow: var(--shadow);
}
.game-shell::before,
.game-shell::after {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
  content: "";
}
.game-shell::before { top: -150px; left: -90px; background: rgba(200,188,232,.43); }
.game-shell::after { right: -130px; bottom: -160px; background: rgba(255,233,168,.42); }
.game-shell > * { position: relative; z-index: 1; }

.game-intro { max-width: 680px; margin: 0 auto 36px; text-align: center; }
.game-intro[hidden],
.jar-stage[hidden] { display: none; }
.step-label { color: var(--violet-700); font-family: var(--serif); font-size: .78rem; letter-spacing: .18em; }
.game-intro h2 { margin: 10px 0 13px; font-size: clamp(1.7rem, 4vw, 3rem); }
.game-intro p { color: rgba(23,20,29,.66); font-size: .88rem; line-height: 1.9; }

.deck {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  padding: 20px 0 38px;
  isolation: isolate;
}
.deck-card {
  position: relative;
  width: clamp(150px, 21vw, 218px);
  aspect-ratio: 2 / 3;
  margin: 0 clamp(-26px, -2.2vw, -12px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(198,164,92,.7);
  border-radius: 19px;
  background: var(--violet-900);
  box-shadow: 0 16px 36px rgba(47,39,95,.22);
  cursor: pointer;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), box-shadow 220ms ease;
}
.deck-card img { width: 100%; height: 100%; object-fit: cover; }
.deck-card:nth-child(1) { transform: rotate(-9deg) translateY(16px); }
.deck-card:nth-child(2) { z-index: 2; transform: translateY(-8px); }
.deck-card:nth-child(3) { transform: rotate(9deg) translateY(16px); }
.deck-card:hover:nth-child(1), .deck-card:focus-visible:nth-child(1) { transform: rotate(-9deg) translateY(-2px); }
.deck-card:hover:nth-child(2), .deck-card:focus-visible:nth-child(2) { transform: translateY(-28px); }
.deck-card:hover:nth-child(3), .deck-card:focus-visible:nth-child(3) { transform: rotate(9deg) translateY(-2px); }
.deck-card span {
  position: absolute;
  right: 0;
  bottom: 15px;
  left: 0;
  color: #fff;
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0,0,0,.4);
}

.result-panel[hidden] { display: none; }
.result-panel { animation: rise 650ms cubic-bezier(.2,.75,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

.result-head { display: grid; grid-template-columns: minmax(200px, 260px) 1fr; align-items: center; gap: clamp(26px, 6vw, 68px); }
.result-card-visual {
  display: block;
  width: min(240px, 100%);
  height: auto;
  aspect-ratio: auto;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(198,164,92,.75);
  border-radius: 22px;
  background-color: var(--violet-100);
  object-fit: contain;
  box-shadow: 0 22px 60px rgba(47,39,95,.18);
}
.result-kicker { color: var(--gold); font-family: var(--serif); font-size: .82rem; letter-spacing: .18em; }
.result-title { margin: 12px 0 18px; font-size: clamp(2rem, 5vw, 4.4rem); line-height: 1.08; }
.result-reading { color: rgba(23,20,29,.76); font-family: "Zen Old Mincho", var(--serif); font-size: 1rem; line-height: 2.1; }
.merume-voice {
  margin: 24px 0 0;
  padding: 18px 20px;
  border-left: 3px solid var(--gold);
  background: rgba(255,255,255,.68);
  font-family: "Zen Old Mincho", var(--serif);
  line-height: 1.85;
}
.merume-voice strong { display: block; margin-bottom: 4px; color: var(--violet-700); font-family: var(--sans); font-size: .66rem; letter-spacing: .14em; }

.result-details { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 34px; border-top: 0.5px solid var(--line); border-left: 0.5px solid var(--line); }
.detail-cell { min-height: 154px; padding: 24px; border-right: 0.5px solid var(--line); border-bottom: 0.5px solid var(--line); background: rgba(255,255,255,.52); }
.detail-cell dt { margin-bottom: 10px; color: var(--violet-700); font-size: .64rem; font-weight: 700; letter-spacing: .16em; }
.detail-cell dd { margin: 0; font-family: "Zen Old Mincho", var(--serif); font-size: 1rem; line-height: 1.95; }
.result-actions { display: flex; justify-content: center; margin-top: 30px; gap: 12px; flex-wrap: wrap; }
.wallpaper-note { width: 100%; margin: 4px 0 0; color: rgba(23,20,29,.55); font-size: .7rem; line-height: 1.7; text-align: center; }
.save-feedback { min-height: 1.6em; margin: 10px 0 0; color: var(--violet-700); font-size: .72rem; text-align: center; }
.primary-button:disabled,
.secondary-button:disabled { cursor: wait; opacity: .58; transform: none; }

.jar-stage { display: grid; place-items: center; min-height: 400px; padding: 44px 0 28px; text-align: center; }
.jar-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 220px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: radial-gradient(circle at 35% 28%, #9b8ade, var(--violet-700) 58%, var(--violet-900));
  box-shadow: 0 22px 60px rgba(75,63,181,.28), inset 0 0 0 12px rgba(255,255,255,.1);
  cursor: pointer;
}
.jar-button::before,
.jar-button::after {
  position: absolute;
  border: 1px solid rgba(198,164,92,.72);
  border-radius: 50%;
  content: "";
}
.jar-button::before { inset: -15px; }
.jar-button::after { inset: -31px; opacity: .48; }
.jar-button strong { display: block; font-family: var(--serif); font-size: 1.15rem; font-weight: 500; letter-spacing: .1em; }
.jar-button small { display: block; margin-top: 8px; font-size: .64rem; letter-spacing: .16em; }
.jar-button.is-shaking { animation: shake 720ms ease-in-out; }
@keyframes shake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  18% { transform: rotate(-7deg) scale(1.03); }
  36% { transform: rotate(7deg) scale(1.03); }
  54% { transform: rotate(-5deg) scale(1.04); }
  72% { transform: rotate(4deg) scale(1.02); }
}

.omikuji-result-card {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 64px);
  border: 1px solid rgba(198,164,92,.72);
  border-radius: 8px 8px 34px 34px;
  background:
    linear-gradient(90deg, transparent 49.7%, rgba(198,164,92,.13) 50%, transparent 50.3%),
    rgba(255,255,255,.82);
  box-shadow: 0 22px 70px rgba(59,43,111,.13);
  text-align: center;
}
.omikuji-date { color: rgba(23,20,29,.5); font-size: .67rem; letter-spacing: .15em; }
.omikuji-mark { margin: 18px 0 8px; color: var(--gold); font-family: var(--serif); font-size: .78rem; letter-spacing: .28em; }
.omikuji-title { margin: 0; color: var(--violet-900); font-size: clamp(2.4rem, 7vw, 5.3rem); letter-spacing: .08em; }
.omikuji-summary { max-width: 34em; margin: 24px auto; font-family: "Zen Old Mincho", var(--serif); line-height: 2.1; }
.omikuji-grid { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 30px; border-top: 0.5px solid var(--line); }
.omikuji-item { padding: 20px; border-bottom: 0.5px solid var(--line); }
.omikuji-item:nth-child(odd) { border-right: 0.5px solid var(--line); }
.omikuji-item dt { margin-bottom: 8px; color: var(--violet-700); font-size: .65rem; font-weight: 700; letter-spacing: .16em; }
.omikuji-item dd { margin: 0; font-family: "Zen Old Mincho", var(--serif); font-size: .85rem; line-height: 1.75; }
.tomorrow-note { margin: 22px 0 0; color: rgba(23,20,29,.5); font-size: .72rem; }

.site-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 28px;
  border-top: 0.5px solid var(--line);
  color: rgba(23,20,29,.56);
  font-size: .65rem;
  line-height: 1.8;
}
.site-footer a { text-decoration: none; }
.disclaimer { max-width: 52em; }

@media (max-width: 900px) {
  .fortune-home-hero { grid-template-columns: 1fr; }
  .fortune-home-hero { padding-top: 46px; }
  .fortune-home-hero h1 { max-width: 12em; }
  .hero-visual { max-width: 560px; }
  .experience-grid { grid-template-columns: 1fr; }
  .game-hero { grid-template-columns: minmax(0, 1fr) minmax(210px, 320px); gap: 24px; }
  .card-reading-hero-image,
  .omikuji-hero-image { width: min(320px, 100%); }
  .result-head { grid-template-columns: minmax(190px, 260px) 1fr; }
}

@media (max-width: 700px) {
  .game-hero { grid-template-columns: 1fr; padding: 32px 0 28px; }
  .card-reading-hero-image,
  .omikuji-hero-image { width: min(360px, 100%); }
}

@media (max-width: 640px) {
  .site-header { padding: 12px 16px 10px; }
  .brand { font-size: 1.34rem; }
  .brand small { max-width: 13em; overflow: hidden; font-size: .48rem; letter-spacing: .18em; text-overflow: ellipsis; white-space: nowrap; }
  .header-nav { gap: 12px; }
  .header-nav a:first-child { display: none; }
  .page-wrap { width: 100%; margin: 0 0 54px; padding: 0 18px; border-left: 0; border-right: 0; }
  .fortune-home-hero { min-height: 0; padding: 42px 0 56px; }
  .fortune-home-hero h1, .game-hero h1 { font-size: 2.25rem; }
  .hero-visual { width: min(380px, 100%); border-radius: 42% 42% 20px 20px; }
  .experience-section { padding-bottom: 70px; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 10px; }
  .experience-card { grid-template-columns: 38% 62%; min-height: 300px; }
  .experience-card-copy { padding: 22px 18px; }
  .game-hero { padding-top: 30px; }
  .game-shell { margin-bottom: 65px; padding: 30px 16px; border-radius: 24px; }
  .deck { min-height: 295px; }
  .deck-card { width: 42vw; margin: 0 -9vw; border-radius: 15px; }
  .result-head { grid-template-columns: 1fr; }
  .result-card-visual { width: min(220px, 70vw); }
  .result-copy { text-align: center; }
  .result-title { font-size: 2.55rem; }
  .result-details { grid-template-columns: 1fr; }
  .detail-cell { min-height: 0; }
  .jar-stage { min-height: 340px; padding-top: 42px; }
  .jar-button { width: 180px; }
  .omikuji-grid { grid-template-columns: 1fr; }
  .omikuji-item:nth-child(odd) { border-right: 0; }
  .site-footer { display: block; }
  .site-footer .footer-brand { margin-top: 14px; }
}

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