:root {
  --bg: #000;
  --fg: #fff;
  --accent: #e60039;
  --muted: rgba(255, 255, 255, 0.7);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  overscroll-behavior: none;
}

/* ===== 年齢確認ゲート ===== */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #0a0a0a;
}
.age-gate[hidden] {
  display: none;
}
.age-gate__card {
  max-width: 340px;
  text-align: center;
}
.age-gate__card h1 {
  font-size: 1.4rem;
  margin: 0 0 12px;
}
.age-gate__card p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 20px;
}
.age-gate__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.btn {
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
  font-size: 1rem;
  cursor: pointer;
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

/* ===== ビューア（縦スクロールスナップ） ===== */
.viewer {
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
}
.viewer[hidden] {
  display: none;
}

.work {
  position: relative;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  background: #000;
}

/* 横カルーセル（作品内サンプル画像） */
.carousel {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}
.slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.slide__placeholder {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    #111,
    #111 12px,
    #161616 12px,
    #161616 24px
  );
}

/* 作品情報オーバーレイ */
.work__overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.work__title {
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0;
  max-height: 3.2em;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.work__cta {
  pointer-events: auto;
  flex: 0 0 auto;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* 画像カウンタ（1 / N） */
.work__counter {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* ===== 状態表示・クレジット ===== */
.status {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  z-index: 50;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--muted);
  font-size: 0.85rem;
}
.status[hidden] {
  display: none;
}
.site-credit {
  position: fixed;
  left: 12px;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 40;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}
