/* Crea. — 基準単位 20px（ダイスの一辺 20mm に対応）。余白は 20 の倍数。角丸 0。
   色は「墨・生成りの紙・ベルベットの赤」の三面で切り替え、金は線と数字にだけ使う。 */
@property --k { syntax: '<length>'; inherits: false; initial-value: 12px; }

:root {
  --bg: #0D0B0A;      /* 墨。わずかに茶へ寄せる */
  --face: #151211;
  --ink: #D8D0C0;
  --ink-2: rgba(216, 208, 192, .52);
  --gold: #A38650;    /* 古金 */
  --hi: #D6BF8C;
  --rule: rgba(163, 134, 80, .28);
  --red: #451016;
  --paper: #E2DACA;
  --sumi: #1B1715;
  --u: 20px;
  --serif-ja: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --serif-en: "Libre Caslon Text", "Times New Roman", serif;
  --display-en: "Libre Caslon Display", "Libre Caslon Text", serif;
  --ease: cubic-bezier(.2, .6, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border-radius: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 14px/2.3 var(--serif-ja); letter-spacing: .06em;
  line-break: strict; overflow-wrap: anywhere; text-wrap: pretty; word-break: auto-phrase;
  font-feature-settings: "palt" 0; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* 紙の粒子 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 9; pointer-events: none; opacity: .06;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-underline-offset: 6px; text-decoration-thickness: 1px; }
b, h1, h2, h3, h4 { font-weight: 400; }
i { font-style: normal; }
ol { list-style: none; }
fieldset { border: 0; min-width: 0; }

/* ---- 面 ---- */
.band { position: relative; }
.band.face { background: var(--face); }
.band.paper { background: var(--paper); color: var(--sumi); --ink: var(--sumi); --ink-2: rgba(27, 23, 21, .62); --gold: #7A6233; --hi: #1B1715; --rule: rgba(27, 23, 21, .22); }
.band.velvet { background: radial-gradient(120% 90% at 28% 18%, #5A171E, #380B10 70%); --ink-2: rgba(216, 208, 192, .66); --rule: rgba(214, 191, 140, .3); }
.row {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--u);
  max-width: 1240px; margin: 0 auto; padding: calc(var(--u) * 10) calc(var(--u) * 2);
}

/* ---- 文字 ---- */
.logo { font: 400 26px/1 var(--display-en); letter-spacing: .08em; text-decoration: none; }
.lbl { font: italic 400 14px/1.6 var(--serif-en); letter-spacing: .02em; color: var(--gold); }
.note { font-size: 12px; line-height: 2; color: var(--ink-2); }
.lead-h { font-size: clamp(22px, 2.5vw, 34px); font-weight: 500; line-height: 1.9; letter-spacing: .14em; }
/* 改行の制御: .ph は文節のかたまり（途中で折らない）、.s は一文（一文一行。入りきらなければ均等に折る） */
.ph { display: inline-block; }
.tcy { text-combine-upright: all; }
.s { display: block; text-wrap: balance; }
h1, h2, h3, h4, dt, legend, .lead-h { text-wrap: balance; }
.mast-no, .big-no, .price-line, .ed-price, .bill dd, .sheet-no, .d-dim { white-space: nowrap; }

/* 章題は縦に組む */
.sec-title {
  grid-column: 1 / span 2; writing-mode: vertical-rl; justify-self: start;
  display: flex; gap: var(--u); font-size: 22px; font-weight: 500; letter-spacing: .34em; line-height: 1;
}
.sec-title span { font: italic 400 13px/1 var(--serif-en); letter-spacing: .04em; color: var(--gold); }
/* 二行にわたる章題（縦組みでは二列） */
.sec-title.long { grid-column: 1 / span 3; font-size: 24px; letter-spacing: .28em; }
.sec-title strong { font-weight: inherit; }
.sec-title em { display: block; font-style: normal; line-height: 2; white-space: nowrap; }

/* 行き先を示す線つきの文字 */
.cta {
  display: inline-flex; align-items: center; gap: var(--u); padding: var(--u) 0;
  font: inherit; font-size: 14px; letter-spacing: .22em; color: var(--hi);
  text-decoration: none; background: none; border: 0; cursor: pointer; white-space: nowrap;
}
/* 線は幅を変えずに伸び縮みさせる（文字が折り返さない） */
.cta::after { content: ""; flex: none; width: 100px; height: 1px; background: currentColor; transform: scaleX(.6); transform-origin: left; transition: transform .6s var(--ease); }
.cta:hover::after, .cta:focus-visible::after { transform: none; }
.cta:focus-visible { outline: 0; }
.cta[disabled] { color: var(--ink-2); cursor: default; }

/* 四隅のカギ形 */
.kagi {
  --g: linear-gradient(var(--gold) 0 0);
  background:
    var(--g) 0 0 / var(--k) 1px, var(--g) 0 0 / 1px var(--k),
    var(--g) 100% 0 / var(--k) 1px, var(--g) 100% 0 / 1px var(--k),
    var(--g) 0 100% / var(--k) 1px, var(--g) 0 100% / 1px var(--k),
    var(--g) 100% 100% / var(--k) 1px, var(--g) 100% 100% / 1px var(--k);
  background-repeat: no-repeat; transition: --k .5s var(--ease);
}
.cta.kagi { padding: var(--u) calc(var(--u) * 2); }
.cta.kagi:hover { --k: 20px; }

/* ---- ヘッダー ---- */
.mast {
  position: fixed; inset: 0 0 auto 0; z-index: 8; display: flex; justify-content: space-between; align-items: baseline;
  padding: var(--u) calc(var(--u) * 2); mix-blend-mode: difference; color: #D8D0C0;
}
.mast-no { font: 400 13px/1 var(--serif-en); letter-spacing: .06em; }
.mast-no i { font-style: italic; opacity: .6; }

/* ---- 1. ヒーロー：ダイスを主役に、見出しはその真下 ---- */
.hero {
  position: relative; min-height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: calc(var(--u) * 3) 0 calc(var(--u) * 2);
  background: radial-gradient(40% 30% at 50% 24%, rgba(163, 134, 80, .14), transparent 70%) #0B0B0C;
}
/* Destiny Dial: ダイスを中心に、傾いた円環の上を版の名前が巡る */
.dial { --cy: 150px; --tilt: 18deg; position: relative; flex: none; width: 100%; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.dial.is-dragging { cursor: grabbing; }
.dial-scene { position: absolute; inset: 0; perspective: 1100px; perspective-origin: 50% var(--cy); }
.dial-ring { position: absolute; left: 50%; top: var(--cy); width: 0; height: 0; transform-style: preserve-3d; transform: rotateX(calc(var(--tilt) * -1)); }
/* ダイスは環の中心に立てる（環の傾きを打ち消して正対させる）。奥の名前はダイスの向こうを通る */
.dial-dice { position: absolute; left: calc(var(--cw, 100vw) / -2); top: calc(var(--cy) * -1); width: var(--cw, 100vw); height: calc(var(--cy) * 2); transform: rotateX(var(--tilt)); touch-action: pan-y; }
.dial-item {
  --f: 0; --glow: 230, 207, 154; position: absolute; left: 0; top: 0; padding: 12px var(--u); background: none; border: 0; cursor: pointer;
  display: grid; justify-items: center; row-gap: 2px; white-space: nowrap; font: inherit;
  color: color-mix(in srgb, #E6CF9A calc(var(--f) * 100%), #A49A84);
  text-shadow: 0 0 calc(var(--f) * 22px) rgba(var(--glow), calc(var(--f) * .55));
  will-change: transform, opacity, filter; backface-visibility: hidden;
}
.dial-item::before { /* 正面に来たときだけ灯る後光 */
  content: ""; position: absolute; inset: -30% -12%; z-index: -1; opacity: var(--f); pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(var(--glow), .16), transparent 70%);
}
.dial-item[data-ed="secret"] { --glow: 255, 105, 165; }
.x18 { font: italic 400 13px/1 var(--serif-en); letter-spacing: 0; color: #FF9CC4; text-shadow: 0 0 6px rgba(255, 90, 155, .95), 0 0 16px rgba(255, 70, 145, .6); animation: neon 2.8s ease-in-out infinite; }
@keyframes neon { 50% { text-shadow: 0 0 9px rgba(255, 90, 155, 1), 0 0 26px rgba(255, 70, 145, .85); } }
.dial-item b { font: 400 24px/1.3 var(--display-en); letter-spacing: .02em; }
.dial-item span { font-size: 11px; line-height: 1.6; letter-spacing: .3em; text-indent: .3em; }
.dial-item:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
/* 確定の瞬間に広がる、1px の環 */
.dial-ripple {
  position: absolute; left: 50%; top: var(--front-y, 80%); width: 300px; height: 300px; border: 1px solid #E6CF9A; border-radius: 50%;
  transform: translate(-50%, -50%) scale(.12); opacity: 0; pointer-events: none;
}
.hero h1 {
  position: relative; pointer-events: none; padding: 0 var(--u);
  font-size: clamp(24px, 3.3vw, 46px); font-weight: 500; line-height: 1.6; letter-spacing: .2em; text-indent: .2em;
}
.hero-copy { padding: 0 var(--u); position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 8px; pointer-events: none; }
.hero-copy a, .hero-copy button { pointer-events: auto; }
.gate button {
  position: relative; padding: 4px 0 6px; line-height: 1.8; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 15px; letter-spacing: .3em; color: var(--ink-2); transition: color .4s;
}
.gate button::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0; background: var(--hi); transition: width .5s var(--ease); }
.gate button:hover { color: var(--hi); }
.gate button:hover::after { width: 100%; }
.gate button:focus-visible { outline: 1px solid var(--gold); outline-offset: 6px; }
.pick-info { font-size: 13px; line-height: 2; min-height: 4em; }
.pick-info b { display: block; font: 400 22px/1.6 var(--display-en); letter-spacing: .02em; color: var(--hi); }
.pick-info i { font: 400 16px var(--display-en); }
.pick-info[hidden], .gate[hidden] { display: none; }
.gate { font-size: 13px; line-height: 2; min-height: 4em; }
.gate .choice { justify-content: center; margin-top: 4px; }
.hero-copy .cta { margin-top: -8px; }
.ed[hidden] { display: none; }
.hero-meta { font-size: 12px; line-height: 2; color: var(--ink-2); }
.hero-meta .ph { margin: 0 .8em; }

/* ---- 2. 導入（紙） ---- */
/* 写真は紙の面いっぱいに。言葉は写真の余白（左下の白い寝具）に組む */
.intro { padding-top: calc(var(--u) * 4); }
/* 最初の写真は画面の幅いっぱいに。上を紙の地へ溶かし、左右の端もわずかにぼかす */
.intro-photo { position: relative; }
.intro-photo img {
  display: block; width: 100%; height: auto; filter: saturate(.92) contrast(1.02);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, .35) 12%, #000 38%), linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, .35) 12%, #000 38%), linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-composite: intersect;
}
/* 下端は写真を切らずに、寝具の白を紙の色へ伸ばして溶かす（写真の中の言葉にかからないように） */
.intro-photo::after {
  /* 写真のいちばん下の行だけを縦に引き伸ばして敷く。色が写真と地続きになるので、継ぎ目が出ない */
  content: ""; display: block; height: clamp(36px, 9vw, 140px); margin-top: -6px; filter: saturate(.92) contrast(1.02) blur(8px);
  background: url("img/intro.jpg?v=3") center bottom / 100% 90000% no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, transparent 100%), linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, #000 0, transparent 100%), linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-composite: intersect;
}
.intro { margin-top: clamp(-80px, -5vw, -16px); position: relative; }
/* 言葉は写真そのものに入っている。見出しは読み上げ用に残す */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.intro-body { grid-column: 5 / span 6; display: flex; flex-direction: column; gap: calc(var(--u) * 2); }
.intro-body .lead-h { margin-bottom: var(--u); }

/* ---- 3. 遊び方 ---- */
/* 三つの場面を一本の線でつなぐ: 写真 → 線の上の印 → 漢数字と言葉 */
.steps { grid-column: 3 / -1; display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: calc(var(--u) * 3); }
.steps li { display: grid; align-content: start; }
.steps figure { margin-right: var(--u); overflow: hidden; }
.steps img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; filter: saturate(.9); transition: transform 1.4s var(--ease); }
.steps li:hover img { transform: scale(1.04); }
.step-body { position: relative; margin-top: var(--u); padding-top: 12px; border-top: 1px solid var(--rule); display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: baseline; }
.step-body::before { content: ""; position: absolute; left: 0; top: -4px; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); } /* 線の上の印 */
.steps b { font-size: 24px; line-height: 1.6; color: var(--gold); }
.steps h3 { font-size: 18px; font-weight: 500; letter-spacing: .3em; line-height: 1.6; }
.steps p { grid-column: 1 / -1; font-size: 12px; color: var(--ink-2); line-height: 1.9; padding-right: var(--u); }
.play-body { grid-column: 4 / span 9; display: flex; flex-direction: column; align-items: flex-start; gap: var(--u); }
.roll-row { display: flex; flex-wrap: wrap; align-items: center; gap: calc(var(--u) * 2) calc(var(--u) * 3); width: 100%; }
/* 試し振りは、本物と同じ木のダイスが転がる */
.roll { --u3: 100px; position: relative; flex: 0 1 560px; min-width: 0; padding-bottom: calc(var(--u) * 2); }
.roll::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(46% 52% at 50% 46%, rgba(163, 134, 80, .16), transparent 72%); }
.roll::after { content: ""; position: absolute; left: 8%; right: 8%; top: calc(140px + var(--u3) * .78); height: 1px; background: linear-gradient(90deg, transparent, var(--rule) 30%, var(--rule) 70%, transparent); }
.roll-stage { position: relative; z-index: 1; display: block; width: 100%; height: 280px; cursor: grab; touch-action: pan-y; }
.roll-stage:active { cursor: grabbing; }
/* 卓に落ちる影。跳ねるほど薄く小さくなる（--ha / --hb は跳ねの高さ） */
.roll-shadow {
  position: absolute; left: calc(50% + var(--x)); top: calc(140px + var(--u3) * .74); width: calc(var(--u3) * 1.5); height: calc(var(--u3) * .26);
  transform: translate(-50%, -50%) scale(calc(1 - var(--h, 0) * .9)); opacity: calc(1 - var(--h, 0) * 1.4); pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(0, 0, 0, .75), transparent 70%);
}
.roll-shadow.a { --x: calc(var(--u3) * -.95); --h: var(--ha, 0); }
.roll-shadow.b { --x: calc(var(--u3) * .95); --h: var(--hb, 0); }
.roll-labels span { position: absolute; top: calc(140px + var(--u3) * .78 + 14px); transform: translateX(-50%); font-size: 11px; letter-spacing: .1em; color: var(--ink-2); white-space: nowrap; }
.roll-labels .a { left: calc(50% - var(--u3) * .95); }
.roll-labels .b { left: calc(50% + var(--u3) * .95); }
/* 振るボタン: ここだけ円。小さく控えめに、外側の環の呼吸で押せることを示す */
.roll-btn {
  position: relative; flex: none; width: 88px; height: 88px; border-radius: 50%; border: 1px solid var(--gold);
  display: grid; place-content: center; background: none; cursor: pointer;
  font: inherit; font-size: 11px; line-height: 1.7; letter-spacing: .14em; text-indent: .14em; color: var(--hi);
  transition: background .5s var(--ease), color .5s var(--ease);
}
.roll-btn span { display: block; }
.roll-btn::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1px solid var(--gold); opacity: .4; animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); opacity: 0; } }
.roll-btn:hover, .roll-btn:focus-visible { background: var(--hi); color: var(--bg); outline: 0; }
.roll-btn:active { transform: scale(.96); }
.play-body.is-rolling .roll-btn { pointer-events: none; opacity: .5; }
.times { font: 400 28px/1 var(--display-en); color: var(--gold); }
.roll-result { margin-top: var(--u); font-size: clamp(22px, 2.5vw, 34px); font-weight: 500; letter-spacing: .16em; line-height: 1.6; min-height: 1.6em; transition: opacity .5s; }
.play-body.is-rolling .roll-result { opacity: 0; }
/* 自分の言葉で試す → Custom Edition へ */
.try { width: 100%; max-width: 680px; margin-top: calc(var(--u) * 3); padding-top: calc(var(--u) * 3); border-top: 1px solid var(--rule); display: flex; flex-direction: column; align-items: flex-start; gap: var(--u); }
.try-cols { width: 100%; display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(var(--u) * 2); }
.try-col h4 { font-size: 14px; font-weight: 500; letter-spacing: .2em; margin-bottom: 4px; }
.try-col h4 i { font-size: 11px; color: var(--ink-2); margin-left: 8px; }
.try-col .line { grid-template-columns: 36px 1fr; margin-bottom: 4px; }
/* 買うためのボタン: 金の地に、品名と価格を並べる */
.order-btn {
  display: inline-flex; align-items: center; gap: calc(var(--u) * 2); max-width: 100%; padding: 16px calc(var(--u) * 1.5);
  background: #D6BF8C; color: #0B0B0C; text-decoration: none; transition: background .4s, transform .4s var(--ease);
  box-shadow: 0 16px 32px -20px rgba(214, 191, 140, .7);
}
.order-btn:hover, .order-btn:focus-visible { background: #F0DDB0; outline: 0; transform: translateY(-1px); }
.order-btn-text { display: grid; text-align: left; min-width: 0; }
.order-btn-text b { font-size: 16px; font-weight: 600; letter-spacing: .22em; line-height: 1.8; white-space: nowrap; }
.order-btn-text small { font-size: 11px; letter-spacing: .06em; line-height: 1.6; color: rgba(11, 11, 12, .68); }
.order-btn-price { flex: none; padding-left: calc(var(--u) * 1.5); border-left: 1px solid rgba(11, 11, 12, .3); white-space: nowrap; }
.order-btn-price i { font: 400 28px/1 var(--display-en); }
.order-btn-price small { font-size: 11px; margin-left: 4px; }
.cta-2 { display: grid; text-align: left; }
.cta-2 b { letter-spacing: .22em; }
.cta-2 small { font-size: 11px; letter-spacing: .1em; color: var(--ink-2); }

/* ---- 4. 物として：写真の代わりに図面 ---- */
.draw { grid-column: 4 / span 9; }
.draw svg { display: block; width: 100%; height: auto; }
.d-logo { font: 400 34px var(--display-en); fill: var(--gold); letter-spacing: .06em; }
.d-face { font: 600 13px var(--serif-ja); fill: #2E1507; letter-spacing: .04em; }
.d-dim { font: italic 400 11px var(--serif-en); fill: var(--gold); }
.d-cap { font: 400 12px var(--serif-ja); fill: var(--ink); letter-spacing: .08em; }
.notes { grid-column: 4 / span 9; display: grid; grid-template-columns: repeat(4, 1fr); column-gap: calc(var(--u) * 2); margin-top: calc(var(--u) * 4); }
.notes div { border-top: 1px solid var(--rule); padding-top: var(--u); }
.notes dt { font-size: 18px; font-weight: 500; letter-spacing: .3em; margin-bottom: 8px; }
.notes dd { font-size: 13px; line-height: 2.1; color: var(--ink-2); }

/* ---- 5. エディション：台帳の行 ---- */
.ed-list { grid-column: 4 / span 9; }
.ed-lead { display: block; margin-bottom: calc(var(--u) * 2); font-size: 14px; }
.ed {
  position: relative; display: grid; grid-template-columns: 60px 1fr auto; column-gap: var(--u); align-items: baseline;
  padding: calc(var(--u) * 2) 0 calc(var(--u) * 2) var(--u); border-top: 1px solid var(--rule); cursor: pointer;
}
.ed:last-child { border-bottom: 1px solid var(--rule); }
.ed input { position: absolute; opacity: 0; }
.ed::before { /* 選択の印：左に線が伸びる */
  content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 0; background: var(--hi);
  transform: translateY(-50%); transition: height .5s var(--ease);
}
.ed:has(input:checked)::before { height: calc(100% - var(--u) * 2); }
.ed-no { font: italic 400 15px/1 var(--serif-en); color: var(--gold); }
.ed-main { display: grid; row-gap: 4px; }
.ed-name { font: 400 clamp(24px, 2.6vw, 34px)/1.3 var(--display-en); letter-spacing: .02em; transition: color .4s; }
.ed:has(input:checked) .ed-name, .ed:hover .ed-name { color: var(--hi); }
.ed:has(input:focus-visible) .ed-name { text-decoration: underline; }
.ed-ja { font-size: 14px; }
.ed-ex { font-size: 12px; color: var(--ink-2); letter-spacing: .12em; }
.ed-ex i { font-family: var(--serif-en); color: var(--gold); margin: 0 4px; }
.ed-price { font: 400 22px/1 var(--display-en); letter-spacing: .04em; }
.ed-price::after { content: " 円"; font: 12px var(--serif-ja); color: var(--ink-2); }

/* ---- 6. コンフィギュレーター ---- */
.config { padding-top: 0; align-items: start; }
.config[hidden] { display: none; }
.stage-wrap { grid-column: 1 / span 5; position: sticky; top: calc(var(--u) * 4); }
.stage { display: block; width: 100%; aspect-ratio: 4 / 3; cursor: grab; touch-action: pan-y; }
.stage:active { cursor: grabbing; }
.stage-wrap .note { text-align: center; }
.stage-flat { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.stage-flat canvas { width: 100%; height: auto; }

.sheet { grid-column: 7 / span 6; padding: calc(var(--u) * 2); background-color: var(--face); }
.sheet-head { display: grid; grid-template-columns: 1fr auto; row-gap: 12px; align-items: end; margin-bottom: calc(var(--u) * 2); }
.sheet-head h3 { font-size: 22px; font-weight: 500; letter-spacing: .3em; line-height: 1; }
.sheet-no { grid-row: 1 / span 2; grid-column: 2; font: 400 15px/1 var(--serif-en); color: var(--gold); }
.sheet-cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(var(--u) * 2); margin-bottom: var(--u); }
.sheet-col h4 { font-size: 14px; font-weight: 500; letter-spacing: .2em; margin-bottom: 8px; }
.sheet-col h4 i { font-size: 11px; color: var(--ink-2); margin-left: 8px; }

.sheet-rule { font-size: 13px; line-height: 2; margin: calc(var(--u) * -1) 0 var(--u); padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
/* 一面 = 枠ひとつ。番号は枠線の上に載せ、中は 4マス × 2行の升目 */
.koma {
  --cell: 36px; position: relative; display: grid; justify-content: start;
  margin: 0 0 var(--u); padding: 12px; border: 1px solid var(--rule); transition: border-color .4s;
}
.koma:focus-within { border-color: var(--hi); }
.koma legend { padding: 0 8px; margin-left: -4px; font: italic 400 13px/1 var(--serif-en); color: var(--gold); transition: color .4s; }
.koma:focus-within legend, .koma.is-filled legend { color: var(--hi); }
.koma label { display: grid; grid-template-columns: 16px auto; align-items: center; }
.koma label i { font: italic 400 11px/1 var(--serif-en); color: var(--ink-2); }
.koma label + label .cells { margin-top: -1px; } /* 上下の行で罫線を共有する */
.cells {
  /* 全角一文字 = 1em。字間を足して、一文字が一マスにちょうど収まるようにする */
  --fs: 20px; width: calc(var(--cell) * 4 + 12px); height: var(--cell); padding: 0 0 0 calc((var(--cell) - var(--fs)) / 2);
  font: 400 var(--fs)/var(--cell) var(--serif-ja); letter-spacing: calc(var(--cell) - var(--fs)); color: var(--ink);
  border: 0; outline: 0; overflow: hidden; caret-color: var(--hi);
  --w: calc(var(--cell) * 4 + 1px); --l: linear-gradient(var(--rule) 0 0);
  background:
    repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px var(--cell)) 0 0 / var(--w) 100% no-repeat,
    var(--l) 0 0 / var(--w) 1px no-repeat, var(--l) 0 100% / var(--w) 1px no-repeat;
  transition: color .4s;
}
.cells:focus { --rule: rgba(214, 191, 140, .6); }
.cells.is-full { color: var(--hi); }
.koma output { justify-self: end; margin: 8px 0 -4px; font: 400 11px/1 var(--serif-en); color: var(--ink-2); }

/* 入力欄：箱ではなく、罫線一本 */
.line { display: grid; grid-template-columns: 36px 1fr auto; column-gap: 8px; align-items: end; margin-bottom: 12px; }
.line small { font: italic 400 12px/1 var(--serif-en); color: var(--gold); padding-bottom: 10px; }
.line .pair { display: grid; }
.line input {
  width: 100%; background: none; border: 0; border-bottom: 1px solid var(--rule); outline: 0;
  color: var(--ink); font: 400 15px/1 var(--serif-ja); letter-spacing: .3em; padding: 10px 0 6px;
  transition: border-color .4s;
}
.line input::placeholder { color: rgba(216, 208, 192, .2); }
.line input:focus { border-bottom-color: var(--hi); }
.line output { font: 400 11px/1 var(--serif-en); color: var(--ink-2); padding-bottom: 10px; min-width: 32px; text-align: right; }

.confirm { display: grid; grid-template-columns: 20px 1fr; column-gap: 12px; align-items: start; margin-top: var(--u); font-size: 12px; line-height: 2; cursor: pointer; }
.confirm input { appearance: none; width: 20px; height: 20px; border: 1px solid var(--gold); margin-top: 2px; display: grid; place-items: center; cursor: pointer; }
.confirm input:checked::after { content: ""; width: 10px; height: 10px; background: var(--hi); }
.confirm input:focus-visible { outline: 1px solid var(--hi); outline-offset: 3px; }

/* ---- 7. 身につける贈りもの（紙の面。白背景の写真は乗算で紙になじませる） ---- */
.acc { row-gap: calc(var(--u) * 5); align-items: start; }
.acc-intro { grid-column: 4 / span 6; display: flex; flex-direction: column; gap: var(--u); }
.acc-intro .lead-h { font-size: clamp(20px, 2.1vw, 28px); }
.price-line { font: 400 34px/1.4 var(--display-en); color: var(--ink); }
.price-line small { font: 12px var(--serif-ja); color: var(--ink-2); margin-left: 8px; }
.acc-scene { grid-column: 10 / span 3; margin-top: calc(var(--u) * -2); }
.acc-scene img { display: block; width: 100%; height: auto; filter: saturate(.86); }

.acc-stage { grid-column: 2 / span 5; position: sticky; top: calc(var(--u) * 4); display: grid; row-gap: 12px; justify-items: start; }
.acc-fig { --rx: 0deg; --ry: 0deg; width: 100%; aspect-ratio: 1; perspective: 900px; margin-bottom: 8px; background: var(--paper); }
.acc-fig img {
  display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) scale(.92); transition: transform .9s var(--ease), opacity .45s;
}
.acc-fig.is-changing img { opacity: 0; transform: rotateX(var(--rx)) rotateY(var(--ry)) scale(.88); }
.acc-stage h3 { font: 400 clamp(30px, 3.4vw, 46px)/1.2 var(--display-en); letter-spacing: .01em; }
.acc-ja { font-size: 14px; }
.acc-color { display: flex; align-items: center; gap: var(--u); margin-top: 8px; font-size: 12px; letter-spacing: .16em; color: var(--ink-2); }
.acc-colors { display: flex; gap: 12px; }
/* 地金の色。色見本と刻印見本の板で共有する */
.m-gold { --m: linear-gradient(135deg, #F3E2A8, #C9A24A 42%, #F1DC9A 58%, #A8842F); }
.m-silver { --m: linear-gradient(135deg, #F6F6F6, #B4B8BC 42%, #EEEFF0 58%, #8B9095); }
.m-rose { --m: linear-gradient(135deg, #F7D6C8, #D39A86 42%, #F3CABA 58%, #B67A67); }
.m-black { --m: linear-gradient(135deg, #5A5A5A, #1A1A1A 42%, #474747 58%, #0B0B0B); --mt: rgba(255, 255, 255, .5); --ms: rgba(0, 0, 0, .6); }
.m-gun { --m: linear-gradient(135deg, #8A8D91, #3D4044 42%, #7C8085 58%, #2A2C2F); --mt: rgba(255, 255, 255, .55); --ms: rgba(0, 0, 0, .6); }
.m-white { --m: linear-gradient(135deg, #FFFFFF, #E4E2DC); }
.m-pink { --m: linear-gradient(135deg, #F9DDE0, #E9B3BC); }
.m-blue { --m: linear-gradient(135deg, #D6ECF4, #A6CFE0); }
.acc-sw {
  position: relative; width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer; background: var(--m);
  box-shadow: inset 0 0 0 1px rgba(27, 23, 21, .18);
}
.acc-sw::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--sumi); opacity: 0; transform: scale(.8); transition: opacity .4s, transform .5s var(--ease); }
.acc-sw[aria-checked="true"]::after { opacity: 1; transform: none; }
.acc-sw:focus-visible { outline: 1px solid var(--gold); outline-offset: 7px; }
.acc-engrave { width: min(100%, 320px); margin: 8px 0 0; }
.acc-engrave small { font: 400 12px/1 var(--serif-ja); letter-spacing: .2em; color: var(--ink-2); }
.acc-engrave input { font: 400 22px/1 var(--serif-en); letter-spacing: .2em; text-transform: uppercase; }
.acc-engrave input::placeholder { color: rgba(27, 23, 21, .25); }
/* 刻印見本: 選んだ地金の板に、打った文字が彫られる */
.acc-proof {
  position: relative; width: min(100%, 320px); height: 52px; margin-top: 28px; display: grid; place-items: center; background: var(--m);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 -1px 0 rgba(0, 0, 0, .18) inset, 0 12px 24px -14px rgba(27, 23, 21, .55);
  transition: background .6s;
}
.acc-proof span { font: 400 20px/1 var(--serif-en); letter-spacing: .24em; text-indent: .24em; color: var(--mt, rgba(40, 28, 10, .62)); text-shadow: 0 1px 0 var(--ms, rgba(255, 255, 255, .55)); }
.acc-proof.is-sample span { opacity: .45; }
.acc-proof i { position: absolute; left: 0; bottom: calc(100% + 8px); line-height: 1; font-size: 10px; letter-spacing: .3em; color: var(--ink-2); }
.acc-count { margin-top: var(--u); display: grid; row-gap: 4px; }
.acc-stage .choice { flex-wrap: wrap; gap: 8px calc(var(--u) * 1.5); }
/* 二点えらぶときの札。編集中の一点に下線 */
.acc-slots { width: 100%; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.acc-slots[hidden] { display: none; }
.acc-slot { position: relative; display: grid; grid-template-columns: 64px 1fr; align-items: center; column-gap: 12px; padding: 8px 12px 8px 0; background: var(--paper); border: 0; cursor: pointer; font: inherit; color: inherit; text-align: left; opacity: .5; transition: opacity .4s; }
.acc-slot + .acc-slot { padding-left: 12px; border-left: 1px solid var(--rule); }
.acc-slot[aria-selected="true"], .acc-slot:hover { opacity: 1; }
.acc-slot::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--sumi); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.acc-slot[aria-selected="true"]::after { transform: none; }
.acc-slot img { display: block; width: 64px; height: 64px; object-fit: contain; mix-blend-mode: multiply; }
.acc-slot span { display: grid; min-width: 0; }
.acc-slot i { font-size: 10px; line-height: 1.6; letter-spacing: .3em; color: var(--gold); }
.acc-slot b { font: 400 17px/1.3 var(--display-en); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-slot small { font-size: 11px; line-height: 1.6; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-slot:focus-visible { outline: 1px solid var(--gold); outline-offset: -2px; }
/* もう一点が置かれている升 */
.acc-cell[data-other]:not([data-other=""])::before { content: attr(data-other); position: absolute; right: 12px; top: 10px; z-index: 1; font-size: 10px; letter-spacing: .2em; color: var(--gold); }
.choice { display: flex; gap: calc(var(--u) * 2); }
.choice label { position: relative; cursor: pointer; padding-bottom: 4px; letter-spacing: .3em; font-size: 15px; }
.choice input { position: absolute; opacity: 0; }
.choice span { color: var(--ink-2); transition: color .4s; }
.choice span::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0; background: var(--hi); transition: width .5s var(--ease); }
.choice input:checked + span { color: var(--hi); }
.choice input:checked + span::after { width: 100%; }
.choice input:focus-visible + span { outline: 1px solid var(--gold); outline-offset: 6px; }

/* 引き出し: 罫線を共有する升目に、一点ずつ並べる */
.acc-tray { grid-column: 8 / span 5; }
.acc-tabs { display: flex; gap: calc(var(--u) * 2); margin-bottom: var(--u); }
.acc-tabs button { position: relative; padding: 4px 0 8px; background: none; border: 0; cursor: pointer; font: inherit; font-size: 15px; letter-spacing: .24em; color: var(--ink-2); transition: color .4s; }
.acc-tabs button i { font: italic 400 12px var(--serif-en); letter-spacing: 0; margin-left: 6px; color: var(--gold); }
.acc-tabs button::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0; background: var(--sumi); transition: width .5s var(--ease); }
.acc-tabs button[aria-selected="true"] { color: var(--sumi); }
.acc-tabs button[aria-selected="true"]::after { width: 100%; }
.acc-tabs button:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }
.acc-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.acc-cell {
  position: relative; display: grid; justify-items: start; row-gap: 2px; padding: 12px 12px 16px; text-align: left;
  border: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: none; cursor: pointer; font: inherit; color: inherit; overflow: hidden;
}
.acc-cell img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; mix-blend-mode: multiply; transition: transform 1s var(--ease); }
.acc-cell:hover img, .acc-cell:focus-visible img { transform: scale(1.09); }
.acc-cell b { font: 400 18px/1.3 var(--display-en); }
.acc-cell span { font-size: 11px; line-height: 1.6; letter-spacing: .08em; color: var(--ink-2); }
.acc-cell span i { display: inline-block; }
/* 選んだ升には、四隅にカギ形が現れる */
.acc-cell::after {
  content: ""; position: absolute; inset: 6px; pointer-events: none; --k: 0px; --g: linear-gradient(var(--sumi) 0 0);
  background:
    var(--g) 0 0 / var(--k) 1px, var(--g) 0 0 / 1px var(--k),
    var(--g) 100% 0 / var(--k) 1px, var(--g) 100% 0 / 1px var(--k),
    var(--g) 0 100% / var(--k) 1px, var(--g) 0 100% / 1px var(--k),
    var(--g) 100% 100% / var(--k) 1px, var(--g) 100% 100% / 1px var(--k);
  background-repeat: no-repeat; transition: --k .5s var(--ease);
}
.acc-cell[aria-pressed="true"]::after { --k: 14px; }
.acc-cell[aria-pressed="true"] b { color: var(--gold); }
.acc-cell:focus-visible { outline: 0; }
.acc-cell:focus-visible::after { --k: 8px; }

/* ---- 8. 限定 ---- */
.limited-body { grid-column: 4 / span 8; display: flex; flex-direction: column; gap: var(--u); }
.big-no { font: 400 clamp(96px, 16vw, 220px)/1 var(--display-en); color: var(--gold); letter-spacing: .02em; }
.big-no i { font: italic 400 20px var(--serif-en); color: var(--ink-2); margin-left: var(--u); letter-spacing: .02em; }
.limited-body p:last-child { max-width: 600px; margin-top: var(--u); }

/* ---- 9. ご注文（紙＝控えの紙片） ---- */
.buy { row-gap: calc(var(--u) * 4); }
.bill { grid-column: 4 / span 6; display: flex; flex-direction: column; gap: var(--u); align-items: flex-start; }
.bill dl { width: 100%; }
.bill dl div { display: flex; justify-content: space-between; align-items: baseline; padding: var(--u) 0; border-top: 1px solid var(--rule); }
.bill dl div[hidden] { display: none; }
.bill dt { font-size: 15px; white-space: pre-line; }
.bill dd { font: 400 22px/1 var(--display-en); }
.bill .total { border-top-color: var(--sumi); }
.bill .total dd { font-size: 60px; }
.bill .total small { font: 13px var(--serif-ja); margin-left: 8px; }
.faq { grid-column: 4 / span 9; display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--u) * 2); }
.faq div { border-top: 1px solid var(--rule); padding-top: var(--u); }
.faq dt { font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.faq dd { font-size: 13px; line-height: 2.1; color: var(--ink-2); }

/* ---- 画面下に常設する注文バー ---- */
body { padding-bottom: 76px; }
.buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; column-gap: calc(var(--u) * 2);
  padding: 12px calc(var(--u) * 2) calc(12px + env(safe-area-inset-bottom));
  background: rgba(11, 11, 12, .88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: #D8D0C0; transition: transform .7s var(--ease);
}
.buybar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, #A38650 20%, #E6CF9A 50%, #A38650 80%, transparent); }
.buybar.is-off { transform: translateY(110%); }
.buybar-ed b { display: block; font: 400 19px/1.4 var(--display-en); letter-spacing: .02em; color: #E6CF9A; white-space: nowrap; }
.buybar-ed span { display: block; font-size: 11px; line-height: 1.6; letter-spacing: .1em; color: rgba(216, 208, 192, .6); }
.buybar-ed span i { font-family: var(--serif-en); color: #D6BF8C; }
.buybar-total { white-space: nowrap; }
.buybar-total i { font: 400 28px/1 var(--display-en); }
.buybar-total small { font-size: 11px; margin-left: 6px; color: rgba(216, 208, 192, .6); }
.buybar-go {
  display: block; padding: 14px calc(var(--u) * 2); background: #D6BF8C; color: #0B0B0C; text-decoration: none; white-space: nowrap;
  font-size: 14px; font-weight: 500; letter-spacing: .3em; text-indent: .3em; transition: background .4s;
}
.buybar-go:hover, .buybar-go:focus-visible { background: #F0DDB0; outline: 0; }

/* ---- フッター ---- */
.foot { padding: calc(var(--u) * 6) calc(var(--u) * 2) calc(var(--u) * 4); display: grid; justify-items: center; row-gap: calc(var(--u) * 2); }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px var(--u); }
.seal { display: block; opacity: .5; transition: opacity .6s; }
.seal:hover, .seal:focus-visible { opacity: 1; outline: 0; }

/* ---- SP ---- */
@media (max-width: 800px) {
  .row { grid-template-columns: 1fr; padding: calc(var(--u) * 6) var(--u); row-gap: calc(var(--u) * 3); }
  .row > * { grid-column: 1 / -1 !important; }
  .sec-title { writing-mode: horizontal-tb; flex-direction: column; gap: 12px; letter-spacing: .24em; }
  .sec-title.long { font-size: 20px; letter-spacing: .14em; }
  .intro { padding-top: calc(var(--u) * 2); }
  .acc-intro .lead-h { font-size: 18px; letter-spacing: .1em; }
  .roll-row { justify-content: center; gap: var(--u); }
  .roll { flex-basis: 100%; }
  .roll-stage { height: 240px; }
  .roll::after { top: calc(120px + var(--u3) * .78); }
  .roll-shadow { top: calc(120px + var(--u3) * .74); }
  .roll-labels span { top: calc(120px + var(--u3) * .78 + 14px); }
  .try-cols { column-gap: var(--u); }
  .order-btn { width: 100%; justify-content: space-between; gap: var(--u); padding: 14px var(--u); }
  .order-btn-text b { font-size: 14px; letter-spacing: .12em; }
  .order-btn-price { padding-left: var(--u); }
  .order-btn-price i { font-size: 22px; }
  .acc-scene { width: 60%; justify-self: end; margin-top: 0; }
  .acc-stage { position: static; }
  .acc-tabs { gap: var(--u); }
  .buybar { grid-template-columns: 1fr auto; column-gap: 12px; padding: 10px var(--u) calc(10px + env(safe-area-inset-bottom)); }
  .buybar-ed b { font-size: 14px; }
  .buybar-ed span { display: none; }
  .buybar-total { grid-column: 1; grid-row: 2; }
  .buybar-total i { font-size: 20px; }
  .buybar-go { grid-column: 2; grid-row: 1 / span 2; padding: 14px var(--u); font-size: 13px; letter-spacing: .2em; text-indent: .2em; }
  .mast { padding: var(--u); }
  .hero { padding: calc(var(--u) * 4) var(--u) calc(var(--u) * 2); }
  .dial { --cy: 120px; }
  .dial-item b { font-size: 19px; }
  .steps {
    display: flex; margin: 0 calc(var(--u) * -1); padding: 0 var(--u); overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding: 0 var(--u); scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .steps::-webkit-scrollbar { display: none; }
  .steps li { flex: 0 0 78%; scroll-snap-align: start; }
  .steps li:last-child { flex-basis: calc(78% + var(--u)); padding-right: var(--u); } /* 最後の一枚も端まで寄せられるように */
  .steps li:last-child figure { margin-right: 0; }
  .steps li:hover img { transform: none; }
  .notes, .faq { grid-template-columns: 1fr 1fr; row-gap: calc(var(--u) * 2); }
  .faq { grid-template-columns: 1fr; }
  .ed { grid-template-columns: 32px 1fr; padding-left: 12px; }
  .ed-price { grid-column: 2; margin-top: 8px; }
  .config { padding-top: 0; }
  .stage-wrap { position: static; }
  .sheet { padding: var(--u) 12px; }
  .sheet-cols { grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .sheet-col h4 i { display: block; margin: 0; } /* 二列の見出しの高さをそろえる */
  /* 二列に収まるよう、マスの大きさを画面幅から割り出す */
  .koma { --cell: clamp(24px, calc((100vw - 76px) / 8 - 9.5px), 30px); padding: 8px 4px; }
  .cells { --fs: calc(var(--cell) * .58); }
  .bill .total dd { font-size: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
