/* ボケあい — 2026-10-13 デザイン刷新。外部フォント・外部 CSS は使わない（CSP style-src 'self'、プライバシーポリシー 1章） */

/* ---------- トークン ---------- */
:root {
  color-scheme: light;  /* 端末がダークモードでもライトのまま（2026-10-13 京右さんの指示） */
  --bg: #fff8ef;
  --bg-soft: #fff1e0;
  --surface: #ffffff;
  --surface-2: #fdf6ec;
  --fg: #221d17;
  --fg-soft: #4a4238;
  --muted: #7a6f62;
  --line: #efe3d1;
  --line-strong: #e2d1b8;
  --accent: #ff5a1f;
  --accent-2: #ff3d6e;
  --accent-ink: #b83d0b;     /* 文字リンク用。淡い背景（--accent-soft）の上でも 4.5:1 以上 */
  --accent-soft: #ffe7d6;
  --yellow: #ffd23f;
  --on-accent: #ffffff;
  --ok: #15803d;  --ok-soft: #e7f7ec;
  --err: #b91c1c; --err-soft: #fdecec;
  --warn-soft: #fff4dc; --warn-line: #f7d79a;
  /* 白文字を載せるので両端とも白とのコントラスト 4.5:1 以上（WCAG AA。2026-10-14） */
  --grad: linear-gradient(135deg, #d4400a 0%, #d62a57 100%);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(60, 35, 10, .06), 0 1px 1px rgba(60, 35, 10, .04);
  --shadow: 0 2px 4px rgba(60, 35, 10, .04), 0 10px 24px -8px rgba(60, 35, 10, .14);
  --shadow-lg: 0 4px 8px rgba(60, 35, 10, .05), 0 22px 44px -14px rgba(60, 35, 10, .26);
  --ring: 0 0 0 3px rgba(255, 90, 31, .28);
  --font: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --font-round: "Hiragino Maru Gothic ProN", "Zen Maru Gothic", "M PLUS Rounded 1c", var(--font);
  --max: 1080px;
}
/* ---------- ベース ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 16px; line-height: 1.7; color: var(--fg);
  background:
    radial-gradient(1200px 500px at 85% -120px, rgba(255, 90, 31, .10), transparent 70%),
    radial-gradient(900px 420px at -10% -80px, rgba(255, 210, 63, .14), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt" 1;
}
main { width: 100%; max-width: var(--max); margin: 0 auto; padding: 28px 20px 56px; flex: 1; }
img { max-width: 100%; }
a { color: var(--accent-ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 16px; border-radius: 999px;
  font-weight: 700; text-decoration: none; color: var(--on-accent); background: var(--accent-ink); transition: top .15s;
}
.skip-link:focus { top: 12px; }
main:focus { outline: none; box-shadow: none; }
::selection { background: var(--yellow); color: #221d17; }
h1, h2, h3 { line-height: 1.35; letter-spacing: .01em; font-feature-settings: "palt" 1; }
h1 { font-size: clamp(24px, 4vw, 32px); font-weight: 800; margin: 4px 0 20px; }
h2 { font-size: clamp(19px, 2.6vw, 22px); font-weight: 800; margin: 36px 0 14px; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 14px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.inline { display: inline; }
.muted { color: var(--muted); font-size: 14px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.site-header-inner {
  max-width: var(--max); margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  color: var(--fg); text-decoration: none; font-family: var(--font-round);
  font-weight: 800; font-size: 20px; letter-spacing: .04em;
}
.brand img { display: block; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.brand:hover img { transform: rotate(-10deg) scale(1.08); }
.site-nav {
  display: flex; align-items: center; gap: 4px; margin-left: auto;
  overflow-x: auto; scrollbar-width: none; white-space: nowrap;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a, .site-nav button.link {
  display: inline-block; padding: 7px 12px; border-radius: 999px;
  color: var(--fg-soft); text-decoration: none; font-size: 14.5px; font-weight: 600;
  transition: background .15s, color .15s;
}
.site-nav a:hover, .site-nav button.link:hover { background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }
.nav-cta { flex-shrink: 0; padding: 9px 18px; font-size: 14.5px; }
.langs { display: inline-flex; gap: 2px; margin-left: 6px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.site-nav .langs a { padding: 3px 9px; font-size: 12px; }
.langs a[aria-current] { background: var(--fg); color: var(--bg); }

@media (max-width: 720px) {
  .site-header-inner { flex-wrap: wrap; row-gap: 4px; padding: 10px 14px 6px; }
  .nav-cta { margin-left: auto; padding: 8px 16px; font-size: 14px; }
  .site-nav { order: 3; width: calc(100% + 14px); margin: 0 -14px 0 -6px; padding-right: 14px;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  main { padding: 20px 14px 48px; }
}

/* ---------- フッター ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); }
.site-footer-inner {
  max-width: var(--max); margin: 0 auto; padding: 28px 20px 36px;
  display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between;
}
.brand-small { font-size: 16px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13.5px; }
.site-footer nav a { color: var(--muted); text-decoration: none; }
.site-footer nav a:hover { color: var(--fg); text-decoration: underline; }

/* ---------- ボタン ---------- */
button, .btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 700; font-size: 15px; line-height: 1.2;
  padding: 12px 22px; border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  color: var(--on-accent); background: var(--grad);
  box-shadow: 0 8px 20px -8px rgba(255, 61, 110, .65), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
button:hover, .btn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 12px 24px -8px rgba(255, 61, 110, .7); text-decoration: none; }
button:active, .btn:active { transform: translateY(0) scale(.98); }
.btn-ghost {
  color: var(--fg); background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line-strong), var(--shadow-sm);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--accent), var(--shadow); color: var(--accent-ink); }
button.link {
  background: none; box-shadow: none; padding: 0; color: var(--accent-ink);
  font-weight: 600; text-decoration: underline; text-underline-offset: .18em;
}
button.link:hover { transform: none; filter: none; box-shadow: none; }
.site-nav button.link { text-decoration: none; }
button.danger {
  background: #d92d20; box-shadow: 0 8px 20px -10px rgba(217, 45, 32, .7);
}
button.danger:hover { box-shadow: 0 12px 24px -10px rgba(217, 45, 32, .8); }

/* ---------- ヒーロー（トップ） ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  margin: 4px 0 8px; padding: clamp(28px, 6vw, 56px) clamp(22px, 5vw, 56px);
  border-radius: 28px; background: var(--surface);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
}
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(8px);
}
.hero::before { width: 360px; height: 360px; right: -90px; top: -150px; background: radial-gradient(circle, rgba(255, 90, 31, .32), transparent 68%); }
.hero::after  { width: 300px; height: 300px; right: 140px; bottom: -190px; background: radial-gradient(circle, rgba(255, 210, 63, .40), transparent 68%); }
.hero-kicker {
  display: inline-block; margin: 0 0 14px; padding: 4px 12px; border-radius: 999px;
  font-family: var(--font-round); font-size: 13px; font-weight: 800; letter-spacing: .12em;
  color: var(--accent-ink); background: var(--accent-soft);
}
.hero h1 {
  margin: 0 0 14px; word-break: auto-phrase; text-wrap: balance;
  font-family: var(--font-round); font-size: clamp(28px, 5.4vw, 48px); line-height: 1.25; letter-spacing: .02em;
}
.hero-lead { max-width: 34em; word-break: auto-phrase; font-size: clamp(15px, 2vw, 17.5px); color: var(--fg-soft); margin-bottom: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.hero-actions .btn { padding: 14px 26px; font-size: 16px; }
.hero-has-feature { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(22px, 4vw, 44px); align-items: center; }
.hero-feature {
  position: relative; display: block; border-radius: 20px; overflow: hidden;
  border: 6px solid var(--surface); background: var(--surface); box-shadow: var(--shadow-lg);
  transform: rotate(2deg); transition: transform .2s ease;
}
.hero-feature:hover { transform: rotate(0) scale(1.02); }
.hero-feature img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; }
.hero-feature-tag {
  position: absolute; left: 12px; top: 12px; padding: 4px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 800; color: var(--on-accent); background: var(--grad);
}
@media (max-width: 760px) {
  .hero-has-feature { grid-template-columns: 1fr; }
  .hero-feature { max-width: 440px; transform: rotate(1.2deg); }
}
@media (prefers-reduced-motion: reduce) { .hero-feature { transition: none; } }

/* ---------- 遊び方（未ログインのトップ） ---------- */
.steps {
  list-style: none; margin: 0; padding: 0; counter-reset: step;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.steps li {
  counter-increment: step; position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 18px 18px 18px 64px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.steps li::before {
  content: counter(step); position: absolute; left: 18px; top: 18px;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-round); font-weight: 800; color: var(--on-accent); background: var(--grad);
}
.steps strong { font-family: var(--font-round); font-size: 17px; }
.steps span { font-size: 14px; color: var(--fg-soft); word-break: auto-phrase; }
@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; gap: 8px; }
  .steps li { padding: 12px 14px 12px 54px; gap: 0; }
  .steps li::before { left: 14px; top: 50%; translate: 0 -50%; width: 28px; height: 28px; font-size: 14px; }
  .steps strong { font-size: 15.5px; }
  .steps span { font-size: 13px; line-height: 1.55; }
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- セクション見出し ---------- */
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; position: relative; padding-left: 16px; }
.section-head h2::before {
  content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 6px; border-radius: 6px; background: var(--grad);
}
.more { flex-shrink: 0; font-size: 14px; font-weight: 700; text-decoration: none; }
.more::after { content: " →"; transition: margin .15s; }
.more:hover::after { margin-left: 3px; }

/* ---------- お題ページの前後のお題 ---------- */
.topic-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; }
.topic-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  font-weight: 700; color: var(--fg); text-decoration: none; transition: box-shadow .2s, transform .2s;
}
.topic-nav a:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: var(--accent-ink); }
.topic-nav img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.topic-nav .topic-nav-older { grid-column: 2; flex-direction: row-reverse; text-align: right; }
@media (max-width: 520px) { .topic-nav img { width: 48px; height: 48px; } .topic-nav a { font-size: 14px; gap: 8px; } }

/* ---------- お題カード ---------- */
.topic-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px;
}
@media (max-width: 520px) { .topic-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.topic-grid li a {
  position: relative; display: block; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: 1 / 1; background: var(--surface-2);
  box-shadow: var(--shadow); border: 1px solid var(--line);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s;
}
.topic-grid li a:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow-lg); }
.topic-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.topic-grid li a:hover img { transform: scale(1.05); }
.topic-grid li a::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 45%;
  background: linear-gradient(transparent, rgba(0, 0, 0, .38)); pointer-events: none;
}
.topic-grid .badge { position: absolute; left: 10px; bottom: 10px; z-index: 1; }
.topic-grid .badge-count { left: auto; right: 10px; color: var(--on-accent); background: var(--grad); }
.topic-grid .badge-status { background: var(--accent-soft); color: var(--accent-ink); }
/* 代表のボケを画像の下側に重ねる。そのときバッジは上へ */
.topic-caption {
  position: absolute; inset: auto 0 0 0; z-index: 1; padding: 34px 12px 11px;
  font-weight: 700; font-size: 14.5px; line-height: 1.45; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
  background: linear-gradient(transparent, rgba(0, 0, 0, .62));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.topic-caption.quoted::before { content: "「"; } .topic-caption.quoted::after { content: "」"; }
.topic-grid a.has-caption::after { display: none; }
.topic-grid a.has-caption .badge { top: 10px; bottom: auto; }
@media (max-width: 520px) { .topic-caption { font-size: 12.5px; padding: 26px 9px 8px; } }
.topic-placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-round); font-weight: 800; color: var(--muted);
  background: repeating-linear-gradient(45deg, var(--surface-2) 0 12px, var(--bg-soft) 12px 24px);
}
/* 入力欄の残り文字数（app.js） */
.char-count { display: block; margin-top: 4px; text-align: right; font-size: 13px; font-weight: 400; color: var(--muted); }
.char-count.is-near { color: var(--accent-ink); font-weight: 700; }
/* 投稿前の画像プレビュー（app.js） */
.upload-preview { display: block; max-width: 100%; max-height: 320px; margin-top: 12px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.upload-preview[hidden] { display: none; }
.topic-grid li.empty, .boke-list li.empty {
  grid-column: 1 / -1; padding: 40px 20px; text-align: center; color: var(--muted);
  background: var(--surface); border: 2px dashed var(--line-strong); border-radius: var(--radius);
}

.badge {
  display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.4;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, .9); color: #2b241c;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

/* ---------- お題詳細 ---------- */
.topic { margin: 0 0 8px; }
.topic img {
  display: block; width: auto; max-width: 100%; height: auto; max-height: min(72vh, 760px);
  margin: 0 auto; border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.topic > a { display: block; }
.topic > p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 16px 0 0; justify-content: center; }
.topic > p .badge { background: var(--accent-soft); color: var(--accent-ink); box-shadow: none; }
.topic > .notice { justify-content: flex-start; }
.topic > p .share { font-size: 14px; font-weight: 700; color: var(--accent-ink); }
.topic > p .share::before { content: "↗ "; }

.boke-post {
  margin: 28px auto 0; max-width: 720px; padding: 22px 24px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
}
.boke-post h2 { margin: 0 0 12px; }
/* ログインしていない人向け: 空の大きな枠にせず、一言とボタンを横に並べる */
.boke-post-guest { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.boke-post-guest h2 { margin: 0 0 4px; }
.boke-post-guest p { margin: 0; }
.boke-post .stack { max-width: none; padding: 0; background: none; border: 0; box-shadow: none; }
.boke-post textarea { font-size: 19px; font-weight: 600; min-height: 3.6em; }

/* ---------- ボケ一覧 ---------- */
.boke-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.boke {
  position: relative; display: flex; gap: 16px; align-items: stretch;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.boke:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.boke:target { border-color: var(--accent); box-shadow: var(--ring), var(--shadow); }
.boke-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.boke-thumb {
  flex-shrink: 0; width: 104px; aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--radius-sm);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
}
.boke-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.boke-thumb:hover img { transform: scale(1.06); }
.boke-topic { font-size: 12.5px; font-weight: 700; color: var(--muted); text-decoration: none; }
.boke-topic:hover { color: var(--accent-ink); }
.boke-body {
  margin: 2px 0 10px; font-size: clamp(18px, 2.4vw, 21px); font-weight: 700; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere; letter-spacing: .01em;
}
.boke-body a { color: var(--fg); text-decoration: none; }
.boke-body a:hover { color: var(--accent-ink); }
.boke-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: auto; font-size: 14px; }
.boke-meta .votes {
  display: inline-flex; align-items: center; gap: 5px; font-weight: 800; color: var(--fg-soft);
  font-variant-numeric: tabular-nums;
}
.boke-meta .votes::before { content: ""; width: 14px; height: 14px; background: var(--grad);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.3C.9 8.3 3 4.5 6.7 4.5c2.1 0 3.6 1.2 5.3 3.1 1.7-1.9 3.2-3.1 5.3-3.1 3.7 0 5.8 3.8 4.3 7.2C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.3C.9 8.3 3 4.5 6.7 4.5c2.1 0 3.6 1.2 5.3 3.1 1.7-1.9 3.2-3.1 5.3-3.1 3.7 0 5.8 3.8 4.3 7.2C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat; }
.boke-meta .muted { font-size: 13px; }
.vote-note { flex-basis: 100%; order: 1; font-size: 12.5px; line-height: 1.5; color: var(--accent-ink); }
.boke-meta a.muted { text-decoration: none; }
.boke-meta a.muted:hover { color: var(--err); text-decoration: underline; }
button.vote, a.vote {
  padding: 7px 16px; font-size: 14px; color: var(--accent-ink); background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 35%, transparent);
}
button.vote:hover, a.vote:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
button.vote.voted { color: var(--on-accent); background: var(--grad); box-shadow: 0 6px 14px -6px rgba(255, 61, 110, .7); }
@media (max-width: 520px) {
  .boke { padding: 12px; gap: 12px; }
  .boke-thumb { width: 76px; }
}

/* 順位 */
.rank {
  align-self: flex-start; display: inline-flex; align-items: center; margin-bottom: 6px;
  padding: 2px 11px; border-radius: 999px; font-size: 13px; font-weight: 800;
  color: var(--fg-soft); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
  font-variant-numeric: tabular-nums;
}
.rank-1 { color: #5a3b00; background: linear-gradient(135deg, #ffe58a, #ffc21a); box-shadow: 0 4px 12px -4px rgba(255, 180, 0, .7); }
.rank-2 { color: #33383f; background: linear-gradient(135deg, #f1f3f6, #c5ccd6); box-shadow: 0 4px 12px -4px rgba(120, 130, 150, .6); }
.rank-3 { color: #4a2610; background: linear-gradient(135deg, #f7cfa6, #d98b4f); box-shadow: 0 4px 12px -4px rgba(200, 110, 50, .6); }
.boke:has(.rank-1) { border-color: #ffd36b; }

/* ---------- タブ・ページ送り ---------- */
.tabs {
  display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 16px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
}
.tabs a {
  padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 700;
  color: var(--muted); text-decoration: none; transition: background .15s, color .15s;
}
.tabs a:hover { color: var(--fg); }
.tabs a[aria-current] { color: var(--fg); background: var(--surface); box-shadow: var(--shadow-sm); }
@media (max-width: 520px) {
  /* 狭い画面では折り返さず横にスクロール（ランキングの5つのタブが2行になるため） */
  .tabs { display: flex; flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex-shrink: 0; padding: 7px 13px; white-space: nowrap; }
}
.pager { display: flex; justify-content: center; gap: 10px; margin: 28px 0 0; }
.pager:empty { display: none; }
.pager a {
  padding: 9px 20px; border-radius: 999px; font-weight: 700; font-size: 14px; text-decoration: none;
  color: var(--fg); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.pager a:hover { color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--accent); }

/* ---------- フォーム ---------- */
.settings-links {
  list-style: none; max-width: 600px; margin: 18px 0 0; padding: 6px 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-sm);
}
.settings-links li + li { border-top: 1px solid var(--line); }
.settings-links a { display: block; padding: 12px 24px; font-weight: 700; text-decoration: none; color: var(--fg); }
.settings-links a::after { content: "›"; float: right; color: var(--muted); }
.settings-links a:hover { background: var(--surface-2); }
.settings-links a.danger-link { color: var(--err); }
.settings-logout { margin-top: 18px; }
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--fg-soft); background: var(--surface-2); border: 1px solid var(--line); }
.status-pill.status-published { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.status-pill.status-pending, .status-pill.status-review, .status-pill.status-quarantined { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.stack {
  display: flex; flex-direction: column; gap: 16px; max-width: 600px;
  padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
}
.stack > button { align-self: flex-start; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14.5px; }
.stack label.choice, .stack > label:has(> input[type=checkbox]) {
  flex-direction: row; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 15px; line-height: 1.6;
}
.stack .muted { margin: 0; }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=search], select, textarea {
  font: inherit; font-size: 16px; font-weight: 500; color: var(--fg); width: 100%;
  padding: 11px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
textarea { resize: vertical; line-height: 1.6; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%237a6f62'%3E%3Cpath d='M5.2 7.6a1 1 0 0 1 1.4 0L10 11l3.4-3.4a1 1 0 1 1 1.4 1.4l-4.1 4.1a1 1 0 0 1-1.4 0L5.2 9a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
input[type=checkbox], input[type=radio] { width: 19px; height: 19px; margin: 3px 0 0; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }
input[type=file] {
  font: inherit; font-size: 14px; font-weight: 500; color: var(--muted); width: 100%;
  padding: 18px; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); cursor: pointer;
  transition: border-color .15s, background .15s;
}
input[type=file]:hover { border-color: var(--accent); background: var(--accent-soft); }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 700; margin-right: 14px; padding: 9px 18px; border: 0; border-radius: 999px;
  color: var(--on-accent); background: var(--grad); cursor: pointer;
}
fieldset {
  margin: 0; padding: 14px 16px 16px; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
legend { padding: 0 8px; margin-left: -4px; font-weight: 800; font-size: 14.5px; }
.topic-form:not(:has(input[value=ai_generated]:checked)) .consents-ai_generated,
.topic-form:not(:has(input[value=own_photo]:checked)) .consents-own_photo { display: none; }

/* ---------- メッセージ ---------- */
.notice, .ok-msg, .error-msg {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 15px; line-height: 1.65;
}
.notice { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--fg); }
.ok-msg { background: var(--ok-soft); color: var(--ok); font-weight: 700; border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.error-msg { background: var(--err-soft); color: var(--err); font-weight: 700; border: 1px solid color-mix(in srgb, var(--err) 30%, transparent); }

/* ---------- 法務ページ・エラー ---------- */
.legal {
  max-width: 780px; margin: 0 auto; padding: clamp(22px, 4vw, 44px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
  line-height: 1.85;
}
.legal h1 { margin-top: 0; }
.legal h2 { font-size: 18px; margin: 32px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.legal ol, .legal ul { padding-left: 1.4em; }
.legal li { margin: 4px 0; }
.legal .admin-table { display: block; overflow-x: auto; }
.legal h2[id], .legal #recipients { scroll-margin-top: 84px; }
.legal-toc { margin: 18px 0 8px; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.legal-toc > p { margin: 0 0 6px; font-weight: 800; font-size: 14px; color: var(--fg-soft); }
.legal-toc ol { margin: 0; padding-left: 0; list-style: none; columns: 2 16em; column-gap: 28px; font-size: 14.5px; }
.legal-toc li { margin: 3px 0; break-inside: avoid; }
.legal-toc a { text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.legal .recipients td { overflow-wrap: break-word; }
@media (max-width: 640px) {
  /* 送信先一覧: 狭い画面では表をやめ、送信先ごとのカードにする（6列が1文字ずつ折り返すため） */
  .legal .recipients, .legal .recipients tbody, .legal .recipients tr, .legal .recipients td { display: block; width: auto; }
  .legal .recipients { border: 0; background: none; box-shadow: none; overflow: visible; }
  .legal .recipients thead { display: none; }
  .legal .recipients tr { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
  .legal .recipients td { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; padding: 6px 0; border: 0; border-top: 1px dashed var(--line); font-size: 14px; overflow-wrap: anywhere; }
  .legal .recipients td:first-child { border-top: 0; }
  .legal .recipients td::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--muted); }
  .legal .recipients td[colspan] { display: block; }
  .legal .recipients td[colspan]::before { content: none; }
}
.error { text-align: center; padding: 56px 20px; }
.error h1 { font-family: var(--font-round); font-size: clamp(26px, 5vw, 38px); }
.error h1::before {
  content: ""; display: block; width: 88px; height: 88px; margin: 0 auto 18px;
  background: url("/static/logo.svg") center / contain no-repeat; filter: grayscale(.35);
  transform: rotate(-8deg);
}
.error a { font-weight: 700; }

/* ---------- 表（自分のボケ・管理画面） ---------- */
.admin-table {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
}
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.admin-table th { background: var(--surface-2); font-size: 12.5px; font-weight: 800; color: var(--muted); letter-spacing: .03em; }
.admin-table tr:last-child td { border-bottom: 0; }
@media (max-width: 720px) {
  /* 管理画面の表: 狭い画面では1文字ずつ折り返さず、横にスクロールさせる */
  .admin-table:not(.recipients) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-table:not(.recipients) th, .admin-table:not(.recipients) td { min-width: 6.5em; overflow-wrap: break-word; }
}
.admin-table tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 20px; }
.admin-nav a {
  padding: 6px 12px; border-radius: 999px; font-size: 13.5px; font-weight: 700; text-decoration: none;
  color: var(--fg-soft); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.admin-nav a:hover { color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent); }
.admin-thumb { max-width: 120px; height: auto; border-radius: 8px; }
.admin-topic img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.admin-dl dt { font-weight: 800; font-size: 13.5px; color: var(--muted); }
.admin-dl dd { margin: 0 0 10px; }
.admin-form { background: var(--surface); border: 1px solid var(--line); padding: 16px; border-radius: var(--radius-sm); margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.inline-check { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; }

/* ---------- 動きを減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
/* 運営者情報などの定義リスト: 項目名を太字にし、内容は字下げせず下に並べる */
.legal dl { margin: 12px 0 0; }
.legal dt { font-weight: 800; margin-top: 14px; }
.legal dt:first-child { margin-top: 0; }
.legal dd { margin: 2px 0 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.legal dd:last-child { border-bottom: 0; padding-bottom: 0; }
.boke-more { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; margin-top: 16px; }
.back-link { margin-top: 18px; }
a.vote { text-decoration: none; }

/* ---------- ボケ単体のページ: 画像とボケを1枚のカードに ---------- */
.boke-feature { max-width: 760px; margin: 0 auto; }
.boke-feature .topic { margin: 0; padding: 12px 12px 0; background: var(--surface); border: 1px solid var(--line);
  border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
.boke-feature .topic img { max-height: min(62vh, 640px); box-shadow: none; border-radius: calc(var(--radius) - 6px); }
.boke-feature .boke-list .boke { border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 18px 22px 20px;
  box-shadow: var(--shadow); flex-direction: column; align-items: center; text-align: center; }
.boke-feature .boke-list .boke:hover { transform: none; }
.boke-feature .boke-body { font-size: clamp(22px, 3.6vw, 30px); line-height: 1.45; margin: 4px 0 14px; }
.boke-feature .boke-meta { justify-content: center; }
.boke-feature .boke-main { width: 100%; }
#posted, .boke-list > li[id], #my-bokes { scroll-margin-top: 110px; }
.empty { word-break: auto-phrase; }
@media (max-width: 520px) { .hero-actions .btn { padding: 12px 18px; font-size: 15px; } }
