/* 吟娘 紹介サイト。和紙・墨・朱。ゲームと同じ書体（しっぽり明朝・佑字粛） */
:root {
  --ink: #231c17;
  --ink-soft: #4a3f36;
  --ink-faint: #8a7b6c;
  --shu: #b3352a;
  --shu-dark: #8c2219;
  --gold: #b8892c;
  --paper: #f4ecdc;
  --paper-2: #ebe0c9;
  --mincho: 'Shippori Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --brush: 'Yuji Syuku', 'Shippori Mincho', serif;
  --washi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0 0.12 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --hd: 60px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--hd); }
body {
  margin: 0;
  font-family: var(--mincho);
  color: var(--ink);
  background: var(--paper) var(--washi);
  line-height: 1.9;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.brush { font-family: var(--brush); font-weight: 400; }

/* ---- 上の帯 ---- */
.hd {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--hd);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  background: rgba(35, 28, 23, 0.86);
  backdrop-filter: blur(6px);
  color: #f4ecdc;
}
.hd-logo { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.hd-logo .brush { font-size: 28px; line-height: 1; }
.hd-logo small { font-size: 11px; opacity: 0.8; }
.hd-nav { display: flex; gap: 22px; margin-left: auto; }
.hd-nav a { text-decoration: none; font-size: 14px; letter-spacing: 0.1em; opacity: 0.9; }
.hd-nav a:hover { opacity: 1; color: #f2c46b; }
.hd-menu { display: none; }

/* ---- 遊ぶボタン（朱の札） ---- */
.btn-play {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 4px;
  background: linear-gradient(#c8432f, var(--shu-dark));
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.12em;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 0 0 2px #f2d79a inset, 0 6px 18px rgba(90, 20, 10, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-play:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px #f2d79a inset, 0 10px 24px rgba(90, 20, 10, 0.45); }
.btn-play.small { padding: 6px 18px; font-size: 14px; }

/* ---- ひと目の絵 ---- */
.hero {
  position: relative;
  min-height: 100svh;
  padding-top: var(--hd);
  display: grid;
  grid-template-columns: 1fr minmax(280px, 34%);
  align-items: end;
  overflow: hidden;
  background: var(--bg) center / cover no-repeat;
}
.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 22%;
  background: linear-gradient(transparent, var(--paper));
  pointer-events: none;
}
.hero-poets {
  position: relative;
  height: calc(100svh - var(--hd));
  min-height: 520px;
}
.hero-poets img {
  position: absolute;
  /* 顔の位置（main.js の fx・fy）を、決めた場所に合わせる */
  top: var(--top);
  height: var(--h, 86%);
  left: var(--x);
  transform: translateX(calc(var(--fx, 0.5) * -100%));
  filter: drop-shadow(0 6px 14px rgba(40, 25, 10, 0.35));
  animation: rise 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--d, 0s);
}
@keyframes rise { from { opacity: 0; transform: translate(calc(var(--fx, 0.5) * -100%), 6%); } }
.hero-title {
  position: relative;
  z-index: 5; /* 読人の絵（z-index 1〜3）より手前 */
  align-self: center;
  margin-right: 6vw;
  padding: 36px 28px;
  text-align: center;
  background: rgba(244, 236, 220, 0.88) var(--washi);
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(40, 25, 10, 0.25);
  animation: fade 1.2s 0.4s both;
}
@keyframes fade { from { opacity: 0; transform: translateY(12px); } }
.hero-catch { margin: 0; font-size: 15px; letter-spacing: 0.2em; color: var(--ink-soft); }
.hero-title h1 { margin: 6px 0 0; font-size: clamp(84px, 11vw, 150px); line-height: 1.05; color: var(--ink); }
.hero-sub { margin: 0 0 14px; letter-spacing: 0.3em; color: var(--shu); font-weight: 600; }
.hero-haiku { margin: 0 0 22px; font-size: 14px; color: var(--ink-faint); letter-spacing: 0.15em; }
.hero-note { margin: 10px 0 0; font-size: 12px; color: var(--ink-faint); }

/* ---- 段 ---- */
.sec { position: relative; padding: 88px max(20px, calc(50% - 540px)); }
.sec-h { display: flex; align-items: baseline; gap: 14px; margin: 0 0 32px; font-weight: 400; }
.sec-h .brush { font-size: 40px; line-height: 1; }
.sec-h small { font-size: 13px; letter-spacing: 0.2em; color: var(--shu); text-transform: uppercase; }
.sec-h::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(35, 28, 23, 0.35), transparent); }
.sec-h.light { color: #f4ecdc; }
.sec-h.light::after { background: linear-gradient(90deg, rgba(244, 236, 220, 0.5), transparent); }
.sec-lead { margin: -16px 0 24px; color: var(--ink-soft); }

/* お知らせ */
.news { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(35, 28, 23, 0.15); }
.news li { border-bottom: 1px solid rgba(35, 28, 23, 0.15); }
.news details summary {
  display: grid;
  grid-template-columns: 110px 1fr 20px;
  align-items: center;
  gap: 16px;
  padding: 16px 4px;
  cursor: pointer;
  list-style: none;
}
.news summary::-webkit-details-marker { display: none; }
.news summary::after { content: '＋'; color: var(--shu); }
.news details[open] summary::after { content: '－'; }
.news time { font-size: 13px; color: var(--ink-faint); letter-spacing: 0.05em; }
.news b { font-weight: 600; }
.news p { margin: 0 0 16px 126px; color: var(--ink-soft); font-size: 14px; }

/* 吟娘とは */
.about { background: var(--paper-2) var(--washi); }
.about-body { max-width: 720px; }
.about-lead { font-family: var(--brush); font-size: clamp(30px, 4vw, 44px); line-height: 1.5; margin: 0 0 20px; }

/* 遊び方 */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step { position: relative; background: #fffaf0; border-radius: 6px; overflow: hidden; box-shadow: 0 4px 18px rgba(60, 35, 10, 0.12); }
.step-img { aspect-ratio: 16 / 10; background: center / cover no-repeat; }
.step-no {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--shu);
  color: #fff;
  font-size: 24px;
}
.step h3 { margin: 18px 20px 4px; font-size: 20px; }
.step p { margin: 0 20px 22px; font-size: 14px; color: var(--ink-soft); }

/* 読人 */
.poets { background: #1d1a24 var(--bg) center / cover no-repeat; color: #f4ecdc; }
.poets::before { content: ''; position: absolute; inset: 0; background: linear-gradient(rgba(20, 16, 28, 0.55), rgba(20, 16, 28, 0.8)); }
.poets > * { position: relative; }
.poet-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 28px; }
.poet-tab {
  width: 64px;
  padding: 0;
  border: 2px solid rgba(244, 236, 220, 0.35);
  border-radius: 50%;
  overflow: hidden;
  background: #f4ecdc;
  cursor: pointer;
  aspect-ratio: 1;
  transition: transform 0.15s, border-color 0.15s;
}
.poet-tab img { width: 100%; height: 100%; object-fit: cover; }
.poet-tab:hover { transform: translateY(-3px); }
.poet-tab[aria-selected='true'] { border-color: #f2c46b; box-shadow: 0 0 0 3px rgba(242, 196, 107, 0.35); }
.poet-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.poet-fig { height: min(78vh, 680px); display: flex; justify-content: center; }
.poet-fig img { height: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45)); animation: fade 0.5s both; }
/* まだ祈願に出ていない姿：黒い影絵に、金のふちと淡い光（夜の背景に沈まないように） */
.poet-fig img.locked { filter: brightness(0) drop-shadow(0 0 1.5px rgba(242, 196, 107, 0.95)) drop-shadow(0 0 16px rgba(242, 196, 107, 0.45)); }
.poet-form.locked { opacity: 0.6; border-style: dashed; }
.poet-reading { margin: 0; letter-spacing: 0.3em; font-size: 13px; color: #f2c46b; }
.poet-name { margin: 0; font-size: 72px; line-height: 1.1; }
.poet-full { margin: 0 0 18px; opacity: 0.8; }
.poet-persona { margin: 0 0 22px; }
.poet-haiku {
  margin: 0 0 26px;
  padding: 14px 18px;
  border-left: 3px solid var(--shu);
  background: rgba(244, 236, 220, 0.08);
  font-size: 24px;
  letter-spacing: 0.1em;
}
.poet-forms { display: flex; flex-wrap: wrap; gap: 8px; }
.poet-form {
  padding: 4px 12px;
  border: 1px solid rgba(244, 236, 220, 0.45);
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.poet-form b { margin-right: 6px; color: #f2c46b; font-size: 11px; }
.poet-form[aria-pressed='true'] { background: #f4ecdc; color: var(--ink); }
.poet-form[aria-pressed='true'] b { color: var(--shu); }
.poet-tagline { margin: 14px 0 0; font-size: 14px; opacity: 0.85; min-height: 1.9em; }

/* 句友札 */
.card-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 23%);
  gap: 20px;
  overflow-x: auto;
  padding: 6px 4px 18px;
  scroll-snap-type: x mandatory;
}
.card {
  scroll-snap-align: start;
  margin: 0;
  background: #fffaf0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 2px #c9a24a, 0 0 0 4px #f2d79a, 0 6px 18px rgba(60, 35, 10, 0.18);
}
.card.r-R { box-shadow: 0 0 0 2px #9aa6b2, 0 0 0 4px #e6ecf2, 0 6px 18px rgba(60, 35, 10, 0.18); }
.card.r-N { box-shadow: 0 0 0 2px #8a6a48, 0 0 0 4px #c9a77a, 0 6px 18px rgba(60, 35, 10, 0.18); }
.card.r-SR { box-shadow: 0 0 0 2px #7b4fa8, 0 0 0 4px #d9c2ee, 0 6px 18px rgba(60, 35, 10, 0.18); }
.card img { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; }
.card figcaption { padding: 10px 14px 14px; }
.card b { display: block; font-size: 16px; }
.card small { color: var(--ink-faint); font-size: 12px; }
.card p { margin: 4px 0 0; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }

.card-rates { margin: -16px 0 20px; font-size: 12px; color: var(--ink-faint); }
.rarity { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 3px; font-size: 11px; line-height: 1.6; color: #fff; vertical-align: 2px; }
.rarity.r-SR { background: #7b4fa8; }
.rarity.r-R { background: #6f8399; }
.rarity.r-N { background: #8a6a48; }
/* 遊ぶ */
.cta {
  padding: 90px 20px;
  text-align: center;
  background: linear-gradient(rgba(35, 28, 23, 0.05), rgba(179, 53, 42, 0.1));
}
.cta-haiku { margin: 0 0 28px; font-size: clamp(24px, 4vw, 34px); letter-spacing: 0.15em; }

/* 下の帯 */
.ft { padding: 40px 20px; text-align: center; background: var(--ink); color: #f4ecdc; }
.ft .hd-logo { justify-content: center; }
.ft-links { display: flex; justify-content: center; gap: 24px; margin: 18px 0; font-size: 13px; }
.ft-voice { max-width: 760px; margin: 0 auto 14px; font-size: 11px; line-height: 1.8; opacity: 0.7; }
.ft-voice span { display: inline-block; margin: 0 0.5em; }
.ft-copy { margin: 0; font-size: 12px; opacity: 0.6; }

/* ---- 文字が主のページ（プライバシーポリシーなど） ---- */
.doc .hd { justify-content: space-between; }
.doc-main { max-width: 860px; margin: 0 auto; padding: calc(var(--hd) + 40px) 20px 60px; }
.doc-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin: 0 0 28px; font-weight: 400; }
.doc-h .brush { font-size: 36px; line-height: 1.2; }
.doc-h small { font-size: 12px; letter-spacing: 0.2em; color: var(--shu); text-transform: uppercase; }
.doc-body { font-size: 15px; }
.doc-body h2 { margin: 36px 0 10px; padding-left: 10px; border-left: 4px solid var(--shu); font-size: 19px; }
.doc-body ul { padding-left: 1.3em; }
.doc-body li { margin: 4px 0; }
.doc-body table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.doc-body th, .doc-body td { padding: 8px; border: 1px solid rgba(35, 28, 23, 0.18); text-align: left; vertical-align: top; }
.doc-body thead th { background: var(--paper-2); }
.doc-body tbody th { font-weight: 600; white-space: nowrap; }
.doc-body td a { word-break: break-all; }
.doc-updated { margin-top: 40px; color: var(--ink-faint); font-size: 13px; }
.faq details { border-bottom: 1px solid rgba(35, 28, 23, 0.15); }
.faq summary { padding: 14px 4px; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::before { content: 'Q. '; color: var(--shu); }
.faq summary::-webkit-details-marker { display: none; }
.faq details p, .faq details ul { margin: 0 0 14px 4px; color: var(--ink-soft); font-size: 14px; }
.ft-links { flex-wrap: wrap; row-gap: 6px; }

/* ---- スマホ ---- */
@media (max-width: 820px) {
  :root { --hd: 54px; }
  .hd { gap: 12px; padding: 0 14px; }
  .hd-menu {
    display: grid;
    gap: 5px;
    margin-left: auto;
    padding: 8px;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .hd-menu span { display: block; width: 22px; height: 2px; background: #f4ecdc; }
  .hd-nav {
    position: absolute;
    inset: var(--hd) 0 auto;
    flex-direction: column;
    gap: 0;
    margin: 0;
    background: rgba(35, 28, 23, 0.96);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s;
  }
  .hd.open .hd-nav { max-height: 320px; }
  .hd-nav a { padding: 14px 20px; border-top: 1px solid rgba(244, 236, 220, 0.12); }
  .hd .btn-play.small { order: 3; }
  .hero { grid-template-columns: 1fr; align-items: start; min-height: auto; }
  .hero-poets { height: 70svh; min-height: 420px; }
  /* スマホは幅がせまいので、真ん中の3人だけを、間を空けて並べる */
  .hero-poets img:nth-child(1), .hero-poets img:nth-child(5) { display: none; }
  .hero-poets img:nth-child(2) { left: 20% !important; }
  .hero-poets img:nth-child(4) { left: 80% !important; }
  .hero-title { margin: -120px 16px 40px; padding: 26px 18px; }
  .sec { padding: 64px 16px; }
  .sec-h .brush { font-size: 32px; }
  .news details summary { grid-template-columns: 1fr 20px; gap: 2px 10px; }
  .news time { grid-column: 1; }
  .news b { grid-column: 1; }
  .news summary::after { grid-row: 1 / 3; grid-column: 2; }
  .news p { margin-left: 4px; }
  .steps { grid-template-columns: 1fr; }
  .poet-tabs { gap: 8px; }
  .poet-tab { width: 46px; }
  .poet-view { grid-template-columns: 1fr; gap: 16px; }
  .poet-fig { height: 56vh; }
  .poet-name { font-size: 52px; }
  .poet-haiku { font-size: 19px; }
  .card-row { grid-auto-columns: 62%; }
  .doc-h .brush { font-size: 28px; }
  .doc-body table, .doc-body thead, .doc-body tbody, .doc-body tr, .doc-body th, .doc-body td { display: block; }
  .doc-body thead { display: none; }
  .doc-body tr { margin-bottom: 10px; border: 1px solid rgba(35, 28, 23, 0.18); }
  .doc-body th, .doc-body td { border: 0; border-bottom: 1px solid rgba(35, 28, 23, 0.08); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
