/* ねこのけんばん（/kenban/・2026-11-24 の試作）: 入口はサイトの明るい地のまま、遊ぶ画面（.kb-game）は画面全体
   色: 夕方の音楽室＝あんず色の壁 --kwall・文字＝こげ茶むらさき --kink・札＝やわらかい黒・押せるもの＝ねこの朱色 --khot
   列・札・指揮者の絵は site/js/kenban/draw.js（canvas） */
:root { --kwall: #f6cfa6; --kpanel: #fffaf2; --kline: #ecd9c2; --kink: #3b2f3f; --kmut: #85727d; --khot: #d9534f; --kgold: #f2b01e; }

/* ── 入口 ── */
.kb-top { display: grid; gap: 16px; padding-top: 8px; }
.kb-hero { position: relative; margin: 0; border-radius: 20px; overflow: hidden; background: var(--kwall); aspect-ratio: 16 / 10; box-shadow: 0 18px 40px -26px rgba(90, 45, 30, .75); }
.kb-hero canvas { display: block; width: 100%; height: 100%; }
.kb-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, rgba(59, 47, 63, .62), rgba(59, 47, 63, .3) 34%, rgba(59, 47, 63, 0) 46%); }
.kb-hero-cap { position: absolute; left: 14px; top: 12px; z-index: 1; max-width: 44%; display: grid; gap: 2px; color: #fff; }
.kb-eb { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: #ffe3a3; }
.kb-hero-cap b { font-family: var(--f-round); font-size: clamp(26px, 8.4vw, 46px); line-height: 1.1; letter-spacing: .04em; text-shadow: 0 2px 14px rgba(40, 20, 30, .6); }
.kb-eb { text-shadow: 0 1px 8px rgba(40, 20, 30, .6); }
.kb-top .lead b { color: #b8361d; }
.kb-start { display: grid; gap: 10px; }
.kb-start .btn.go { --go: #e0604f; --go-step: #a63d2e; --go-soft: rgba(166, 61, 46, .5); }
.kb-note { font-size: 13px; color: var(--muted); }
.kb-note b { color: var(--ink); }
.kb-h2 { font-size: 20px; margin-top: 10px; }
.kb-opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kb-speed { display: flex; flex: 1 1 250px; min-width: 0; border-radius: 12px; overflow: hidden; border: 1.5px solid var(--line); background: #fff; }
.kb-speed button { flex: 1 1 0; min-width: 0; display: grid; gap: 0; justify-items: center; border: 0; background: none; padding: 6px 2px 5px; font: 700 13px/1.25 var(--f-body); color: var(--ink2); cursor: pointer; white-space: nowrap; }
.kb-speed button small { font-size: 10.5px; font-weight: 600; opacity: .75; font-variant-numeric: tabular-nums; }
.kb-speed button + button { border-left: 1px solid var(--line); }
.kb-speed button[aria-checked="true"] { background: var(--kink); color: #fff; }
.kb-snd { flex: none; align-self: stretch; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 9px 12px; font: 700 13px/1.25 var(--f-body); color: var(--ink2); cursor: pointer; white-space: nowrap; }
.kb-snd[aria-pressed="false"] { color: var(--muted); background: #f3f1ee; }
@media (max-width: 360px) { .kb-speed button { font-size: 12.5px; } }
.kb-songs { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.kb-song { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); text-align: left; cursor: pointer; font: inherit; color: inherit; transition: transform .08s; }
.kb-song:active { transform: scale(.985); }
@media (hover: hover) { .kb-song:not(.locked):hover { border-color: var(--kink); } }
.kb-num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--kink); color: #fff; font: 800 15px/1 var(--f-round); }
.kb-num svg { width: 18px; height: 18px; fill: currentColor; color: #fff; }
.kb-info { display: grid; min-width: 0; }
.kb-info b { font-size: 15.5px; line-height: 1.3; overflow-wrap: anywhere; }
.kb-info small { font-size: 12px; color: var(--muted); }
.kb-side { display: grid; justify-items: end; gap: 3px; }
.kb-lv { font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.kb-lv.lv1 { background: #e3f4e6; color: #2c7a43; }
.kb-lv.lv2 { background: #fff0d4; color: #a06208; }
.kb-lv.lv3 { background: #fde2df; color: #b23a2c; }
.kb-rec { display: flex; align-items: center; gap: 6px; }
.kb-rec small { font-size: 11.5px; color: var(--ink2); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kb-sts { display: inline-flex; gap: 1px; }
.kb-st { width: 15px; height: 15px; fill: #e8e1d6; }
.kb-st.on { fill: var(--kgold); }
.kb-song.locked { background: #f6f4f1; cursor: default; }
.kb-song.locked .kb-num { background: #b9b2ab; }
.kb-song.locked .kb-info b { color: var(--muted); }
.kb-lock-t { font-size: 11px; color: var(--muted); white-space: nowrap; }
@media (max-width: 350px) { .kb-lock-t { white-space: normal; text-align: right; max-width: 6.5em; line-height: 1.3; } }
.kb-how { margin: 0; padding: 0; list-style: none; counter-reset: kb; display: grid; gap: 10px; }
.kb-how li { counter-increment: kb; position: relative; display: grid; gap: 2px; padding: 12px 14px 12px 50px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.kb-how li::before { content: counter(kb); position: absolute; left: 14px; top: 12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #e0604f; color: #fff; font: 800 14px/1 var(--f-round); }
.kb-how b { font-size: 15.5px; }
.kb-how span { font-size: 13.5px; color: var(--ink2); line-height: 1.6; }
.kb-faq details { border-bottom: 1px solid var(--line); padding: 10px 2px; }
.kb-faq summary { cursor: pointer; font-weight: 700; }
.kb-faq p { margin-top: 6px; font-size: 14px; color: var(--ink2); }

/* ── 遊ぶ画面 ── */
html.kb-lock, html.kb-lock body { overflow: hidden; overscroll-behavior: none; }
.kb-game { position: fixed; inset: 0; z-index: 2147483000; display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); background: var(--kwall); color: var(--kink); font-family: var(--f-body); line-height: 1.5; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.kb-game button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
.kb-hud { display: flex; align-items: center; gap: 8px; padding: max(7px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) 7px max(10px, env(safe-area-inset-left, 0px)); background: rgba(255, 248, 238, .97); border-bottom: 1px solid var(--kline); }
.kb-pause { flex: none; display: flex; gap: 4px; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--kline); border-radius: 10px; background: #fff; }
.kb-pause i { display: block; width: 4px; height: 14px; border-radius: 2px; background: var(--kink); }
.kb-hearts { flex: none; display: flex; gap: 1px; }
.kb-heart { width: 21px; height: 21px; fill: #ef5d72; transition: transform .2s, opacity .2s; }
.kb-heart.lost { fill: #d9cfc6; animation: kb-lose .45s ease-out; }
.kb-prog { flex: 1 1 auto; min-width: 0; display: grid; gap: 3px; }
.kb-ttl { font-size: 12px; font-weight: 700; color: var(--kmut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.kb-bar { display: block; position: relative; height: 6px; border-radius: 6px; background: var(--kline); overflow: hidden; }
.kb-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; background: linear-gradient(90deg, #ffb13b, #ff7aa2); }
.kb-score { flex: none; display: flex; align-items: baseline; gap: 3px; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--kline); white-space: nowrap; }
.kb-score b { font: 800 18px/1 var(--f-round); font-variant-numeric: tabular-nums; }
.kb-score span { font-size: 11.5px; color: var(--kmut); }
@media (max-width: 340px) { .kb-hud { gap: 6px; } .kb-heart { width: 18px; height: 18px; } .kb-score { padding: 4px 8px; } .kb-score b { font-size: 16px; } }
.kb-stage { position: relative; min-height: 0; overflow: hidden; }
.kb-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.kb-banner { position: absolute; left: 50%; top: 12%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 28px); display: grid; gap: 2px; padding: 10px 16px; border-radius: 14px; background: rgba(255, 250, 242, .96); border: 1px solid var(--kline); text-align: center; box-shadow: 0 12px 30px -16px rgba(60, 30, 40, .6); pointer-events: none; }
.kb-banner[hidden] { display: none; }
.kb-banner b { font: 800 18px/1.3 var(--f-round); }
.kb-banner small { font-size: 12px; color: var(--kmut); }
.kb-banner span { font-size: 13.5px; font-weight: 700; color: var(--khot); }
.kb-banner.shake { animation: kb-shake .35s ease-in-out; }

/* 一時停止・クリア・おしまい（列の上の札） */
.kb-sheet { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 14px; background: rgba(59, 47, 63, .45); animation: kb-fade .2s ease-out; }
.kb-sheet[hidden] { display: none; }
.kb-card { width: min(420px, 100%); max-height: calc(100% - 6px); overflow: auto; padding: 18px 18px 16px; border-radius: 20px; background: var(--kpanel); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .6); display: grid; gap: 11px; animation: kb-up .25s ease-out; }
.kb-card h2 { font: 800 24px/1.3 var(--f-round); text-align: center; }
.kb-card .sub { font-size: 14px; color: var(--kmut); text-align: center; margin: -4px 0 0; }
.kb-eb2 { text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--khot); margin: 0 0 -8px; }
.kb-bigsts { display: flex; justify-content: center; gap: 8px; }
.kb-bigst { width: 46px; height: 46px; fill: #ece3d6; }
.kb-bigst.on { fill: var(--kgold); animation: kb-star .4s cubic-bezier(.3, 1.6, .5, 1); filter: drop-shadow(0 3px 4px rgba(200, 140, 20, .35)); }
.kb-big { text-align: center; }
.kb-big b { font: 900 50px/1 var(--f-round); font-variant-numeric: tabular-nums; color: var(--khot); }
.kb-big span { font-size: 16px; font-weight: 700; margin-left: 4px; }
.kb-facts { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--kmut); }
.kb-facts b { color: var(--kink); font-variant-numeric: tabular-nums; }
.kb-best { text-align: center; font-size: 13.5px; font-weight: 700; color: #2f8f5f; margin: 0; }
.kb-hint { text-align: center; font-size: 13.5px; color: var(--kmut); margin: 0; line-height: 1.6; }
.kb-unlock { text-align: center; font-size: 14px; font-weight: 700; margin: 0; padding: 8px 10px; border-radius: 12px; background: #fff3d6; color: #8a5a00; }
.kb-prog-big { height: 10px; border-radius: 10px; background: var(--kline); overflow: hidden; }
.kb-prog-big i { display: block; height: 100%; border-radius: 10px; background: linear-gradient(90deg, #ffb13b, #ff7aa2); }
.kb-acts { display: grid; gap: 8px; }
.kb-acts .btn { min-height: 48px; font: 700 16px/1.3 var(--f-round); }
.kb-acts .btn.kb-main { background: var(--khot); color: #fff; }
.kb-acts .btn.sub { color: var(--kink); }
.kb-menu { display: grid; gap: 8px; }
.kb-menu button { min-height: 48px; border-radius: 12px; border: 1px solid var(--kline); background: #fff; font-weight: 700; }
.kb-help { display: grid; gap: 8px; font-size: 13.5px; line-height: 1.6; }
.kb-help p { margin: 0; }
/* 共有のかたまり（../js/share.js の shareBlock）。札の中なので、上の余白をつめて見出しを小さく左に・ボタンの字の色はもどす */
.kb-sharebox:empty { display: none; }
.kb-sharebox .section { margin-top: 2px; gap: 10px; }
.kb-sharebox .share > h2 { font: 800 15px/1.3 var(--f-round); text-align: left; }
.kb-sharebox .btn { min-height: 50px; color: #fff; font: 700 16px/1.3 var(--f-round); }
.kb-sharebox .seg button { font: 700 13px/1.5 var(--f-body); }
.kb-sharebox .share-apps { grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); }
.kb-sharebox .seg button:not([aria-pressed="true"]) { color: var(--kmut); }
/* 全画面のゲームの上に出す: 知らせ（.toast）と、画像を長押しで保存する窓（.share-sheet） */
.kb-lock .toast, .kb-lock .share-sheet { z-index: 2147483100; }
.kb-lock .pc-cols .toast { left: 50%; }

@keyframes kb-lose { 0% { transform: scale(1.3); } 50% { transform: scale(.7) rotate(-12deg); } 100% { transform: none; } }
@keyframes kb-shake { 0%, 100% { transform: translateX(-50%); } 25% { transform: translateX(calc(-50% - 6px)); } 75% { transform: translateX(calc(-50% + 6px)); } }
@keyframes kb-star { from { transform: scale(.2) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kb-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kb-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .kb-heart.lost, .kb-banner.shake, .kb-bigst.on, .kb-sheet, .kb-card { animation: none; } }
