/*
VOICE: 放課後の教室。友だちに「この遊び、どっちが勝つと思う？」と出す挑戦状
IDEA: 黒板と、そこにマグネットで留めた問題プリント。採点は赤ペンの花丸
PICTURE: 黒板の上で動くデモプレイ／対戦盤そのもの
COLOUR and TYPE: 黒板の深緑・木の枠・チョークの白、先攻はピンク・後攻は水色のチョーク、紙の白と罫線の青、赤ペン／Klee One＋Zen Maru Gothic
LAYOUT: 縦持ち1カラム。黒板（盤）とプリント（文字）を交互に重ねる
*/
:root {
  color-scheme: dark;
  --board: #24443c;
  --board2: #1c3832;
  --wood: #8b5b33;
  --wood2: #5e3a1e;
  --chalk: #f2f0e7;
  --dim: #b7c6bd;
  --p0: #f7a8c2;
  --p1: #93d3f2;
  --ac: #f4de86;
  --bad: #ff8a7a;
  --line: rgba(242, 240, 231, .22);
  --paper: #fbfaf4;
  --rule: #d6e4ef;
  --ink: #2b2a27;
  --ink2: #6a6760;
  --red: #d2382c;
  --hand: 'Klee One', 'Zen Maru Gothic', sans-serif;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--chalk); overflow-x: clip; min-height: 100dvh;
  font: 500 16px/1.6 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', sans-serif;
  background: var(--noise), radial-gradient(130% 70% at 50% 0%, #2c5048 0%, var(--board2) 75%);
  background-color: var(--board2);
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 540px; margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}
.screen[hidden], [hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, summary:focus-visible { outline: 3px solid var(--ac); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--hand); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
h2 { font-size: 30px; }
b { font-weight: 700; color: var(--ac); }
.small { font-size: 14px; }
.c0 { color: var(--p0); } .c1 { color: var(--p1); }

/* ---------- 黒板 ---------- */
.blackboard {
  position: relative;
  background: var(--noise), linear-gradient(165deg, #2b4e45, #213f38 60%, #1d3731);
  border: 11px solid var(--wood);
  border-image: linear-gradient(135deg, #a06a3c, #7b4d28 40%, #9a6438 70%, #6e4321) 1;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, .38), 0 12px 26px rgba(0, 0, 0, .4);
  border-radius: 4px;
}
.hero { padding: 14px 12px 30px; margin-bottom: 18px; }
.title-svg { width: 100%; display: block; overflow: visible; }
.title-svg text { text-anchor: middle; fill: var(--chalk); font-family: var(--hand); filter: url(#chalk); }
.t-small { font-size: 17px; fill: var(--ac) !important; letter-spacing: .1em; }
.t-big { font-size: 50px; font-weight: 600; }
.t-line { fill: none; stroke: var(--p0); stroke-width: 3; stroke-linecap: round; filter: url(#chalk); opacity: .9; }
.demo { margin-top: 6px; border-top: 2px dashed var(--line); padding-top: 10px; }
.demo-cap { margin: 0; text-align: center; font: 600 16px var(--hand); color: var(--dim); }
.demo-stage { zoom: .74; pointer-events: none; min-height: 300px; display: grid; align-items: center; }
.demo-status { margin: 4px 0 0; text-align: center; min-height: 26px; font: 600 17px var(--hand); }
.tray { position: absolute; left: -11px; right: -11px; bottom: -11px; height: 16px; background: linear-gradient(#a06a3c, #6e4321); box-shadow: 0 6px 10px rgba(0, 0, 0, .35); }
.chalk-stick { position: absolute; bottom: 9px; left: 18%; width: 34px; height: 8px; border-radius: 3px; background: #f3f1ea; transform: rotate(-4deg); }
.chalk-stick.p { left: 28%; width: 24px; background: var(--p0); transform: rotate(3deg); }
.chalk-stick.y { left: 35%; width: 18px; background: var(--ac); }
.eraser { position: absolute; bottom: 9px; right: 14%; width: 58px; height: 16px; border-radius: 3px; background: linear-gradient(#3d3d4a 55%, #c9b98a 55%); }
.play { padding: 12px 10px 18px; margin-top: 14px; }

/* ---------- プリント（紙） ---------- */
.paper {
  position: relative; color: var(--ink); text-align: left;
  background: repeating-linear-gradient(transparent 0 29px, var(--rule) 29px 30px), var(--paper);
  border-radius: 3px; padding: 18px 18px 16px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 10px 22px rgba(0, 0, 0, .32);
}
.paper b { color: var(--red); }
.paper h2 { color: var(--ink); }
.paper .kicker { margin: 0 0 2px; font-size: 13px; color: var(--ink2); }
.magnet { position: absolute; top: -9px; left: 50%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe9a0, #d9a920); box-shadow: 0 3px 4px rgba(0, 0, 0, .35); }
.magnet.m-red { background: radial-gradient(circle at 35% 30%, #ffb3a8, var(--red)); }
.magnet.m-blue { background: radial-gradient(circle at 35% 30%, #c3ecff, #3b8fc0); }

.menu { display: grid; gap: 22px; padding-top: 6px; }
.card p { margin: 6px 0 12px; }
.big-card h2 { font-size: 32px; }
.lockrow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card.locked { opacity: .55; transform: rotate(-.6deg); padding: 14px; }
.card.locked + .card.locked { transform: rotate(.8deg); }
.card.locked h3 { font-size: 19px; }
.card.locked p { font-size: 13px; color: var(--ink2); margin: 4px 0 0; }
.prog { height: 10px; border-radius: 99px; background: #e8e4d6; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--red); }
.foot { text-align: center; color: var(--dim); font-size: 14px; margin: -8px 0 0; }

.btn {
  display: block; width: 100%; min-height: 52px; border-radius: 10px; border: 2px solid var(--ink);
  background: #fff; color: var(--ink); font-size: 17px; font-weight: 700;
  box-shadow: 0 3px 0 var(--ink);
}
.btn.pri { background: var(--red); border-color: #8f1f16; color: #fff; box-shadow: 0 4px 0 #8f1f16; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.m-acts .btn + .btn, .card .btn + .btn { margin-top: 10px; }
.toggle { min-height: 46px; border-radius: 10px; border: 2px dashed var(--line); background: none; color: var(--dim); font-size: 14px; }
.toggle.on { border-style: solid; border-color: var(--ac); color: var(--ac); }

/* 正の字 */
.tally { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; }
.tally .sei { width: 22px; height: 26px; fill: none; stroke: var(--chalk); stroke-width: 3.2; stroke-linecap: round; filter: url(#chalk); }
.tally b { font: 600 15px var(--hand); color: var(--chalk); margin-left: 4px; }
.tally.ink .sei { stroke: var(--red); filter: none; }
.tally.ink b { color: var(--red); }
.tally-0 { font: 600 16px var(--hand); }

/* 上部バー */
.bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; min-height: 46px; margin-bottom: 8px; }
.back { background: none; border: 0; color: var(--dim); min-height: 44px; padding: 0 4px; font-size: 15px; }
.back.warn { color: var(--bad); font-weight: 700; }
.bar-t { text-align: center; font: 600 17px var(--hand); }
.bar-r { font-size: 14px; color: var(--dim); white-space: nowrap; }

/* 先生のメモ */
.note { margin-top: 26px; transform: rotate(-.4deg); }
.note h2 { font-size: 34px; color: var(--red); margin-bottom: 8px; }
.note p { margin: 0 0 12px; }
.steps { margin: 0 0 18px; padding-left: 1.4em; }
.steps li { margin-bottom: 6px; }

/* 予習ノート */
.intro { margin-bottom: 10px; font-size: 15px; }
.intro p { margin: 0; }
.lh { font-size: 20px; margin: 22px 0 10px; color: var(--chalk); }
.lh small { display: block; font: 500 13px 'Zen Maru Gothic', sans-serif; color: var(--dim); margin-top: 2px; }
.sgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sitem { border: 0; padding: 12px 12px 14px; min-height: 120px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.sitem strong { font: 600 18px/1.25 var(--hand); }
.sitem span { font-size: 13px; color: var(--ink2); }
.sitem em { font-style: normal; font-size: 12.5px; margin-top: auto; padding-top: 6px; }
.sitem.got em { padding-bottom: 22px; }
.sitem .todo { color: #a19d92; font-family: var(--hand); }
.sitem .motto-line { color: var(--red); font-weight: 700; }
.sitem .stamp { position: absolute; bottom: 8px; right: 6px; font: 600 12px var(--hand); font-style: normal; color: var(--red); border: 2px solid var(--red); border-radius: 4px; padding: 0 5px; transform: rotate(12deg); opacity: .85; }
@media (max-width: 360px) { .sgrid { grid-template-columns: 1fr; } }

/* 問題用紙 */
.sheet-q { margin-top: 12px; }
.sheet-q h2 { font-size: 30px; }
.catch { margin: 2px 0 8px; color: var(--ink2); font-size: 15px; }
.rules { border-top: 1px dashed #c8c3b3; }
.rules summary { min-height: 40px; display: flex; align-items: center; font-size: 14px; color: var(--ink2); cursor: pointer; }
.rules p { margin: 0 0 8px; font-size: 15.5px; }
.variant { margin: 6px 0 0; font-size: 16px; }
.variant b { color: var(--red); }
.variant:empty { display: none; }
.study-aid { margin-top: 10px; border-top: 1px dashed #c8c3b3; padding-top: 10px; }
.hint-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 99px; border: 2px solid var(--ink); background: #fff; font-size: 14px; font-weight: 700; color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; }
.motto-chip { border-color: var(--red); color: var(--red); }
.motto-chip.on { background: var(--red); color: #fff; }
.hint-box { margin-top: 10px; background: #fff7d1; border-radius: 6px; padding: 10px 12px; font-size: 15px; }
.hint-box p { margin: 0 0 6px; }
.hint-box p:last-child { margin: 0; }
.hint-box .kicker { color: #8a6d00; }
.motto { font: 600 18px/1.45 var(--hand); color: var(--red); border-left: 4px solid var(--red); padding-left: 10px; margin: 0 0 10px; }

/* 対戦エリア */
.status { text-align: center; min-height: 30px; margin: 0 0 8px; font: 600 19px var(--hand); }
.board-wrap { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 10px; }
.sub { margin: 0; color: var(--dim); font-size: 13px; text-align: center; }
.evalmsg { margin: 10px 0 0; text-align: center; min-height: 22px; font-size: 15px; }
.evalmsg .good { color: var(--ac); } .evalmsg .bad { color: var(--bad); }
.choose { margin-top: 16px; }
.ask { text-align: center; margin: 0 0 10px; font: 600 21px var(--hand); }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.side { position: relative; min-height: 82px; border-radius: 10px; border: 0; background: var(--paper); color: var(--ink); display: grid; place-items: center; padding: 14px 6px 8px; box-shadow: 0 6px 0 rgba(0, 0, 0, .3); }
.side b { color: inherit; font: 600 28px/1 var(--hand); }
.side small { color: var(--ink2); font-size: 13px; }
.side .mag { position: absolute; top: -8px; left: 50%; margin-left: -10px; width: 20px; height: 20px; border-radius: 50%; }
.side.s0 .mag { background: radial-gradient(circle at 35% 30%, #ffe1ea, #e6719a); }
.side.s1 .mag { background: radial-gradient(circle at 35% 30%, #e3f6ff, #4aa3d6); }
.side.s0 b { color: #c84a77; } .side.s1 b { color: #2f86b8; }
.side:disabled { opacity: .45; }
.side:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.tool { min-height: 46px; border-radius: 8px; border: 2px solid var(--line); background: rgba(0, 0, 0, .18); font-size: 15px; padding: 2px; }
.tool:disabled { opacity: .4; }

/* 結果（赤ペン採点） */
.modal { position: fixed; inset: 0; background: rgba(10, 22, 19, .7); display: grid; align-items: end; justify-items: center; z-index: 10; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.sheet-r { width: min(100%, 500px); max-height: 90dvh; overflow-y: auto; padding: 18px 20px 18px; }
.m-mark { float: right; width: 96px; height: 96px; margin: -6px -6px 0 6px; }
.redpen { width: 100%; height: 100%; fill: none; stroke: var(--red); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.sheet-r h2 { font-size: 34px; margin: 2px 0 10px; }
.sheet-r h2.win { color: var(--red); font-size: 28px; line-height: 1.35; }
.sheet-r h2.lose { color: var(--ink); }
.sheet-r p { margin: 0 0 10px; }
.sheet-r .score { clear: both; }
.m-acts { clear: both; margin-top: 14px; }
.gotmotto { background: #fff1ee; border-radius: 6px; padding: 10px 12px; margin: 10px 0; }
.gotmotto .motto { margin: 0; }
.newrec { display: inline-block; background: var(--red); color: #fff; border-radius: 4px; padding: 0 8px; font-weight: 700; font-size: 13px; transform: rotate(-3deg); }
.more summary { min-height: 40px; display: flex; align-items: center; color: var(--ink2); font-size: 14px; cursor: pointer; }

/* ---------- 盤と駒（チョーク） ---------- */
.mk { width: 72%; height: 72%; fill: none; stroke: currentColor; stroke-width: 11; stroke-linecap: round; }
.cw { color: var(--chalk); } .ch { color: var(--ac); opacity: .7; }
.hint { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; gap: 2px; }
.hint .mk { width: 40%; height: 40%; stroke-width: 9; }
.grid { display: grid; gap: 0; }
.board-sq { width: 100%; max-width: 340px; aspect-ratio: 1; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.cell { border: 0; background: none; display: grid; place-items: center; padding: 0; position: relative; }
.g3 .cell { box-shadow: inset -4px 0 0 var(--chalk), inset 0 -4px 0 var(--chalk); }
.g3 .cell:nth-child(3n) { box-shadow: inset 0 -4px 0 var(--chalk); }
.g3 .cell:nth-child(7), .g3 .cell:nth-child(8) { box-shadow: inset -4px 0 0 var(--chalk); }
.g3 .cell:nth-child(9) { box-shadow: none; }
.g3 .mk { filter: url(#chalk); }
.cell.last::after { content: ''; position: absolute; inset: 14%; border-radius: 50%; background: rgba(244, 222, 134, .13); }
.cell.winl { background: rgba(244, 222, 134, .22); }
.cell.losel { background: rgba(255, 138, 122, .28); }
.cell.old .mk { opacity: .35; stroke-dasharray: 10 9; }
.symbar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 340px; }
.symbtn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px; border-radius: 10px; border: 2px solid var(--line); background: rgba(0, 0, 0, .15); font-size: 15px; }
.symbtn .mk { width: 26px; height: 26px; stroke-width: 12; }
.symbtn.on { border-color: var(--ac); background: rgba(244, 222, 134, .14); color: var(--ac); }
.symbtn.on .mk { color: var(--ac); }
.tower { width: 100%; max-width: 340px; background: rgba(0, 0, 0, .15); border: 4px solid var(--chalk); border-top: 0; border-radius: 0 0 10px 10px; }
.tower .cell { box-shadow: inset -2px 0 0 var(--line), inset 0 2px 0 var(--line); }
.colhint { width: 100%; max-width: 340px; height: 26px; }
.colhint span { display: flex; justify-content: center; }
.colhint .mk { width: 24px; height: 24px; }

/* 数を言う・足す・取る */
.now { display: flex; align-items: baseline; gap: 8px; color: var(--dim); }
.now b { font: 600 64px/1 var(--hand); color: var(--chalk); }
.chips { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; width: 100%; max-width: 420px; }
.chip-n, .chips span { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; border: 2px dashed var(--line); font-size: 14px; color: var(--dim); }
.chips .f0 { border: 2px solid var(--p0); color: var(--p0); background: rgba(247, 168, 194, .14); }
.chips .f1 { border: 2px solid var(--p1); color: var(--p1); background: rgba(147, 211, 242, .14); }
.chips .doom { border: 2px solid var(--bad); color: var(--bad); font-weight: 700; }
.acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; width: 100%; max-width: 420px; }
.acts.one { grid-template-columns: 1fr; }
.acts.nums { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.act { min-height: 54px; border-radius: 10px; border: 2px solid var(--chalk); background: rgba(0, 0, 0, .15); font: 600 18px var(--hand); display: grid; place-items: center; line-height: 1.2; padding: 4px; }
.act small { font: 500 12px 'Zen Maru Gothic', sans-serif; color: var(--dim); }
.act.go { background: var(--paper); color: var(--ink); border-color: var(--paper); font-size: 17px; }
.act:disabled { opacity: .45; }
.act.go:disabled { background: transparent; color: var(--dim); border-color: var(--line); border-style: dashed; opacity: 1; }
.act.hinted { border-color: var(--ac); box-shadow: 0 0 0 3px rgba(244, 222, 134, .35); }
.meter { width: 100%; max-width: 420px; height: 12px; border-radius: 99px; background: rgba(0, 0, 0, .25); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ac); border-radius: 99px; transition: width .3s; }
.log { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; min-height: 24px; font-size: 15px; }
.dimt { color: var(--dim); }
.pebbles { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; width: 100%; max-width: 380px; min-height: 18px; }
.pebble { width: 15px; height: 15px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #c9c4b4); }

/* 石取り */
.piles { display: grid; gap: 12px; width: 100%; max-width: 420px; padding: 6px 0; }
.pile { display: flex; align-items: center; gap: 5px; min-height: 46px; padding: 4px 6px; border-radius: 10px; flex-wrap: nowrap; }
.pile.lastrow { background: rgba(244, 222, 134, .08); }
.plab { width: 22px; color: var(--dim); font-size: 14px; text-align: right; flex: none; }
.stone { flex: none; width: min(40px, calc((100% - 30px - (var(--n, 7) - 1) * 5px) / var(--n, 7))); height: auto; aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0; background: radial-gradient(circle at 35% 30%, #fbfaf5, #cfcabb 60%, #9c978a); box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.stone.sel { background: radial-gradient(circle at 35% 30%, #fff, var(--bad)); transform: translateY(-3px); }
.stone.hintstone { outline: 3px solid var(--ac); outline-offset: 2px; }

/* わけっこ */
.heaps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 420px; }
.heap { min-height: 140px; border-radius: 12px; border: 2px dashed var(--line); background: rgba(0, 0, 0, .14); display: grid; align-content: space-between; justify-items: center; padding: 12px 8px 8px; }
.heap b { color: var(--chalk); font: 600 22px var(--hand); }
.heap.sel { border: 3px solid var(--ac); }
.heap.drop { opacity: .35; }
.candies { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.candy { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--p0)); box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.heap:nth-child(2) .candy { background: radial-gradient(circle at 35% 30%, #fff, var(--p1)); }

/* チョコ */
.chocbar { display: grid; gap: 4px; width: 92%; }
.choc { aspect-ratio: 1; border-radius: 6px; border: 0; background: linear-gradient(145deg, #8a5a3a, #5b3520); box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .15), inset -3px -3px 0 rgba(0, 0, 0, .3); padding: 0; display: grid; place-items: center; }
.choc.gone { visibility: hidden; }
.choc.poison { background: linear-gradient(145deg, #6c3a8a, #3e1f55); }
.choc.poison span { font: 600 15px var(--hand); color: #e9d6ff; }
.choc.sel { background: linear-gradient(145deg, #e48474, #a8463a); }
.choc.hintc { outline: 3px solid var(--ac); outline-offset: -3px; }
.pieces { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: flex-start; width: 100%; max-width: 460px; min-height: 80px; }
.piece { display: grid; gap: 2px; padding: 3px; border: 2px solid transparent; border-radius: 6px; background: #3b2213; }
.piece span { width: 24px; height: 24px; border-radius: 3px; background: linear-gradient(145deg, #8a5a3a, #5b3520); box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .15); }
.piece span.on { background: linear-gradient(145deg, #e48474, #a8463a); }
.piece.sel { border-color: var(--ac); }
.piece.last { box-shadow: 0 0 0 3px rgba(244, 222, 134, .35); }
.piece:disabled { opacity: .85; }

/* ピン */
.pinrow { display: flex; justify-content: center; gap: 2px; width: 100%; max-width: 460px; padding: 8px 0; }
.pinring { position: relative; width: 100%; max-width: 330px; aspect-ratio: 1; }
.pin { border: 0; background: none; padding: 0; display: grid; justify-items: center; color: var(--chalk); flex: 1 1 0; max-width: 40px; }
.pinring .pin { position: absolute; width: 38px; transform: translate(-50%, -50%); }
.pinsvg { width: 100%; height: auto; max-height: 76px; }
.pinsvg path { fill: #f2f0e7; }
.pinsvg .band { fill: none; stroke: var(--bad); stroke-width: 4; }
.pin small { font-size: 12px; color: var(--dim); }
.pin.down { opacity: .18; }
.pin.down .pinsvg { transform: scaleY(.25); transform-origin: bottom; }
.pin.sel .pinsvg path:first-child { fill: var(--ac); }
.pin.last small { color: var(--ac); }
.hinttxt { margin: 0; color: var(--ac); font-size: 14px; text-align: center; }

/* 王様 */
.kgrid { display: grid; width: 94%; border: 3px solid var(--chalk); }
.kc { aspect-ratio: 1; border: 0; padding: 0; background: transparent; box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; position: relative; }
.kc.alt { background: rgba(0, 0, 0, .12); }
.kc.goal { background: rgba(247, 168, 194, .18); }
.kc.goal span { font: 600 11px var(--hand); color: var(--p0); }
.kc.trail::after { content: ''; width: 18%; aspect-ratio: 1; border-radius: 50%; background: var(--line); }
.kc.can { background: rgba(244, 222, 134, .22); box-shadow: inset 0 0 0 2px var(--ac); }
.kc.hintc { box-shadow: inset 0 0 0 3px var(--ac); }
.crown { width: 78%; height: 78%; fill: var(--ac); stroke: #8a6d00; stroke-width: 2; stroke-linejoin: round; }
.crown .base { stroke: var(--ac); stroke-width: 5; }

/* 碁石 */
.ggrid { display: grid; width: 92%; gap: 0; background: rgba(0, 0, 0, .12); border: 3px solid var(--chalk); }
.gc { aspect-ratio: 1; border: 0; padding: 0; background: none; box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; position: relative; }
.gc.ban::after { content: ''; width: 16%; aspect-ratio: 1; border-radius: 50%; background: var(--line); }
.gc.hintc { box-shadow: inset 0 0 0 3px var(--ac); }
.go-stone { width: 74%; aspect-ratio: 1; border-radius: 50%; }
.go-stone.b { background: radial-gradient(circle at 35% 30%, #ffe1ea, #e6719a); }
.go-stone.w { background: radial-gradient(circle at 35% 30%, #e3f6ff, #4aa3d6); }
.gc.last .go-stone { box-shadow: 0 0 0 3px var(--ac); }

/* オセロ */
.felt { background: #2f6b4f; border: 4px solid #183a2a; border-radius: 6px; }
.felt .cell { box-shadow: inset -1px -1px 0 rgba(0, 0, 0, .4), inset 1px 1px 0 rgba(255, 255, 255, .06); }
.disc { width: 74%; aspect-ratio: 1; border-radius: 50%; display: inline-block; }
.disc.d1 { background: radial-gradient(circle at 35% 30%, #555, #111); }
.disc.d2 { background: radial-gradient(circle at 35% 30%, #fff, #ccc); }
.score2 .disc { width: 16px; vertical-align: -3px; margin-right: 4px; }
.dot { width: 18%; aspect-ratio: 1; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.dot.good { background: var(--ac); width: 26%; }
.score2 { display: flex; gap: 14px; justify-content: center; font-size: 16px; }
.tag { padding: 2px 12px; border-radius: 99px; border: 2px solid currentColor; }

/* ドット＆ボックス */
.dab { width: 100%; max-width: 400px; }
.dab .dotp { fill: var(--chalk); }
.dab .hit { stroke: transparent; stroke-width: 34; stroke-linecap: round; }
.dab .vis { stroke: var(--line); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 2 12; }
.dab .edge.on .vis { stroke: var(--chalk); stroke-dasharray: none; stroke-width: 8; }
.dab .edge.last .vis { stroke: var(--ac); }
.dab .edge.hinte .vis { stroke: var(--ac); stroke-dasharray: 8 8; }
.dab.live .edge:not(.on) { cursor: pointer; }
.box.o0 { fill: rgba(247, 168, 194, .28); } .box.o1 { fill: rgba(147, 211, 242, .28); }
.boxt { font: 600 30px var(--hand); fill: var(--chalk); text-anchor: middle; }

/* シム */
.simsvg { width: 100%; max-width: 340px; }
.sim { stroke-width: 7; stroke-linecap: round; }
.sim.free { stroke: var(--line); stroke-width: 3; stroke-dasharray: 3 9; }
.sim.o0 { stroke: var(--p0); } .sim.o1 { stroke: var(--p1); }
.sim.last { stroke-width: 11; }
.sim.bad { stroke: var(--bad); stroke-width: 12; }
.sim.hinte { stroke: var(--ac); stroke-dasharray: 10 8; stroke-width: 5; }
.vtx .vhit { fill: transparent; }
.vtx .vdot { fill: var(--chalk); }
.vtx.sel .vdot { fill: var(--ac); r: 17; }
.simsvg.live .vtx { cursor: pointer; }

/* ドミノ */
.dgrid { display: grid; gap: 4px; width: 92%; }
.dcell { aspect-ratio: 1; border-radius: 6px; border: 2px dashed var(--line); background: rgba(0, 0, 0, .12); padding: 0; }
.dcell.sel { border: 3px solid var(--ac); background: rgba(244, 222, 134, .2); }
.dcell.hintc { border: 3px dashed var(--ac); }
.dom { z-index: 1; border-radius: 10px; display: flex; padding: 3px; pointer-events: none; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); }
.dom.o0 { background: var(--p0); } .dom.o1 { background: var(--p1); }
.dom i { flex: 1; border: 2px solid rgba(0, 0, 0, .18); border-radius: 7px; }
.dom.v { flex-direction: column; }
.dom.last { outline: 3px solid var(--ac); }

/* はしっこコイン */
.coins { display: grid; gap: 4px; width: 100%; max-width: 460px; }
.coin { aspect-ratio: 1; border-radius: 50%; border: 3px solid #b99a3e; background: radial-gradient(circle at 35% 30%, #fff3b8, #d9b34c); color: #3a2c08; padding: 0; display: grid; place-items: center; line-height: 1; position: relative; }
.coin b { color: inherit; font: 600 clamp(15px, 4.5vw, 20px) var(--hand); }
.coin small { position: absolute; bottom: -18px; left: 0; right: 0; font-size: 11px; color: var(--dim); }
.coin.o0, .coin.o1 { opacity: .35; background: none; color: var(--chalk); }
.coin.o0 { border-color: var(--p0); } .coin.o1 { border-color: var(--p1); }
.coin.end { box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); }
.coin.hintc { box-shadow: 0 0 0 4px var(--ac); }
.coin.last { opacity: .7; }
.coins + .sub { margin-top: 16px; }

@media (prefers-reduced-motion: no-preference) {
  .cell.last .mk, .cell.last .disc, .gc.last .go-stone, .dom.last { animation: pop .22s ease-out; }
  .sheet-r { animation: rise .28s ease-out; }
  .redpen path { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw .9s .15s ease-out forwards; }
  @keyframes pop { from { transform: scale(.4); opacity: 0; } }
  @keyframes rise { from { transform: translateY(40px); opacity: 0; } }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

/* 輪っかドミノ・円卓 */
.ringsvg { width: 100%; max-width: 330px; }
.rguide { fill: none; stroke: var(--line); stroke-width: .8; stroke-dasharray: 1.5 2.5; }
.rd { stroke-width: 6.5; stroke-linecap: round; }
.rd.o0 { stroke: var(--p0); } .rd.o1 { stroke: var(--p1); }
.rd.last { stroke-width: 8; }
.rhit, .shit { fill: transparent; }
.rdot { fill: var(--chalk); }
.rc.used .rdot { fill: rgba(0, 0, 0, .3); }
.rc.dead .rdot { fill: var(--line); }
.rc.sel .rdot { fill: var(--ac); r: 6.5; }
.rc.hintc .rdot { fill: var(--ac); }
.ringsvg.live [data-c] { cursor: pointer; }
.tabletop { fill: #6b4527; stroke: #8b5b33; stroke-width: 2; }
.sring { fill: rgba(0, 0, 0, .18); stroke: var(--chalk); stroke-width: .9; stroke-dasharray: 2 1.6; }
.seat.has .sring { stroke-dasharray: none; stroke: var(--line); }
.seat.hintc .sring { stroke: var(--ac); stroke-width: 1.6; stroke-dasharray: none; }
.tcoin { stroke: rgba(0, 0, 0, .25); stroke-width: .6; }
.tcoin.o0 { fill: var(--p0); } .tcoin.o1 { fill: var(--p1); }
.seat.last .tcoin { stroke: var(--ac); stroke-width: 1.4; }
.tban { fill: var(--line); }

.seat:not(.ban):not(.has) .sring { stroke-dasharray: none; stroke-width: 1.3; }
.seat.ban .sring { opacity: .45; }
.acts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* タイトルを1画面に収める */
.hero { padding: 8px 10px 24px; margin-bottom: 16px; }
.title-svg { max-height: 15dvh; }
.demo { margin-top: 2px; padding-top: 4px; }
.demo-cap { font-size: 14px; }
.demo-stage { zoom: 1; height: clamp(100px, 18dvh, 176px); min-height: 0; overflow: hidden; display: grid; place-items: center; }
#demo-board { width: 340px; }
.demo-status { min-height: 22px; font-size: 15px; margin: 0; }
.menu { gap: 14px; padding-top: 4px; }
.menu .card { padding: 12px 14px 12px; }
.menu .card p { margin: 4px 0 10px; font-size: 15px; line-height: 1.55; }
.big-card h2 { font-size: 28px; }
.menu .btn { min-height: 48px; }
.row-card { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.row-card h3 { font-size: 20px; }
.row-card p.small { margin: 2px 0 6px; font-size: 13px; }
.row-card .btn { width: auto; padding: 0 18px; min-height: 46px; }
.menu-foot { display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; }
.menu-foot .toggle { min-height: 40px; padding: 0 12px; font-size: 13px; }
.lockrow .card.locked { padding: 10px 12px; }
.card.locked p { margin: 2px 0 0; }
.nowrap { white-space: nowrap; }
@media (max-height: 700px) { .title-svg { max-height: 11dvh; } .demo-stage { height: 17dvh; } .menu .card p { font-size: 14px; line-height: 1.45; } .hero { margin-bottom: 12px; } }
#demo-board .sub, #demo-board .symbar { display: none; }
#study-list > .toggle { width: 100%; margin-top: 12px; }
@media (max-height: 700px) {
  #app { padding-bottom: 10px; }
  .menu { gap: 12px; }
  .menu .card { padding: 10px 12px; }
  .menu .card p { margin: 2px 0 8px; font-size: 13.5px; }
  .big-card h2 { font-size: 24px; }
  .menu .btn { min-height: 44px; }
  .title-svg { max-height: 10dvh; }
  .hero { padding-bottom: 20px; }
}

.lvl { display: inline-block; font: 700 12px 'Zen Maru Gothic', sans-serif; font-style: normal; color: #fff; background: #5b4a8a; border-radius: 4px; padding: 1px 6px; vertical-align: 2px; margin-left: 6px; }
.sitem .lvl { margin: 2px 0 0; align-self: flex-start; }
.note-adv { margin: 14px 0 0; color: var(--dim); font-size: 14px; text-align: center; }

/* ヘックス */
.hexsvg { width: 100%; max-width: 330px; }
.hx polygon { fill: rgba(0, 0, 0, .18); stroke: var(--chalk); stroke-width: 1.4; }
.hx.o0 polygon { fill: var(--p0); }
.hx.o1 polygon { fill: var(--p1); }
.hx.last polygon { stroke: var(--ac); stroke-width: 2.4; }
.hx.win polygon { stroke: var(--ac); stroke-width: 3; }
.hx.hintc polygon { stroke: var(--ac); stroke-width: 2.6; stroke-dasharray: 4 3; }
.hexsvg.live [data-c] { cursor: pointer; }
.hedge { stroke-width: 5; stroke-linecap: round; }
.hedge.e0 { stroke: var(--p0); } .hedge.e1 { stroke: var(--p1); }
/* ユークリッド・フィボナッチ */
.pair { display: flex; align-items: baseline; gap: 14px; }
.pair b { font: 600 60px/1 var(--hand); color: var(--chalk); }
.pair span { color: var(--dim); }
.stepper { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 10px; width: 100%; max-width: 300px; }
.stepper b { text-align: center; font: 600 30px var(--hand); color: var(--chalk); }
.stepper b.good { color: var(--ac); }
.pebble.take { background: radial-gradient(circle at 35% 30%, #fff, var(--bad)); }
.sub .lim { color: var(--ac); }

.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 2px; }
.sheet-q .tags { margin-left: 6px; vertical-align: 1px; }
.tg { font: 700 11px 'Zen Maru Gothic', sans-serif; font-style: normal; border-radius: 4px; padding: 1px 6px; border: 1.5px solid; white-space: nowrap; }
.tg.r1 { color: #3a7d5c; border-color: #3a7d5c; }
.tg.r2 { color: #9a6a12; border-color: #9a6a12; }
.tg.d1 { color: #fff; background: #3a7d5c; border-color: #3a7d5c; }
.tg.d2 { color: #fff; background: #c07a12; border-color: #c07a12; }
.tg.d3 { color: #fff; background: #5b4a8a; border-color: #5b4a8a; }

/* ================= 音・会話ボタン ================= */
.snd { position: fixed; z-index: 30; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .35); background: rgba(0, 0, 0, .35); padding: 8px; display: grid; place-items: center; }
.snd svg { width: 22px; height: 22px; fill: var(--chalk); stroke: none; }
.snd svg .w { fill: none; stroke: var(--chalk); stroke-width: 2; stroke-linecap: round; }
.snd.off { opacity: .6; }
.bar { padding-right: 46px; }
.bar-r { display: inline-flex; align-items: center; gap: 6px; }
.talk { min-height: 30px; padding: 0 9px; border-radius: 99px; border: 1px solid var(--line); background: none; color: var(--dim); font-size: 12px; }
.talk.off { opacity: .55; }
.hero .title-svg { margin-top: 2px; }

/* ================= 先生・春海 ================= */
.teacher { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: end; margin-bottom: 10px; }
.t-face { width: 76px; height: 76px; border-radius: 50%; background: rgba(0, 0, 0, .22); border: 2px solid var(--line); overflow: hidden; }
.hface { width: 100%; height: 100%; fill: none; stroke: var(--chalk); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; filter: url(#chalk); }
.hface .hair { fill: rgba(242, 240, 231, .85); }
.t-bubble { position: relative; padding: 12px 14px; font-size: 15px; margin-bottom: 6px; }
.t-bubble::before { content: ''; position: absolute; left: -9px; bottom: 16px; border: 9px solid transparent; border-right-color: var(--paper); border-left: 0; }
.who { display: block; font: 600 13px var(--hand); color: var(--red) !important; }
.teacher.big { grid-template-columns: 96px 1fr; margin-top: 18px; margin-bottom: -6px; }
.teacher.big .t-face { width: 96px; height: 96px; }
.t-name { margin: 0 0 10px; font: 600 26px var(--hand); }
.t-name small { display: block; font: 500 13px 'Zen Maru Gothic', sans-serif; color: var(--dim); }
.hint-box { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: start; }
.hb-face { width: 44px; height: 44px; border-radius: 50%; background: #23413a; overflow: hidden; }
.hb-face .hface { filter: none; }
.hint-box .kicker { margin: 0 0 2px; font-weight: 700; color: var(--red) !important; }
.hsay { background: #fff7d1; border-radius: 6px; padding: 8px 12px; }

/* ================= タイトルの招待状カード ================= */
.invite-card { position: relative; color: #efe6d8; background: linear-gradient(160deg, #1a1414, #0d0a0a); border: 1px solid #6e5631; border-radius: 6px; box-shadow: 0 10px 24px rgba(0, 0, 0, .45), inset 0 0 0 4px #0d0a0a, inset 0 0 0 5px rgba(216, 180, 106, .35); overflow: hidden; }
.invite-card h2 { color: #efe6d8; font-family: 'Zen Kaku Gothic New', sans-serif; font-weight: 800; }
.invite-card .kicker { color: #d8b46a; }
.invite-card b { color: #e05a4a; }
.invite-card .small { color: #b9ab98; }
.ic-env { position: absolute; right: -10px; top: 6px; width: 112px; transform: rotate(8deg); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); pointer-events: none; }
.invite-card .btn { position: relative; z-index: 1; }
.invite-card .kicker, .invite-card h2 { padding-right: 96px; position: relative; z-index: 1; }
.invite-card p { position: relative; z-index: 1; }
.invite-card .btn.pri { background: #8e1c17; border-color: #4a0e0b; box-shadow: 0 4px 0 #4a0e0b; }

/* ================= 招待状の演出 ================= */
.invite { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(5, 3, 3, .82) url(../img/venue.webp) center / cover; background-blend-mode: multiply; }
.invite-in { width: min(100%, 460px); display: grid; justify-items: center; gap: 14px; }
.env { border: 0; background: none; padding: 0; width: 100%; transition: transform .45s ease, opacity .45s ease; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .7)); }
.env img { width: 100%; display: block; }
.invite.opened .env { transform: translateY(-30px) scale(.55); opacity: .0; height: 0; }
.env-tap { margin: 0; color: #d8b46a; font: 700 15px 'Zen Kaku Gothic New', sans-serif; letter-spacing: .06em; animation: blink 1.8s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
.letter { width: 100%; color: #efe6d8; background: linear-gradient(170deg, #1d1616, #0e0b0b); border: 1px solid #6e5631; box-shadow: inset 0 0 0 5px #0e0b0b, inset 0 0 0 6px rgba(216, 180, 106, .4), 0 20px 40px rgba(0, 0, 0, .6); padding: 26px 22px 20px; border-radius: 4px; animation: rise .45s ease-out; }
.letter .l-kicker { margin: 0; text-align: center; color: #d8b46a; letter-spacing: .12em; font: 700 13px 'Zen Kaku Gothic New', sans-serif; }
.letter h2 { text-align: center; font: 800 28px/1.3 'Zen Kaku Gothic New', sans-serif; margin: 6px 0 14px; }
.letter p { margin: 0 0 10px; font-size: 15px; line-height: 1.75; }
.letter b { color: #e05a4a; }
.letter .btn { margin-top: 10px; }
.btn.ghost { background: transparent; color: #b9ab98; border: 1px solid #5c4a3a; box-shadow: none; }

/* ================= 会場（うでだめし） ================= */
body.venue {
  --chalk: #efe6d8; --dim: #b4a593; --line: rgba(239, 230, 216, .2); --ac: #d8b46a; --bad: #ff7f6e;
  --hand: 'Zen Kaku Gothic New', sans-serif;
  background: #0b0707;
}
body.venue::before { content: ''; position: fixed; inset: 0; z-index: -1; background: linear-gradient(rgba(8, 5, 5, .35), rgba(8, 5, 5, .55)), url(../img/venue.webp) center top / cover; }
body.venue .bar-t { font-family: 'Zen Kaku Gothic New', sans-serif; letter-spacing: .08em; }
.dealer { display: grid; grid-template-columns: 118px 1fr; align-items: end; gap: 6px; margin: -4px 0 0; }
.dealer img { width: 118px; height: 150px; object-fit: cover; object-position: 50% 0; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .6)); -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.dealer-line { position: relative; margin: 0 0 18px; min-height: 48px; padding: 11px 14px; border-radius: 4px; background: rgba(12, 8, 8, .85); border: 1px solid rgba(216, 180, 106, .55); font: 600 16px/1.5 'Zen Kaku Gothic New', sans-serif; color: #efe6d8; }
.dealer-line::before { content: ''; position: absolute; left: -8px; bottom: 14px; border: 8px solid transparent; border-right-color: rgba(216, 180, 106, .55); border-left: 0; }
.dealer.quiet .dealer-line { visibility: hidden; }
body.venue .sheet-q { background: rgba(14, 9, 9, .88); color: #efe6d8; border: 1px solid rgba(216, 180, 106, .45); box-shadow: inset 0 0 0 4px rgba(14, 9, 9, .9), inset 0 0 0 5px rgba(216, 180, 106, .25), 0 10px 24px rgba(0, 0, 0, .5); margin-top: 0; }
body.venue .sheet-q .magnet { display: none; }
body.venue .sheet-q h2 { color: #efe6d8; font: 800 30px/1.2 'Zen Kaku Gothic New', sans-serif; }
body.venue .sheet-q .kicker, body.venue .catch, body.venue .rules summary { color: #b4a593; }
body.venue .sheet-q b, body.venue .variant b { color: #ec6a58; }
body.venue .rules { border-top-color: rgba(216, 180, 106, .3); }
body.venue .tg.r1 { color: #8fd1ae; border-color: #8fd1ae; }
body.venue .tg.r2 { color: #e2b25a; border-color: #e2b25a; }
body.venue .blackboard.play { border: 1px solid rgba(216, 180, 106, .6); border-image: none; border-radius: 22px; background: radial-gradient(120% 90% at 50% 20%, #1c1a19, #0b0a0a 75%); box-shadow: inset 0 0 0 6px #120d0b, inset 0 0 0 7px rgba(216, 180, 106, .35), inset 0 0 50px rgba(0, 0, 0, .6), 0 16px 30px rgba(0, 0, 0, .6); }
body.venue .status { font-family: 'Zen Kaku Gothic New', sans-serif; letter-spacing: .04em; }
body.venue .g3 .mk, body.venue .tally .sei { filter: none; }
body.venue .ask { font: 800 20px 'Zen Kaku Gothic New', sans-serif; letter-spacing: .1em; color: #d8b46a; }
body.venue .act.go { background: #efe6d8; border-color: #efe6d8; }
body.venue .tool { border-color: var(--line); }

/* 宣言カード */
body.venue .sides { gap: 18px; perspective: 800px; }
body.venue .side { min-height: 0; aspect-ratio: 2 / 3; max-height: 190px; justify-self: center; width: 100%; max-width: 126px; padding: 0; border-radius: 10px; background: #0b0606 url(../img/cardback.webp) center / cover; box-shadow: 0 10px 18px rgba(0, 0, 0, .6); display: grid; place-items: end center; transition: transform .2s; }
body.venue .side .mag { display: none; }
body.venue .side b { margin-bottom: 14px; padding: 4px 14px; border-radius: 4px; background: rgba(10, 6, 6, .85); border: 1px solid rgba(216, 180, 106, .6); font: 800 22px/1.2 'Zen Kaku Gothic New', sans-serif; color: #efe6d8 !important; }
body.venue .side small { display: none; }
body.venue .side.flip { animation: flipcard .6s ease-in-out forwards; }
body.venue .side.chosen { box-shadow: 0 0 0 2px #d8b46a, 0 0 26px rgba(216, 180, 106, .55); }
@keyframes flipcard { 0% { transform: rotateY(0); } 50% { transform: rotateY(90deg); } 51% { background: #efe6d8; } 100% { transform: rotateY(0); background: #efe6d8; } }
body.venue .side.flip b { color: #8e1c17 !important; background: transparent; border-color: transparent; font-size: 30px; }

/* チップの山（連勝数） */
.chipstack { display: inline-flex; align-items: flex-end; gap: 6px; }
.chipstack .stack { position: relative; width: 26px; height: 26px; }
.chipstack .stack i { position: absolute; left: 0; width: 26px; height: 9px; border-radius: 50%; background: repeating-linear-gradient(90deg, #8e1c17 0 5px, #efe6d8 5px 7px); box-shadow: 0 1px 0 #3a0b08; }
.chipstack b { font: 800 18px/1 'Zen Kaku Gothic New', sans-serif; color: #efe6d8; }
.chipstack small { font-size: 11px; color: #b4a593; }

/* 会場の結果画面 */
.venue-m { background: rgba(5, 3, 3, .78); }
.venue-m .sheet-r { color: #efe6d8; background: linear-gradient(170deg, #1d1616, #0e0b0b); border: 1px solid #6e5631; box-shadow: inset 0 0 0 5px #0e0b0b, inset 0 0 0 6px rgba(216, 180, 106, .35), 0 -10px 40px rgba(0, 0, 0, .6); border-radius: 6px; }
.venue-m .kicker { color: #b4a593 !important; }
.venue-m h2 { font: 800 46px/1.1 'Zen Kaku Gothic New', sans-serif !important; letter-spacing: .1em; }
.venue-m h2.win { color: #d8b46a !important; }
.venue-m h2.lose { color: #e05a4a !important; }
.venue-m b { color: #ec6a58; }
.venue-m .quote { font: 600 16px/1.6 'Zen Kaku Gothic New', sans-serif; color: #efe6d8; border-left: 2px solid #d8b46a; padding-left: 10px; }
.venue-m .big-n { font: 800 54px/1 'Zen Kaku Gothic New', sans-serif; color: #efe6d8; margin: 4px 0 10px; }
.venue-m .big-n small { font-size: 16px; color: #b4a593; margin-left: 6px; }
.venue-m .m-mark { width: 84px; height: 84px; display: grid; place-items: center; }
.venue-m .m-mark .chipstack { transform: scale(1.5); }
.venue-m .m-mark .chipstack b, .venue-m .m-mark .chipstack small { display: none; }
.seal { display: grid; place-items: center; width: 78px; height: 78px; border: 3px solid #c0392b; border-radius: 50%; color: #c0392b; font: 800 20px 'Zen Kaku Gothic New', sans-serif; transform: rotate(-14deg); box-shadow: inset 0 0 0 3px rgba(192, 57, 43, .3); }
.venue-m .btn { background: #efe6d8; color: #1a1414; border-color: #efe6d8; box-shadow: 0 3px 0 #6e5631; }
.venue-m .btn.pri { background: #8e1c17; color: #fff; border-color: #4a0e0b; box-shadow: 0 4px 0 #4a0e0b; }
.venue-m .gotmotto { background: rgba(216, 180, 106, .1); }
.venue-m .gotmotto .motto, .venue-m .motto { color: #d8b46a; border-left-color: #d8b46a; }
.venue-m .hint-box { background: rgba(216, 180, 106, .1); color: #efe6d8; }
.venue-m .hint-box .kicker { color: #d8b46a !important; }
.venue-m .newrec { background: #8e1c17; }
@media (prefers-reduced-motion: no-preference) {
  .dealer-line.in { animation: linein .35s ease-out; }
  @keyframes linein { from { opacity: 0; transform: translateY(6px); } }
}
.hint-box.plain { display: block; }
.t-game { fill: var(--ac) !important; letter-spacing: .04em; }

.hface-img { width: 100%; height: 100%; object-fit: cover; display: block; background: #f6f3ea; }
.t-face { border-color: rgba(242, 240, 231, .55); }
.t-bust { width: 118px; height: 148px; border-radius: 10px; overflow: hidden; background: #f6f3ea; border: 3px solid rgba(242, 240, 231, .7); box-shadow: 0 8px 16px rgba(0, 0, 0, .35); }
.t-bust img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; display: block; }
.teacher.big { grid-template-columns: 118px 1fr; }
.note h2 { font-size: 28px; word-break: keep-all; }

/* タイトルロゴ（会場の見た目） */
.tagline { margin: 0; text-align: center; font: 600 15px 'Zen Kaku Gothic New', sans-serif; letter-spacing: .3em; color: #d8b46a; }
.logo-h { margin: 2px 0 0; line-height: 0; }
.logo { display: block; margin: 0 auto; width: auto; max-width: 84%; max-height: 17dvh; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .7)); }
body.venue .blackboard.hero { border: 1px solid rgba(216, 180, 106, .6); border-image: none; border-radius: 22px; background: radial-gradient(120% 90% at 50% 15%, rgba(40, 30, 26, .92), rgba(10, 8, 8, .94) 75%); box-shadow: inset 0 0 0 6px #120d0b, inset 0 0 0 7px rgba(216, 180, 106, .35), 0 16px 30px rgba(0, 0, 0, .6); padding-bottom: 12px; }
body.venue .hero .tray { display: none; }
body.venue .demo { border-top-color: rgba(216, 180, 106, .25); }
body.venue .demo-cap, body.venue .demo-status { font-family: 'Zen Kaku Gothic New', sans-serif; }
@media (max-height: 700px) { .logo { max-height: 14dvh; } }
body.venue .hero { padding-top: 6px; }
body.venue .hero .demo { margin-top: 0; }
@media (max-height: 700px) { .logo { max-height: 12.5dvh; } .demo-stage { height: 15dvh; } body.venue .hero { padding-bottom: 6px; } }

/* タイトルをシンプルに */
.logo { max-height: 24dvh !important; max-width: 88%; }
@media (max-height: 700px) { .logo { max-height: 20dvh !important; } }
body.venue .hero { padding: 16px 12px 14px; }
body.venue .hero .demo { border-top: 0; padding-top: 6px; }
.demo-stage { height: clamp(120px, 24dvh, 220px) !important; }
.invite-card h2 { margin: 2px 0 12px; }

/* 導入 */
.prologue { position: absolute; inset: 0; display: grid; align-content: center; gap: 22px; padding: 40px 28px; background: rgba(4, 2, 2, .78); cursor: pointer; }
.prologue p { margin: 0; color: #efe6d8; font: 600 18px/1.8 'Zen Kaku Gothic New', sans-serif; letter-spacing: .04em; opacity: 0; transform: translateY(8px); transition: opacity 1.2s ease, transform 1.2s ease; }
.prologue p.in { opacity: 1; transform: none; }
.pl-skip { position: absolute; bottom: max(24px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #8a7d6c; font: 500 13px 'Zen Kaku Gothic New', sans-serif; letter-spacing: .06em; }
.letter .l-lead { font: 700 17px/1.9 'Zen Kaku Gothic New', sans-serif; text-align: center; margin: 4px 0 16px; padding: 10px 0 14px; border-bottom: 1px solid rgba(216, 180, 106, .3); }
.letter .l-lead b { color: #d8b46a; }
.invite { overflow-y: auto; }

.dealer-line.more { cursor: pointer; padding-bottom: 22px; }
.dealer-line.more::after { content: 'タップで次へ ▾'; position: absolute; right: 10px; bottom: 4px; font: 600 11px 'Zen Maru Gothic', sans-serif; color: #d8b46a; letter-spacing: .05em; animation: blink 1.6s ease-in-out infinite; }


/* =====================================================================
   会場の素材（駒・盤・卓）と書体の見直し
   - 書体はゴシック（Zen Kaku Gothic New）に統一。字間は詰め気味
   - 枠の二重線・金のヘアライン・角丸カードをやめ、物の質感で見せる
   - 先攻＝朱の漆、後攻＝象牙。盤はランプに照らされた黒いラシャ
   ===================================================================== */
body.venue {
  --p0: #d8434b; --p1: #ebe2cf; --chalk: #ebe2cf; --ac: #c9a45a; --line: rgba(235, 226, 207, .16);
  --hand: 'Zen Kaku Gothic New', sans-serif;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.venue h1, body.venue h2, body.venue h3 { font-family: 'Zen Kaku Gothic New', sans-serif; font-weight: 900; letter-spacing: .01em; }

/* 卓：黒いラシャ＋木の縁 */
body.venue .blackboard.play, .baize {
  border: 0; border-image: none; border-radius: 6px;
  background: radial-gradient(ellipse 75% 55% at 50% 38%, rgba(255, 236, 205, .09), transparent 72%), var(--noise), #191514;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .7), inset 0 0 36px rgba(0, 0, 0, .65), 0 0 0 5px #2b1a11, 0 0 0 6px #120a06, 0 16px 28px rgba(0, 0, 0, .6);
}
body.venue .sheet-q { box-shadow: 0 10px 24px rgba(0, 0, 0, .5); border: 1px solid rgba(235, 226, 207, .14); border-radius: 4px; background: rgba(16, 12, 11, .92); }
body.venue .sheet-q h2 { font: 900 28px/1.2 'Zen Kaku Gothic New', sans-serif; }
.dealer-line { border-radius: 2px; border-color: rgba(235, 226, 207, .22); background: rgba(14, 11, 10, .92); font-weight: 500; }
.dealer-line::before { border-right-color: rgba(235, 226, 207, .22); }
.venue-m .sheet-r { box-shadow: 0 -10px 40px rgba(0, 0, 0, .6); border: 1px solid rgba(235, 226, 207, .14); }
.venue-m h2 { letter-spacing: .02em; }
.venue-m h2.win { font-size: 30px !important; line-height: 1.3 !important; }
body.venue .ask { letter-spacing: .02em; font-weight: 900; }
body.venue .side b { font-weight: 900; border-color: rgba(235, 226, 207, .3); }
body.venue .act { border: 1px solid rgba(235, 226, 207, .35); border-radius: 3px; background: rgba(0, 0, 0, .3); font-weight: 700; }
body.venue .act.go { background: #ebe2cf; color: #191514; border-color: #ebe2cf; }

/* まるばつの線と記号 */
body.venue .g3 .cell { box-shadow: inset -2px 0 0 rgba(235, 226, 207, .4), inset 0 -2px 0 rgba(235, 226, 207, .4); }
body.venue .g3 .cell:nth-child(3n) { box-shadow: inset 0 -2px 0 rgba(235, 226, 207, .4); }
body.venue .g3 .cell:nth-child(7), body.venue .g3 .cell:nth-child(8) { box-shadow: inset -2px 0 0 rgba(235, 226, 207, .4); }
body.venue .g3 .cell:nth-child(9) { box-shadow: none; }
body.venue .mk { stroke-width: 8; filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, .7)) !important; }
body.venue .cw { color: #ebe2cf; }
body.venue .cell.last::after { background: rgba(201, 164, 90, .12); }
body.venue .cell.winl { background: rgba(201, 164, 90, .18); }
body.venue .cell.losel { background: rgba(179, 34, 43, .3); }
body.venue .symbtn { border: 1px solid rgba(235, 226, 207, .3); border-radius: 3px; }

/* チップ（DOMの丸駒）：縁に差し色の入ったカジノチップ */
body.venue .go-stone, body.venue .candy, body.venue .chips .f0, body.venue .chips .f1 {
  --c: #b3222b; --e: #f1e9d8; --d: #5e0c12;
  border: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 255, 255, .38), transparent 38%),
    radial-gradient(circle, var(--c) 0 44%, var(--e) 45% 48%, var(--c) 49% 64%, transparent 65%),
    repeating-conic-gradient(var(--c) 0 22.5deg, var(--e) 22.5deg 45deg);
  box-shadow: 0 2px 0 var(--d), 0 4px 6px rgba(0, 0, 0, .55);
}
body.venue .go-stone.w, body.venue .heap:nth-child(2) .candy, body.venue .chips .f1 { --c: #e8dec8; --e: #2a2320; --d: #8a7f69; }
body.venue .chips .f0, body.venue .chips .f1 { color: transparent; }
body.venue .gc.last .go-stone { box-shadow: 0 2px 0 var(--d), 0 4px 6px rgba(0, 0, 0, .55), 0 0 0 3px rgba(201, 164, 90, .8); }
body.venue .candy { width: 22px; height: 22px; }

/* 碁盤・王様の盤 */
body.venue .ggrid, body.venue .kgrid { border: 1px solid rgba(235, 226, 207, .35); background: rgba(0, 0, 0, .18); }
body.venue .gc, body.venue .kc { box-shadow: inset 0 0 0 .5px rgba(235, 226, 207, .14); }
body.venue .gc.ban::after, body.venue .kc.trail::after { background: rgba(235, 226, 207, .16); }
body.venue .kc.alt { background: rgba(0, 0, 0, .2); }
body.venue .kc.goal { background: rgba(179, 34, 43, .32); }
body.venue .kc.goal span { color: #f0c2c4; font-weight: 700; }
body.venue .kc.can { background: rgba(201, 164, 90, .16); box-shadow: inset 0 0 0 1.5px var(--ac); }
body.venue .crown { fill: url(#gBrass); stroke: #4d3817; stroke-width: 1.6; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .7)); }
body.venue .crown .base { stroke: #c39b4e; stroke-width: 4; }

/* 石取り・小石：象牙の玉 */
body.venue .stone, body.venue .pebble {
  background: radial-gradient(circle at 34% 28%, #fff 0, #efe7d6 22%, #c8bca2 62%, #7d725d 100%);
  box-shadow: 0 3px 4px rgba(0, 0, 0, .6), inset 0 -2px 3px rgba(0, 0, 0, .25);
}
body.venue .stone.sel, body.venue .pebble.take { background: radial-gradient(circle at 34% 28%, #ff9ea2 0, #d8434b 35%, #6e0f15 100%); }
body.venue .pile.lastrow { background: rgba(201, 164, 90, .08); }

/* わけっこの山 */
body.venue .heap { border: 1px solid rgba(235, 226, 207, .14); border-radius: 4px; background: rgba(0, 0, 0, .22); }
body.venue .heap.sel { border: 1.5px solid var(--ac); }

/* チョコ */
body.venue .choc, body.venue .piece span { background: linear-gradient(150deg, #6b4029 0%, #48291a 55%, #2f1a10 100%); box-shadow: inset 1.5px 1.5px 0 rgba(255, 220, 190, .18), inset -2px -2px 0 rgba(0, 0, 0, .45), 0 2px 3px rgba(0, 0, 0, .5); border-radius: 3px; }
body.venue .choc.poison { background: linear-gradient(150deg, #3a1214, #1c0809); }
body.venue .choc.poison span { color: #e0474f; font-weight: 900; }
body.venue .choc.sel, body.venue .piece span.on { background: linear-gradient(150deg, #d8434b, #7d121a); }
body.venue .piece { background: #1f120b; border-radius: 3px; }

/* ボウリングピン */
body.venue .pinsvg path { fill: url(#gPin); }
body.venue .pinsvg { filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .6)); }
body.venue .pinsvg .band { stroke: #b3222b; fill: none; }
body.venue .pin.sel .pinsvg path:first-child { fill: url(#gBrass); }

/* ドミノ */
body.venue .dcell { border: 0; border-radius: 3px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(235, 226, 207, .08); }
body.venue .dcell.sel { box-shadow: inset 0 0 0 2px var(--ac); background: rgba(201, 164, 90, .14); }
body.venue .dom { border-radius: 5px; padding: 4px; box-shadow: 0 3px 0 rgba(0, 0, 0, .45), 0 7px 10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .35); }
body.venue .dom.o0 { background: linear-gradient(160deg, #d9484f, #a01d26 55%, #6a0e15); }
body.venue .dom.o1 { background: linear-gradient(160deg, #fffaf0, #e3d8bf 55%, #b4a78b); }
body.venue .dom i { border: 0; border-radius: 3px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35); }
body.venue .dom.last { outline: 2px solid var(--ac); outline-offset: 2px; }

/* はしっこコイン */
body.venue .coin { border: 2px solid #5e4520; background: radial-gradient(circle at 34% 28%, #fff4c4 0, #e2bd5c 34%, #a5802f 78%, #6e5426 100%); box-shadow: inset 0 0 0 3px rgba(255, 238, 180, .35), 0 3px 4px rgba(0, 0, 0, .55); color: #2e2206; }
body.venue .coin b { font-weight: 900; }
body.venue .coin.o0, body.venue .coin.o1 { background: rgba(0, 0, 0, .25); box-shadow: none; color: rgba(235, 226, 207, .7); }

/* SVGの盤（輪っか・円卓・ヘックス） */
body.venue .rguide { stroke: rgba(235, 226, 207, .2); }
body.venue .rd { filter: url(#sh); stroke-width: 7; }
body.venue .rd.o0 { stroke: #b3222b; } body.venue .rd.o1 { stroke: #e8dec8; }
body.venue .rdot { fill: url(#gBrass); }
body.venue .rc.used .rdot { fill: none; }
body.venue .rc.dead .rdot { fill: rgba(235, 226, 207, .14); }
body.venue .tabletop { fill: url(#gWood); stroke: #6e5426; stroke-width: .8; }
body.venue .sring { fill: rgba(0, 0, 0, .3); stroke: rgba(235, 226, 207, .45); }
body.venue .tcoin { stroke: rgba(0, 0, 0, .45); stroke-width: .5; filter: url(#sh); }
body.venue .tcoin.o0 { fill: url(#gR); } body.venue .tcoin.o1 { fill: url(#gI); }
body.venue .hx polygon { fill: rgba(0, 0, 0, .3); stroke: rgba(235, 226, 207, .3); stroke-width: 1; }
body.venue .hx.o0 polygon { fill: url(#gR); } body.venue .hx.o1 polygon { fill: url(#gI); }
body.venue .hedge.e0 { stroke: #b3222b; } body.venue .hedge.e1 { stroke: #e8dec8; }

/* ===== タイトル ===== */
body.on-title { background: #070505; }
body.on-title::before { background: radial-gradient(80% 40% at 50% -4%, rgba(255, 232, 196, .14), transparent 70%), var(--noise), #070505; }
.tt {
  height: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(28px, env(safe-area-inset-bottom)));
  min-height: 560px; display: flex; flex-direction: column;
}
.tt .logo-h { margin: 2px 0 0; }
.tt .logo { max-height: 20dvh !important; max-width: 80% !important; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .85)); }
.tt-demo { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 6px 4px 0; }
.td-name { margin: 0 0 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; color: #a89e8c; font-size: 13.5px; line-height: 1.5; }
.td-name b { color: #ebe2cf; font-size: 17px; font-weight: 900; letter-spacing: .01em; }
.tt .demo-stage { flex: 1; min-height: 0; height: auto !important; display: grid; place-items: center; overflow: hidden; pointer-events: none; zoom: 1; padding: 10px; }
.tt .demo-stage .board-wrap { width: 100%; }
.td-foot { margin: 10px 0 0; min-height: 21px; font-size: 13.5px; color: #a89e8c; }
.td-foot .c0 { color: #e0545b; } .td-foot .c1 { color: #ebe2cf; }
.td-win { color: #ebe2cf; font-weight: 900; font-size: 15px; }

.tt-menu { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 16px; }
.tm { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 0 16px; min-height: 58px;
  border: 1px solid rgba(235, 226, 207, .2); border-radius: 3px; background: #14100f; color: #ebe2cf; overflow: hidden; }
.tm:active { transform: translateY(1px); }
.tm-t { font-size: 20px; font-weight: 900; letter-spacing: .02em; }
.tm-s { margin-left: auto; font-size: 13px; color: #a89e8c; white-space: nowrap; }
.tm-s em { font-style: normal; font-size: 18px; font-weight: 900; color: #ebe2cf; margin: 0 1px; }
.tm-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(235, 226, 207, .08); }
.tm-bar i { display: block; height: 100%; background: #c9a45a; }
.tm.pri { min-height: 74px; border: 0; background: #a3161f; box-shadow: inset 0 1px 0 rgba(255, 200, 190, .25), 0 4px 0 #4a080c; }
.tm.pri .tm-t { font-size: 27px; color: #fff; }
.tm.pri .tm-s { color: rgba(255, 228, 220, .8); }
.tm.pri .tm-s em { color: #fff; font-size: 22px; }
.tm-env { position: absolute; right: -10px; top: 50%; width: 132px; transform: translateY(-50%) rotate(-9deg); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .55)); pointer-events: none; }
@media (max-height: 700px) {
  .tt .logo { max-height: 16dvh !important; }
  .tm { min-height: 50px; } .tm.pri { min-height: 64px; } .tm.pri .tm-t { font-size: 24px; }
  .tt-menu { margin-top: 12px; }
}
.cn0, .cn1 { font-style: normal; }
.cn0::before { content: 'ピンク'; } .cn1::before { content: '水色'; }
body.venue .cn0::before { content: '赤'; } body.venue .cn1::before { content: '白'; }
body.venue .chips span { border: 1px solid rgba(235, 226, 207, .12); }
body.venue .chips .doom { border: 1.5px solid #d8434b; color: #e0545b; }
body.venue .tag { border-radius: 3px; border-width: 1px; }
body.venue .tg { border-radius: 2px; border-width: 1px; font-family: 'Zen Kaku Gothic New', sans-serif; }
body.venue .tg.r1, body.venue .tg.r2 { color: #b9ae9a; border-color: rgba(235, 226, 207, .35); background: none; }
body.venue .tg.d1, body.venue .tg.d2, body.venue .tg.d3 { color: #191514; border-color: #c9a45a; background: #c9a45a; }
body.venue .tg.d3 { color: #fff; border-color: #a3161f; background: #a3161f; }

/* ===== ゲーム画面を1ページに収める ===== */
body.on-round #app { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
#s-round:not([hidden]) {
  display: flex; flex-direction: column;
  height: calc(100dvh - max(6px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)));
}
#s-round > * { flex: none; }
#s-round .bar { min-height: 40px; margin-bottom: 2px; }
#s-round .dealer { grid-template-columns: 62px 1fr; gap: 8px; margin: 0 0 6px; align-items: center; }
#s-round .dealer img { width: 62px; height: 70px; object-position: 50% 4%; -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent); }
#s-round .dealer-line { margin: 0; min-height: 0; padding: 9px 12px; font-size: 15px; line-height: 1.45; }
#s-round .dealer-line::before { bottom: auto; top: 50%; margin-top: -7px; border-width: 7px; left: -7px; }
#s-round .sheet-q { margin-top: 0; padding: 10px 14px 8px; max-height: 32dvh; overflow-y: auto; overscroll-behavior: contain; }
#s-round .sheet-q .kicker { margin: 0; line-height: 1; }
#s-round .sheet-q .tags { margin: 0 0 2px; }
#s-round .sheet-q h2 { font-size: 22px; line-height: 1.2; }
#s-round .catch { margin: 0 0 4px; font-size: 13px; }
#s-round .rules summary { min-height: 30px; font-size: 13px; }
#s-round .rules p { margin: 0 0 4px; font-size: 14px; line-height: 1.55; }
#s-round .variant { margin: 2px 0 0; font-size: 14px; }
#s-round .study-aid { margin-top: 6px; padding-top: 6px; }
#s-round .hint-row .chip { min-height: 34px; padding: 0 11px; font-size: 13px; }
#s-round .hint-box { font-size: 14px; }
#s-round .play { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; margin-top: 8px; padding: 8px 8px 10px; }
#s-round .status { min-height: 24px; margin: 0 0 4px; font-size: 16px; line-height: 1.4; }
.board-box { flex: 1 1 0; min-height: 40px; overflow: hidden; display: grid; place-items: center; }
.board-box > .board-wrap { width: 100%; }
#s-round .evalmsg { margin: 4px 0 0; min-height: 0; font-size: 14px; }
#s-round .evalmsg:empty { display: none; }
#s-round .choose { margin-top: 6px; }
#s-round .ask { margin: 0 0 6px; font-size: 16px; }
#s-round .side { min-height: 58px; padding: 8px 6px 6px; }
#s-round .side b { font-size: 24px; }
body.venue #s-round .sides { gap: 12px; }
body.venue #s-round .side { aspect-ratio: auto; height: 76px; max-height: none; max-width: none; border-radius: 4px; background-position: center 42%; place-items: center; padding: 0; }
body.venue #s-round .side b { margin: 0; font-size: 20px; padding: 3px 14px; }
body.venue #s-round .side.flip b { font-size: 24px; }
#s-round .tools { margin-top: 6px; gap: 6px; }
#s-round .tool { min-height: 36px; font-size: 13px; }
@media (max-height: 700px) {
  #s-round .dealer img { width: 52px; height: 58px; }
  #s-round .dealer { grid-template-columns: 52px 1fr; }
  #s-round .dealer-line { padding: 7px 10px; font-size: 14px; }
  #s-round .sheet-q { max-height: 30dvh; padding: 8px 12px 6px; }
  #s-round .sheet-q h2 { font-size: 20px; }
  body.venue #s-round .side { height: 62px; }
  #s-round .side { min-height: 50px; }
}

/* ===== 追加ゲーム ===== */
/* 紙切り */
.cutsvg { width: 100%; }
.paperrect { fill: #f3efe2; stroke: rgba(0, 0, 0, .25); stroke-width: 1; }
.cutl .chit { stroke: transparent; stroke-width: 22; }
.cutl .cvis { stroke: rgba(60, 50, 40, .35); stroke-width: 1.5; stroke-dasharray: 4 4; }
.cutsvg.live .cutl { cursor: pointer; }
.cutsvg.live .cutl .cvis { stroke: #c0392b; stroke-opacity: .55; stroke-width: 2.2; }
.cutl.hintc .cvis { stroke: var(--ac); stroke-width: 3.5; stroke-dasharray: none; stroke-opacity: 1; }
body.venue .paperrect { fill: url(#gI); stroke: #6f654f; filter: url(#sh); }
/* 数字消し */
.ntiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 360px; }
.ntile { aspect-ratio: 3 / 4; border-radius: 6px; border: 2px solid var(--chalk); background: rgba(0, 0, 0, .15); font: 700 24px var(--hand); color: var(--chalk); display: grid; place-items: center; padding: 0; }
.ntile.even { color: var(--p0); } .ntile.odd { color: var(--p1); }
.ntile.gone { opacity: .16; text-decoration: line-through; }
.ntile.last.gone { opacity: .4; }
.ntile.hintc { box-shadow: 0 0 0 3px var(--ac); }
body.venue .ntile { border: 0; border-radius: 4px; background: linear-gradient(160deg, #fffaf0, #e3d8bf 60%, #b9ad92); box-shadow: 0 3px 0 rgba(0, 0, 0, .45), 0 6px 8px rgba(0, 0, 0, .4); font-weight: 900; }
body.venue .ntile.even { color: #a3161f; } body.venue .ntile.odd { color: #2a2320; }
body.venue .ntile.gone { opacity: .12; box-shadow: none; }
/* 紙折り */
.fstrip { display: flex; height: 26px; border-radius: 2px; overflow: hidden; background: #f3efe2; box-shadow: 0 3px 6px rgba(0, 0, 0, .35); transition: width .3s; }
.fstrip i { flex: 1; border-right: 1px solid rgba(0, 0, 0, .18); }
.fstrip i:last-child { border-right: 0; }
body.venue .fstrip { background: linear-gradient(#fffaf0, #e3d8bf); }
/* カレンダー */
.cdate { display: flex; align-items: baseline; gap: 4px; color: var(--chalk); }
.cdate b { font: 900 54px/1 var(--hand); }
.cdate small { font-size: 18px; color: var(--dim); margin-right: 8px; }
.clab { margin: 4px 0 0; width: 100%; max-width: 420px; font-size: 13px; color: var(--dim); }
.cgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; width: 100%; max-width: 420px; }
.cday { min-height: 38px; border-radius: 6px; border: 1.5px solid var(--line); background: rgba(0, 0, 0, .15); color: var(--chalk); font: 700 15px var(--hand); padding: 0; }
.cday:not(:disabled) { border-color: var(--chalk); }
.cday:disabled { opacity: .5; }
.cday.hintc { border-color: var(--ac); box-shadow: 0 0 0 2px var(--ac); }
body.venue .cday { border-radius: 3px; border-width: 1px; }
/* ルーク並べ・ナイト */
.kc.rk.hit { background: rgba(0, 0, 0, .3); }
.kc.rk.hit::after { content: ''; position: absolute; inset: 42%; border-radius: 50%; background: var(--line); }
.kc.rk.o0 .crown { fill: var(--p0); } .kc.rk.o1 .crown { fill: var(--p1); }
.kc.rk.last { box-shadow: inset 0 0 0 2px var(--ac); }
body.venue .kc.rk.o0 .crown { fill: url(#gR); stroke: #3d070b; } body.venue .kc.rk.o1 .crown { fill: url(#gI); stroke: #5d5442; }
.crown .eye { fill: #1a1a1a; stroke: none; }
.paperghost { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 5 5; }
.cdate b { color: var(--chalk); }
#s-round .variant { margin: 0 0 2px; }
/* 1・3・4取り */
.heap134 { gap: 6px; max-width: 330px; }
.heap134 .pebble { width: 20px; height: 20px; }
/* コイン寄せ */
.slrow { display: grid; gap: 3px; width: 100%; max-width: 420px; }
.sl { aspect-ratio: 1; border: 0; border-radius: 4px; padding: 0; background: rgba(0, 0, 0, .2); box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; position: relative; }
.sl.can { box-shadow: inset 0 0 0 1.5px var(--ac); background: rgba(201, 164, 90, .1); }
.sl.hintc { box-shadow: inset 0 0 0 3px var(--ac); }
.scoin { display: block; width: 82%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 34% 28%, #fff4c4 0, #e2bd5c 34%, #a5802f 78%, #6e5426 100%); box-shadow: inset 0 0 0 2px rgba(255, 238, 180, .35), 0 2px 3px rgba(0, 0, 0, .5); }
.scoin.pb { background: radial-gradient(circle at 34% 28%, #fff 0, #dcdcd6 34%, #9a9a92 78%, #5d5d57 100%); }
.sl.last .scoin { box-shadow: 0 0 0 2px var(--ac), 0 2px 3px rgba(0, 0, 0, .5); }
/* Xでポスト */
.xpost { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 10px 0 4px; border-radius: 3px; background: #0f0f0f; color: #f2f2f2; border: 1px solid rgba(255, 255, 255, .28); font: 700 15px 'Zen Kaku Gothic New', sans-serif; text-decoration: none; }
.xpost::before { content: 'X'; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 3px; background: #f2f2f2; color: #0f0f0f; font: 900 14px/1 'Zen Kaku Gothic New', sans-serif; }
.xpost:active { transform: translateY(1px); }
.tt-menu .xpost { min-height: 34px; margin: 0; font-size: 13px; background: transparent; border-color: rgba(235, 226, 207, .16); color: #a89e8c; }
.tt-menu .xpost::before { width: 18px; height: 18px; font-size: 12px; background: #a89e8c; }
