/* コスプレのリクエスト掲示板（board.js）— /cosplay/ と店内メニューで共用。スマホで指で触る前提。 */
.kb-board, .kb-sheet {
  --kb-bg: #0b0610; --kb-card: #1c1023; --kb-ink: #fff6fb; --kb-dim: #cdb6c8; --kb-mute: #8f7a8b;
  --kb-pink: #ff3ea5; --kb-pink-2: #ff9bd2; --kb-violet: #9b5cff; --kb-gold: #ffd98a; --kb-blue: #6fb6ff;
  --kb-line: rgba(255, 246, 251, .12);
  --kb-soft: rgba(255, 246, 251, .08); --kb-field: rgba(5, 2, 8, .6); --kb-sheet-bg: #160c1c; --kb-seg-on: #fff6fb; --kb-seg-on-ink: #0b0610; --kb-shadow: none;
  --kb-en: 'Syne', 'Outfit', 'Zen Kaku Gothic New', sans-serif;
  --kb-pop: 'Dela Gothic One', 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif;
  --kb-ease: cubic-bezier(.16, 1, .3, 1); --kb-spring: cubic-bezier(.34, 1.56, .64, 1);
  color: var(--kb-ink); line-height: 1.8;
}
/* 下地のリセットは :where() で弱くして、下の個別の指定が必ず勝つようにする */
:where(.kb-board, .kb-sheet) *, :where(.kb-board, .kb-sheet) *::before, :where(.kb-board, .kb-sheet) *::after { box-sizing: border-box; margin: 0; padding: 0; }
:where(.kb-board) :where(ol, ul) { list-style: none; }
:where(.kb-board, .kb-sheet) :where(button, textarea) { font: inherit; color: inherit; }
:where(.kb-board, .kb-sheet) button { cursor: pointer; background: none; border: 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.kb-lock, .kb-lock body { overflow: hidden; }

/* ---------- 男性・女性・カップル、どこからの希望か ---------- */
.kb-bar { display: flex; height: 12px; overflow: hidden; border-radius: 999px; background: var(--kb-card); }
.kb-bar i { flex: var(--v) 1 0; min-width: 0; transition: flex-grow 1.2s var(--kb-spring); }
.kb-bar i + i { box-shadow: -2px 0 0 var(--kb-bg); }
.b-female { background: linear-gradient(90deg, var(--kb-pink), var(--kb-pink-2)); }
.b-male { background: linear-gradient(90deg, #3d7cff, var(--kb-blue)); }
.kb-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 10px; }
.kb-legend li { display: grid; justify-items: center; padding: 8px 4px 6px; border-radius: 14px; background: var(--kb-card); border: 1px solid var(--kb-line); box-shadow: var(--kb-shadow); }
.kb-legend span { font-size: .72rem; font-weight: 900; }
.kb-legend b { font-family: var(--kb-en); font-weight: 800; font-size: 1.6rem; line-height: 1.1; }
.kb-legend .is-female span, .kb-legend .is-female b { color: var(--kb-pink-2); }
.kb-legend .is-male span, .kb-legend .is-male b { color: var(--kb-blue); }

/* ---------- 書くボタン ---------- */
.kb-compose { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 12px; width: 100%; margin-top: 16px; padding: 14px 18px; overflow: hidden; border-radius: 20px; background: linear-gradient(110deg, var(--kb-pink), var(--kb-violet)); color: #fff; text-align: left; font-weight: 900; font-size: 1.02rem; line-height: 1.4; box-shadow: 0 12px 30px rgba(255, 62, 165, .4); transition: transform .3s var(--kb-spring); }
.kb-compose::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); transform: translateX(-100%); animation: kbShine 3.2s ease-in-out infinite; }
@keyframes kbShine { 60%, 100% { transform: translateX(100%); } }
.kb-compose:active { transform: scale(.96); }
.kb-plus { grid-row: 1 / span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .22); font-size: 1.5rem; }
.kb-compose small { font-size: .72rem; font-weight: 700; opacity: .85; }

/* ---------- 並び順・絞り込み ---------- */
.kb-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 22px; scroll-margin-top: 72px; }
.kb-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--kb-card); border: 1px solid var(--kb-line); box-shadow: var(--kb-shadow); }
.kb-seg button { min-height: 40px; min-width: 40px; padding: 0 12px; white-space: nowrap; border-radius: 999px; font-size: .82rem; font-weight: 900; color: var(--kb-dim); transition: background .3s ease, color .3s ease; }
.kb-seg button[aria-checked="true"] { background: var(--kb-seg-on); color: var(--kb-seg-on-ink); }
.kb-seg.is-small button { padding: 0 10px; font-size: .9rem; }

/* ---------- 一覧 ---------- */
.kb-list { display: grid; gap: 10px; margin-top: 12px; }
.kb-empty { padding: 30px 10px; text-align: center; color: var(--kb-dim); font-size: .88rem; }
.kb-req { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 14px 8px 12px 16px; border-radius: 18px; background: var(--kb-card); border: 1px solid var(--kb-line); box-shadow: var(--kb-shadow); user-select: none; -webkit-user-select: none; animation: kbReqIn .6s var(--kb-spring) both; animation-delay: var(--d, 0s); }
.kb-req::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.kb-req.is-male { --c: var(--kb-blue); } .kb-req.is-female { --c: var(--kb-pink); }
.kb-req.is-mine { box-shadow: 0 0 0 2px var(--kb-gold), 0 0 30px rgba(255, 217, 138, .3); }
@keyframes kbReqIn { from { opacity: 0; transform: translateY(20px) scale(.94); } }
.kb-req-who { justify-self: start; padding: 0 9px; border-radius: 999px; background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--c); font-size: .68rem; font-weight: 900; }
.kb-req.is-female .kb-req-who { color: var(--kb-pink-2); }
.kb-req-text { grid-column: 1; margin-top: 2px; font-weight: 700; font-size: 1rem; line-height: 1.55; word-break: break-word; }
.kb-link { grid-column: 1; justify-self: start; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 40px; margin: 4px 0 2px; padding: 0 14px; border-radius: 999px; background: var(--kb-soft); border: 1.5px solid var(--kb-line); color: var(--kb-ink); font-size: .8rem; text-decoration: none; transition: transform .25s var(--kb-spring), background .3s ease; }
.kb-link b { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.kb-link i { font-style: normal; color: var(--kb-pink-2); }
.kb-link:active { transform: scale(.95); }
.kb-req-time { grid-column: 1; font-size: .68rem; color: var(--kb-mute); }
.kb-req-rank { position: absolute; right: 12px; top: -9px; padding: 0 8px; border-radius: 999px; background: var(--kb-gold); color: var(--kb-bg); font-family: var(--kb-en); font-weight: 800; font-size: .66rem; }
.kb-like { grid-column: 2; grid-row: 1 / span 3; display: grid; justify-items: center; align-content: center; min-width: 56px; min-height: 56px; border-radius: 16px; transition: transform .3s var(--kb-spring), background .3s ease; }
.kb-like:active { transform: scale(.88); background: rgba(255, 62, 165, .12); }
.kb-like svg { width: 28px; height: 28px; fill: none; stroke: var(--kb-pink-2); stroke-width: 2; transition: fill .3s ease; }
.kb-like b { font-family: var(--kb-en); font-weight: 800; font-size: .9rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.kb-like.is-on svg { fill: var(--kb-pink); stroke: var(--kb-pink); }
.kb-like.is-pop svg { animation: kbHeartPop .6s var(--kb-spring); }
@keyframes kbHeartPop { 0% { transform: scale(1); } 30% { transform: scale(.6); } 60% { transform: scale(1.45); } 100% { transform: scale(1); } }
.kb-more { display: block; width: 100%; min-height: 50px; margin-top: 12px; border-radius: 999px; border: 1.5px solid var(--kb-line); background: var(--kb-card); color: var(--kb-ink); font-weight: 900; font-size: .9rem; }
.kb-more[hidden] { display: none; }
.kb-local { margin: 12px 0 0; padding: 8px 12px; border: 1px dashed #ffd98a; border-radius: 10px; color: #ffd98a; font-size: 12px; line-height: 1.6; }

/* ハートが弾ける */
.kb-burst { position: fixed; z-index: 200; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; pointer-events: none; animation: kbBurst .8s cubic-bezier(.16, 1, .3, 1) forwards; }
@keyframes kbBurst { to { transform: translate(var(--bx), var(--by)) scale(0); opacity: 0; } }
.kb-fly { position: fixed; z-index: 200; font-size: 22px; pointer-events: none; animation: kbFly 1.2s cubic-bezier(.16, 1, .3, 1) forwards; }
@keyframes kbFly { to { transform: translate(var(--fx), -120px) rotate(var(--fr)) scale(1.4); opacity: 0; } }

/* ---------- 書く画面（下からせり上がるシート） ---------- */
.kb-sheet { position: fixed; inset: auto 0 0; width: 100%; max-width: none; max-height: 92svh; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; border: 0; border-radius: 26px 26px 0 0; background: var(--kb-sheet-bg); color: var(--kb-ink); box-shadow: 0 -20px 60px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .1); transform: translateY(var(--drag, 0px)); font-family: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif; }
.kb-sheet[open] { animation: kbUp .45s var(--kb-ease); }
.kb-sheet.is-closing { animation: kbDown .26s ease-in forwards; }
@keyframes kbUp { from { transform: translateY(100%); } }
@keyframes kbDown { to { transform: translateY(100%); } }
.kb-sheet::backdrop { background: var(--kb-backdrop, rgba(5, 2, 8, .7)); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.kb-form { position: relative; padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); }
.kb-form.is-shake { animation: kbShake .45s ease; }
@keyframes kbShake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.kb-grip { width: 100%; height: 28px; touch-action: none; cursor: grab; }
.kb-grip::before { content: ''; display: block; width: 44px; height: 5px; margin: 8px auto 0; border-radius: 999px; background: var(--kb-line); }
.kb-close { position: absolute; right: 12px; top: 10px; width: 44px; height: 44px; border-radius: 50%; background: var(--kb-soft); color: var(--kb-ink); font-size: 1.4rem; line-height: 1; }
.kb-sheet-title { padding-right: 44px; font-family: var(--kb-pop); font-weight: 900; font-size: 1.3rem; line-height: 1.45; }
.kb-sheet:focus { outline: none; }
.kb-label { margin-top: 16px; font-size: .82rem; font-weight: 900; color: var(--kb-dim); }
.kb-who { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 6px; }
.kb-who button { display: grid; justify-items: center; padding: 12px 4px 10px; border-radius: 18px; border: 1.5px solid var(--kb-line); background: var(--kb-card); font-weight: 900; font-size: .92rem; line-height: 1.35; transition: transform .35s var(--kb-spring), border-color .3s ease, background .3s ease; }
.kb-who button i { font-style: normal; font-size: 1.6rem; line-height: 1.1; }
.kb-who button small { font-size: .66rem; font-weight: 700; color: var(--kb-mute); }
.kb-who button[data-g="female"][aria-checked="true"] { border-color: var(--kb-pink); background: rgba(255, 62, 165, .2); }
.kb-who button[data-g="male"][aria-checked="true"] { border-color: var(--kb-blue); background: rgba(111, 182, 255, .18); }
.kb-who button[aria-checked="true"] { transform: scale(1.05); }
.kb-who button[aria-checked="true"] small { color: var(--kb-ink); }
.kb-text { display: grid; gap: 6px; margin-top: 16px; font-size: .82rem; font-weight: 900; color: var(--kb-dim); }
.kb-text textarea { width: 100%; padding: 12px 14px; border-radius: 16px; border: 1.5px solid var(--kb-line); background: var(--kb-field); color: var(--kb-ink); font-size: 16px; font-weight: 700; line-height: 1.6; resize: none; transition: border-color .3s ease, box-shadow .3s ease; }
.kb-text textarea:focus { outline: none; border-color: var(--kb-pink); box-shadow: 0 0 0 4px rgba(255, 62, 165, .18); }
.kb-count { justify-self: end; font-size: .72rem; font-weight: 400; color: var(--kb-mute); }
.kb-url { display: grid; gap: 6px; margin-top: 10px; font-size: .82rem; font-weight: 900; color: var(--kb-dim); }
.kb-url small { margin-left: 4px; font-size: .7rem; font-weight: 700; color: var(--kb-mute); }
.kb-url input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 16px; border: 1.5px solid var(--kb-line); background: var(--kb-field); color: var(--kb-ink); font-size: 16px; font-weight: 500; transition: border-color .3s ease, box-shadow .3s ease; }
.kb-url input::placeholder { font-size: 12px; color: var(--kb-mute); }
.kb-url input:focus { outline: none; border-color: var(--kb-pink); box-shadow: 0 0 0 4px rgba(255, 62, 165, .18); }
.kb-url input.is-filled { animation: kbFilled .8s ease; }
@keyframes kbFilled { 30% { border-color: var(--kb-pink); box-shadow: 0 0 0 6px rgba(255, 62, 165, .25); } }
.kb-chips { display: flex; gap: 6px; margin: 4px -18px 0; padding: 2px 18px 6px; overflow-x: auto; scrollbar-width: none; }
.kb-chips::-webkit-scrollbar { display: none; }
.kb-chips button { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--kb-soft); color: var(--kb-ink); font-size: .82rem; font-weight: 700; transition: transform .3s var(--kb-spring), background .3s ease; }
.kb-chips button:active { transform: scale(.92); background: rgba(255, 62, 165, .3); }
.kb-submit { width: 100%; min-height: 56px; margin-top: 14px; border-radius: 999px; background: linear-gradient(110deg, var(--kb-pink), var(--kb-violet)); color: #fff; font-weight: 900; font-size: 1rem; box-shadow: 0 10px 30px rgba(255, 62, 165, .35); transition: transform .35s var(--kb-spring), opacity .3s ease; }
.kb-submit:active { transform: scale(.96); }
.kb-submit:disabled { opacity: .6; }
.kb-note { margin-top: 10px; font-size: .7rem; color: var(--kb-mute); line-height: 1.7; }

/* ---------- 返信（カードの下：最新の返信の吹き出しと、返信ボタン） ---------- */
.kb-prev { grid-column: 1; justify-self: start; position: relative; display: flex; align-items: center; gap: 6px; max-width: 100%; margin: 8px 0 0 6px; padding: 6px 12px; border-radius: 4px 16px 16px 16px; background: var(--kb-soft); border: 1px solid var(--kb-line); font-size: .8rem; font-weight: 700; line-height: 1.4; text-align: left; }
.kb-prev::before { content: ''; position: absolute; left: -1px; top: -7px; border: 7px solid transparent; border-bottom: 0; border-left-color: var(--kb-line); transform: rotate(180deg) scaleX(-1); }
.kb-prev i { flex: none; font-style: normal; font-weight: 900; color: var(--kb-blue); }
.kb-prev.is-female i { color: var(--kb-pink-2); }
.kb-prev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-reply { grid-column: 1; justify-self: start; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; margin-top: 4px; padding: 0 12px 0 8px; border-radius: 999px; color: var(--kb-pink-2); font-size: .78rem; font-weight: 900; transition: transform .3s var(--kb-spring), background .3s ease; }
.kb-reply b { font-family: var(--kb-en); font-weight: 800; font-size: .95rem; }
.kb-reply:active { transform: scale(.94); background: var(--kb-soft); }

/* ---------- 返信のシート（コメント欄） ---------- */
.kb-thread { display: none; }
.kb-thread[open] { display: block; }
.kb-th { position: relative; display: flex; flex-direction: column; min-height: 50svh; }
.kb-th-title { padding: 0 60px 0 18px; font-family: var(--kb-pop); font-weight: 900; font-size: 1.1rem; }
.kb-th-title b { font-family: var(--kb-en); color: var(--kb-pink-2); }
.kb-th-post { position: relative; display: grid; gap: 2px; margin: 10px 18px 0; padding: 12px 14px 12px 16px; border-radius: 16px; background: var(--kb-card); border: 1px solid var(--kb-line); }
.kb-th-post::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.kb-th-post.is-male { --c: var(--kb-blue); } .kb-th-post.is-female { --c: var(--kb-pink); }
.kb-th-post .kb-req-text { font-size: .95rem; }
.kb-th-list { flex: 1; display: grid; align-content: start; gap: 10px; padding: 16px 18px 12px; list-style: none; }
.kb-th-empty { padding: 26px 0; text-align: center; font-size: .86rem; font-weight: 700; line-height: 1.8; color: var(--kb-mute); }
.kb-rp { justify-self: start; display: grid; gap: 1px; max-width: 86%; padding: 8px 14px 6px; border-radius: 4px 18px 18px 18px; background: var(--kb-card); border: 1px solid var(--kb-line); animation: kbReqIn .5s var(--kb-spring) both; }
.kb-rp:not(.is-new) { animation: none; }
.kb-rp.is-mine { justify-self: end; border-radius: 18px 4px 18px 18px; background: color-mix(in srgb, var(--kb-pink) 14%, var(--kb-card)); border-color: color-mix(in srgb, var(--kb-pink) 35%, transparent); }
.kb-rp-who { font-size: .66rem; font-weight: 900; color: var(--kb-blue); }
.kb-rp.is-female .kb-rp-who { color: var(--kb-pink-2); }
.kb-rp p { font-weight: 700; font-size: .92rem; line-height: 1.55; word-break: break-word; }
.kb-rp-time { justify-self: end; font-size: .62rem; color: var(--kb-mute); }
.kb-th-form { position: sticky; bottom: 0; z-index: 2; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); background: var(--kb-sheet-bg); border-top: 1px solid var(--kb-line); }
.kb-th-form.is-shake { animation: kbShake .45s ease; }
.kb-th-who { display: flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 900; color: var(--kb-dim); }
.kb-th-who button { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--kb-line); background: var(--kb-card); font-size: .78rem; font-weight: 900; }
.kb-th-who button[data-rg="female"][aria-checked="true"] { border-color: var(--kb-pink); background: rgba(255, 62, 165, .2); }
.kb-th-who button[data-rg="male"][aria-checked="true"] { border-color: var(--kb-blue); background: rgba(111, 182, 255, .18); }
.kb-th-row { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; }
.kb-th-row textarea { flex: 1; min-height: 46px; max-height: 120px; padding: 11px 14px; border-radius: 22px; border: 1.5px solid var(--kb-line); background: var(--kb-field); color: var(--kb-ink); font: inherit; font-size: 16px; font-weight: 700; line-height: 1.5; resize: none; }
.kb-th-row textarea:focus { outline: none; border-color: var(--kb-pink); box-shadow: 0 0 0 4px rgba(255, 62, 165, .18); }
.kb-th-send { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(110deg, var(--kb-pink), var(--kb-violet)); box-shadow: 0 8px 20px rgba(255, 62, 165, .35); transition: transform .3s var(--kb-spring), opacity .3s ease; }
.kb-th-send svg { width: 22px; height: 22px; fill: #fff; margin-left: 2px; }
.kb-th-send:active { transform: scale(.9); }
.kb-th-send:disabled { opacity: .5; }
.kb-th-note { margin-top: 6px; font-size: .64rem; color: var(--kb-mute); line-height: 1.6; }

@media (min-width: 760px) {
  .kb-board { max-width: 720px; }
  .kb-sheet { inset: 0; width: min(520px, 92vw); max-height: 88svh; margin: auto; border-radius: 26px; }
  .kb-sheet[open] { animation: kbPop .4s var(--kb-spring); }
  @keyframes kbPop { from { opacity: 0; transform: scale(.9); } }
  .kb-sheet.is-closing { animation: kbFade .22s ease forwards; }
  @keyframes kbFade { to { opacity: 0; transform: scale(.95); } }
  .kb-grip { display: none; }
  .kb-form { padding-top: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .kb-board *, .kb-sheet, .kb-sheet *, .kb-burst, .kb-fly { animation: none !important; transition: none !important; }
}
