/* 係の道具箱: 方眼紙の机に、紙と文房具が並んでいる見た目。PC を先に、スマホは下の @media で */
:root {
  --paper: #f6f1e7; --grid: #ebe4d3; --card: #fffdf8; --ink: #22304f; --ink2: #5b6680; --line: #e3dccb;
  --red: #e4572e; --red-d: #b93f1c; --yellow: #ffcf48; --green: #2e7d67; --blue: #3b6fd4;
  --tc: var(--red); --tt: #fde3dc;
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --shadow: 0 2px 0 rgba(34, 48, 79, .06), 0 10px 26px rgba(34, 48, 79, .09);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--font); font-weight: 500; font-size: 16px; line-height: 1.75;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
a { color: var(--blue); text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0; font-weight: 900; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { display: block; }

/* ---- ボタン ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none;
  padding: 9px 16px; border-radius: 12px; border: 2px solid var(--ink); background: #fff; color: var(--ink); font-weight: 700; font-size: 15px;
  box-shadow: 0 3px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
.btn.primary { background: var(--red); border-color: var(--red-d); color: #fff; box-shadow: 0 3px 0 var(--red-d); }
.btn.primary:hover { box-shadow: 0 4px 0 var(--red-d); }
.btn.primary:active { box-shadow: 0 0 0 var(--red-d); }
.btn.big { width: 100%; padding: 14px 18px; font-size: 18px; border-radius: 14px; font-weight: 900; }
.btn.ghost { border-color: var(--line); box-shadow: none; color: var(--ink2); }
.btn:focus-visible, .seg input:focus-visible + span, a:focus-visible, summary:focus-visible, .node:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.link { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; cursor: pointer; font-weight: 700; font-size: 14px; }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.badges li { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: #fff; border: 1.5px solid var(--line); color: var(--ink2); }
.badges li::before { content: "✓ "; color: var(--green); }

/* ---- ヘッダー ---- */
.hdr { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px; padding: 10px 28px; background: rgba(255, 253, 248, .94); backdrop-filter: blur(8px); border-bottom: 2px solid var(--ink); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.logo-mark { width: 40px; height: 40px; }
.logo b { display: block; font-size: 20px; font-weight: 900; line-height: 1.2; letter-spacing: .02em; }
.logo small { display: block; font-size: 11px; color: var(--ink2); line-height: 1.2; }
.tnav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.tnav::-webkit-scrollbar { display: none; }
.tnav a { flex: none; text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 700; padding: 5px 11px; border-radius: 99px; border-bottom: 3px solid transparent; }
.tnav a:hover { background: #fff; border-bottom-color: var(--tc); }

/* ---- トップ: 主役 ---- */
.home, .tool, .doc { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 36px; align-items: center; padding: 54px 0 46px; }
.eyebrow { display: inline-block; font-weight: 700; font-size: 14px; background: var(--ink); color: #fff; padding: 3px 14px; border-radius: 99px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(34px, 4.3vw, 54px); letter-spacing: .01em; line-height: 1.32; }
.mark { background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%); padding: 0 4px; }
.hero-lead { margin: 20px 0 26px; font-size: 18px; color: var(--ink2); }
.hero-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-cta .btn.big { width: auto; padding: 14px 34px; }
.hero-art { position: relative; height: 430px; }
.paper { position: absolute; background: #fff; border: 2px solid var(--ink); border-radius: 10px; box-shadow: 6px 8px 0 rgba(34, 48, 79, .13); padding: 14px 16px; }
.paper > b { display: block; text-align: center; font-weight: 900; font-size: 15px; margin-bottom: 8px; }
.p-a { width: 300px; left: 4%; top: 18px; transform: rotate(-3deg); }
.p-a svg { width: 100%; height: auto; font-family: var(--font); }
.p-b { width: 236px; right: 2%; top: 150px; transform: rotate(3.5deg); }
.p-b table { width: 100%; border-collapse: collapse; font-size: 13px; }
.p-b th, .p-b td { border: 1.5px solid var(--line); padding: 3px 6px; text-align: center; font-weight: 700; }
.p-b th { background: #d9efe6; }
.sticky { position: absolute; width: 92px; padding: 10px 10px 14px; font-size: 14px; font-weight: 700; line-height: 1.5; box-shadow: 3px 5px 0 rgba(34, 48, 79, .13); }
.sticky b { display: block; font-weight: 900; border-bottom: 2px dashed rgba(34, 48, 79, .3); margin-bottom: 4px; }
.s-a { background: var(--yellow); left: 9%; bottom: 14px; transform: rotate(-6deg); }
.s-b { background: #ffb3a0; left: calc(9% + 106px); bottom: 34px; transform: rotate(4deg); }
.ballmini { position: absolute; right: 9%; top: 26px; width: 88px; height: 88px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #fff 0 16%, #3fc9c4 17%, #12a3a3 70%); border: 2px solid var(--ink); color: #fff; font-weight: 900; font-size: 13px; display: grid; place-content: center; text-align: center; line-height: 1; box-shadow: 4px 6px 0 rgba(34, 48, 79, .13); transform: rotate(8deg); }
.ballmini b { font-size: 30px; }
.bubble { position: absolute; right: 4%; bottom: 20px; background: #06c755; color: #fff; font-weight: 900; font-size: 14px; padding: 8px 16px; border-radius: 18px 18px 4px 18px; box-shadow: 3px 5px 0 rgba(34, 48, 79, .13); }
.hero-pal { position: absolute; left: 36%; bottom: -8px; width: 190px; height: auto; filter: drop-shadow(4px 6px 0 rgba(34, 48, 79, .12)); }

/* ---- 節 ---- */
.sec { padding: 36px 0; }
.sec-title { font-size: 28px; margin-bottom: 8px; display: flex; align-items: center; gap: 14px; }
.sec-title span { background: linear-gradient(transparent 62%, var(--yellow) 62%); padding: 0 4px; }
.sec-title::after { content: ""; flex: 1; border-top: 3px dotted #cfc5ad; }
.sec-lead { color: var(--ink2); margin-bottom: 20px; }
.sec-title + .tgrid, .sec-title + .sgrid, .sec-title + .pgrid, .sec-title + .faq { margin-top: 20px; }

/* ---- 道具のカード ---- */
.tgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.tcard { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 26px 18px 18px; background: var(--card); border: 2px solid var(--ink); border-radius: 16px; text-decoration: none; color: var(--ink); box-shadow: 0 5px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.tcard:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 9px 0 var(--ink); }
.tape { position: absolute; top: -11px; left: 50%; width: 84px; height: 22px; margin-left: -42px; background: var(--tc); opacity: .85; transform: rotate(-2deg); border-radius: 2px; clip-path: polygon(0 0, 100% 0, 97% 50%, 100% 100%, 0 100%, 3% 50%); }
.ticon { width: 60px; height: 60px; flex: none; border-radius: 16px; background: var(--tt); color: var(--tc); display: grid; place-items: center; border: 2px solid var(--tc); overflow: hidden; }
.ticon svg { width: 34px; height: 34px; }
.ticon img { width: 100%; height: 100%; object-fit: cover; }
.tbody { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tbody b { font-size: 20px; font-weight: 900; line-height: 1.3; }
.tbody > span { font-size: 14px; color: var(--ink2); line-height: 1.6; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 4px; }
.tags i { font-style: normal; font-size: 12px; font-weight: 700; background: var(--tt); color: var(--ink); padding: 0 8px; border-radius: 6px; }
.go { position: absolute; right: 16px; top: 26px; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 900; transition: transform .12s; }
.tcard:hover .go { transform: translateX(4px); background: var(--tc); }
.tgrid.rel { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 22px; }

/* ---- 場面 ---- */
.sgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.scard { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 0 16px 16px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.sart { margin: 0 -16px 12px; height: 132px; background: #efe8d6; display: grid; place-items: center; }
.sart img { width: 100%; height: 100%; object-fit: cover; }
.sart .emoji { font-size: 60px; line-height: 1; }
.scard h3 { font-size: 19px; }
.scard p { font-size: 14px; color: var(--ink2); margin: 4px 0 12px; flex: 1; }
.slinks { display: flex; flex-wrap: wrap; gap: 6px; }
.slinks a { font-size: 13px; font-weight: 700; text-decoration: none; color: var(--ink); background: #fff; border: 2px solid var(--tc); padding: 1px 10px; border-radius: 99px; }
.slinks a:hover { background: var(--tc); color: #fff; }

/* ---- 約束 ---- */
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.pcard { position: relative; background: #2f5d50; color: #fff; border-radius: 16px; padding: 26px 22px 22px; border: 6px solid #8a6a45; box-shadow: var(--shadow); }
.pnum { position: absolute; top: -18px; left: 18px; width: 38px; height: 38px; border-radius: 50%; background: var(--yellow); color: var(--ink); font-weight: 900; display: grid; place-items: center; border: 2px solid var(--ink); }
.pcard h3 { font-size: 20px; margin-bottom: 6px; }
.pcard p { font-size: 15px; opacity: .92; }

/* ---- FAQ ---- */
.faq { display: grid; gap: 10px; max-width: 860px; }
.faq details { background: var(--card); border: 2px solid var(--line); border-radius: 12px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 13px 44px 13px 46px; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q"; position: absolute; left: 14px; top: 11px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 900; display: grid; place-items: center; line-height: 1; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 9px; font-size: 22px; font-weight: 900; color: var(--ink2); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 18px 15px 46px; color: var(--ink2); }

/* ---- フッター ---- */
.foot { margin-top: 56px; background: var(--ink); color: #dfe4ee; padding: 40px 28px 20px; }
.foot-in { max-width: 1144px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1.6fr 1fr; gap: 36px; }
.foot-brand { display: flex; gap: 12px; align-items: flex-start; }
.foot-brand .logo-mark { width: 44px; height: 44px; flex: none; background: #fff; border-radius: 12px; padding: 4px; }
.foot-brand b { font-size: 20px; font-weight: 900; color: #fff; }
.foot-brand p { font-size: 14px; opacity: .8; }
.foot nav { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; align-content: start; }
.foot nav:last-child { grid-template-columns: 1fr; }
.foot h4 { grid-column: 1 / -1; font-size: 13px; color: var(--yellow); margin-bottom: 4px; letter-spacing: .08em; }
.foot a { color: #dfe4ee; text-decoration: none; font-size: 14px; }
.foot a:hover { color: #fff; text-decoration: underline; }
.copy { max-width: 1144px; margin: 28px auto 0; font-size: 12px; opacity: .6; border-top: 1px solid rgba(255, 255, 255, .18); padding-top: 14px; }

/* ---- ツールのページ ---- */
.tool-head { padding: 22px 0 20px; }
.crumb { font-size: 13px; color: var(--ink2); display: flex; gap: 8px; margin-bottom: 12px; }
.crumb a { color: var(--ink2); }
.th-row { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 14px; }
.ticon.big { width: 76px; height: 76px; border-radius: 20px; box-shadow: 0 4px 0 var(--tc); }
.ticon.big svg { width: 44px; height: 44px; }
.tool-head h1 { font-size: clamp(26px, 3vw, 36px); }
.tool-head h1::after { content: ""; display: block; width: 72px; height: 6px; border-radius: 3px; background: var(--tc); margin-top: 8px; }
.lead { margin-top: 10px; color: var(--ink2); max-width: 820px; }
.work { display: grid; grid-template-columns: 372px minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { position: sticky; top: 78px; max-height: calc(100vh - 94px); overflow-y: auto; background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: 20px 18px; box-shadow: 0 5px 0 var(--ink); display: grid; gap: 14px; border-top: 12px solid var(--tc); }
.result { min-width: 0; display: grid; gap: 14px; align-content: start; }

/* 入力欄 */
.f { display: grid; gap: 5px; min-width: 0; }
.f > label, .lab { font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cnt { font-weight: 500; font-size: 13px; color: var(--ink2); }
.cnt b { color: var(--tc); font-size: 16px; font-weight: 900; }
input[type=text], input[type=number], input[type=date], textarea, select { width: 100%; padding: 9px 11px; border: 2px solid #cfc7b4; border-radius: 10px; background: #fff; font-size: 16px; line-height: 1.5; }
textarea { resize: vertical; min-height: 64px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--tc); box-shadow: 0 0 0 3px var(--tt); }
::placeholder { color: #a9a393; }
.mini { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink2); }
.hint { font-size: 13px; color: var(--ink2); line-height: 1.65; }
.hint b { color: var(--ink); background: linear-gradient(transparent 60%, var(--yellow) 60%); }
.seg { display: flex; border: 2px solid var(--ink); border-radius: 11px; overflow: hidden; background: #fff; }
.seg label { flex: 1; cursor: pointer; text-align: center; min-width: 0; }
.seg label + label { border-left: 2px solid var(--ink); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 4px; font-size: 13.5px; font-weight: 700; line-height: 1.35; height: 100%; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.chk { display: flex; gap: 9px; align-items: center; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.chk input { width: 20px; height: 20px; accent-color: var(--tc); flex: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pts label { font-size: 13px; font-weight: 700; display: grid; gap: 3px; }
.wds, .swatches { display: flex; gap: 5px; }
.wds label { flex: 1; cursor: pointer; }
.wds input, .swatches input { position: absolute; opacity: 0; pointer-events: none; }
.wds span { display: block; text-align: center; padding: 6px 0; border: 2px solid #cfc7b4; border-radius: 9px; font-weight: 700; background: #fff; }
.wds input:checked + span { background: var(--tc); border-color: var(--tc); color: #fff; }
.swatches label { cursor: pointer; }
.swatches span { display: block; width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #cfc7b4; }
.swatches input:checked + span { box-shadow: 0 0 0 3px var(--ink); }
.inline { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; font-weight: 700; }
.inline input { width: 84px; flex: none; }
.inline em { font-style: normal; color: var(--tc); font-weight: 900; margin-left: auto; }
.tabs { display: flex; gap: 4px; background: #efe8d6; padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; border: 0; background: none; padding: 8px 4px; font-weight: 700; font-size: 13.5px; border-radius: 9px; cursor: pointer; color: var(--ink2); line-height: 1.3; }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 0 var(--ink); }

/* できあがり */
.empty { border: 3px dashed #cfc5ad; border-radius: 18px; min-height: 340px; display: grid; place-content: center; text-align: center; gap: 6px; padding: 30px; color: var(--ink2); background: rgba(255, 253, 248, .6); }
.empty b { font-size: 20px; color: var(--ink); font-weight: 900; }
.sheet { background: var(--card); border: 2px solid var(--ink); border-radius: 6px; padding: 26px 24px; box-shadow: 8px 10px 0 rgba(34, 48, 79, .12); min-width: 0; }
.sheet-title { text-align: center; font-size: 24px; margin-bottom: 16px; }
.sheet-scroll { overflow-x: auto; }
.sheet-scroll > svg { margin: 0 auto; max-width: none; }
h3.sub { font-size: 17px; margin: 22px 0 10px; padding-left: 10px; border-left: 6px solid var(--tc); }
h3.sub small { font-size: 12.5px; font-weight: 500; color: var(--ink2); margin-left: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions.top .hint { flex: 1; min-width: 200px; }
.toolbar { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.podium { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.pod { min-width: 150px; text-align: center; padding: 10px 18px; border-radius: 12px; border: 2px solid var(--ink); background: #fff; }
.pod small { display: block; font-weight: 700; font-size: 12px; }
.pod b { font-size: 19px; font-weight: 900; }
.pod.p1 { background: var(--yellow); }
.pod.p2 { background: #e8ecf3; }
.pod.p3 { background: #f1d3b6; }
.node circle { transition: transform .1s; transform-box: fill-box; transform-origin: center; }
.node:hover circle { transform: scale(1.18); }

/* 表 */
.tbl { border-collapse: collapse; margin: 0 auto; font-size: 15px; background: #fff; }
.tbl th, .tbl td { border: 1.5px solid #cfc7b4; padding: 7px 12px; text-align: center; white-space: nowrap; }
.tbl thead th { background: var(--ink); color: #fff; font-weight: 700; }
.tbl tbody th { background: #f6f1e7; font-weight: 700; }
.tbl tbody tr:nth-child(even) td { background: #fbf8f1; }
.matrix td { min-width: 78px; font-weight: 700; line-height: 1.4; }
.matrix .diag { background: repeating-linear-gradient(135deg, #e9e3d3 0 6px, #f6f1e7 6px 12px) !important; }
.win { color: #c8401f; } .lose { color: var(--blue); } .draw { color: var(--ink2); }
.rank tr.top td, .rank tr.top th { background: #fff1c4 !important; }
.rounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.round { border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.round h4 { font-size: 14px; color: var(--tc); margin-bottom: 6px; }
.match { display: grid; grid-template-columns: 22px minmax(0, 1fr) 50px 10px 50px minmax(0, 1fr); gap: 6px; align-items: center; padding: 4px 0; }
.match + .match { border-top: 1px dashed var(--line); }
.match i { font-style: normal; font-size: 12px; color: var(--ink2); text-align: center; }
.match .ta { text-align: right; } .match .tb { text-align: left; }
.match span { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match input { padding: 5px 2px; text-align: center; font-weight: 900; -moz-appearance: textfield; }
.match input::-webkit-outer-spin-button, .match input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.match em { font-style: normal; text-align: center; }
.rest { font-size: 13px; color: var(--ink2); margin-top: 6px; }

/* 当番表 */
.touban td { padding: 5px 8px; }
.chip, .mem { border: 2px solid transparent; background: none; padding: 2px 8px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
.chip:hover, .mem:hover { background: var(--tt); }
.chip.picked, .mem.picked, .seat.picked { border-color: var(--red) !important; background: #fde3dc !important; animation: wiggle .5s infinite; }
.touban td .chip + .chip { margin-left: 2px; }
.tally { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 16px; font-size: 13px; }
.tally span { font-weight: 700; color: var(--ink2); margin-right: 4px; }
.tally em { font-style: normal; background: #f1ede3; border-radius: 99px; padding: 0 10px; }
.tally b { color: var(--tc); }
@keyframes wiggle { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }

/* 班分け */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.grp { background: var(--tint); border-radius: 4px; padding: 12px 10px 14px; box-shadow: 3px 5px 0 rgba(34, 48, 79, .12); }
.grp:nth-child(odd) { transform: rotate(-.6deg); } .grp:nth-child(even) { transform: rotate(.5deg); }
.grp h3 { font-size: 18px; border-bottom: 2px dashed rgba(34, 48, 79, .3); padding-bottom: 4px; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: baseline; }
.grp h3 small { font-size: 12px; font-weight: 700; color: var(--ink2); }
.grp ul { list-style: none; margin: 0; padding: 0; }
.mem { width: 100%; justify-content: flex-start; font-size: 16px; }
.mem i { font-style: normal; color: var(--red); }
.mem small { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--ink2); }
.groups.anim .grp { animation: pop .45s both; animation-delay: calc(var(--i) * 70ms); }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.9) rotate(-4deg); } }

/* 席替え */
.board, .desk { margin: 0 auto 16px; width: min(70%, 420px); text-align: center; font-weight: 900; color: #fff; background: #2f5d50; border: 5px solid #8a6a45; border-radius: 6px; padding: 5px; letter-spacing: .5em; }
.desk { margin: 16px auto 0; width: 150px; background: #b98a55; border-color: #8a6a45; letter-spacing: .2em; }
.seats { display: grid; grid-template-columns: repeat(var(--c), minmax(74px, 1fr)); gap: 8px; min-width: calc(var(--c) * 82px - 8px); }
.seat { min-height: 52px; border: 2px solid var(--ink); border-radius: 8px 8px 3px 3px; background: #fff; font-weight: 700; font-size: 15px; cursor: pointer; padding: 4px 2px; box-shadow: 0 3px 0 #c9b28f; overflow: hidden; text-overflow: ellipsis; }
.seat.none { background: #fbf8f1; border-style: dashed; border-color: #cfc7b4; box-shadow: none; }
.seat.off { background: #e3dccb; border-color: #cfc7b4; color: #9a927e; box-shadow: none; }
.seats.editing .seat { cursor: crosshair; }
.seats.anim .seat:not(.off):not(.none) { animation: pop .4s both; animation-delay: calc(var(--i) * 18ms); }

/* くじ */
.kuji { text-align: center; }
.drum { font-size: clamp(34px, 6vw, 64px); font-weight: 900; min-height: 1.6em; padding: 18px 10px; border-radius: 16px; background: var(--tt); border: 3px dashed var(--tc); }
.drum.hit, .ball.hit { animation: hit .5s; }
.drum.hit { background: var(--yellow); border-style: solid; border-color: var(--ink); }
@keyframes hit { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } }
.winners, .orderlist { list-style: none; padding: 0; margin: 0 auto; max-width: 460px; display: grid; gap: 6px; text-align: left; }
.winners li, .orderlist li { display: flex; align-items: center; gap: 12px; background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: 6px 14px; font-size: 19px; font-weight: 700; }
.winners i, .orderlist i { font-style: normal; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--tc); color: #fff; font-size: 14px; display: grid; place-items: center; font-weight: 900; }
.orderlist.anim li { animation: pop .4s both; animation-delay: calc(var(--i) * 60ms); }
.left { font-weight: 700; margin-bottom: 12px; }
.left b { font-size: 24px; color: var(--tc); }
.kcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; perspective: 800px; }
.kcard { position: relative; aspect-ratio: 3 / 4; border: 0; background: none; padding: 0; cursor: pointer; transform-style: preserve-3d; transition: transform .5s; }
.kcard.open { transform: rotateY(180deg); cursor: default; }
.face { position: absolute; inset: 0; border-radius: 10px; border: 2px solid var(--ink); display: grid; place-items: center; backface-visibility: hidden; font-weight: 900; padding: 4px; overflow: hidden; }
.face.back { background: repeating-linear-gradient(45deg, var(--tc) 0 8px, #e58aa3 8px 16px); color: #fff; font-size: 22px; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.face.front { background: #fff; transform: rotateY(180deg); font-size: 15px; line-height: 1.3; word-break: break-all; }

/* ビンゴ・名札の印刷ページ(mm) */
.pages-wrap { min-width: 0; overflow: hidden; }
.pages { zoom: var(--z, 1); display: grid; gap: 24px; justify-items: start; }
.page { width: 190mm; height: 276mm; background: #fff; box-shadow: 0 0 0 1px #cfc7b4, 8px 10px 0 rgba(34, 48, 79, .12); display: grid; grid-template-columns: repeat(var(--c), 1fr); grid-template-rows: repeat(var(--r), 1fr); place-items: center; overflow: hidden; color: #111; font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif; }
.bcard { width: var(--w); font-size: calc(var(--w) / 20); }
.bhead { display: flex; justify-content: space-between; align-items: baseline; padding: 0 .2em .3em; }
.bhead b { font-size: 1.5em; font-weight: 900; }
.bhead small { font-size: .8em; color: #666; }
.bingo-letters { display: grid; grid-template-columns: repeat(5, 1fr); background: #111; color: #fff; text-align: center; font-weight: 900; font-size: 2em; line-height: 1.5; border-radius: .25em .25em 0 0; }
.bgrid { display: grid; grid-template-columns: repeat(var(--n), 1fr); border: .12em solid #111; width: 20em; height: 20em; }
.bgrid span { display: grid; place-items: center; border: .06em solid #111; font-weight: 700; line-height: 1.1; text-align: center; overflow: hidden; word-break: keep-all; }
.bgrid .free { background: #111; color: #fff; }
.caller { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: center; }
.ballbox { text-align: center; display: grid; gap: 8px; justify-items: center; }
.ballbox small { font-size: 26px; font-weight: 900; color: var(--tc); min-height: 1.4em; line-height: 1.4; }
.ball { width: 200px; height: 200px; border-radius: 50%; display: grid; place-items: center; font-size: 96px; font-weight: 900; color: var(--ink); background: radial-gradient(circle at 34% 28%, #fff 0 44%, #d3f1ef 45%, var(--tc) 100%); border: 4px solid var(--ink); box-shadow: 0 8px 0 rgba(34, 48, 79, .18); line-height: 1; }
.ball.word { font-size: 30px; padding: 20px; text-align: center; line-height: 1.25; word-break: break-all; }
.called { display: grid; grid-template-columns: repeat(15, 1fr); grid-auto-flow: column; grid-template-rows: repeat(5, auto); gap: 4px; }
.called.words { grid-auto-flow: row; grid-template-rows: none; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.called span { text-align: center; font-weight: 700; font-size: 14px; padding: 4px 0; border-radius: 7px; background: #f1ede3; color: #a39b88; }
.called span.on { background: var(--tc); color: #fff; }
.called span.last { outline: 3px solid var(--yellow); }
.page.nafuda { grid-template-columns: repeat(var(--c), var(--cw)); grid-template-rows: none; grid-auto-rows: var(--ch); justify-content: center; align-content: start; place-items: stretch; }
.ncard { border: .3mm dashed #999; overflow: hidden; }
.nface { height: 100%; display: flex; flex-direction: column; text-align: center; }
.nhead { font-size: 3.6mm; font-weight: 700; padding: 1.4mm 2mm; min-height: 8mm; line-height: 1.4; color: var(--col); }
.band .nhead { background: var(--col); color: #fff; }
.line { border-left: 3mm solid var(--col); }
.line .nbody { border-top: .5mm solid var(--col); margin: 0 3mm; }
.nbody { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1mm; padding: 1mm 2mm; min-height: 0; }
.nname { font-weight: 700; line-height: 1.2; white-space: nowrap; }
.nrole { font-size: 3.8mm; color: #444; }
.ncard.tent { display: grid; grid-template-rows: 1fr 1fr; }
.half + .half { border-top: .3mm dashed #999; }
.half.flip { transform: rotate(180deg); }

/* ---- 読みもの ---- */
.article { max-width: 880px; margin: 48px auto 0; background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 14px 38px 34px; box-shadow: var(--shadow); }
.article h2 { font-size: 23px; margin: 30px 0 12px; display: flex; align-items: center; gap: 10px; }
.article h2::before { content: ""; width: 12px; height: 24px; background: var(--tc); border-radius: 3px; flex: none; }
.steps { list-style: none; counter-reset: st; padding: 0; margin: 0; display: grid; gap: 8px; }
.steps li { counter-increment: st; position: relative; padding: 10px 14px 10px 54px; background: #fff; border: 2px solid var(--line); border-radius: 12px; }
.steps li::before { content: counter(st); position: absolute; left: 12px; top: 9px; width: 30px; height: 30px; border-radius: 50%; background: var(--tc); color: #fff; font-weight: 900; display: grid; place-items: center; }
.scenes-list, .tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.scenes-list { grid-template-columns: 1fr 1fr; }
.scenes-list li { background: var(--tt); border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: 15px; }
.tips li { padding-left: 30px; position: relative; }
.tips li::before { content: "💡"; position: absolute; left: 0; }
.article > p { color: var(--ink2); }
.tablewrap { overflow-x: auto; margin-top: 12px; }
.info { border-collapse: collapse; width: 100%; background: #fff; font-size: 15px; }
.info th, .info td { border: 1.5px solid #cfc7b4; padding: 6px 12px; text-align: center; }
.info thead th { background: var(--ink); color: #fff; }
.info tbody th { background: var(--tt); }
.back { margin-top: 26px; font-weight: 700; }
.doc { max-width: 860px; padding-top: 26px; }
.doc h1 { font-size: 32px; margin-bottom: 16px; }
.doc h2 { font-size: 22px; margin: 30px 0 10px; padding-left: 12px; border-left: 8px solid var(--red); }
.doc li { margin-bottom: 6px; }
.doc .tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 28px; }

/* ---- お知らせ・入力の小窓 ---- */
#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 12px; font-weight: 700; font-size: 15px; opacity: 0; pointer-events: none; transition: .22s; z-index: 60; max-width: min(92vw, 560px); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
dialog { border: 2px solid var(--ink); border-radius: 18px; padding: 0; width: min(92vw, 460px); box-shadow: 0 8px 0 var(--ink); color: var(--ink); background: var(--card); }
dialog::backdrop { background: rgba(34, 48, 79, .45); }
.dlg-in { padding: 22px; display: grid; gap: 14px; }
.dlg-in h3 { text-align: center; font-size: 20px; }
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; text-align: center; }
.vs b { display: block; font-size: 17px; margin-bottom: 6px; word-break: break-all; line-height: 1.3; }
.vs input { text-align: center; font-weight: 900; }
.vs > span { font-weight: 900; color: var(--ink2); }
.dlg-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dlg-btns .btn { white-space: normal; line-height: 1.3; }

/* ---- スマホ・タブレット ---- */
@media (max-width: 1080px) {
  .tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tnav a { font-size: 13px; padding: 5px 8px; }
}
@media (max-width: 920px) {
  .hdr { padding: 8px 14px; gap: 10px; flex-wrap: wrap; }
  .tnav { margin: 0 -14px; padding: 0 14px; width: calc(100% + 28px); order: 3; }
  .logo small { display: none; }
  .logo-mark { width: 32px; height: 32px; }
  html { scroll-padding-top: 104px; }
  .home, .tool, .doc { padding: 0 16px; }
  .hero { grid-template-columns: 1fr; padding: 30px 0 20px; gap: 14px; }
  .hero-art { height: 380px; max-width: 520px; width: 100%; margin: 0 auto; }
  .work { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; }
  .pgrid { grid-template-columns: 1fr; gap: 28px; }
  .foot-in { grid-template-columns: 1fr; gap: 24px; }
  .article { padding: 6px 18px 26px; margin-top: 32px; }
  .caller { grid-template-columns: 1fr; }
  .tgrid.rel { grid-template-columns: 1fr; }
  .empty { min-height: 200px; }
}
@media (max-width: 560px) {
  .tgrid, .doc .tgrid { grid-template-columns: 1fr; }
  .tcard { flex-direction: row; align-items: flex-start; padding: 22px 14px 14px; }
  .go { display: none; }
  .sgrid { grid-template-columns: 1fr; }
  .sart { height: 110px; }
  .hero-lead br { display: none; }
  .hero-lead { font-size: 16px; }
  .hero-art { height: 330px; }
  .p-a { width: 250px; left: 0; top: 8px; }
  .p-b { width: 200px; right: 0; top: 128px; }
  .ballmini { width: 66px; height: 66px; right: 4%; top: 30px; }
  .ballmini b { font-size: 22px; }
  .s-a { left: 2%; bottom: 4px; } .s-b { left: calc(2% + 98px); bottom: 20px; }
  .bubble { right: 0; bottom: 4px; font-size: 12.5px; padding: 6px 12px; }
  .hero-pal { display: none; }
  .th-row { gap: 12px; }
  .ticon.big { width: 56px; height: 56px; border-radius: 14px; }
  .ticon.big svg { width: 32px; height: 32px; }
  .sheet { padding: 18px 12px; }
  .scenes-list { grid-template-columns: 1fr; }
  .rounds { grid-template-columns: 1fr; }
  .match { grid-template-columns: 18px minmax(0, 1fr) 42px 8px 42px minmax(0, 1fr); gap: 4px; }
  .called { grid-template-columns: repeat(10, 1fr); grid-auto-flow: row; grid-template-rows: none; }
  .ball { width: 160px; height: 160px; font-size: 76px; }
  .actions .btn { flex: 1 1 46%; padding: 9px 8px; font-size: 14px; }
  .sec-title { font-size: 23px; }
  .foot nav { grid-template-columns: 1fr 1fr; }
}

/* ---- 印刷: できあがった紙だけを出す ---- */
@page { margin: 10mm; }
@page a4p { size: A4 portrait; margin: 10mm; }
@media print {
  .noprint, .hdr, .foot, .panel, .tool-head, .article, #toast, dialog { display: none !important; }
  html, body { background: #fff !important; }
  .home, .tool, .doc { max-width: none; padding: 0; }
  .work { display: block; }
  .sheet { border: 0; box-shadow: none; padding: 0; background: #fff; }
  .sheet-scroll { overflow: visible; }
  .sheet-scroll > svg { max-width: 100%; height: auto; }
  .round, .grp, .match { break-inside: avoid; }
  .grp { box-shadow: none; border: 1px solid #999; transform: none !important; }
  .seat { box-shadow: none; }
  .kcard { display: none; }
  .pages-wrap { overflow: visible; }
  .pages { zoom: 1 !important; gap: 0; }
  .page { page: a4p; box-shadow: none; break-after: page; }
  .page:last-child { break-after: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }

/* スマホ: 説明文をアイコンの横に押し込めず、下に全幅で置く */
@media (max-width: 560px) {
  .th-row { flex-wrap: wrap; align-items: center; }
  .th-row > div { display: contents; }
  .tool-head h1 { flex: 1; min-width: 0; }
  .lead { flex-basis: 100%; margin-top: 0; }
}
@media (max-width: 560px) {
  .match span { white-space: normal; font-size: 13px; line-height: 1.25; overflow-wrap: anywhere; }
}

/* 主役のキャラクターが付せんと吹き出しの間に立つ */
.s-a { left: 0; bottom: 40px; }
.s-b { left: 96px; bottom: 62px; }
.hero-pal { left: 33%; bottom: -12px; width: 176px; }
@media (max-width: 560px) { .s-a { left: 2%; bottom: 4px; } .s-b { left: calc(2% + 98px); bottom: 20px; } }

/* 場面の絵: 高さを決め打ちにして、見出しに食い込ませない */
.sart { height: 150px; overflow: hidden; display: block; }
.sart img { display: block; width: 100%; height: 150px; object-fit: cover; }
.sart .emoji { display: grid; place-items: center; height: 100%; }
.scard h3 { margin-top: 2px; }
@media (max-width: 560px) { .sart, .sart img { height: 120px; } }
