/* ============================================================
   スケスケメーカー — サイト共通スタイル
   デザイン言語は tategazou-maker を踏襲（紙色×ガラスパネル×ピル型）
   アクセントは紫→ピンク、モチーフは市松（透過チェッカーボード）
   ============================================================ */

:root {
  --paper: #f7f3ee;
  --ink: #24211d;
  --muted: #6f675e;
  --card: rgba(255, 255, 255, 0.74);
  --line: rgba(36, 33, 29, 0.1);
  --accent1: #a855f7;
  --accent2: #ec4899;
  --accent-grad: linear-gradient(135deg, var(--accent1), var(--accent2));
  --erase: #ef4444;
  --keep: #10b981;
  --radius: 22px;
  --radius-s: 12px;
  --shadow: 0 18px 50px -22px rgba(168, 85, 247, 0.35);
  --checker: repeating-conic-gradient(#e8e2da 0% 25%, #ffffff 0% 50%) 0 0 / 16px 16px;
  --checker-dark: repeating-conic-gradient(#2a2a2e 0% 25%, #1c1c1f 0% 50%) 0 0 / 16px 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  overflow-x: hidden;
}

/* ふわっと浮かぶ背景ブロブ */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  pointer-events: none;
}
body::before {
  width: 46vw; height: 46vw; min-width: 340px; min-height: 340px;
  left: -12vw; top: -14vw;
  background: radial-gradient(circle at 30% 30%, #e9d5ff, transparent 65%);
  animation: float1 16s ease-in-out infinite alternate;
}
body::after {
  width: 42vw; height: 42vw; min-width: 300px; min-height: 300px;
  right: -10vw; bottom: -12vw;
  background: radial-gradient(circle at 70% 70%, #fbcfe8, transparent 65%);
  animation: float1 20s ease-in-out infinite alternate-reverse;
}
@keyframes float1 { from { transform: translateY(-16px); } to { transform: translateY(16px); } }

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 0.5em; }
button { font-family: inherit; }

main { max-width: 860px; margin: 0 auto; padding: 0 18px 80px; }
section { margin: 72px 0; }
section h2 { font-size: clamp(22px, 4vw, 30px); font-weight: 900; text-align: center; }
.section-lead { text-align: center; color: var(--muted); margin-top: -4px; }

/* ------------------------------------------------ ヘッダー/フッター */
.site-head {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 28px);
  background: rgba(247, 243, 238, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 900; font-size: 17px; text-decoration: none;
}
.brand-chip {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--checker);
  position: relative; overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--line);
}
.brand-chip::after {
  content: ""; position: absolute; inset: 0;
  background: var(--accent-grad);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  opacity: 0.9;
}
.site-head nav { display: flex; gap: clamp(10px, 3vw, 22px); font-size: 13.5px; font-weight: 500; }
.site-head nav a { text-decoration: none; color: var(--muted); }
.site-head nav a:hover { color: var(--ink); }

.site-foot {
  border-top: 1px solid var(--line);
  padding: 28px 18px 48px;
  text-align: center; color: var(--muted); font-size: 13px;
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin-bottom: 10px; }
.site-foot a { color: var(--muted); }

/* ------------------------------------------------ ヒーロー */
.hero { text-align: center; margin-top: 48px; }
.badge {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  background: rgba(168, 85, 247, 0.12); color: #7c3aed;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em;
}
.hero h1 { font-size: clamp(28px, 6vw, 46px); font-weight: 900; letter-spacing: 0.01em; }
.hero h1 em {
  font-style: normal;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .lead { color: var(--muted); max-width: 560px; margin: 0 auto 26px; }

.dropzone {
  position: relative;
  max-width: 620px; margin: 0 auto;
  padding: clamp(34px, 7vw, 56px) 24px;
  border: 2.5px dashed rgba(168, 85, 247, 0.45);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent1); transform: translateY(-2px); }
.dropzone.dragover {
  border-color: var(--accent2);
  background: rgba(255, 255, 255, 0.92);
  transform: scale(1.015);
}
.dz-mascot {
  position: absolute; top: -52px; right: 22px; width: 104px;
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(80, 40, 120, 0.22));
}
.dz-icon { font-size: 42px; margin-bottom: 6px; }
.dz-main { font-size: clamp(15px, 3vw, 18px); font-weight: 700; }
.dz-sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.hero-actions { margin-top: 18px; }
.btn-ghost {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.6);
  border-radius: 999px; padding: 10px 22px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.btn-ghost:hover { background: #fff; }
.turnstile-box { display: flex; justify-content: center; margin-top: 18px; min-height: 0; }

/* ------------------------------------------------ 汎用ボタン */
.btn-primary {
  display: inline-block; width: 100%;
  border: none; border-radius: 999px;
  padding: 14px 26px;
  background: var(--accent-grad);
  color: #fff; font-size: 15.5px; font-weight: 800; letter-spacing: 0.02em;
  cursor: pointer; box-shadow: var(--shadow);
  transition: opacity 0.15s, transform 0.15s;
}
.btn-primary:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.45; cursor: default; }

.chip {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.7);
  border-radius: 999px; padding: 7px 14px;
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover:not(:disabled) { background: #fff; }
.chip:disabled { opacity: 0.4; cursor: default; }
.chip-danger { color: #b91c1c; }

/* ------------------------------------------------ エディタ */
.editor-section { display: none; }
body.editing .editor-section { display: block; margin: 26px 0; }
body.editing .lp-only { display: none !important; }

.editor {
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(12px, 3vw, 22px);
}

.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.editor-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); min-height: 28px; }
.hover-color { display: inline-flex; align-items: center; gap: 6px; }
.hover-color i { width: 15px; height: 15px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
.editor-actions { display: flex; gap: 6px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.small { font-size: 11.5px; }
.dim { color: var(--muted); }

.canvas-wrap {
  position: relative;
  height: min(62vh, 640px);
  min-height: 300px;
  border-radius: var(--radius-s);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--checker);
  touch-action: none;
}
.canvas-wrap.mode-tap { background: #000; }
.canvas-wrap.mode-mask { background: var(--checker); }
.canvas-wrap.mode-timeline { background: #000; }
.canvas-wrap.mode-timeline.timeline-light { background: #fff; }
.editor-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.canvas-wrap.mode-timeline .editor-canvas { cursor: default; }

.brush-ring {
  position: absolute; left: 0; top: 0; display: none;
  border: 1.6px solid #fff; border-radius: 50%;
  mix-blend-mode: difference;
  pointer-events: none;
}
.canvas-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(247, 243, 238, 0.7);
  font-weight: 700; font-size: 14px;
  backdrop-filter: blur(3px);
}
.canvas-overlay.small { inset: auto 10px 10px auto; background: rgba(0,0,0,0.55); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 11.5px; }
.timeline-note {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6); color: #eee;
  font-size: 11px; padding: 4px 12px; border-radius: 999px;
  pointer-events: none; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis;
}

.view-tabs { display: flex; gap: 6px; margin: 12px 0 4px; flex-wrap: wrap; align-items: center; }
.view-tab {
  flex: 1; min-width: 72px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.55);
  padding: 9px 4px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.view-tab.active { background: var(--accent-grad); color: #fff; border-color: transparent; }

.toolbar {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px;
  position: sticky; bottom: 10px; z-index: 5;
}
.tool-btn {
  flex: 1 1 40%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 14px; padding: 11px 8px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  cursor: pointer; min-height: 44px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.tool-btn.tool-erase.active { background: var(--erase); color: #fff; border-color: transparent; box-shadow: 0 6px 20px -8px var(--erase); }
.tool-btn.tool-keep.active { background: var(--keep); color: #fff; border-color: transparent; box-shadow: 0 6px 20px -8px var(--keep); }

.brush-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.brush-row label { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); flex: 1; }
.brush-row input[type="range"] { flex: 1; min-width: 120px; accent-color: var(--accent1); }

/* TAP!スタンプパネル */
.stamp-panel {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 10px 12px;
}
.stamp-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.credit-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.stamp-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; cursor: pointer; }
.stamp-toggle input { accent-color: var(--accent1); width: 16px; height: 16px; }
.stamp-body { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.stamp-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.stamp-thumbs button {
  width: 64px; height: 44px; padding: 4px;
  border: 2px solid var(--line); border-radius: 10px;
  background: var(--checker); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.stamp-thumbs button.sel { border-color: var(--accent1); box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25); }
.stamp-thumbs img { max-width: 100%; max-height: 100%; object-fit: contain; }
.stamp-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.anchor-grid {
  display: grid; grid-template-columns: repeat(3, 15px); grid-template-rows: repeat(3, 15px);
  gap: 3px; padding: 5px;
  background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line); border-radius: 8px;
}
.anchor-grid button {
  border: 1px solid var(--line); border-radius: 4px;
  background: #fff; cursor: pointer; padding: 0;
}
.anchor-grid button.sel { background: var(--accent1); border-color: var(--accent1); }
.stamp-size { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.stamp-size input { width: 110px; accent-color: var(--accent1); }

/* ルール一覧 */
.rules { margin: 18px 0 6px; }
.rules h3 { font-size: 14px; color: var(--muted); font-weight: 700; }
.rules ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rules-empty {
  border: 1.5px dashed var(--line); border-radius: var(--radius-s);
  padding: 16px; text-align: center; color: var(--muted); font-size: 13px;
  background: rgba(255, 255, 255, 0.4);
}
.rule { background: rgba(255, 255, 255, 0.66); border-radius: var(--radius-s); border: 1px solid var(--line); overflow: hidden; }
.rule.erase { border-left: 4px solid var(--erase); }
.rule.keep { border-left: 4px solid var(--keep); }
.rule.disabled { opacity: 0.45; }
.rule-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; }
.swatch { width: 22px; height: 22px; border-radius: 6px; border: 2px solid rgba(0, 0, 0, 0.15); flex-shrink: 0; }
.badge-erase, .badge-keep { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.badge-erase { color: var(--erase); background: rgba(239, 68, 68, 0.12); }
.badge-keep { color: var(--keep); background: rgba(16, 185, 129, 0.12); }
.rule-head .dim { margin-left: auto; }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 14px; padding: 3px; }
.rule-body { padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.rule-mode-row { display: flex; gap: 6px; margin: 10px 0; }
.mode-btn { flex: 1; border: 1px solid var(--line); background: rgba(255,255,255,0.6); border-radius: 8px; padding: 7px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.mode-btn.erase.active { background: var(--erase); color: #fff; border-color: transparent; }
.mode-btn.keep.active { background: var(--keep); color: #fff; border-color: transparent; }
.rule-slider { display: block; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.rule-slider span { display: flex; justify-content: space-between; }
.rule-slider b { color: var(--ink); }
.rule-slider input { width: 100%; accent-color: var(--accent1); }

.export-open { margin-top: 14px; }

/* モーダル */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30, 25, 20, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 480px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.4);
}
.modal h3 { font-size: 18px; font-weight: 900; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); margin-bottom: 8px; cursor: pointer; background: rgba(255,255,255,0.6); }
.opt input { margin-top: 4px; accent-color: var(--accent1); }
.opt b { display: block; font-size: 14px; }
.opt small { color: var(--muted); display: block; font-size: 12px; line-height: 1.6; }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.opt-row select { font-family: inherit; font-size: 13px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.warn { color: #b45309; font-size: 12.5px; }
.export-checks { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-s); background: rgba(255,255,255,0.7); border: 1px solid var(--line); font-size: 13px; }
.export-checks .ng { color: #b45309; font-weight: 700; }
.export-checks .done { font-size: 12.5px; color: var(--muted); margin: 8px 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.modal-actions .btn-primary { width: auto; padding: 11px 28px; }

/* ------------------------------------------------ Before/After デモ */
.ba-wrap {
  position: relative;
  max-width: 520px; margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: ew-resize;
  box-shadow: var(--shadow);
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.x-card { position: relative; background: #000; }
.ba-wrap img { width: 100%; pointer-events: none; }
.ba-after { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 3px; background: #fff;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.ba-handle::after {
  content: "⇔"; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900;
}
.tap-demo {
  max-width: 300px; margin: 26px auto 0; text-align: center; cursor: pointer;
}
.tap-demo img {
  border-radius: var(--radius-s);
  background: #000;
  box-shadow: 0 12px 34px -16px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s;
}
.tap-demo:hover img { transform: scale(1.02); }
.tap-demo.revealed img { outline: 3px solid var(--accent2); }
.tap-demo figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ------------------------------------------------ 使い方/仕組み/注意/FAQ */
.step-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.step-grid li {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 18px;
  backdrop-filter: blur(10px);
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-grad); color: #fff; font-weight: 900;
  margin-bottom: 10px;
}
.step-grid h3 { font-size: 15.5px; }
.step-grid p { font-size: 13px; color: var(--muted); margin: 0; }

.mechanism p { max-width: 640px; margin: 0 auto 24px; }
.mech-visual { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.mech-box { text-align: center; font-size: 11.5px; color: var(--muted); }
.mech-checker, .mech-empty {
  width: 120px; height: 120px; border-radius: var(--radius-s);
  border: 1px solid var(--line); margin-bottom: 6px;
}
.mech-checker {
  background:
    repeating-conic-gradient(rgba(168, 85, 247, 0.85) 0% 25%, transparent 0% 50%) 0 0 / 8px 8px,
    var(--checker);
}
.mech-empty { background: var(--checker); }
.mech-arrow { font-weight: 800; color: var(--muted); font-size: 13px; }

.note-list {
  list-style: none; margin: 0 auto; padding: 0; max-width: 720px;
  display: flex; flex-direction: column; gap: 12px;
  counter-reset: note;
}
.note-list li {
  background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--accent1);
  border-radius: var(--radius-s); padding: 16px 20px 16px 58px;
  position: relative;
  counter-increment: note;
}
.note-list li::before {
  content: counter(note);
  position: absolute; left: 18px; top: 17px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-grad); color: #fff;
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.note-list li b { display: block; font-size: 15.5px; line-height: 1.5; margin-bottom: 3px; }
.note-list li p { margin: 0; font-size: 13.5px; color: var(--muted); }

.faq details {
  max-width: 640px; margin: 0 auto 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 0 18px;
}
.faq summary { cursor: pointer; font-weight: 700; font-size: 14px; padding: 14px 0; list-style-position: outside; }
.faq p { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }

/* ------------------------------------------------ レスポンシブ */
@media (max-width: 680px) {
  section { margin: 52px 0; }
  .step-grid { grid-template-columns: 1fr; }
  .canvas-wrap { height: min(58vh, 480px); }
  .tool-btn { font-size: 12px; padding: 12px 4px; }
  .editor { padding: 10px; border-radius: 16px; }
  .site-head nav a:not(:last-child) { display: none; }
  .mech-arrow { width: 100%; text-align: center; }
  .dz-mascot { width: 76px; top: -38px; right: 12px; }
}

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