/* Layout: a full-bleed 3D table scene; UI is cut-paper cards and marker type floating over it, pinned inside the safe area.
   One deliberate look (kraft cardboard + marker colors), so a single palette serves every host theme. */
:root {
  --kraft: #c9a06b;
  --kraft-deep: #8e6a40;
  --card: #fffdf7;
  --ink: #27221e;
  --ink-soft: #6a5d52;
  --shu: #dc3f2f;
  --ai: #2a4d96;
  --night: #2b1d15;
  --scrim: rgba(28, 20, 14, .62);
  --p1: #e5483b; --p2: #2f6fd6; --p3: #eeb12a; --p4: #2a9e66;
  --f-display: "Dela Gothic One", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  --f-hand: "Yusei Magic", "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  --f-ui: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --cut: 18px 12px 20px 10px / 12px 20px 10px 18px;
  /* iOS 26 の Safari は、画面に固定した要素の入れ物が 下の ツールバーの裏まで 伸びる ことがある。その差（100% と 100svh の差）だけ 下端を 上げる。PC・古い iOS は 0 */
  --tb: max(0px, calc(100% - 100svh));
  color-scheme: light;
}
* { box-sizing: border-box; }
/* hidden で隠す画面・札は、display の指定より必ず優先する（元はアーティファクトの外枠が持っていた指定） */
[hidden] { display: none !important; }
img { max-width: 100%; }
html, body { height: 100%; }
/* 太字の無い書体（Dela Gothic One・Yusei Magic は 400 だけ）を、ブラウザが 同じ色の線で なぞって 太らせない（にせの太字で タイトルの 字の 穴が つぶれていた）*/
html { font-synthesis: none; }
body {
  margin: 0; overflow: hidden; background: var(--night); color: var(--ink);
  font-family: var(--f-ui); font-size: 15px;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
#app { position: fixed; inset: 0; bottom: var(--tb); overflow: hidden; overflow: clip; contain: paint; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#ui { position: absolute; inset: 0; pointer-events: none; }
.screen {
  position: absolute; inset: 0; pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding-block: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.overlay { background: var(--scrim); z-index: 40; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px dashed var(--ai); outline-offset: 3px; }

/* ---------- paper & buttons ---------- */
.paper { background: var(--card); border: 3px solid var(--ink); border-radius: var(--cut); box-shadow: 5px 6px 0 rgba(39, 34, 30, .28); }
.btn {
  font-family: var(--f-ui); font-weight: 900; font-size: 17px; line-height: 1.15; color: var(--ink);
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--cut);
  padding: 12px 20px; min-height: 52px; box-shadow: 0 5px 0 var(--ink); cursor: pointer;
  transition: transform .08s, box-shadow .08s; touch-action: manipulation;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn-primary { background: var(--shu); color: #fff; }
.btn[disabled] { opacity: .42; pointer-events: none; }
.btn.small { min-height: 40px; padding: 7px 14px; font-size: 14px; box-shadow: 0 3px 0 var(--ink); }
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--ink); background: var(--card); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 3px 0 var(--ink); touch-action: manipulation; pointer-events: auto;
}
.icon-btn svg { width: 22px; height: 22px; }
.chip { font-weight: 700; font-size: 14px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px; padding: 8px 16px; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.sound-btn {
  position: absolute; z-index: 45;
  top: calc(max(12px, env(safe-area-inset-top, 0px)));
  right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 8px; pointer-events: auto;
  font-weight: 700; font-size: 13px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px; padding: 6px 14px 6px 8px; cursor: pointer; box-shadow: 0 3px 0 var(--ink);
}
.sound-btn svg { width: 22px; height: 22px; }
/* narrow phones: the floating sound button shrinks to just its icon so it never touches the page title */
@media (max-width: 400px) { #btn-sound .lab { display: none; } #btn-sound { padding: 6px 8px; } }
.js-sound .wave { transition: opacity .15s; }
.js-sound.muted .wave { opacity: 0; }
.js-sound .x { opacity: 0; }
.js-sound.muted .x { opacity: 1; }

/* ---------- loading ---------- */
/* 段ボールの台の上で、紙にマーカーで力士がかき上がり → 切りとり線 → 土俵でトン！と跳ねる、をくり返す（1周 3.2秒） */
#scr-loading {
  z-index: 60; color: var(--ink); transition: opacity .45s ease, visibility 0s linear .45s;
  background: radial-gradient(120% 80% at 50% 38%, #d8b47f, var(--kraft) 55%, var(--kraft-deep));
}
#scr-loading::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .22;
  background: repeating-linear-gradient(90deg, rgba(90, 60, 30, .35) 0 2px, transparent 2px 14px); }
#scr-loading.out { opacity: 0; visibility: hidden; }
.loader { position: relative; display: grid; justify-items: center; gap: 6px; font-family: var(--f-hand); font-size: 18px; text-align: center; }
.ld-kids { width: min(58vw, 230px); padding: 7px 14px; background: var(--ink); border-radius: 999px; transform: rotate(-2deg); box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.ld-stage { width: min(56vw, 210px); margin-top: 8px; }
.ld-art { display: block; width: 100%; height: auto; overflow: visible; }
.ld-dohyo { fill: #e9cf9d; stroke: var(--ink); stroke-width: 3; }
.ld-ring { fill: none; stroke: var(--shu); stroke-width: 2.5; stroke-dasharray: 5 4; }
.ld-paper rect { fill: #fffdf7; stroke: rgba(39, 34, 30, .25); stroke-width: 2; }
.ld-paper { transform-box: fill-box; transform-origin: 50% 100%; animation: ldPaper 3.2s infinite; }
.ld-doll { transform-box: view-box; transform-origin: 80px 140px; animation: ldHop 3.2s infinite; }
.ld-squash { transform-box: view-box; transform-origin: 80px 140px; animation: ldSquash 3.2s infinite; }
/* 切りぬき：かいた線を太らせた形を、ふち（墨）→ 白 の順に重ねてシールのように見せる */
.ld-cut, .ld-fill { stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.ld-cut { fill: var(--ink); stroke: var(--ink); stroke-width: 25; animation: ldCut 3.2s infinite; }
.ld-fill { fill: #fffdf7; stroke: #fffdf7; stroke-width: 20; animation: ldFill 3.2s infinite; }
.ld-ink { fill: none; stroke: var(--ink); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.ld-ink.red { stroke: var(--shu); stroke-width: 7; }
.ld-ink.k1 { animation: ldK1 3.2s infinite; } .ld-ink.k2 { animation: ldK2 3.2s infinite; } .ld-ink.k3 { animation: ldK3 3.2s infinite; }
.ld-ink.k4 { animation: ldK4 3.2s infinite; } .ld-ink.k5 { animation: ldK5 3.2s infinite; }
.ld-face { opacity: 0; animation: ldFace 3.2s infinite; }
.ld-face circle { fill: var(--ink); } .ld-face path { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; } .ld-face .ld-blush { fill: #f6a99f; }
.ld-pen { animation: ldPen 3.2s infinite; } .ld-pen rect { fill: var(--p2); stroke: var(--ink); stroke-width: 2; } .ld-pen path { fill: var(--ink); }
.ld-ton { font-family: var(--f-display); font-size: 17px; fill: var(--shu); stroke: #fffdf7; stroke-width: 5px; stroke-linejoin: round; paint-order: stroke; text-anchor: middle; opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; animation: ldTon 3.2s infinite; }
@keyframes ldK1 { 0% { stroke-dashoffset: 1; opacity: 1; } 10%, 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes ldK2 { 0%, 9% { stroke-dashoffset: 1; opacity: 0; } 9.5% { stroke-dashoffset: 1; opacity: 1; } 22%, 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes ldK3 { 0%, 21% { stroke-dashoffset: 1; opacity: 0; } 21.5% { stroke-dashoffset: 1; opacity: 1; } 27%, 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes ldK4 { 0%, 26% { stroke-dashoffset: 1; opacity: 0; } 26.5% { stroke-dashoffset: 1; opacity: 1; } 33%, 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes ldK5 { 0%, 32% { stroke-dashoffset: 1; opacity: 0; } 32.5% { stroke-dashoffset: 1; opacity: 1; } 38%, 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes ldFace { 0%, 38% { opacity: 0; } 41%, 100% { opacity: 1; } }
@keyframes ldPen {
  0% { transform: translate(97px, 30px) rotate(20deg); } 10% { transform: translate(64px, 40px) rotate(20deg); }
  22% { transform: translate(118px, 86px) rotate(20deg); } 27% { transform: translate(116px, 92px) rotate(20deg); }
  33% { transform: translate(104px, 134px) rotate(20deg); } 38% { transform: translate(132px, 64px) rotate(20deg); }
  41% { transform: translate(86px, 46px) rotate(20deg); opacity: 1; } 46%, 100% { transform: translate(150px, 10px) rotate(35deg); opacity: 0; }
}
@keyframes ldCut { 0%, 45% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes ldFill { 0%, 40% { opacity: 0; } 44%, 100% { opacity: 1; } }
@keyframes ldPaper { 0%, 54% { opacity: 1; transform: none; } 60% { opacity: 0; transform: translateY(6px) rotate(4deg) scale(.96); } 92% { opacity: 0; } 100% { opacity: 1; transform: none; } }
@keyframes ldHop {
  0%, 56% { transform: none; } 62% { transform: translateY(-22px) rotate(-4deg); } 68% { transform: none; }
  74% { transform: translateY(-14px) rotate(5deg); } 80%, 94% { transform: none; } 100% { transform: none; }
}
@keyframes ldSquash { 0%, 67% { transform: none; } 69% { transform: scale(1.08, .9); } 72%, 79% { transform: none; } 81% { transform: scale(1.06, .93); } 84%, 100% { transform: none; } }
@keyframes ldTon { 0%, 67% { opacity: 0; transform: scale(.4) rotate(-8deg); } 70% { opacity: 1; transform: scale(1.15) rotate(-8deg); } 86% { opacity: 1; transform: scale(1) rotate(-8deg); } 92%, 100% { opacity: 0; transform: scale(1) rotate(-8deg); } }
.ld-name { margin: 2px 0 4px; font-family: var(--f-display); font-size: clamp(28px, 7.5vw, 40px); letter-spacing: .04em; color: var(--card); text-shadow: 3px 0 0 var(--ink), 2.898px 0.776px 0 var(--ink), 2.598px 1.5px 0 var(--ink), 2.121px 2.121px 0 var(--ink), 1.5px 2.598px 0 var(--ink), 0.776px 2.898px 0 var(--ink), 0 3px 0 var(--ink), -0.776px 2.898px 0 var(--ink), -1.5px 2.598px 0 var(--ink), -2.121px 2.121px 0 var(--ink), -2.598px 1.5px 0 var(--ink), -2.898px 0.776px 0 var(--ink), -3px 0 0 var(--ink), -2.898px -0.776px 0 var(--ink), -2.598px -1.5px 0 var(--ink), -2.121px -2.121px 0 var(--ink), -1.5px -2.598px 0 var(--ink), -0.776px -2.898px 0 var(--ink), 0 -3px 0 var(--ink), 0.776px -2.898px 0 var(--ink), 1.5px -2.598px 0 var(--ink), 2.121px -2.121px 0 var(--ink), 2.598px -1.5px 0 var(--ink), 2.898px -0.776px 0 var(--ink), 0 6px 0 rgba(0, 0, 0, .25); transform: rotate(-1.5deg); }
/* 進み具合は 土俵の俵（たわら）がのびていく */
.ld-bar { position: relative; width: min(64vw, 240px); height: 14px; border: 3px solid var(--ink); border-radius: 999px; background: #fffdf7; overflow: hidden; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.ld-bar i { position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform .35s ease;
  background: repeating-linear-gradient(90deg, #e1c27a 0 9px, #c9a04f 9px 11px); }
.ld-msg { margin: 2px 0 0; font-size: 16px; color: var(--ink); min-height: 1.5em; }

/* ---------- title ---------- */
#scr-title { justify-content: space-between; gap: 8px; background: linear-gradient(180deg, rgba(28, 18, 10, .55), rgba(28, 18, 10, 0) 34%, rgba(28, 18, 10, 0) 58%, rgba(28, 18, 10, .7)); }
.title-bottom { display: grid; justify-items: center; gap: 14px; width: 100%; }
.logo { font-weight: 400; margin: 2vh 0 0; display: grid; justify-items: center; line-height: .95; transform: rotate(-2.5deg); isolation: isolate; }
.logo-raku { font-family: var(--f-hand); font-size: clamp(36px, 8.5vw, 70px); display: flex; letter-spacing: .02em; transform: translateX(-.6em) rotate(-4deg); }
.logo-raku span { position: relative; text-shadow: 3.5px 0 0 #fff, 3.381px 0.906px 0 #fff, 3.031px 1.75px 0 #fff, 2.475px 2.475px 0 #fff, 1.75px 3.031px 0 #fff, 0.906px 3.381px 0 #fff, 0 3.5px 0 #fff, -0.906px 3.381px 0 #fff, -1.75px 3.031px 0 #fff, -2.475px 2.475px 0 #fff, -3.031px 1.75px 0 #fff, -3.381px 0.906px 0 #fff, -3.5px 0 0 #fff, -3.381px -0.906px 0 #fff, -3.031px -1.75px 0 #fff, -2.475px -2.475px 0 #fff, -1.75px -3.031px 0 #fff, -0.906px -3.381px 0 #fff, 0 -3.5px 0 #fff, 0.906px -3.381px 0 #fff, 1.75px -3.031px 0 #fff, 2.475px -2.475px 0 #fff, 3.031px -1.75px 0 #fff, 3.381px -0.906px 0 #fff, 0 6px 0 rgba(0, 0, 0, .25); }
.logo-raku span:nth-child(1) { color: var(--p1); } .logo-raku span:nth-child(2) { color: var(--p2); transform: translateY(-4px); }
.logo-raku span:nth-child(3) { color: var(--p3); } .logo-raku span:nth-child(4) { color: var(--p4); transform: translateY(3px); }
.outlined { position: relative; color: var(--card); z-index: 0; }
/* 縁取りは text-stroke（角がとがる）でなく、円状にずらした影を重ねてなめらかに。下の影は filter で全体に落とす */
.outlined::before { content: attr(data-text); position: absolute; left: 0; top: 0; z-index: -1; color: var(--ink); text-shadow: 0.085em 0 0 var(--ink), 0.084em 0.013em 0 var(--ink), 0.081em 0.026em 0 var(--ink), 0.076em 0.039em 0 var(--ink), 0.069em 0.05em 0 var(--ink), 0.06em 0.06em 0 var(--ink), 0.05em 0.069em 0 var(--ink), 0.039em 0.076em 0 var(--ink), 0.026em 0.081em 0 var(--ink), 0.013em 0.084em 0 var(--ink), 0 0.085em 0 var(--ink), -0.013em 0.084em 0 var(--ink), -0.026em 0.081em 0 var(--ink), -0.039em 0.076em 0 var(--ink), -0.05em 0.069em 0 var(--ink), -0.06em 0.06em 0 var(--ink), -0.069em 0.05em 0 var(--ink), -0.076em 0.039em 0 var(--ink), -0.081em 0.026em 0 var(--ink), -0.084em 0.013em 0 var(--ink), -0.085em 0 0 var(--ink), -0.084em -0.013em 0 var(--ink), -0.081em -0.026em 0 var(--ink), -0.076em -0.039em 0 var(--ink), -0.069em -0.05em 0 var(--ink), -0.06em -0.06em 0 var(--ink), -0.05em -0.069em 0 var(--ink), -0.039em -0.076em 0 var(--ink), -0.026em -0.081em 0 var(--ink), -0.013em -0.084em 0 var(--ink), 0 -0.085em 0 var(--ink), 0.013em -0.084em 0 var(--ink), 0.026em -0.081em 0 var(--ink), 0.039em -0.076em 0 var(--ink), 0.05em -0.069em 0 var(--ink), 0.06em -0.06em 0 var(--ink), 0.069em -0.05em 0 var(--ink), 0.076em -0.039em 0 var(--ink), 0.081em -0.026em 0 var(--ink), 0.084em -0.013em 0 var(--ink); filter: drop-shadow(0 .09em 0 rgba(0, 0, 0, .3)); }
.logo-main { font-family: var(--f-display); font-size: clamp(56px, 15vw, 132px); letter-spacing: .02em; }
.logo-en { margin-top: 14px; font-family: var(--f-ui); font-weight: 900; font-size: 12px; letter-spacing: .5em; color: var(--card); background: var(--ink); padding: 6px 8px 6px 14px; transform: rotate(1.5deg); }
.title-menu { display: flex; flex-wrap: wrap; gap: 14px 22px; justify-content: center; }
.btn-big { display: grid; justify-items: start; gap: 4px; min-width: min(82vw, 290px); padding: 14px 22px 16px; text-align: left; }
.btn-big .btn-label { font-family: var(--f-display); font-weight: 400; font-size: 30px; letter-spacing: .04em; }
.btn-big .btn-sub { font-size: 14px; font-weight: 700; opacity: .9; }
#btn-solo { transform: rotate(-1.4deg); }
#btn-party { transform: rotate(1.2deg); }
#btn-solo:active { transform: rotate(-1.4deg) translateY(4px); }
#btn-party:active { transform: rotate(1.2deg) translateY(4px); }
.title-foot { display: flex; align-items: center; gap: 16px; width: 100%; justify-content: center; max-width: 720px; }
.brand { font-weight: 900; font-size: 11px; letter-spacing: .28em; color: var(--card); opacity: .85; }

/* ---------- headers ---------- */
.bar { width: 100%; max-width: 980px; display: flex; align-items: center; gap: 14px; }
.bar h2 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: clamp(28px, 6vw, 40px); color: var(--card); text-shadow: 0 4px 0 rgba(0, 0, 0, .35); letter-spacing: .06em; }
.back { white-space: nowrap; font-weight: 900; font-size: 14px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px; padding: 8px 14px 8px 10px; cursor: pointer; box-shadow: 0 3px 0 var(--ink); display: flex; align-items: center; gap: 4px; }
.back::before { content: ""; width: 9px; height: 9px; border-left: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(45deg); margin-left: 4px; }

/* ---------- banzuke ---------- */
#scr-map { justify-content: flex-start; background: linear-gradient(180deg, rgba(28, 18, 10, .7), rgba(28, 18, 10, .25)); }
.mydoll { width: 100%; max-width: 980px; display: flex; justify-content: flex-end; }
.md-card { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; transform: rotate(-1deg); max-width: 100%; }
.md-k { white-space: nowrap; flex: none; font-size: 12px; font-weight: 900; background: var(--ink); color: var(--card); padding: 3px 8px; border-radius: 4px; }
.md-thumb canvas { display: block; width: 52px; height: 52px; }
.md-card .btn { white-space: nowrap; flex: none; }
/* narrow phones: the special shows as its icon only, so the card stays on one line */
@media (max-width: 420px) { .md-card { gap: 8px; } .md-card .md-waza { font-size: 0; } .md-card .md-waza .wz-ic { width: 22px; height: 22px; } }
@media (max-width: 360px) { .diff-k { padding: 0 4px 0 8px; } .diff-b { padding: 6px 8px; font-size: 12px; } }
@media (max-width: 340px) { .md-thumb canvas { width: 40px; height: 40px; } .md-card .btn { padding: 6px 10px; } }
.md-name { font-family: var(--f-hand); font-size: 20px; }
.ladder { list-style: none; margin: 0; padding: 14px 4px 22px; width: 100%; max-width: 1340px; display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; flex: 1; align-items: center; }
/* one card per basho: its rank, the three wrestlers (the last is the むすび), and the pen it awards */
.basho { flex: 0 0 auto; scroll-snap-align: center; }
.basho:nth-child(odd) { transform: rotate(-1deg); } .basho:nth-child(even) { transform: rotate(.8deg) translateY(8px); }
.bs-btn {
  position: relative; width: 250px; display: grid; justify-items: center; gap: 6px; padding: 0 0 12px; cursor: pointer; overflow: hidden; text-align: center;
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--cut); box-shadow: 5px 6px 0 rgba(39, 34, 30, .28);
}
.bs-btn:active { transform: translateY(3px); }
.basho.next .bs-btn, .basho.live .bs-btn { box-shadow: 0 0 0 4px #ffe066, 5px 6px 0 rgba(39, 34, 30, .28); }
.bs-rank { width: 100%; padding: 7px 0 5px; font-weight: 900; font-size: 13px; letter-spacing: .2em; color: #fff; background: var(--s1); border-bottom: 3px solid var(--ink); }
.bs-name { font-family: var(--f-display); font-size: 20px; line-height: 1.1; }
.bs-ops { display: flex; gap: 4px; justify-content: center; padding: 0 6px; }
.bs-op { position: relative; display: grid; justify-items: center; width: 76px; gap: 1px; }
.bs-face { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--s2) 60%, #fff), transparent 70%); }
.bs-face canvas { width: 62px; height: 62px; display: block; }
.bs-op.boss .bs-face { box-shadow: inset 0 0 0 2.5px var(--s1); }
.bs-op b { font-family: var(--f-hand); font-weight: 400; font-size: 12px; white-space: nowrap; }
.bs-op.win::after, .bs-op.lose::after { content: ""; position: absolute; right: 2px; top: 0; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--ink); background: var(--card); }
.bs-op.lose::after { background: var(--ink); }
.bs-rule, .bs-live { font-size: 12px; font-weight: 900; color: var(--ink-soft); }
.bs-live { color: var(--shu); }
.bs-pen { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 900; padding: 3px 10px 3px 4px; border: 2px dashed var(--ink-soft); border-radius: 999px; }
.bs-pen::before { content: "ごほうび"; font-size: 10px; letter-spacing: .1em; color: #fff; background: var(--shu); border-radius: 999px; padding: 1px 6px; order: -1; }
.bs-pen .rw-pen { width: 18px; height: 18px; border-width: 2px; }
.basho.locked .bs-btn { cursor: default; }
.basho.locked .bs-rank, .basho.locked .bs-ops, .basho.locked .bs-name { filter: grayscale(.85); opacity: .7; }
.basho.locked .bs-face::after { content: "？"; font-family: var(--f-display); font-size: 30px; color: var(--ink-soft); }
.hanko { position: absolute; right: 4px; top: 3px; width: 50px; height: 50px; border: 3.5px solid var(--shu); border-radius: 50%; color: var(--shu); font-family: var(--f-ui); font-weight: 900; font-size: 14px; display: grid; place-items: center; transform: rotate(-14deg); background: rgba(255, 255, 255, .78); z-index: 1; line-height: 1.05; align-content: center; }
.hanko > span { white-space: nowrap; }   /* ゆう／しょう・かち／こし の2行に */
.hanko.gold { border-color: #b8860b; color: #9a6a00; background: rgba(255, 244, 200, .9); font-size: 12px; }
.md-k.gold { background: linear-gradient(135deg, #b07d12, #f7dc7c 35%, #c99417 55%, #fff0b0 70%, #a8740f); color: var(--ink); }
/* 星取: ○ white star = a win, ● black star = a loss */
.hoshi { display: flex; gap: 8px; justify-content: center; }
.ho { position: relative; display: grid; justify-items: center; }
.ho-face { width: 44px; height: 44px; display: block; border-radius: 50%; background: #fff; border: 2.5px solid var(--ink); }
.ho.cur .ho-face { box-shadow: 0 0 0 3px #ffe066; }
.ho-mark { width: 22px; height: 22px; margin-top: -10px; border-radius: 50%; border: 3px solid var(--ink); background: var(--card); z-index: 1; }
.ho.lose .ho-mark { background: var(--ink); }
.ho.none .ho-mark { border-style: dashed; border-color: var(--ink-soft); opacity: .6; }
.ho.cur.win .ho-mark, .ho.cur.lose .ho-mark { animation: stampIn .35s .25s cubic-bezier(.2, 1.6, .4, 1) both; }
.hoshi.xs { gap: 4px; margin-top: 4px; } .hoshi.xs .ho-face { width: 30px; height: 30px; border-width: 2px; } .hoshi.xs .ho-mark { width: 16px; height: 16px; border-width: 2.5px; margin-top: -7px; }
.hoshi.lg { gap: 14px; } .hoshi.lg .ho-face { width: 60px; height: 60px; } .hoshi.lg .ho-mark { width: 28px; height: 28px; margin-top: -12px; }

/* ---------- party setup ---------- */
#scr-setup { justify-content: flex-start; background: linear-gradient(180deg, rgba(28, 18, 10, .72), rgba(28, 18, 10, .35)); }
.setup-body { width: 100%; max-width: 760px; display: grid; gap: 16px; flex: 1; align-content: center; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-aspect-ratio: 1/1) { .slots { grid-template-columns: repeat(2, 1fr); } }
.slot { position: relative; display: grid; gap: 6px; justify-items: center; padding: 12px 8px; cursor: pointer; background: var(--card); border: 3px solid var(--ink); border-radius: var(--cut); box-shadow: 0 5px 0 var(--ink); }
.slot:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.slot-color { width: 100%; text-align: center; font-weight: 900; font-size: 15px; color: #fff; background: var(--pc); border: 2.5px solid var(--ink); border-radius: 8px; padding: 6px 0; }
.slot-type { font-family: var(--f-display); font-size: 26px; }
.slot-hint { font-size: 11px; color: var(--ink-soft); min-height: 1em; }
.slot.s-off { opacity: .55; }
.slot.s-off .slot-color { background: #bbb; }
.slot.s-cpu .slot-type { color: var(--ai); }
.stage-pick { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.stage-chip { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 14px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px; padding: 6px 14px 6px 6px; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.stage-chip.sel { background: var(--ink); color: var(--card); }
.sc-sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); background: linear-gradient(135deg, var(--s1) 50%, var(--s2) 50%); }
.setup-foot { display: grid; justify-items: center; gap: 10px; }
#setup-note { margin: 0; color: var(--card); font-weight: 700; }

/* ---------- drawing ---------- */
#scr-draw { background: var(--scrim); justify-content: stretch; }
.draw-layout {
  width: 100%; max-width: 1000px; height: 100%; min-height: 0; display: grid; gap: 10px;
  grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "head" "paper" "side";
}
@media (min-aspect-ratio: 1/1) {
  .draw-layout { grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "head head" "paper side"; }
}
.draw-headrow { grid-area: head; display: flex; align-items: center; gap: 10px; min-width: 0; }
.draw-headrow .back { flex: none; }
#draw-head { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
#draw-head .who { white-space: nowrap; flex: none; font-weight: 900; color: #fff; background: var(--pc); border: 2.5px solid var(--ink); border-radius: 8px; padding: 4px 10px; font-size: 14px; }
#draw-head .what { min-width: 0; font-family: var(--f-display); font-size: clamp(17px, 4.6vw, 28px); line-height: 1.12; color: var(--card); text-shadow: 0 3px 0 rgba(0, 0, 0, .35); word-break: keep-all; overflow-wrap: anywhere; }
.paper-wrap { grid-area: paper; position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; }
#pad { display: block; background: transparent; border-radius: 3px; box-shadow: 0 0 0 3px var(--ink), 8px 10px 0 rgba(0, 0, 0, .3); touch-action: none; cursor: crosshair; transition: transform .45s cubic-bezier(.2, 1.4, .4, 1), box-shadow .3s, filter .3s; }
.paper-wrap.cut #pad { box-shadow: none; }
.paper-wrap.lift #pad { transform: translateY(-8px) rotate(-2deg) scale(.96); filter: drop-shadow(0 0 0 #fff) drop-shadow(6px 14px 6px rgba(0, 0, 0, .45)); }
.pad-hint { position: absolute; pointer-events: none; font-family: var(--f-hand); font-size: clamp(18px, 4vw, 26px); color: var(--ink-soft); text-align: center; }
.draw-side { grid-area: side; display: grid; gap: 10px; align-content: start; min-width: 0; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; background: var(--card); border: 3px solid var(--ink); border-radius: var(--cut); padding: 8px; }
#swatches { display: grid; grid-template-columns: repeat(6, 34px); gap: 6px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid var(--ink); cursor: pointer; position: relative; touch-action: manipulation; }
.swatch.pen-kin:not(.locked), .rw-pen.pen-kin { background: linear-gradient(135deg, #b07d12, #f7dc7c 30%, #c99417 50%, #fff0b0 65%, #a8740f); }
.swatch.locked { background: #f4efe4; border-style: dashed; border-color: var(--c); cursor: help; }
.swatch.locked.pen-shiro { border-color: #a99f92; }
.swatch.locked::after { content: "？"; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 15px; color: var(--ink-soft); }
.swatch.sel { transform: scale(1.12); box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--ink); }
.tool { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; padding: 4px 6px; background: transparent; border: 0; cursor: pointer; font-weight: 700; font-size: 11px; touch-action: manipulation; }
.tool svg { width: 26px; height: 26px; }
.tool.arm { color: var(--shu); }
#pen-size .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); transition: transform .15s; }
#pen-size.thin .dot { transform: scale(.45); }
#draw-tip { margin: 0; text-align: center; font-family: var(--f-hand); font-size: 15px; color: var(--card); }
#btn-done { font-size: 22px; font-family: var(--f-display); font-weight: 400; }
.cut-result { position: absolute; inset: 0; display: grid; place-items: end center; padding: 16px; pointer-events: none; }
.reveal { pointer-events: auto; display: grid; justify-items: center; gap: 6px; padding: 14px 18px 16px; width: min(92vw, 380px); animation: pop .45s cubic-bezier(.2, 1.5, .4, 1) both; }
.reveal-name { margin: 0; font-family: var(--f-display); font-size: clamp(30px, 8vw, 40px); line-height: 1.1; }
.reveal-btns { display: grid; gap: 8px; margin-top: 6px; width: 100%; justify-self: stretch; }   /* 縦に2段（横に並べると「これで い／く！」と 途中で 折り返した）。上が これで いく！ */
.reveal-btns .btn { width: 100%; white-space: nowrap; }
@keyframes pop { from { transform: translateY(30px) scale(.8) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- match ---------- */
#scr-match { padding: 0; display: block; }
.hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5; pointer-events: none;
  display: flex; align-items: flex-start; justify-content: center; gap: 8px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.hud.n2 { justify-content: space-between; }
.tag { display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px; background: var(--card); border: 3px solid var(--ink); border-left: 9px solid var(--pc); border-radius: 12px; box-shadow: 0 3px 0 rgba(0, 0, 0, .3); min-width: 0; transition: filter .3s, opacity .3s; position: relative; }
.tag-thumb { width: 40px; height: 40px; display: block; flex: none; }
.tag-text { display: grid; line-height: 1.1; min-width: 0; }
.tag-name { font-family: var(--f-hand); font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.tag-cpu { font-size: 10px; font-weight: 900; letter-spacing: .15em; color: var(--ink-soft); }
.hud:not(.n2) .tag-name { max-width: 16vw; font-size: 14px; }
.tag.lost { filter: grayscale(1); opacity: .6; }
.tag.lost::after { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 4px; background: var(--shu); transform: rotate(-8deg); border-radius: 2px; }
#btn-pause { width: 42px; height: 42px; pointer-events: auto; flex: none; }
.zones { position: absolute; inset: 0; }
.zone { position: absolute; touch-action: none; }
.zone::before { content: ""; position: absolute; inset: 0; background: var(--pc); opacity: 0; pointer-events: none; }
.zone.hit::before { animation: wash .28s ease-out; }
@keyframes wash { from { opacity: .16; } to { opacity: 0; } }
.z-solo .zone { inset: 0; }
.z-2 .zone-L { left: 0; top: 0; bottom: 0; width: 50%; } .z-2 .zone-R { right: 0; top: 0; bottom: 0; width: 50%; }
.z-3 .zone-BL, .z-4 .zone-BL { left: 0; bottom: 0; width: 50%; height: 50%; }
.z-3 .zone-BR, .z-4 .zone-BR { right: 0; bottom: 0; width: 50%; height: 50%; }
.z-3 .zone-T { left: 0; right: 0; top: 0; height: 50%; }
.z-4 .zone-TL { left: 0; top: 0; width: 50%; height: 50%; } .z-4 .zone-TR { right: 0; top: 0; width: 50%; height: 50%; }
.zone-badge {
  position: absolute; display: flex; align-items: center; gap: 8px; pointer-events: none;
  background: var(--card); border: 3px solid var(--ink); border-bottom-width: 6px; border-radius: 16px; padding: 6px 12px 6px 8px; color: var(--ink);
  box-shadow: 0 0 0 3px var(--pc);
}
.zb-hand { width: 30px; height: 30px; color: var(--pc); }
.zb-hand svg { width: 100%; height: 100%; display: block; }
.zb-text { display: grid; line-height: 1.05; white-space: nowrap; }
.zb-text b { font-family: var(--f-display); font-weight: 400; font-size: 20px; }
.zb-text small { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.zone-badge kbd { font-family: var(--f-ui); font-weight: 900; font-size: 12px; border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: 6px; padding: 1px 6px; background: #fff; }
.zb-combo { display: flex; gap: 2px; }
.zb-combo i { width: 7px; height: 16px; border-radius: 3px; background: #f2c230; border: 1.5px solid var(--ink); animation: pip .2s ease-out; }
@keyframes pip { from { transform: scaleY(.3); } to { transform: none; } }
.zone.hit .zone-badge { animation: bump .18s ease-out; }
.zone.miss .zone-badge { animation: shake .25s; filter: grayscale(.6); }
.zone.hot .zone-badge { box-shadow: 0 0 0 3px var(--pc), 0 0 22px 6px color-mix(in srgb, var(--pc) 70%, #fff); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px) rotate(-3deg); } 75% { transform: translateX(6px) rotate(3deg); } }
.zone-ALL .zone-badge, .zone-L .zone-badge, .zone-BL .zone-badge { left: max(16px, env(safe-area-inset-left, 0px)); bottom: max(14px, env(safe-area-inset-bottom, 0px)); }
.zone-ALL .zone-badge { left: 50%; transform: translateX(-50%); }
.zone-ALL.hit .zone-badge { animation: bumpc .18s ease-out; }
@keyframes bumpc { 0% { transform: translateX(-50%) scale(1); } 40% { transform: translateX(-50%) scale(1.12); } 100% { transform: translateX(-50%) scale(1); } }
.zone-R .zone-badge, .zone-BR .zone-badge { right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(14px, env(safe-area-inset-bottom, 0px)); flex-direction: row-reverse; }
.zone-TL .zone-badge { left: max(16px, env(safe-area-inset-left, 0px)); top: calc(max(10px, env(safe-area-inset-top, 0px)) + 62px); }
.zone-TR .zone-badge { right: max(16px, env(safe-area-inset-right, 0px)); top: calc(max(10px, env(safe-area-inset-top, 0px)) + 62px); flex-direction: row-reverse; }
.zone-T .zone-badge { left: 50%; top: calc(max(10px, env(safe-area-inset-top, 0px)) + 62px); transform: translateX(-50%); }
.hint-bubble { position: absolute; z-index: 6; pointer-events: none; display: grid; gap: 2px; max-width: min(78vw, 340px); background: var(--card); border: 3px solid var(--ink); border-radius: 14px; padding: 10px 14px; box-shadow: 0 0 0 3px var(--pc), 4px 6px 0 rgba(0, 0, 0, .3); animation: pop .35s cubic-bezier(.2, 1.5, .4, 1) both; }
.hint-bubble b { font-family: var(--f-display); font-weight: 400; font-size: 18px; }
.hint-bubble span { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
/* hints sit in open space under the name tags (or above the bottom players' cards), never on a button */
.hint-bubble.at-ALL { left: 50%; top: calc(max(10px, env(safe-area-inset-top, 0px)) + 66px); transform: translateX(-50%); animation: none; }
.hint-bubble.at-L { left: max(16px, env(safe-area-inset-left, 0px)); top: calc(max(10px, env(safe-area-inset-top, 0px)) + 66px); }
.hint-bubble.at-R { right: max(16px, env(safe-area-inset-right, 0px)); top: calc(max(10px, env(safe-area-inset-top, 0px)) + 66px); }
.hint-bubble.at-BL, .hint-bubble.at-TL { left: max(16px, env(safe-area-inset-left, 0px)); }
.hint-bubble.at-BR, .hint-bubble.at-TR { right: max(16px, env(safe-area-inset-right, 0px)); }
.hint-bubble.at-T { left: 50%; transform: translateX(-50%); animation: none; }






/* ---------- callouts & speed lines ---------- */
#callout { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; z-index: 30; overflow: hidden; }
.callout {
  grid-area: 1 / 1; font-family: var(--f-display); font-size: clamp(50px, 13vw, 124px); color: #fff; white-space: nowrap; letter-spacing: .02em;
  --o: var(--ink);
  text-shadow: 5px 0 0 var(--o), 4.904px 0.975px 0 var(--o), 4.619px 1.913px 0 var(--o), 4.157px 2.778px 0 var(--o), 3.536px 3.536px 0 var(--o), 2.778px 4.157px 0 var(--o), 1.913px 4.619px 0 var(--o), 0.975px 4.904px 0 var(--o), 0 5px 0 var(--o), -0.975px 4.904px 0 var(--o), -1.913px 4.619px 0 var(--o), -2.778px 4.157px 0 var(--o), -3.536px 3.536px 0 var(--o), -4.157px 2.778px 0 var(--o), -4.619px 1.913px 0 var(--o), -4.904px 0.975px 0 var(--o), -5px 0 0 var(--o), -4.904px -0.975px 0 var(--o), -4.619px -1.913px 0 var(--o), -4.157px -2.778px 0 var(--o), -3.536px -3.536px 0 var(--o), -2.778px -4.157px 0 var(--o), -1.913px -4.619px 0 var(--o), -0.975px -4.904px 0 var(--o), 0 -5px 0 var(--o), 0.975px -4.904px 0 var(--o), 1.913px -4.619px 0 var(--o), 2.778px -4.157px 0 var(--o), 3.536px -3.536px 0 var(--o), 4.157px -2.778px 0 var(--o), 4.619px -1.913px 0 var(--o), 4.904px -0.975px 0 var(--o), 0 12px 0 rgba(0, 0, 0, .28);
  animation: callPop 1.1s ease forwards;
}
.callout.go { color: #ffe066; font-size: clamp(60px, 16vw, 150px); }
.callout.small { font-size: clamp(40px, 10vw, 92px); }
.callout.gyoji { font-size: clamp(30px, 7vw, 60px); align-self: start; margin-top: calc(max(10px, env(safe-area-inset-top, 0px)) + 64px); color: #fff3c4; }
@keyframes callPop { 0% { transform: scale(.35) rotate(-8deg); opacity: 0; } 14% { transform: scale(1.1) rotate(-3deg); opacity: 1; } 24% { transform: scale(1) rotate(-3deg); } 82% { opacity: 1; } 100% { transform: scale(1.04) rotate(-3deg); opacity: 0; } }
.callout.namecard { display: grid; justify-items: start; gap: 2px; font-size: 18px; text-shadow: none; color: var(--ink); animation-name: slideL; align-self: end; justify-self: start; margin: 0 0 18vh max(18px, env(safe-area-inset-left, 0px)); background: var(--card); border: 3px solid var(--ink); border-radius: var(--cut); padding: 10px 22px 14px 16px; box-shadow: 6px 7px 0 rgba(0, 0, 0, .3); }
.callout.namecard.right { justify-self: end; justify-items: end; animation-name: slideR; margin: 0 max(18px, env(safe-area-inset-right, 0px)) 18vh 0; }
.nc-side { font-family: var(--f-ui); font-weight: 900; font-size: 14px; letter-spacing: .3em; background: var(--ink); color: var(--card); padding: 2px 10px; border-radius: 4px; }
.nc-rank { font-family: var(--f-ui); font-weight: 700; font-size: 13px; color: var(--ink-soft); min-height: 1em; }
.nc-name { font-family: var(--f-display); font-size: clamp(32px, 8vw, 56px); line-height: 1.05; color: var(--ink); border-bottom: 6px solid var(--pc); }
.nc-gim { margin-top: 3px; font-family: var(--f-ui); font-weight: 900; font-size: 12px; color: #fff; background: var(--shu); border-radius: 4px; padding: 1px 8px; }
.callout.bout-banner { align-self: start; margin-top: calc(max(10px, env(safe-area-inset-top, 0px)) + 66px); display: grid; justify-items: center; gap: 0; font-size: 16px; text-shadow: none; color: var(--ink);
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--cut); padding: 6px 18px 8px; box-shadow: 6px 7px 0 rgba(0, 0, 0, .3); animation-name: dropBanner; }
.bb-basho { font-family: var(--f-ui); font-weight: 900; font-size: 12px; letter-spacing: .2em; color: var(--ink-soft); }
.bb-bout { font-family: var(--f-display); font-size: clamp(24px, 6vw, 38px); line-height: 1.1; }
@keyframes dropBanner { 0% { transform: translateY(-40px) rotate(-3deg); opacity: 0; } 14% { transform: rotate(-1.5deg); opacity: 1; } 84% { opacity: 1; } 100% { transform: rotate(-1.5deg) translateY(-10px); opacity: 0; } }
@keyframes slideL { 0% { transform: translateX(-120%) rotate(-3deg); } 18% { transform: translateX(0) rotate(-2deg); } 85% { transform: translateX(0) rotate(-2deg); opacity: 1; } 100% { transform: translateX(-30px) rotate(-2deg); opacity: 0; } }
@keyframes slideR { 0% { transform: translateX(120%) rotate(3deg); } 18% { transform: translateX(0) rotate(2deg); } 85% { transform: translateX(0) rotate(2deg); opacity: 1; } 100% { transform: translateX(30px) rotate(2deg); opacity: 0; } }
#lines { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 2;
  background: repeating-conic-gradient(from 3deg at 50% 50%, rgba(39, 34, 30, 0) 0deg 5deg, rgba(39, 34, 30, .5) 5deg 6deg, rgba(39, 34, 30, 0) 6deg 9deg, rgba(255, 255, 255, .55) 9deg 9.6deg);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 30%, #000 62%); mask: radial-gradient(circle at 50% 50%, transparent 30%, #000 62%); }
#lines.on { animation: lines .36s ease-out; }
#flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 3; background: radial-gradient(circle at 50% 35%, rgba(255, 252, 225, .95), rgba(255, 236, 140, .45)); }
#flash.on { animation: flashIn .3s ease-out; }
@keyframes flashIn { 0% { opacity: .8; } 100% { opacity: 0; } }
@keyframes lines { 0% { opacity: 1; transform: scale(1.25) rotate(2deg); } 100% { opacity: 0; transform: scale(1.1); } }

/* ---------- result ---------- */
#scr-result { background: radial-gradient(ellipse at 50% 60%, rgba(28, 18, 10, 0), rgba(28, 18, 10, .55)); justify-content: flex-end; }
.result { display: grid; justify-items: center; gap: 8px; padding: 16px 20px 18px; width: min(94vw, 460px); margin-bottom: 2vh; container-type: inline-size; }
.result.in { animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.rs-head { display: grid; justify-items: center; }
.rs-big { font-family: var(--f-display); font-size: clamp(36px, 9vw, 54px); line-height: 1.05; color: var(--pc, var(--shu)); }
.rs-big.lose { color: var(--ai); }
.rs-big.name { font-size: clamp(26px, 7.4vw, 46px); word-break: keep-all; text-align: center; }
.rs-sub { font-weight: 900; font-size: 15px; }
.rs-winner { display: flex; align-items: center; gap: 10px; border-bottom: 5px solid var(--pc); padding-bottom: 2px; }
.rs-thumb { width: 64px; height: 64px; }
.rs-name { font-family: var(--f-hand); font-size: 24px; }
.rs-km { display: grid; justify-items: center; gap: 0; padding: 6px 0 2px; }
.rs-km-label { font-size: 11px; font-weight: 900; letter-spacing: .3em; color: var(--card); background: var(--ink); padding: 2px 10px; border-radius: 3px; }
.rs-km-name { font-family: var(--f-display); font-size: clamp(30px, 8vw, 44px); letter-spacing: .08em; text-align: center; line-height: 1.2;
  /* 字数（--n）と 技の 絵（--ic）から、カードの 幅に 1行で おさまる 大きさ（cqi を 知らない ブラウザは 上の 値のまま） */
  --fit: calc(106cqi / (var(--n, 6) * 1.08 + var(--ic, 0)));
  font-size: min(clamp(30px, 8vw, 44px), var(--fit)); }
.rs-km-name .w { white-space: nowrap; }
.rs-km-desc { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.rs-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }
.result .hoshi { margin: 2px 0; }
.basho-sum { gap: 8px; }
.bs-title { margin: 0; font-weight: 900; font-size: 14px; letter-spacing: .2em; color: var(--card); background: var(--ink); padding: 3px 12px; border-radius: 4px; }
.bs-verdict { display: grid; justify-items: center; }
.bs-big { font-family: var(--f-display); font-size: clamp(24px, 7vw, 34px); line-height: 1.05; color: var(--shu); white-space: nowrap; text-align: center; }
.bs-verdict.make .bs-big { color: var(--ai); }
.bs-verdict.zensho .bs-big { color: #c99700; --o: var(--ink); text-shadow: 2px 0 0 var(--o), 1.848px 0.765px 0 var(--o), 1.414px 1.414px 0 var(--o), 0.765px 1.848px 0 var(--o), 0 2px 0 var(--o), -0.765px 1.848px 0 var(--o), -1.414px 1.414px 0 var(--o), -1.848px 0.765px 0 var(--o), -2px 0 0 var(--o), -1.848px -0.765px 0 var(--o), -1.414px -1.414px 0 var(--o), -0.765px -1.848px 0 var(--o), 0 -2px 0 var(--o), 0.765px -1.848px 0 var(--o), 1.414px -1.414px 0 var(--o), 1.848px -0.765px 0 var(--o), 0 5px 0 rgba(0, 0, 0, .2); }
.bs-score { font-weight: 900; font-size: 15px; }
.bs-promo { margin: 0; font-family: var(--f-display); font-size: clamp(15px, 4.6vw, 20px); white-space: nowrap; padding: 3px 16px; border-radius: 999px; border: 2.5px solid var(--ink); background: #ffe066; margin: 4px 0 2px; transform: rotate(-1.5deg); animation: promoIn .4s .35s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes promoIn { from { transform: rotate(-1.5deg) scale(2.2); opacity: 0; } to { transform: rotate(-1.5deg); opacity: 1; } }
.bs-promo.gold { background: linear-gradient(90deg, #f7dc7c, #e3b23c, #fff0b0, #e3b23c); }
.reward { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 3px solid var(--ink); border-radius: 10px; background: #fff7d6; animation: dropCard .55s .5s cubic-bezier(.2, 1.5, .4, 1) both; text-align: left; }
.rw-k { writing-mode: vertical-rl; font-weight: 900; font-size: 11px; letter-spacing: .2em; background: var(--shu); color: #fff; padding: 6px 2px; border-radius: 4px; }
.rw-pen { width: 36px; height: 36px; border-radius: 50%; background: var(--c); border: 3px solid var(--ink); display: inline-block; flex: none; }
.rw-body { display: grid; gap: 2px; min-width: 0; }
.rw-body b { font-family: var(--f-display); font-weight: 400; font-size: 18px; line-height: 1.15; word-break: keep-all; }
.rw-waza { display: flex; flex-wrap: wrap; gap: 2px 10px; font-weight: 900; font-size: 12px; }
.rw-waza span { color: var(--fc); display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.rw-note { font-weight: 700; font-size: 12px; color: var(--ink-soft); }
@media (min-aspect-ratio: 1/1) {
  #scr-result { justify-content: center; align-items: flex-end; }
  .result { width: min(46vw, 410px); margin: 0; }
}
@media (max-height: 460px) {
  .result { gap: 4px; padding: 10px 16px 12px; }
  .rs-big { font-size: 34px; } .rs-big.name { font-size: 30px; } .rs-km-name { font-size: 28px; font-size: min(28px, var(--fit)); } .rs-thumb { width: 48px; height: 48px; } .rs-name { font-size: 20px; }
  .rs-btns .btn { min-height: 44px; padding: 8px 16px; font-size: 15px; }
  .callout.bout-banner { padding: 3px 14px 5px; } .bb-bout { font-size: 22px; } .bb-basho { font-size: 11px; }
  .bout-banner .hoshi.xs .ho-face { width: 24px; height: 24px; } .bout-banner .hoshi.xs .ho-mark { width: 13px; height: 13px; margin-top: -6px; }
  .result.basho-sum { gap: 4px; width: min(58vw, 440px); } .bs-big { font-size: 26px; } .bs-title { font-size: 12px; padding: 2px 10px; } .bs-score { font-size: 13px; } .bs-promo { font-size: 16px; padding: 1px 12px; }
  .hoshi.lg { gap: 10px; } .hoshi.lg .ho-face { width: 44px; height: 44px; } .hoshi.lg .ho-mark { width: 22px; height: 22px; margin-top: -10px; }
  .hoshi.sm .ho-face { width: 36px; height: 36px; } .hoshi.sm .ho-mark { width: 18px; height: 18px; margin-top: -8px; }
  .reward { padding: 4px 10px; gap: 8px; } .rw-pen { width: 28px; height: 28px; } .rw-body b { font-size: 15px; }
}

/* ---------- pause & how-to ---------- */
.menu-card { display: grid; gap: 12px; padding: 20px; width: min(86vw, 320px); }
.menu-card h3, .howto h3 { margin: 0 0 4px; font-family: var(--f-display); font-weight: 400; font-size: 28px; text-align: center; }
.menu-card .btn { width: 100%; }
.menu-card .sound-row { justify-self: center; position: static; }
.howto { display: grid; gap: 12px; padding: 18px; width: min(94vw, 760px); max-height: 100%; overflow: auto; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-aspect-ratio: 1/1) { .steps { grid-template-columns: 1fr; } }
.step { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: center; }
@media (min-aspect-ratio: 1/1) { .step { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.step svg { width: 76px; height: 76px; }
.step b { font-family: var(--f-display); font-weight: 400; font-size: 22px; display: block; }
.step p { margin: 2px 0 0; font-size: 14px; font-weight: 700; line-height: 1.5; }
.howto .btn { justify-self: center; }

@media (max-width: 620px) {
  .hud:not(.n2) .tag-text { display: none; }
  .hud:not(.n2) .tag { padding-right: 3px; }
  .z-3 .zone-badge, .z-4 .zone-badge { padding: 4px 8px 4px 6px; gap: 5px; }
  .z-3 .zb-text b, .z-4 .zb-text b { font-size: 16px; }
  .z-3 .zone-badge kbd, .z-4 .zone-badge kbd { display: none; }
  .tag-name { max-width: 34vw; }
}

/* ---------- specials ---------- */
.wz-ic { width: 1.25em; height: 1.25em; display: inline-block; vertical-align: -0.22em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.wz-ic .f { fill: currentColor; stroke: none; }
.waza-card {
  position: absolute; width: 86px; height: 80px; padding: 6px 4px 5px; display: grid; justify-items: center; align-content: center; gap: 2px;
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--cut); color: var(--ink); overflow: visible; cursor: pointer;
  box-shadow: 0 4px 0 var(--ink); pointer-events: none; touch-action: none; filter: saturate(.55); opacity: .82; transition: transform .15s, filter .2s, opacity .2s;
}
.wc-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--fl); transform-origin: 50% 100%; transform: scaleY(var(--g, 0)); transition: transform .12s linear; }
.wc-ic { position: relative; color: var(--fc); font-size: 26px; line-height: 1; }
.wc-name { position: relative; font-weight: 900; font-size: 11px; line-height: 1.15; text-align: center; }
.waza-card kbd { position: absolute; right: -8px; bottom: -10px; font: 900 11px var(--f-ui); border: 2px solid var(--ink); border-bottom-width: 3px; border-radius: 5px; padding: 0 5px; background: #fff; color: var(--ink); }   /* 札がたまると 札の 文字が 白に なるので、キーの 札は 墨色に 固定 */
.wc-ready { position: absolute; top: -15px; left: 50%; transform: translateX(-50%) scale(.6); opacity: 0; white-space: nowrap; font-family: var(--f-ui); font-weight: 900; font-size: 13px; color: #fff; background: var(--ink); border-radius: 999px; padding: 2px 8px; transition: transform .2s, opacity .2s; }
.waza-card.ready { pointer-events: auto; filter: none; opacity: 1; background: var(--fc); color: #fff; animation: cardReady 1s ease-in-out infinite; box-shadow: 0 4px 0 var(--ink), 0 0 0 3px var(--card), 0 0 24px 6px var(--fc); }
.waza-card.ready .wc-fill { opacity: 0; }
.waza-card.ready .wc-ic { color: #fff; }
.waza-card.ready .wc-name { text-shadow: 1.1px 0 0 var(--ink), 0.953px 0.55px 0 var(--ink), 0.55px 0.953px 0 var(--ink), 0 1.1px 0 var(--ink), -0.55px 0.953px 0 var(--ink), -0.953px 0.55px 0 var(--ink), -1.1px 0 0 var(--ink), -0.953px -0.55px 0 var(--ink), -0.55px -0.953px 0 var(--ink), 0 -1.1px 0 var(--ink), 0.55px -0.953px 0 var(--ink), 0.953px -0.55px 0 var(--ink); }
.waza-card.ready .wc-ready { opacity: 1; transform: translateX(-50%) scale(1); }
.waza-card.queued { animation: none; transform: translateY(-4px) scale(1.06); }
.waza-card.firing { animation: cardFire .5s ease-out; }
@keyframes cardReady { 0%, 100% { transform: rotate(-3deg) scale(1); } 50% { transform: rotate(3deg) scale(1.07); } }
@keyframes cardFire { 0% { transform: scale(1.25); filter: brightness(1.6); } 100% { transform: scale(1); } }
.zone-ALL .waza-card { right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(14px, env(safe-area-inset-bottom, 0px)); }
@media (max-aspect-ratio: 1/1) { .zone-ALL .waza-card { bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 78px); } }
.zone-L .waza-card, .zone-BL .waza-card { left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 78px); }
.zone-R .waza-card, .zone-BR .waza-card { right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 78px); }
.zone-TL .waza-card { left: max(16px, env(safe-area-inset-left, 0px)); top: calc(max(10px, env(safe-area-inset-top, 0px)) + 136px); }
.zone-TR .waza-card { right: max(16px, env(safe-area-inset-right, 0px)); top: calc(max(10px, env(safe-area-inset-top, 0px)) + 136px); }
.zone-T .waza-card { left: calc(50% + 104px); top: calc(max(10px, env(safe-area-inset-top, 0px)) + 66px); }
@media (min-aspect-ratio: 1/1) {
  .z-3 .zone-BL .waza-card, .z-4 .zone-BL .waza-card { left: auto; right: 16px; bottom: max(14px, env(safe-area-inset-bottom, 0px)); }
  .z-3 .zone-BR .waza-card, .z-4 .zone-BR .waza-card { right: auto; left: 16px; bottom: max(14px, env(safe-area-inset-bottom, 0px)); }
  .z-4 .zone-TL .waza-card { left: auto; right: 16px; top: calc(max(10px, env(safe-area-inset-top, 0px)) + 62px); }
  .z-4 .zone-TR .waza-card { right: auto; left: 16px; top: calc(max(10px, env(safe-area-inset-top, 0px)) + 62px); }
}
@media (max-width: 620px) {
  .z-3 .waza-card, .z-4 .waza-card { width: 74px; height: 68px; }
  .z-3 .wc-name, .z-4 .wc-name { font-size: 10px; }
  .zone-T .waza-card { left: auto; right: max(16px, env(safe-area-inset-right, 0px)); }
}
.zone.lost::after { content: ""; position: absolute; inset: 0; background: rgba(39, 34, 30, .3); pointer-events: none; }
.zone.lost .waza-card { display: none; }
.zone.lost .zone-badge { box-shadow: 0 0 0 3px var(--pc); background: var(--card); }
.zo-place { font-family: var(--f-display); font-size: 34px; line-height: 1; color: var(--pc); text-shadow: 1.2px 0 0 var(--ink), 1.039px 0.6px 0 var(--ink), 0.6px 1.039px 0 var(--ink), 0 1.2px 0 var(--ink), -0.6px 1.039px 0 var(--ink), -1.039px 0.6px 0 var(--ink), -1.2px 0 0 var(--ink), -1.039px -0.6px 0 var(--ink), -0.6px -1.039px 0 var(--ink), 0 -1.2px 0 var(--ink), 0.6px -1.039px 0 var(--ink), 1.039px -0.6px 0 var(--ink); }
.zo-place small { font-size: 16px; text-shadow: none; color: var(--ink); margin-left: 1px; }
.zo-why { display: grid; font-weight: 900; font-size: 14px; line-height: 1.2; }
.zo-why em { font-style: normal; font-weight: 700; font-size: 10px; color: var(--ink-soft); }
.zone.duel .zone-badge { box-shadow: 0 0 0 3px var(--pc), 0 0 0 6px #ffe066, 0 0 26px 8px rgba(255, 224, 102, .7); }
.zone.wobble .zone-badge { animation: tilt .5s ease-in-out; }
@keyframes tilt { 0%, 100% { rotate: 0deg; } 25% { rotate: -7deg; } 75% { rotate: 7deg; } }
.tag-stamp { position: absolute; right: -10px; top: -10px; width: 30px; height: 30px; border: 3px solid var(--shu); border-radius: 50%; display: grid; place-items: center; font-family: var(--f-ui); font-weight: 900; font-size: 16px; color: var(--shu); background: rgba(255, 255, 255, .92); transform: rotate(-12deg); animation: stampIn .3s cubic-bezier(.2, 1.6, .4, 1) both; z-index: 1; }
@keyframes stampIn { from { transform: rotate(-12deg) scale(2.4); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }
/* special banner: a slim strip on the player's side, clear of the ring */
.callout.wazacut {
  position: absolute; top: calc(max(10px, env(safe-area-inset-top, 0px)) + 64px); left: max(16px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; gap: 8px; max-width: min(46vw, 340px); padding: 5px 14px 6px 10px;
  font-size: 16px; color: #fff; text-shadow: none; white-space: normal;
  background: var(--fc); border: 3px solid var(--ink); border-left: 9px solid var(--pc); border-radius: 8px;
  box-shadow: 4px 5px 0 rgba(0, 0, 0, .3); animation-name: cutL;
}
.callout.wazacut.right { left: auto; right: max(16px, env(safe-area-inset-right, 0px)); border-left-width: 3px; border-right: 9px solid var(--pc); flex-direction: row-reverse; animation-name: cutR; }
.callout.wazacut.center { left: 50%; transform: translateX(-50%); animation-name: cutC; }
.callout.wazacut.at-T, .hint-bubble.at-T { top: calc(max(10px, env(safe-area-inset-top, 0px)) + 156px); }
.callout.wazacut.at-BL, .callout.wazacut.at-BR, .hint-bubble.at-BL, .hint-bubble.at-BR { top: auto; bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 180px); }
.callout.wazacut.at-TL, .callout.wazacut.at-TR, .hint-bubble.at-TL, .hint-bubble.at-TR { top: calc(max(10px, env(safe-area-inset-top, 0px)) + 234px); }
@media (min-aspect-ratio: 1/1) {
  .callout.wazacut.at-BL, .callout.wazacut.at-BR, .hint-bubble.at-BL, .hint-bubble.at-BR { bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 102px); }
  .callout.wazacut.at-TL, .callout.wazacut.at-TR, .hint-bubble.at-TL, .hint-bubble.at-TR { top: calc(max(10px, env(safe-area-inset-top, 0px)) + 160px); }
}
.wct-ic { font-size: 26px; line-height: 1; color: #fff; filter: drop-shadow(1px 1px 0 var(--ink)); }
.callout.wazacut.small { padding: 3px 10px 4px 8px; gap: 5px; max-width: min(40vw, 240px); border-width: 2.5px; }
.callout.wazacut.small .wct-ic { font-size: 18px; }
.callout.wazacut.small .wct-name { font-size: clamp(13px, 3.4vw, 17px); }
.wct-name { font-family: var(--f-display); font-size: clamp(18px, 4.6vw, 26px); line-height: 1.05; word-break: keep-all; --o: var(--ink); text-shadow: 2px 0 0 var(--o), 1.848px 0.765px 0 var(--o), 1.414px 1.414px 0 var(--o), 0.765px 1.848px 0 var(--o), 0 2px 0 var(--o), -0.765px 1.848px 0 var(--o), -1.414px 1.414px 0 var(--o), -1.848px 0.765px 0 var(--o), -2px 0 0 var(--o), -1.848px -0.765px 0 var(--o), -1.414px -1.414px 0 var(--o), -0.765px -1.848px 0 var(--o), 0 -2px 0 var(--o), 0.765px -1.848px 0 var(--o), 1.414px -1.414px 0 var(--o), 1.848px -0.765px 0 var(--o); }
.wct-perfect { font-family: var(--f-ui); font-weight: 900; font-size: 13px; color: #ffe066; text-shadow: 1px 1px 0 var(--ink); white-space: nowrap; }
@keyframes cutL { 0% { transform: translateX(-120%); } 12% { transform: translateX(0); } 82% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(-20px); opacity: 0; } }
@keyframes cutR { 0% { transform: translateX(120%); } 12% { transform: translateX(0); } 82% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(20px); opacity: 0; } }
@keyframes cutC { 0% { transform: translate(-50%, -30px); opacity: 0; } 12% { transform: translate(-50%, 0); opacity: 1; } 82% { opacity: 1; } 100% { transform: translate(-50%, 0); opacity: 0; } }
.nc-waza { margin-top: 4px; font-family: var(--f-ui); font-weight: 900; font-size: 14px; color: var(--fc); display: flex; align-items: center; gap: 4px; }
.waza-reveal { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "k k" "ic name" "ic desc"; align-items: center; gap: 0 10px; width: 100%; padding: 8px 12px; border: 3px solid var(--ink); border-radius: 10px; background: var(--fl); animation: dropCard .55s .15s cubic-bezier(.2, 1.5, .4, 1) both; }
.wr-k { grid-area: k; justify-self: start; font-weight: 900; font-size: 11px; letter-spacing: .3em; color: #fff; background: var(--fc); border-radius: 4px; padding: 1px 8px; margin-bottom: 4px; }
.wr-ic { grid-area: ic; font-size: 40px; color: var(--fc); line-height: 1; }
.wr-name { grid-area: name; font-family: var(--f-display); font-size: clamp(22px, 6vw, 30px); line-height: 1.1; word-break: keep-all; overflow-wrap: anywhere; }
.wr-desc { grid-area: desc; font-weight: 700; font-size: 13px; color: var(--ink-soft); }
@keyframes dropCard { from { transform: translateY(-40px) rotate(-8deg) scale(1.3); opacity: 0; } to { transform: none; opacity: 1; } }
#pad-glow { position: absolute; inset: 0; margin: auto; pointer-events: none; opacity: 0; transition: transform .45s cubic-bezier(.2, 1.4, .4, 1); }
#pad-glow.on { animation: glowInk 1.6s ease-out forwards; }
.paper-wrap.lift #pad-glow { transform: translateY(-8px) rotate(-2deg) scale(.96); }
@keyframes glowInk { 0% { opacity: 0; } 15%, 45% { opacity: 1; } 30% { opacity: .35; } 60% { opacity: .9; } 100% { opacity: .55; } }
.rk-why, .nc-waza, .rung-waza, .md-waza { word-break: keep-all; }
.rung-waza, .md-waza { font-weight: 900; font-size: 11px; color: var(--fc); display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.rung-waza .wz-ic { font-size: 14px; }
.rs-km-name .wz-ic { color: var(--fc); margin-right: 4px; }
.rk-list { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; display: grid; gap: 4px; }
.rk { display: grid; grid-template-columns: 44px 40px 1fr; grid-template-areas: "p t n" "p t w"; align-items: center; column-gap: 8px; padding: 3px 8px; border-left: 6px solid var(--pc); background: rgba(39, 34, 30, .05); border-radius: 6px; }
.rk.top { background: rgba(255, 224, 102, .35); }
.rk-place { grid-area: p; font-family: var(--f-display); font-size: 26px; color: var(--pc); text-shadow: 1px 0 0 var(--ink), 0.866px 0.5px 0 var(--ink), 0.5px 0.866px 0 var(--ink), 0 1px 0 var(--ink), -0.5px 0.866px 0 var(--ink), -0.866px 0.5px 0 var(--ink), -1px 0 0 var(--ink), -0.866px -0.5px 0 var(--ink), -0.5px -0.866px 0 var(--ink), 0 -1px 0 var(--ink), 0.5px -0.866px 0 var(--ink), 0.866px -0.5px 0 var(--ink); }
.rk-place small { font-size: 13px; text-shadow: none; color: var(--ink); }
.rk-thumb { grid-area: t; width: 40px; height: 40px; }
.rk-name { grid-area: n; font-family: var(--f-hand); font-size: 17px; }
.rk-why { grid-area: w; font-weight: 700; font-size: 12px; color: var(--ink-soft); }
.map-row { width: 100%; max-width: 980px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.map-row .mydoll { width: auto; }
.diff { display: flex; align-items: center; gap: 0; background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px; padding: 3px; box-shadow: 0 3px 0 var(--ink); }
.diff-k { white-space: nowrap; font-weight: 900; font-size: 12px; padding: 0 8px 0 10px; color: var(--ink-soft); }
.diff-b { white-space: nowrap; font-weight: 900; font-size: 13px; border: 0; background: transparent; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.diff-b.sel { background: var(--ink); color: var(--card); }
#diff-setup { justify-self: center; }
@media (max-height: 460px) { .rk-list { gap: 2px; } .rk { padding: 1px 8px; } .rk-thumb { width: 32px; height: 32px; } .rk-place { font-size: 22px; } }


/* ---------- layout fixes so nothing sits on top of anything ---------- */
.scroll-y { overflow-y: auto; -webkit-overflow-scrolling: touch; }
/* reveal: beside the cut-out in landscape, over the (dimmed) tools in portrait; never on the doll */
.draw-layout.revealing .draw-side { opacity: .18; pointer-events: none; filter: grayscale(.6); }
.draw-layout.revealing #btn-draw-back { visibility: hidden; }
@media (min-aspect-ratio: 1/1) {
  .cut-result { place-items: center end; padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .reveal { width: min(38vw, 330px); }
}
@media (max-aspect-ratio: 1/1) {
  .cut-result { place-items: end center; padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
  /* the cut-out lifts up and shrinks a little so the card below never covers its feet */
  .paper-wrap.lift #pad, .paper-wrap.lift #pad-glow { transform: translateY(-16%) rotate(-2deg) scale(.74); }
}
/* title: keep the logo clear of the sound button on tall screens */
@media (max-aspect-ratio: 1/1) { .title-top { margin-top: 46px; } }
/* short landscape: compact banzuke, setup and results */
@media (max-height: 460px) {
  .bar h2 { font-size: 26px; }
  .map-row { gap: 6px; }
  .md-card { padding: 3px 6px 3px 10px; } .md-thumb canvas { width: 38px; height: 38px; }
  .ladder { padding: 8px 4px 10px; align-items: flex-start; }
  .basho:nth-child(even) { transform: rotate(.8deg); }
  .bs-btn { width: 226px; gap: 3px; padding-bottom: 8px; }
  .bs-rank { padding: 4px 0 3px; font-size: 12px; }
  .bs-name { font-size: 16px; }
  .bs-op { width: 68px; } .bs-face { width: 46px; height: 46px; } .bs-face canvas { width: 46px; height: 46px; }
  .bs-op b { font-size: 11px; }
  .hanko { width: 40px; height: 40px; font-size: 10px; top: 2px; } .hanko.gold { font-size: 9px; }
  .setup-body { gap: 8px; align-content: start; }
  .slot { padding: 6px 6px; gap: 2px; } .slot-type { font-size: 20px; } .slot-hint { display: none; }
  .stage-pick { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 2px 2px 6px; }
  .stage-chip { flex: none; }
  .setup-foot { grid-auto-flow: column; align-items: center; justify-content: center; gap: 14px; }
  .setup-foot .btn-big { padding: 8px 16px; min-height: 0; } .setup-foot .btn-big .btn-label { font-size: 22px; }
  .result.many { width: min(58vw, 440px); }
  .rk-list { grid-template-columns: 1fr 1fr; }
  .rk { grid-template-columns: 34px 30px 1fr; column-gap: 4px; padding: 2px 6px; }
  .rk .rk-thumb { width: 30px; height: 30px; } .rk-place { font-size: 19px; white-space: nowrap; }
  .rk-name { font-size: 13px; white-space: nowrap; } .rk-why { font-size: 10px; }
  .result.many .rs-big { font-size: 28px; }
  .howto { padding: 12px; gap: 6px; } .step svg { width: 54px; height: 54px; } .step p { font-size: 12px; line-height: 1.4; }
}
@media (max-height: 460px) {
  .stage-chip { font-size: 12px; padding: 4px 10px 4px 4px; } .sc-sw { width: 20px; height: 20px; }
  .reveal { gap: 4px; padding: 8px 12px 10px; width: min(42vw, 330px); }
  .reveal-name { font-size: 22px; }
  .waza-reveal { padding: 5px 10px; } .wr-ic { font-size: 28px; } .wr-name { font-size: 18px; } .wr-desc { font-size: 11px; } .wr-k { margin-bottom: 2px; }
  .reveal-btns .btn { min-height: 42px; padding: 7px 14px; font-size: 15px; }
}
@media (max-aspect-ratio: 1/1) and (max-height: 720px) {
  .reveal { gap: 4px; padding: 8px 12px 10px; }
  .reveal-name { font-size: 22px; }
  .waza-reveal { padding: 5px 10px; } .wr-ic { font-size: 28px; } .wr-name { font-size: 19px; } .wr-desc { font-size: 11px; }
  .reveal-btns .btn { min-height: 44px; padding: 8px 14px; font-size: 15px; }
  .setup-body { gap: 10px; align-content: start; }
  .slot { padding: 8px 6px; } .slot-type { font-size: 22px; } .slot-hint { display: none; }
  .stage-chip { font-size: 13px; padding: 4px 10px 4px 4px; } .sc-sw { width: 22px; height: 22px; }
  .setup-foot .btn-big { padding: 10px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .callout:not(.wazacut):not(.namecard), .reveal, .result.in, .zone.hit .zone-badge, .zone.miss .zone-badge, .waza-card.ready, .tag-stamp, .waza-reveal { animation-duration: 1ms !important; }
}
@media (max-height: 460px) {
  .logo { margin-top: 0; transform: rotate(-2.5deg) scale(.82); transform-origin: top center; }
  .title-menu { gap: 10px 16px; } .btn-big { min-width: 0; width: min(42vw, 270px); } .btn-big .btn-sub { font-size: 12px; }
  .title-bottom { gap: 8px; } .logo-main { font-size: clamp(44px, 11vh, 90px); } .logo-raku { font-size: clamp(28px, 7vh, 52px); }
  .btn-big { padding: 10px 18px; } .btn-big .btn-label { font-size: 24px; }
}

/* ---------- AMIX GAMES KIDS（2026-10-27 公開準備） ---------- */
/* ボタン・札は ダブルタップで拡大しない（スクロールと ピンチは そのまま）。とりくみの手・お絵かきの紙は none のまま */
button, a, .screen { touch-action: manipulation; }
.kl-logo { display: block; width: 100%; height: auto; }
#scr-loading .loader { text-align: center; }
.ld-err { margin: 6px 0 0; display: grid; justify-items: center; gap: 10px; font-family: var(--f-ui); font-weight: 700; font-size: 14px; line-height: 1.6; }
/* タイトル：KIDS ロゴは タイトルロゴの 上（KIDS の ほかの 作品と 同じ）*/
.title-top { display: grid; justify-items: center; gap: 6px; margin-top: 2vh; }
.title-top .logo { margin: 0; }
.t-kids { display: block; width: clamp(140px, 30vw, 190px); padding: 6px 12px; background: rgba(39, 34, 30, .78); border-radius: 999px; transform: rotate(-2deg); pointer-events: auto; }
.t-foot { margin: -4px 0 0; width: 100%; max-width: 720px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; font-size: 11.5px; font-weight: 700; color: rgba(255, 253, 247, .78); text-shadow: 0 1px 4px rgba(0, 0, 0, .6); pointer-events: auto; }
.t-foot a { color: inherit; text-underline-offset: 3px; }
.t-foot a:hover { color: var(--card); }
.t-foot > * + *::before { content: "/"; display: inline-block; opacity: .55; margin-right: 8px; }
@media (max-height: 460px) { .t-foot { margin-top: -6px; font-size: 10.5px; } .t-kids { width: 130px; } .title-top { margin-top: 0; gap: 2px; } }
@media (prefers-reduced-motion: reduce) {
  .ld-paper, .ld-doll, .ld-squash, .ld-cut, .ld-pen, .ld-ton, .ld-ink, .ld-face, .ld-fill { animation: none !important; }
  .ld-ink { stroke-dashoffset: 0; opacity: 1; } .ld-face, .ld-fill, .ld-cut { opacity: 1; } .ld-pen { display: none; }
}
@media (max-height: 520px) { .ld-stage { width: 130px; margin-top: 0; } .ld-name { font-size: 26px; } }

/* あそびかたの絵：4つとも 2.4秒で くり返す（ひらいている間だけ動く） */
.hw * { transform-box: view-box; }
.hk { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.hk1 { animation: hk1 2.4s infinite; } .hk2 { animation: hk2 2.4s infinite; } .hk3 { animation: hk3 2.4s infinite; } .hk4 { animation: hk4 2.4s infinite; }
@keyframes hk1 { 0% { stroke-dashoffset: 1; opacity: 1; } 18%, 88% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes hk2 { 0%, 18% { stroke-dashoffset: 1; opacity: 0; } 19% { opacity: 1; } 42%, 88% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes hk3 { 0%, 42% { stroke-dashoffset: 1; opacity: 0; } 43% { opacity: 1; } 56%, 88% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes hk4 { 0%, 56% { stroke-dashoffset: 1; opacity: 0; } 57% { opacity: 1; } 66%, 88% { stroke-dashoffset: 0; opacity: 1; } 96%, 100% { stroke-dashoffset: 0; opacity: 0; } }
.hk-pen { animation: hkPen 2.4s infinite; }
@keyframes hkPen {
  0% { transform: translate(40px, 18px); } 9% { transform: translate(48px, 26px); } 18% { transform: translate(40px, 18px); }
  30% { transform: translate(26px, 46px); } 42% { transform: translate(40px, 35px); } 49% { transform: translate(28px, 66px); }
  56% { transform: translate(52px, 66px); } 66% { transform: translate(53px, 48px); } 80%, 100% { transform: translate(58px, 50px); }
}
.ht-fist { animation: htFist 1.2s infinite cubic-bezier(.5, 0, .5, 1); }
@keyframes htFist { 0%, 40% { transform: translateY(-6px); } 52% { transform: translateY(6px); } 62%, 100% { transform: translateY(-6px); } }
.ht-hit { opacity: 0; animation: htHit 1.2s infinite; }
@keyframes htHit { 0%, 50% { opacity: 0; } 53%, 66% { opacity: 1; } 76%, 100% { opacity: 0; } }
.ht-ring { transform-origin: 40px 64px; animation: htRing 1.2s infinite; }
@keyframes htRing { 0%, 50% { transform: scale(1); stroke-width: 3; } 58% { transform: scale(1.35); stroke-width: 4.5; } 76%, 100% { transform: scale(1); stroke-width: 3; } }
.hz-glow { opacity: 0; transform-origin: 40px 40px; animation: hzGlow 2.4s infinite; }
@keyframes hzGlow { 0%, 30% { opacity: 0; transform: scale(.9); } 40%, 70% { opacity: .9; transform: scale(1.04); } 55% { opacity: .55; transform: scale(1); } 85%, 100% { opacity: 0; transform: scale(.9); } }
.hz-card { transform-origin: 40px 68px; animation: hzCard 2.4s infinite; }
@keyframes hzCard { 0%, 30% { transform: none; } 36% { transform: rotate(-4deg) scale(1.04); } 42% { transform: rotate(3deg) scale(1.04); } 48%, 100% { transform: none; } }
.hz-fire { transform-origin: 40px 50px; animation: hzFire .5s infinite alternate ease-in-out; }
@keyframes hzFire { from { transform: scale(1, .94); } to { transform: scale(.96, 1.06); } }
.hz-rays { opacity: .25; animation: hzRays 2.4s infinite; }
@keyframes hzRays { 0%, 32% { opacity: .25; } 40%, 72% { opacity: 1; } 56% { opacity: .5; } 85%, 100% { opacity: .25; } }
.hc-push { transform-origin: 18px 58px; animation: hcPush 2.4s infinite; }
@keyframes hcPush { 0%, 10% { transform: rotate(-12deg); } 26% { transform: rotate(8deg); } 40%, 100% { transform: none; } }
.hc-out { animation: hcOut 2.4s infinite; }
@keyframes hcOut { 0%, 22% { transform: translate(-14px, -32px); opacity: 1; } 44% { transform: none; } 50% { transform: translateY(-3px); } 56%, 92% { transform: none; opacity: 1; } 100% { transform: none; opacity: 0; } }
.hc-star { transform-origin: 62px 23px; animation: hcStar 2.4s infinite; }
@keyframes hcStar { 0%, 46% { transform: scale(0) rotate(-40deg); } 56% { transform: scale(1.25) rotate(8deg); } 64%, 90% { transform: scale(1) rotate(0); } 100% { transform: scale(0); } }
@media (prefers-reduced-motion: reduce) {
  .hw * { animation: none !important; }
  .hk { stroke-dashoffset: 0; opacity: 1; } .hk-pen { transform: translate(58px, 50px); } .hz-glow, .ht-hit { opacity: 0; }
}
/* 読みこみのあと：はじめる と おと（KIDS の ほかの 作品と 同じ。押すと タイトルの 曲が 流れる） */
.ld-gate { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 8px; animation: gateIn .35s ease both; }   /* はじめる の下に おと */
.ld-gate .btn { font-family: var(--f-display); font-weight: 400; font-size: 24px; letter-spacing: .06em; padding: 10px 34px 12px; transform: rotate(-1deg); }
.ld-gate .btn:active { transform: rotate(-1deg) translateY(4px); }
.ld-snd { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-ui); color: var(--ink); touch-action: manipulation; }
.ld-snd svg { width: 20px; height: 20px; }
#scr-loading.gate .ld-bar { display: none; }
@keyframes gateIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
