:root {
  /* layout: 1カラム。①回す → ②ぶっ飛び度 → ③AIで描く の3ステップを縦に積む */
  --bg: #eeedf7;
  --panel: #ffffff;
  --ink: #1b1830;
  --muted: #6b6787;
  --accent: #ff4f2e;
  --blue: #3157e8;
  --line: #d8d5e8;
  --reel: #1b1830;
  --reel-ink: #fff6d6;
  --yellow: #ffd43b;
  --mint: #6fe3c1;
  --pink: #ff8fc7;
  --font-display: "Dela Gothic One", "Hiragino Kaku Gothic StdN", sans-serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14121f; --panel: #1f1c2f; --ink: #f1eefc; --muted: #a29dbf;
    --accent: #ff6a4d; --blue: #7b95ff; --line: #35304d;
    --reel: #0b0a12; --reel-ink: #ffe9a8; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14121f; --panel: #1f1c2f; --ink: #f1eefc; --muted: #a29dbf;
  --accent: #ff6a4d; --blue: #7b95ff; --line: #35304d;
  --reel: #0b0a12; --reel-ink: #ffe9a8; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); line-height: 1.6; }
main { max-width: 640px; margin: 0 auto; padding: 28px 16px 48px; display: grid; gap: 26px; }
header { display: grid; gap: 6px; }
h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 8vw, 44px); margin: 0; letter-spacing: 0.02em; line-height: 1.2; text-wrap: balance; }
h1 span { color: var(--accent); }
.lead { margin: 0; font-size: 15px; font-weight: 700; }
.lead small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
button, .btn { font-family: var(--font-body); font-weight: 700; cursor: pointer; }
button:focus-visible, .btn:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.step { display: grid; gap: 12px; }
.step-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 17px; }
.step-num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--panel);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 400; font-size: 15px; flex: none;
}

.machine {
  background: var(--panel); border: 2px solid var(--ink); border-radius: 18px;
  padding: 18px; display: grid; gap: 14px; box-shadow: 6px 6px 0 var(--ink);
}
.block { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.block-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.tag { font-size: 12px; font-weight: 700; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; }
.pick {
  margin-left: auto; font: 700 12px var(--font-body); color: var(--ink); background: var(--panel);
  border: 1px solid var(--ink); border-radius: 8px; padding: 3px 6px; max-width: 60%;
}
.reel {
  background: var(--reel); color: var(--reel-ink); border-radius: 12px;
  min-height: 58px; padding: 10px 16px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 4px;
  font-family: var(--font-body); font-weight: 900; letter-spacing: 0.02em; line-height: 1.35; font-size: clamp(20px, 5.4vw, 26px); overflow: hidden;
}
.reel.touch { background: var(--blue); color: #fff; }
.reel .word { overflow-wrap: anywhere; }
.reel .joint { font-family: var(--font-body); font-weight: 700; font-size: 17px; letter-spacing: 0; color: var(--accent); }
.reel.touch .joint { color: #fff; opacity: 0.8; }
.reel.spinning .word { filter: blur(0.6px); opacity: 0.75; }
.reel.locked { outline: 3px solid var(--accent); outline-offset: 2px; }
.reel.pop .word { animation: pop 0.28s ease-out; }
@keyframes pop { from { transform: translateY(-30%); } to { transform: translateY(0); } }
.lock {
  width: 58px; min-height: 58px; border-radius: 12px; border: 2px solid var(--line);
  background: transparent; color: var(--muted); font-size: 12px; display: grid; place-items: center; padding: 4px;
}
.lock svg { width: 20px; height: 20px; }
.lock[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.divider { border: none; border-top: 2px dashed var(--line); margin: 2px 0; }

.result { font-weight: 700; font-size: 19px; text-wrap: balance; }
.result small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }

.actions { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; }
.spin {
  background: var(--accent); color: #fff; border: 2px solid var(--ink); border-radius: 14px;
  font-family: var(--font-display); font-weight: 400; font-size: 22px; padding: 14px;
  box-shadow: 4px 4px 0 var(--ink); transition: transform 0.08s, box-shadow 0.08s;
}
.spin:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.spin:disabled { opacity: 0.6; cursor: default; }
.sub {
  background: var(--panel); color: var(--ink); border: 2px solid var(--ink); border-radius: 14px;
  padding: 0 14px; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; min-height: 44px;
}
.toast { min-height: 1.4em; font-size: 13px; color: var(--blue); margin: -6px 0 0; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; background: var(--panel); font-variant-numeric: tabular-nums; }

/* ぶっ飛び度のスライドスイッチ */
.switch {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--panel); border: 2px solid var(--ink); border-radius: 999px; padding: 4px;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch label {
  position: relative; z-index: 1; text-align: center; padding: 10px 4px; font-weight: 700; font-size: 15px;
  cursor: pointer; border-radius: 999px; transition: color 0.2s; color: var(--muted);
}
.switch input:checked + label { color: #fff; }
.switch input:focus-visible + label { outline: 3px solid var(--blue); outline-offset: 2px; }
.thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3);
  border-radius: 999px; background: var(--accent); transition: transform 0.25s cubic-bezier(.3,1.4,.5,1);
  transform: translateX(calc(var(--pos, 2) * 100%));
}
.weird-note { margin: 0; font-size: 13px; color: var(--muted); }

.draw {
  background: var(--panel); border: 2px solid var(--ink); border-radius: 18px; padding: 18px;
  display: grid; gap: 12px; box-shadow: 6px 6px 0 var(--blue);
}
.prompt-label { font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 0 -6px; letter-spacing: 0.05em; }
.prompt { background: var(--bg); border-radius: 10px; padding: 12px 14px; font-size: 13px; white-space: pre-wrap; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; overflow-wrap: anywhere; }
.how-to { margin: 0; font-size: 13px; color: var(--muted); }
.shot-tip { margin: 0; justify-self: start; font-size: 14px; font-weight: 900; background: linear-gradient(transparent 55%, var(--yellow) 55%); padding: 0 4px; }
.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.service {
  display: grid; gap: 0; text-decoration: none; color: var(--ink); background: var(--bg);
  border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px;
}
.service strong { font-size: 15px; }
.service span { font-size: 12px; color: var(--muted); font-weight: 400; }
.service.main { background: var(--blue); color: #fff; }
.service.main span { color: #fff; opacity: 0.85; }
.copy-only { justify-self: start; }

h2 { font-size: 15px; margin: 0 0 8px; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.history li {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  font-size: 14px; display: flex; justify-content: space-between; gap: 10px; align-items: center;
}
.history li button { background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 12px; padding: 2px 8px; flex: none; }
.history .empty { color: var(--muted); border-style: dashed; }

@media (max-width: 420px) {
  .actions { grid-template-columns: 1fr 1fr 1fr; }
  .actions .sub { font-size: 13px; padding: 0 8px; }
  .spin { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .reel.pop .word { animation: none; }
  .spin, .thumb, .switch label { transition: none; }
}
/* ---- サイト共通（トップと各ツール） ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.back { font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }
.site-name { font-family: var(--font-display); font-weight: 400; font-size: 14px; color: var(--muted); text-decoration: none; }
.hub-hero { display: grid; gap: 8px; padding-top: 8px; }
.hub-hero h1 { font-size: clamp(32px, 9vw, 52px); }
.hub-hero .lead { font-size: 16px; }
.tools { display: grid; gap: 16px; }
.tool-card {
  display: grid; gap: 8px; text-decoration: none; color: var(--ink);
  background: var(--panel); border: 2px solid var(--ink); border-radius: 18px; padding: 18px;
  box-shadow: 6px 6px 0 var(--ink); transition: transform 0.1s, box-shadow 0.1s;
}
.tool-card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.tool-card:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.tool-card h2 { font-family: var(--font-display); font-weight: 400; font-size: 24px; margin: 0; }
.tool-card h2 span { color: var(--accent); }
.tool-card p { margin: 0; font-size: 14px; color: var(--muted); }
.tool-card .sample { background: var(--reel); color: var(--reel-ink); border-radius: 10px; padding: 10px 12px; font-weight: 700; font-size: 15px; }
.tool-card .go { justify-self: end; font-weight: 700; font-size: 14px; color: var(--accent); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; color: var(--muted); margin-right: 4px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; cursor: pointer; justify-self: start; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { width: 52px; height: 30px; border-radius: 999px; background: var(--line); border: 2px solid var(--ink); position: relative; transition: background 0.2s; flex: none; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--panel); border: 2px solid var(--ink); transition: transform 0.2s; }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(22px); }
.toggle input:focus-visible + .track { outline: 3px solid var(--blue); outline-offset: 2px; }
.hub-h { margin: 0 0 14px; font-family: var(--font-display); font-weight: 400; font-size: 20px; letter-spacing: 0.04em; }
.hub-h span { background: linear-gradient(transparent 58%, var(--yellow) 58%); padding: 0 4px; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.flow li {
  border: 2px solid var(--ink); border-radius: 18px; padding: 16px 14px 14px; color: #1b1830;
  display: grid; gap: 6px; justify-items: center; text-align: center; position: relative;
  box-shadow: 4px 4px 0 var(--ink);
}
.flow li.c1 { background: var(--yellow); transform: rotate(-2deg); }
.flow li.c2 { background: var(--mint); transform: rotate(1.5deg); }
.flow li.c3 { background: var(--pink); transform: rotate(-1deg); }
.flow li.c4 { background: #a9c7ff; transform: rotate(2deg); }
.flow li:not(:last-child)::after {
  content: "▶"; position: absolute; right: -16px; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 18px; line-height: 1; z-index: 1;
}
.flow .ico { width: 44px; height: 44px; color: #1b1830; }
.flow strong { font-size: 16px; font-weight: 900; }
.flow li > span:last-child { font-size: 12px; line-height: 1.5; }
.flow-num {
  position: absolute; top: -12px; left: -10px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: var(--panel); border: 2px solid var(--panel);
  display: grid; place-items: center; font-family: var(--font-display); font-size: 14px;
}
.scenes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.scenes li {
  position: relative; background: var(--panel); border: 2px solid var(--ink); border-radius: 20px;
  padding: 14px; display: grid; gap: 6px; align-content: start;
}
.scenes li::after {
  content: ""; position: absolute; left: 26px; bottom: -11px; width: 18px; height: 18px;
  background: var(--panel); border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}
.scenes strong { font-size: 16px; font-weight: 900; line-height: 1.35; }
.scenes li.s1 strong { color: var(--accent); }
.scenes li.s2 strong { color: var(--blue); }
.scenes li.s3 strong { color: #c2368a; }
.scenes span { font-size: 12px; color: var(--muted); }
@media (max-width: 560px) {
  .flow, .scenes { grid-template-columns: 1fr; gap: 22px; }
  .flow li:not(:last-child)::after { content: "▼"; right: auto; left: 50%; top: auto; bottom: -21px; transform: translateX(-50%); }
  .scenes strong br { display: none; }
}
@media (prefers-reduced-motion: reduce) { .flow li { transform: none !important; } }
.letter {
  background: var(--panel); border: 2px solid var(--ink); border-radius: 18px; padding: 20px 20px 16px;
  box-shadow: 6px 6px 0 var(--yellow); display: grid; gap: 12px; max-width: 60ch;
  background-image: repeating-linear-gradient(transparent 0 31px, color-mix(in srgb, var(--line) 70%, transparent) 31px 32px);
}
.letter p { margin: 0; font-size: 15px; line-height: 1.9; }
.letter strong { background: linear-gradient(transparent 60%, color-mix(in srgb, var(--pink) 55%, transparent) 60%); }
.letter .punch { font-family: var(--font-display); font-size: clamp(22px, 6vw, 30px); color: var(--accent); line-height: 1.4; transform: rotate(-2deg); justify-self: start; padding-top: 4px; }
.letter .sign { justify-self: end; font-size: 13px; color: var(--muted); font-weight: 700; }
.owner-x { margin: -8px 0 0; font-size: 13px; color: var(--muted); }
.owner-x a { color: var(--ink); font-weight: 700; }
.x-follow {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff;
  background: #111; border: 2px solid var(--ink); border-radius: 16px; padding: 14px 18px;
  box-shadow: 4px 4px 0 var(--accent); transition: transform 0.1s, box-shadow 0.1s;
}
.x-follow:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--accent); }
.x-follow:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--accent); }
.x-mark { width: 40px; height: 40px; border-radius: 10px; background: #fff; color: #111; display: grid; place-items: center; font: 900 22px var(--font-body); flex: none; }
.x-follow strong { display: block; font-size: 17px; }
.x-follow small { display: block; font-size: 12px; opacity: 0.8; }
.x-mini { font-size: 12px; font-weight: 700; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.x-mini:hover { color: var(--ink); border-color: var(--ink); }
.footnote { font-size: 12px; color: var(--muted); margin: 0; }

/* ---- フッター（全ページ共通） ---- */
.site-foot { max-width: 640px; margin: 0 auto; padding: 0 16px 32px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--ink); text-decoration: underline; }
.site-foot .copy { color: var(--muted); width: 100%; }

/* ---- 文章ページ（プライバシーポリシー・このサイトについて） ---- */
.doc { display: block; }
.doc h1 { font-size: clamp(26px, 7vw, 34px); margin: 18px 0 20px; }
.doc h2 { font-size: 17px; margin: 30px 0 8px; padding-left: 10px; border-left: 5px solid var(--accent); }
.doc p, .doc li { font-size: 15px; line-height: 1.9; margin: 0 0 10px; }
.doc ul { padding-left: 1.3em; margin: 0 0 10px; }
.doc a { color: var(--blue); }
.doc-info { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 15px;
  background: var(--panel); border: 2px solid var(--ink); border-radius: 14px; padding: 14px 16px; }
.doc-info dt { font-weight: 700; color: var(--muted); }
.doc-info dd { margin: 0; overflow-wrap: anywhere; }
.doc-date { margin-top: 24px !important; font-size: 13px !important; color: var(--muted); text-align: right; }
@media (max-width: 420px) { .doc-info { grid-template-columns: 1fr; gap: 2px; } .doc-info dd { margin-bottom: 8px; } }
