/* ソク同：縦にめくって作品を見る画面（サンプル画像を流す） */
:root {
  --pink: #e21d63;        /* サイト本体の主色 */
  --pink-d: #a80f45;
  --pink-l: #ff8fb6;      /* 黒地の上の小さい文字・線 */
  --sale: #ffe14d;        /* 黄色は割引だけに使う */
  --sale-d: #c9a400;
  --ink: #2a2025;
  --dk: #151013;
  --dk-2: #221a1f;
  --dk-line: rgba(255, 255, 255, 0.2);
  --dk-soft: #d3c6cc;
  --bar-h: 52px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  color: #fff;
  background: var(--dk);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--pink); color: #fff; }
:focus-visible { outline: 3px solid var(--pink-l); outline-offset: 2px; }
svg { display: block; }

/* ---------- 上の帯 ---------- */
.bar {
  position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: var(--bar-h);
  background: var(--dk); display: flex; align-items: center; gap: 10px; padding: 0 4px 0 14px;
}
.bar__logo { flex: none; font-family: "Zen Maru Gothic", sans-serif; font-weight: 900; font-size: 20px; letter-spacing: 0.02em; color: var(--pink-l); text-decoration: none; }
.tabs { flex: 1; min-width: 0; align-self: stretch; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; display: flex; align-items: center; padding: 0 9px; text-decoration: none; white-space: nowrap;
  font-size: 15px; font-weight: 700; color: var(--dk-soft); position: relative;
}
.tabs a[aria-current="page"] { color: #fff; font-weight: 800; }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: 7px; height: 3px; background: var(--pink); }
.tabs a.is-sale, .tabs a.is-sale[aria-current="page"] { color: var(--sale); }
.tabs a.is-sale[aria-current="page"]::after { background: var(--sale); }
.bar__list { flex: none; width: 44px; height: 44px; display: grid; place-items: center; color: #fff; border-left: 1px solid var(--dk-line); }
.bar__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; }
.bar__progress i { background: rgba(255, 255, 255, 0.22); }
.bar__progress i.is-done { background: var(--pink); }

/* ---------- 縦スワイプの入れ物 ---------- */
.feed {
  height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory; scrollbar-width: none; background: var(--dk);
}
.feed::-webkit-scrollbar { display: none; }
.slide {
  position: relative; height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always;
  padding-top: var(--bar-h); display: flex; flex-direction: column;
}

/* ---------- サンプル画像の面 ---------- */
.stage { position: relative; flex: 1; min-height: 0; background: #000; overflow: hidden; user-select: none; -webkit-user-select: none; }
.stage img { -webkit-user-drag: none; -webkit-touch-callout: none; }

/* 自動でめくれる（1枚の <img> を差し替える） */
.stage__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.stage__tap { position: absolute; top: 0; bottom: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.stage__tap--prev { left: 0; width: 32%; }
.stage__tap--next { right: 0; width: 68%; }
.stage__tap:focus-visible { outline-offset: -4px; }
.segs { position: absolute; z-index: 3; top: 8px; left: 8px; right: 8px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; pointer-events: none; }
.segs i { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.38); overflow: hidden; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35); }
.segs i b { display: block; height: 100%; width: 0; background: #fff; }
.segs i.is-done b { width: 100%; }
.segs i.is-now b { animation: seg var(--dur, 3s) linear forwards; }
.stage.is-held .segs i.is-now b { animation-play-state: paused; }
@keyframes seg { from { width: 0; } to { width: 100%; } }
.held { position: absolute; z-index: 3; left: 50%; top: 22px; transform: translateX(-50%); display: none; font-size: 12px; font-weight: 700; background: rgba(21, 16, 19, 0.82); border: 1px solid rgba(255, 255, 255, 0.5); padding: 4px 10px; border-radius: 99px; pointer-events: none; }
.stage.is-held .held { display: block; }

/* 画像の面の上に重ねるもの */
.count, .zoom {
  position: absolute; z-index: 4; font-size: 12px; font-weight: 700; line-height: 1;
  background: rgba(21, 16, 19, 0.82); border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 99px;
}
.count { right: 10px; top: 22px; padding: 6px 9px; font-variant-numeric: tabular-nums; pointer-events: none; }
.zoom { right: 10px; bottom: 10px; padding: 8px 12px 8px 9px; display: inline-flex; align-items: center; gap: 5px; cursor: zoom-in; }
.off {
  position: absolute; z-index: 4; left: 0; top: 22px; pointer-events: none; background: var(--sale); color: var(--ink);
  font-weight: 900; line-height: 1; padding: 8px 12px 8px 10px; border-radius: 0 8px 8px 0; box-shadow: 0 3px 0 var(--sale-d);
  display: flex; align-items: baseline; gap: 1px; font-size: 13px;
}
.off b { font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hint {
  position: absolute; z-index: 4; left: 50%; bottom: 52px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; white-space: nowrap;
  background: rgba(21, 16, 19, 0.88); border: 1.5px solid rgba(255, 255, 255, 0.5); font-size: 13px; font-weight: 700; padding: 7px 14px 7px 11px; border-radius: 99px;
  transition: opacity 0.4s ease; pointer-events: none;
}
.hint svg { animation: nudge 1.6s cubic-bezier(0.16, 1, 0.3, 1) infinite; }
.hint.is-gone { opacity: 0; }
@keyframes nudge { 0%, 100% { transform: translateY(4px); } 50% { transform: translateY(-3px); } }

/* ---------- 作品の情報 ---------- */
.info { flex: none; padding: 12px 16px 0; }
.meta { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--dk-soft); }
.rank { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 14px; background: #fff; color: var(--ink); font-variant-numeric: tabular-nums; }
.rank.is-top { background: var(--pink); color: #fff; }
.rank.is-new { width: auto; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; background: var(--pink); color: #fff; letter-spacing: 0.04em; }
.meta > span { white-space: nowrap; }
.kind { flex: none; color: #fff; padding: 2px 8px; border-radius: 99px; border: 1.5px solid rgba(255, 255, 255, 0.65); font-size: 12px; }
.meta time { margin-left: auto; flex: none; font-variant-numeric: tabular-nums; }
.title { margin: 8px 0 0; font-size: 18px; font-weight: 800; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sub { display: flex; align-items: center; gap: 12px; margin-top: 6px; font-size: 13.5px; min-width: 0; }
.circle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--dk-soft); }
.star { flex: none; font-weight: 800; color: var(--pink-l); font-variant-numeric: tabular-nums; }
.star small { font-size: 12px; font-weight: 700; color: var(--dk-soft); margin-left: 3px; }
.detail { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 1px; font-weight: 700; text-decoration: underline; text-decoration-color: var(--pink); text-underline-offset: 4px; text-decoration-thickness: 2px; padding: 4px 0; }
.genres { display: none; }

/* ---------- 購入ボタン ---------- */
.cta { position: relative; flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.price { flex: none; line-height: 1.15; font-variant-numeric: tabular-nums; }
.price__was { display: block; font-size: 12px; color: var(--dk-soft); }
.price__was i { font-style: normal; font-weight: 700; margin-left: 5px; }
.price b { font-size: 22px; font-weight: 900; }
.price b small { font-size: 12px; font-weight: 700; margin-left: 1px; }
.price.is-off b { color: var(--sale); }
.btn {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap;
  font-weight: 800; font-size: 15.5px; padding: 13px 12px; border-radius: 14px; background: var(--pink); color: #fff; box-shadow: 0 4px 0 var(--pink-d);
  transition: transform 0.15s ease;
}
.btn:active { transform: translateY(2px); }
.btn svg { flex: none; }
.btn__off { flex: none; background: var(--sale); color: var(--ink); font-size: 13px; font-weight: 900; line-height: 1; padding: 5px 7px; border-radius: 6px; }
.pr { position: absolute; right: 16px; top: 0; font-size: 10px; line-height: 12px; color: var(--dk-soft); }

/* ---------- 最後のスライド ---------- */
.end { justify-content: center; padding-left: 20px; padding-right: 20px; }
.end h2 { font-size: 21px; font-weight: 800; margin: 0 0 6px; line-height: 1.45; }
.end p { margin: 0 0 18px; font-size: 14px; line-height: 1.7; }
.end .btn { flex: none; margin-bottom: 30px; }
.end h3 { font-size: 15px; font-weight: 800; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--pink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { text-decoration: none; font-size: 13.5px; font-weight: 700; padding: 7px 13px; border-radius: 99px; border: 1.5px solid rgba(255, 255, 255, 0.65); }

/* ---------- 拡大表示 ---------- */
.lb { position: fixed; inset: 0; z-index: 50; background: #0f0b0d; display: none; flex-direction: column; }
.lb.is-open { display: flex; }
.lb:focus { outline: none; }
.lb__top { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lb__img { flex: 1; min-height: 0; overflow: auto; display: flex; }
.lb__img img { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
.lb__img.is-zoom img { max-width: none; max-height: none; width: 220%; cursor: zoom-out; }
.lb button { background: rgba(255, 255, 255, 0.16); border: 0; border-radius: 99px; padding: 10px 14px; font-size: 13px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.lb button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.lb__nav { display: flex; justify-content: center; gap: 10px; padding: 12px 0 calc(16px + env(safe-area-inset-bottom)); }

.stepper, .side { display: none; }

/* 低い画面（iPhone SE など） */
@media (max-height: 620px) {
  .title { font-size: 16px; -webkit-line-clamp: 1; }
  .info { padding-top: 9px; }
  .cta { padding-top: 9px; padding-bottom: calc(9px + env(safe-area-inset-bottom)); }
  .btn { padding: 11px 10px; }
  .hint { bottom: 46px; }
}
@media (max-width: 350px) {
  .tabs a { font-size: 14px; padding: 0 7px; }
  .bar { gap: 6px; padding-left: 10px; }
  .btn { font-size: 13.5px; padding-left: 8px; padding-right: 8px; gap: 4px; }
  .btn__off { font-size: 12px; padding: 5px 5px; }
  .cta { gap: 10px; }
  .price b { font-size: 20px; }
}

/* ---------- PC：左に画像を大きく、右に情報 ---------- */
@media (min-width: 900px) {
  :root { --panel: 400px; }
  .slide { display: grid; grid-template-columns: minmax(0, 1fr) var(--panel); grid-template-rows: minmax(0, 1fr) auto; column-gap: 0; }
  .stage { grid-row: 1 / 3; border-right: 1px solid var(--dk-line); }
  .info { grid-column: 2; align-self: end; padding: 0 32px 0 28px; }
  .cta { grid-column: 2; flex-direction: column; align-items: stretch; gap: 14px; padding: 22px 32px 40px 28px; }
  .pr { right: 32px; top: 6px; }
  .title { font-size: 23px; -webkit-line-clamp: 4; margin-top: 12px; }
  .sub { flex-wrap: wrap; row-gap: 8px; margin-top: 12px; font-size: 14.5px; }
  .detail { margin-left: 0; flex-basis: 100%; }
  .genres { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; }
  .genres li { font-size: 12.5px; font-weight: 700; color: var(--dk-soft); padding: 3px 9px; border-radius: 99px; border: 1px solid var(--dk-line); }
  .price { display: flex; align-items: baseline; gap: 10px; }
  .price__was { display: inline; font-size: 14px; order: 2; }
  .price b { font-size: 30px; }
  .btn { flex: none; font-size: 17px; padding: 16px; }
  .btn:hover { background: #f02a70; }
  .zoom { right: 16px; bottom: 16px; }
  .count { right: 16px; }
  .segs { left: 16px; right: 16px; top: 12px; }
  .off { top: 30px; font-size: 15px; padding: 10px 16px 10px 14px; }
  .off b { font-size: 30px; }
  .count, .held { top: 30px; }
  .hint { bottom: 28px; }
  .stepper {
    display: flex; gap: 10px; position: fixed; z-index: 20; right: 32px; top: calc(var(--bar-h) + 20px);
  }
  .stepper button { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid #fff; background: var(--dk); display: grid; place-items: center; cursor: pointer; padding: 0; }
  .stepper button:hover:not(:disabled) { background: var(--dk-2); }
  .stepper button:disabled { border-color: var(--dk-line); color: rgba(255, 255, 255, 0.3); cursor: default; }
  .end { display: flex; max-width: 560px; margin: 0 auto; }
  .side { position: fixed; z-index: 19; top: var(--bar-h); right: 0; width: var(--panel); bottom: 440px; padding: 22px 32px 0 28px; flex-direction: column; }
  .side h2 { flex: none; margin: 0; padding: 0 100px 12px 0; font-size: 15px; font-weight: 800; line-height: 40px; padding-bottom: 6px; border-bottom: 2px solid var(--pink); }
  .side ol { flex: 1; min-height: 0; overflow-y: auto; list-style: none; margin: 0; padding: 0; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.3) transparent; }
  .side li button { width: 100%; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left; padding: 7px 6px; border: 0; border-bottom: 1px solid var(--dk-line); background: none; cursor: pointer; }
  .side li button:hover { background: rgba(255, 255, 255, 0.08); }
  .side li button[aria-current="true"] { background: rgba(255, 255, 255, 0.14); }
  .side li button:focus-visible { outline-offset: -3px; }
  .side .rank { width: 24px; height: 24px; font-size: 12px; }
  .side b { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side li button[aria-current="true"] b { font-weight: 800; }
  .tabs a { padding: 0 12px; }
  .tabs a[aria-current="page"]::after { left: 12px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .hint svg { animation: none; }
  .feed { scroll-behavior: auto; }
}

/* PC で縦に余裕があるとき：右の上に、この並びの一覧を出す */
@media (min-width: 900px) and (min-height: 800px) {
  .side { display: flex; }
  .stepper { top: calc(var(--bar-h) + 22px); }
}
