:root { --paper: #f3ead6; --paper2: #fbf6ea; --ink: #2a1f17; --sumi: #1f1a17; --red: #d8402f; --red-d: #8e1d14; --blue: #3f6fc9; --blue-d: #16357a; --gold: #d9a520; --green: #3e9a55; --bg: #2a211b; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: 'M PLUS Rounded 1c', sans-serif; font-weight: 800; -webkit-user-select: none; user-select: none; }
#arena { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
.hide { display: none !important; }
.screen { position: fixed; inset: 0; display: none; }
.screen.active { display: flex; }
.btn { border: 0; border-radius: 14px; padding: 11px 18px; background: var(--paper2); color: var(--ink); font-size: 16px; font-weight: 900; box-shadow: 0 4px 0 #b9a27c; transition: transform .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b9a27c; }
.btn.hot { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-d); }
.btn.blue { background: var(--blue); color: #fff; box-shadow: 0 4px 0 var(--blue-d); }
.btn.big { font-size: 19px; padding: 14px 22px; }
.btn.sm { font-size: 13px; padding: 7px 12px; border-radius: 10px; box-shadow: 0 3px 0 #b9a27c; }
.btn.ghost { background: rgba(255,255,255,.12); color: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* タイトル */
#s-title { align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, rgba(42,33,27,.15), rgba(42,33,27,.75)); }
.t-wrap { text-align: center; padding: max(16px, env(safe-area-inset-top)) 16px 16px; max-width: 560px; }
.logo { font-family: 'Dela Gothic One', sans-serif; line-height: 1; color: #fff; text-shadow: 0 4px 0 var(--sumi), 0 0 24px rgba(0,0,0,.4); }
.logo .l1 { display: block; font-size: clamp(30px, min(8vw, 9vh), 54px); letter-spacing: .1em; }
.logo .l2 { display: block; font-size: clamp(64px, min(20vw, 22vh), 140px); color: #ffcf3a; letter-spacing: .04em; -webkit-text-stroke: 3px var(--sumi); paint-order: stroke fill; }
.sub { color: #f3ead6; font-size: 15px; line-height: 1.6; margin: 12px 0 16px; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.sub b { color: #ffcf3a; }
.t-btns { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.t-btns .btn.big { min-width: 280px; }
.loading { color: #e9dcc0; font-size: 13px; margin-top: 12px; }
@media (max-height: 470px) { .logo .l2 { font-size: 70px; } .sub { margin: 6px 0 8px; font-size: 13px; } .t-btns { gap: 6px; } .btn.big { padding: 10px 18px; font-size: 16px; } }

/* えらぶ */
#s-setup { flex-direction: column; background: rgba(42,33,27,.88); }
.bar { display: flex; align-items: center; gap: 10px; padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left)); color: #fff; }
.bar.bottom { justify-content: center; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.bar.bottom .btn { min-width: 260px; }
.mode { display: flex; background: rgba(255,255,255,.12); border-radius: 12px; padding: 3px; margin-left: auto; }
.seg { border: 0; background: none; color: #e9dcc0; padding: 6px 12px; border-radius: 9px; font-size: 13px; }
.seg.on { background: var(--paper2); color: var(--ink); }
.on-st { font-size: 12px; color: #ffcf3a; }
.slots { flex: 1; display: flex; gap: 8px; padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); overflow: hidden; min-height: 0; }
.vs-mid { display: flex; align-items: center; justify-content: center; font-family: 'Dela Gothic One'; color: #ffcf3a; font-size: 24px; text-shadow: 0 3px 0 var(--sumi); }
.slot { flex: 1; min-width: 0; background: var(--paper); border-radius: 16px; padding: 10px; overflow-y: auto; box-shadow: inset 0 0 0 3px var(--red); position: relative; }
#slot1 { box-shadow: inset 0 0 0 3px var(--blue); }
@media (max-aspect-ratio: 1/1) { .slots { flex-direction: column; overflow-y: auto; } .slot { flex: none; overflow: visible; } .vs-mid { font-size: 18px; } }
.sl-side { display: inline-block; font-size: 11px; color: #fff; background: var(--red); border-radius: 6px; padding: 1px 8px; }
#slot1 .sl-side { background: var(--blue); }
.sl-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 160px; color: #7a6a55; }
.sl-top { display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; }
.sl-shape { position: relative; flex: 0 0 auto; }
.sl-shape canvas { display: block; background: var(--paper2); border-radius: 12px; }
.dir { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.dir .btn { padding: 4px 9px; font-size: 13px; }
.dir-lab { font-size: 11px; color: #7a6a55; text-align: center; }
.sl-info { min-width: 0; flex: 1; }
.sl-name { font-size: 20px; line-height: 1.15; word-break: break-all; }
.sl-name small { display: block; font-size: 11px; color: #7a6a55; font-weight: 800; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; margin: 4px 0; background: #2f8a4b; color: #fff; }
.badge.old { background: #8a6a3a; }
.sl-data { font-size: 12px; color: #4a3a2a; line-height: 1.6; font-weight: 800; }
.sl-data .est { color: #b0571b; }
.sl-mid { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.sl-mid canvas { flex: 0 0 auto; }
.st-list { flex: 1; font-size: 12px; line-height: 1.55; }
.st-list div { display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px dashed rgba(60,40,20,.15); }
.st-list span { color: #7a6a55; font-weight: 800; font-size: 10px; }
.st-list .up { color: #b07a00; } .st-list .kf { color: var(--green); } .st-list .dn { color: #b0302a; }
.pol-h { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; font-size: 13px; }
.pol-h .bud b { font-size: 16px; } .pol-h .kof { color: var(--green); font-size: 11px; }
.pols { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin-top: 6px; }
.pol { border: 2px solid rgba(60,40,20,.2); background: var(--paper2); border-radius: 10px; padding: 5px 7px; text-align: left; font-size: 12px; line-height: 1.25; }
.pol b { font-size: 13px; } .pol i { float: right; font-style: normal; background: var(--ink); color: #fff; border-radius: 6px; padding: 0 5px; font-size: 11px; }
.pol small { display: block; color: #6a5a45; font-size: 10px; font-weight: 800; }
.pol.on { border-color: var(--gold); background: #fff3c8; }
.pol.on.kf { border-color: var(--green); background: #e1f3e4; }
.pol:disabled { opacity: .4; }
.sl-btns { display: flex; gap: 6px; margin-top: 8px; }
.hidden-foe { display: flex; align-items: center; justify-content: center; min-height: 160px; color: #7a6a55; text-align: center; font-size: 14px; }

/* 検索 */
.sheet { position: fixed; inset: 0; background: rgba(20,15,10,.6); display: none; align-items: center; justify-content: center; z-index: 20; padding: 10px; }
.sheet.on { display: flex; }
.sheet-in { background: var(--paper); border-radius: 18px; width: 100%; max-width: 620px; max-height: 100%; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,.4); }
.pk-head { display: flex; gap: 6px; padding: 10px; }
.pk-head input { flex: 1; min-width: 0; font: inherit; font-size: 17px; padding: 9px 12px; border-radius: 12px; border: 2px solid #c9b38f; background: #fff; -webkit-user-select: text; user-select: text; }
.pk-hint { font-size: 12px; color: #7a6a55; padding: 0 12px 6px; }
.pk-list { list-style: none; margin: 0; padding: 0 6px 10px; overflow-y: auto; flex: 1; }
.pk-list li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; }
.pk-list li:nth-child(odd) { background: rgba(255,255,255,.45); }
.pk-list li:active { background: #fff3c8; }
.pk-list .nm { font-size: 16px; } .pk-list .kn { font-size: 11px; color: #7a6a55; display: block; font-weight: 800; }
.pk-list .bd { margin-left: auto; text-align: right; font-size: 11px; white-space: nowrap; }

/* 試合 */
#s-battle { pointer-events: none; }
.hud { position: absolute; top: max(6px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); display: flex; align-items: center; gap: 8px; color: #fff; }
.hp { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.hp.r { flex-direction: row; }
.hp b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34%; }
.hp span { font-size: 13px; font-variant-numeric: tabular-nums; width: 40px; text-align: center; }
.gauge { flex: 1; height: 14px; background: rgba(255,255,255,.15); border-radius: 7px; overflow: hidden; position: relative; }
.gauge::after { content: ''; position: absolute; top: 0; bottom: 0; left: 35%; width: 2px; background: rgba(255,255,255,.6); }
.hp.r .gauge::after { left: auto; right: 35%; }
.gauge i { display: block; height: 100%; width: 100%; background: var(--red); transition: width .2s; }
.hp.r .gauge i { background: var(--blue); margin-left: auto; }
.clock { font-family: 'Dela Gothic One'; font-size: 24px; min-width: 44px; text-align: center; color: #ffcf3a; }
.call { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-family: 'Dela Gothic One'; font-size: clamp(36px, 9vw, 80px); color: #fff; text-shadow: 0 5px 0 var(--sumi), 0 0 20px rgba(0,0,0,.5); opacity: 0; transform: scale(.8); transition: opacity .2s, transform .25s; white-space: pre-line; line-height: 1.1; }
.call.on { opacity: 1; transform: scale(1); }
.call small { display: block; font-family: 'M PLUS Rounded 1c'; font-size: .3em; margin-top: 6px; }
.b-btns { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 6px; pointer-events: auto; }

/* 結果 */
.res { padding: 12px; text-align: center; overflow-y: auto; }
.res-t { font-family: 'Dela Gothic One'; font-size: 34px; color: var(--red-d); }
.res-line { font-size: 15px; margin: 2px 0 8px; }
#res-img { width: 100%; height: auto; border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.note { font-size: 12px; color: #6a5a45; font-weight: 500; line-height: 1.6; }

/* カード */
#s-online, #s-howto { align-items: center; justify-content: center; background: rgba(42,33,27,.85); padding: 10px; }
.card { background: var(--paper); border-radius: 18px; padding: 16px 18px; max-width: 520px; width: 100%; max-height: 100%; overflow-y: auto; text-align: center; }
.card h2 { font-family: 'Dela Gothic One'; font-weight: 400; margin: 0 0 8px; }
.card h3 { margin: 12px 0 4px; font-size: 15px; text-align: left; }
.how { max-width: 640px; text-align: left; }
.how h2 { text-align: center; } .how ol { padding-left: 1.3em; font-size: 14px; font-weight: 500; line-height: 1.65; margin: 0; } .how li { margin-bottom: 6px; } .how b { font-weight: 900; }
.how .btn { display: block; margin: 12px auto 0; }
.credit { font-size: 11px; color: #6a5a45; font-weight: 500; line-height: 1.6; }
.fld { display: flex; flex-direction: column; text-align: left; font-size: 13px; gap: 4px; margin-bottom: 10px; }
.fld input { font: inherit; font-size: 17px; padding: 10px 12px; border-radius: 12px; border: 2px solid #c9b38f; -webkit-user-select: text; user-select: text; }
.big-note { font-size: 17px; } .err { color: #c0281c; font-size: 13px; min-height: 1em; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: rgba(20,15,10,.88); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 30; }
.toast.on { opacity: 1; }
#res-img { max-height: 46vh; width: auto; max-width: 100%; }
@media (max-height: 470px) { .res-t { font-size: 24px; } .res-line { font-size: 13px; margin-bottom: 4px; } #res-img { max-height: 40vh; } .res .row { margin-top: 6px; } .res .btn { padding: 8px 14px; font-size: 14px; } .sl-shape canvas { width: 96px !important; height: 96px !important; } .sl-name { font-size: 17px; } }

.cls { font: inherit; font-size: 13px; font-weight: 900; padding: 6px 8px; border-radius: 10px; border: 0; background: var(--paper2); color: var(--ink); max-width: 46vw; }
.cls-warn { background: #fde2d8; color: #9a2a14; border-radius: 10px; padding: 4px 8px; font-size: 12px; margin-top: 6px; }
.gk { display: inline-block; background: #ffcf3a; color: var(--sumi); border-radius: 8px; padding: 0 8px; margin-left: 6px; font-family: 'Dela Gothic One'; font-weight: 400; }
/* 挑戦状 */
.chal-mine { margin: 2px 0 0; font-size: 13px; font-weight: 800; color: #ffcf3a; min-height: 0; text-shadow: 0 1px 0 rgba(0,0,0,.5); }
.chal-mine:empty { display: none; }
.chal-h { display: block; font-size: 11px; font-weight: 800; opacity: .8; }
#chal-row .btn[hidden], .btn[hidden] { display: none !important; }
#chal-row:not(:has(.btn:not([hidden]))) { display: none; }
.qm-cnt { color: #f3e7cf; }
@media (max-height: 470px) { .qm-cnt { margin-top: 0; font-size: 11.5px; line-height: 1.35; } .qm-cnt .qm-prime { margin-top: 1px; padding: 1px 10px; font-size: 11px !important; } }
@media (max-height: 420px) { .sub { display: none; } }
@media (max-height: 420px) { .logo .l2 { font-size: 58px; } .logo .l1 { font-size: 20px; } }
.pk-list li.pk-note { font-size: 12.5px; color: #7a5a2a; cursor: default; background: transparent; line-height: 1.5; }
.pk-list .nm small { font-size: .78em; opacity: .75; font-weight: 800; }
/* 結果画像 */
.img-btn { display: block; margin: 6px auto 2px; min-width: 260px; }
#imgview { z-index: 25; background: rgba(15,11,8,.86); }
.iv { padding: 12px; text-align: center; width: auto; max-width: min(940px, 100%); overflow-y: auto; }
.iv img { display: block; margin: 0 auto; width: auto; max-width: 100%; height: auto; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 10px; box-shadow: 0 6px 16px rgba(0,0,0,.35); -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; }
.iv .note { margin: 6px 0 0; }
@media (max-height: 470px) { .iv img { max-height: calc(100vh - 110px); } .iv .row { margin-top: 6px; } .iv .btn { padding: 8px 14px; font-size: 14px; } }
#res-img[hidden] { display: none !important; }
/* タイトル：あなたの挑戦状・番付・お知らせ */
.t-row2 { margin-top: 0; gap: 8px; }
.btn.sm2 { font-size: 14px; padding: 8px 14px; border-radius: 12px; }

.news { border: 0; background: #ffcf3a; color: var(--sumi); font: inherit; font-size: 13px; font-weight: 800; padding: 6px 14px; border-radius: 999px; box-shadow: 0 3px 0 #9a7410; max-width: 100%; animation: newsPop .6s ease-out; }
.news b { font-weight: 900; }
.news[hidden] { display: none; }
@keyframes newsPop { 0% { transform: scale(.7); opacity: 0; } 70% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
@media (max-height: 470px) { .t-row2 .btn { padding: 6px 12px; font-size: 13px; } .news { padding: 4px 12px; font-size: 12px; } }
/* 画面（あなたの挑戦状・番付） */
#s-mine, #s-bz { align-items: stretch; justify-content: center; background: rgba(42,33,27,.92); padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
.panel { background: var(--paper); border-radius: 18px; width: 100%; max-width: 620px; display: flex; flex-direction: column; overflow: hidden; }
.p-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--sumi); color: #fff; flex-wrap: wrap; }
.p-head h2 { margin: 0; font-family: 'Dela Gothic One'; font-weight: 400; font-size: 20px; letter-spacing: .04em; }
.p-head .cls { margin-left: auto; max-width: 52vw; font-size: 14px; padding: 7px 8px; }
.p-body { flex: 1; overflow-y: auto; padding: 10px 12px 16px; -webkit-overflow-scrolling: touch; }
.mc-empty { text-align: center; color: #6a5a45; font-size: 14px; line-height: 1.7; padding: 20px 6px; margin: 0; }
.mc { background: var(--paper2); border-radius: 14px; padding: 10px; margin-bottom: 10px; box-shadow: 0 2px 0 #d9c8a6; }
.mc.gone { opacity: .6; }
.mc-head { display: flex; gap: 10px; align-items: center; }
.mc-shape { flex: 0 0 auto; background: #fff; border-radius: 10px; }
.mc-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.mc-info b { font-size: 19px; line-height: 1.2; word-break: break-all; }
.mc-info small { font-size: 11.5px; color: #6a5a45; font-weight: 800; }
.mc-rec { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.mc-rec .w { color: var(--red-d); font-size: 17px; font-weight: 900; } .mc-rec .l { color: var(--blue-d); font-size: 17px; font-weight: 900; }
.mc-rec em { font-style: normal; background: #6a5a45; color: #fff; font-size: 11px; border-radius: 6px; padding: 1px 7px; }
.mc-res { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px dashed rgba(60,40,20,.2); }
.mc-res li { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px dashed rgba(60,40,20,.12); font-size: 13px; }
.mc-res li.none { color: #7a6a55; font-weight: 500; }
.mc-res li.new { background: #fff3c8; border-radius: 8px; }
.mc-res .mk { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 900; }
.mc-res .mk.w { background: var(--red); } .mc-res .mk.l { background: #6a5a45; }
.mc-res .who { flex: 1; min-width: 0; line-height: 1.35; word-break: break-all; }
.mc-res .who small { display: block; color: #8a7a65; font-size: 11px; font-weight: 500; }
.mc-res .btn { flex: 0 0 auto; }
.mc-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.xf { border-top: 2px dashed rgba(60,40,20,.2); margin-top: 6px; padding-top: 6px; text-align: center; }
.xf h3 { margin: 6px 0 2px; font-size: 15px; }
.xf .note { margin: 0; }
.xf-code { font-family: 'Dela Gothic One'; font-size: 34px; letter-spacing: .08em; margin: 6px 0; color: var(--ink); -webkit-user-select: all; user-select: all; }
/* 番付 */
.bz-note { margin: 0 0 6px; }
.bz-st { font-size: 12px; color: #9a6a10; margin: 0 0 6px; min-height: 1em; }
.bz-st:empty { display: none; }
.bz-row { display: flex; align-items: center; gap: 8px; background: var(--paper2); border-radius: 12px; padding: 8px; margin-bottom: 8px; box-shadow: 0 2px 0 #d9c8a6; }
.bz-row.top { background: linear-gradient(135deg, #fff6d8, #ffe08a); box-shadow: 0 2px 0 #c9a23a; }
.bz-rank { flex: 0 0 auto; writing-mode: vertical-rl; font-family: 'Yuji Syuku', serif; font-weight: 400; font-size: 17px; background: var(--sumi); color: #fff; border-radius: 8px; padding: 6px 3px; min-height: 64px; display: flex; align-items: center; justify-content: center; letter-spacing: .05em; }
.bz-row.top .bz-rank { background: #c8281c; font-size: 20px; }
.bz-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.bz-info small { font-size: 11px; color: #6a5a45; font-weight: 800; }
.bz-info .nm { font-size: 17px; word-break: break-all; }
.bz-w { font-size: 12px; color: #4a3a2a; }
.bz-w b { color: var(--red-d); font-size: 15px; margin: 0 2px; }
.bz-w i { font-style: normal; margin-left: 6px; font-size: 10.5px; background: #e9dcc0; border-radius: 6px; padding: 1px 6px; color: #7a5a2a; }
.bz-row .btn { flex: 0 0 auto; }
.bz-row .btn:disabled { opacity: .55; }
/* 上の帯：せまい画面でもつぶれないように（説明は2段目へ） */
#s-setup .bar:not(.bottom) { flex-wrap: wrap; row-gap: 6px; }
.bar .btn, .seg { white-space: nowrap; flex: 0 0 auto; }
#s-setup .bar .cls { flex: 0 1 auto; min-width: 0; }
.on-st { flex: 1 0 100%; order: 9; line-height: 1.4; }
.on-st:empty { display: none; }
.qm-card .xf-code, .xf-code { font-size: 34px !important; line-height: 1.2; }
/* タイトルが入りきらない画面では、上が切れずにスクロールできるように */
#s-title { align-items: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#s-title .t-wrap { margin: auto; }
@media (max-height: 700px) { .logo .l2 { font-size: clamp(56px, min(18vw, 15vh), 120px); } .sub { margin: 8px 0 10px; } }
@media (max-height: 470px) { .sub { display: none; } .logo .l1 { font-size: 22px; } .logo .l2 { font-size: 56px; } .t-btns .btn.big { padding: 9px 18px; font-size: 16px; } }
.toast { bottom: calc(90px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); text-align: center; }
.bz-w { display: flex; flex-wrap: wrap; column-gap: 8px; }
.bz-w > span { white-space: nowrap; }
.bz-info small b { word-break: break-all; }
.mc-note { flex-basis: 100%; font-size: 11px; color: #8a7a65; font-weight: 500; }
/* スマホで2回つづけてタップしても拡大しないように（スクロールはそのままできる） */
html, body, * { touch-action: manipulation; }

/* 弾丸合併へのリンク */
.to-dangan { display: inline-block; margin-top: 4px; color: #ffcf3a; font-size: 13px; font-weight: 800; text-shadow: 0 1px 3px #000; }
@media (max-height: 470px) { .to-dangan { font-size: 12px; margin-top: 0; } }

/* ことばの切りかえ（タイトルは暗い背景なので明るい色） */
.langs{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin-top:4px}
.langs button{font:800 13px 'M PLUS Rounded 1c',sans-serif;background:rgba(23,17,13,.45);color:#f3ead6;border:2px solid rgba(243,234,214,.55);border-radius:999px;padding:4px 12px;cursor:pointer}
.langs button[aria-pressed="true"]{background:#ffcf3a;color:var(--sumi);border-color:#ffcf3a}
@media (max-height: 470px) { .langs { margin-top: 0; } .langs button { padding: 2px 10px; font-size: 12px; } }
/* 韓国語：Dela Gothic One にハングルがないので Black Han Sans */
html[data-lang="ko"] .logo,html[data-lang="ko"] .call,html[data-lang="ko"] .clock,html[data-lang="ko"] .res-t,html[data-lang="ko"] .card h2,html[data-lang="ko"] .p-head h2,html[data-lang="ko"] .gk,html[data-lang="ko"] .vs-mid,html[data-lang="ko"] .xf-code{font-family:'Black Han Sans','Dela Gothic One',sans-serif;font-weight:400}
html[data-lang="ko"] .logo .l2{letter-spacing:.08em}
/* 繁體中文の題字 */
html[data-lang="zh"] .logo{font-family:'Noto Sans TC','Dela Gothic One',sans-serif;font-weight:900;font-synthesis:none}
/* 英語の題字：横に長いので小さめ */
html[data-lang="en"] .logo .l1{letter-spacing:.16em;padding-left:.16em;font-size:clamp(24px,min(7vw,7.5vh),46px)}
html[data-lang="en"] .logo .l2{font-size:clamp(32px,min(11vw,12vh),66px);letter-spacing:.02em}
@media (max-height: 470px) { html[data-lang="en"] .logo .l2 { font-size: 46px; } }
@media (max-height: 420px) { html[data-lang="en"] .logo .l2 { font-size: 40px; } html[data-lang="en"] .logo .l1 { font-size: 18px; } }
/* 外国語は長い名前が多いので、語の切れ目で折り返す */
html:not([data-lang="ja"]) .sl-name{word-break:normal;overflow-wrap:anywhere}
html:not([data-lang="ja"]) .mc-info b,html:not([data-lang="ja"]) .mc-res .who{word-break:normal;overflow-wrap:anywhere}
html[data-lang="ko"] .sl-name,html[data-lang="ko"] .res-line,html[data-lang="ko"] .mc-info b{word-break:keep-all;overflow-wrap:anywhere}
/* 韓国語：語の途中で折り返さない */
html[data-lang="ko"] .res-t,html[data-lang="ko"] .call,html[data-lang="ko"] .qm-fld,html[data-lang="ko"] .pk-list .badge,html[data-lang="ko"] .mc-res .who,html[data-lang="ko"] .hidden-foe,html[data-lang="ko"] .cls-warn{word-break:keep-all;overflow-wrap:anywhere}
html:not([data-lang="ja"]) .qm-fld{white-space:nowrap}
.qm-fld input{min-width:0}
html:not([data-lang="ja"]) .bz-w > span{white-space:normal}
/* タイトル：入りきらない画面では上からスクロール（入るときは今までどおり真ん中） */
#s-title{overflow-y:auto;align-items:flex-start;-webkit-overflow-scrolling:touch}
#s-title .t-wrap{margin:auto}
/* 明るい箱の上の「とじる」「もどる」が見えるように */
.card .btn.ghost,.sheet-in .btn.ghost{background:rgba(42,33,27,.1);color:var(--ink);box-shadow:0 3px 0 rgba(42,33,27,.2)}
/* 検索：外国語の合併先は長いので折り返す */
html:not([data-lang="ja"]) .pk-list .bd{white-space:normal;max-width:48%}
html:not([data-lang="ja"]) .pk-list .bd .badge{line-height:1.35}
/* 番付の位：英語・韓国語は横書き */
html[data-lang="en"] .bz-rank,html[data-lang="ko"] .bz-rank{writing-mode:horizontal-tb;font-family:'M PLUS Rounded 1c',sans-serif;font-weight:900;font-size:12px;width:62px;min-height:52px;padding:4px;text-align:center;letter-spacing:0;line-height:1.2}
html[data-lang="en"] .bz-row.top .bz-rank,html[data-lang="ko"] .bz-row.top .bz-rank{font-size:13px}
/* 繁體中文：筆の字体に繁体字がないので、丸ゴシックの横書き */
html[data-lang="zh"] .bz-rank{writing-mode:horizontal-tb;font-family:'M PLUS Rounded 1c',sans-serif;font-weight:900;font-size:14px;width:50px;min-height:52px;padding:4px;text-align:center;letter-spacing:0;line-height:1.2}

/* ===== 2026-10-31 リニューアル：スマホで選びやすく ===== */
.side-tabs { display: none; }
@media (max-aspect-ratio: 1/1) {
  .side-tabs { display: flex; align-items: stretch; gap: 6px; padding: 0 max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left)); }
  .stab { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 6px; border: 0; border-radius: 14px; padding: 6px 8px; background: rgba(243,234,214,.18); color: #f3ead6; text-align: left; box-shadow: inset 0 0 0 2px rgba(243,234,214,.25); }
  .stab canvas { width: 44px; height: 44px; flex: 0 0 auto; background: rgba(251,246,234,.9); border-radius: 10px; }
  .st-t { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
  .st-t small { font-size: 11px; opacity: .85; }
  .st-t b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stab.on { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 3px var(--red), 0 3px 0 rgba(0,0,0,.35); }
  .stab.s1.on { box-shadow: inset 0 0 0 3px var(--blue), 0 3px 0 rgba(0,0,0,.35); }
  .stab.empty:not(.on) { animation: stabPulse 1.4s ease-in-out infinite; }
  @keyframes stabPulse { 50% { background: rgba(255,207,58,.38); } }
  .st-vs { align-self: center; font-family: 'Dela Gothic One'; color: #ffcf3a; font-size: 16px; text-shadow: 0 2px 0 var(--sumi); }
  html[data-lang="ko"] .st-vs { font-family: 'Black Han Sans','Dela Gothic One',sans-serif; }
  /* えらんでいる方だけを大きく出す */
  .slots { flex-direction: column; overflow: hidden; }
  .slots .vs-mid { display: none; }
  .slots[data-tab="0"] #slot1, .slots[data-tab="1"] #slot0 { display: none; }
  .slots .slot { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  /* 向き・政策を押しやすく */
  .dir { gap: 8px; }
  .dir .btn { padding: 8px 14px; font-size: 20px; line-height: 1; border-radius: 12px; }
  .pols { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .pol { min-height: 58px; padding: 8px 9px; }
  .pol b { font-size: 14px; }
  .pol i { font-size: 13px; padding: 1px 7px; }
  .pol small { font-size: 12px; line-height: 1.35; margin-top: 2px; }
  .sl-btns .btn { flex: 1 1 0; padding: 10px 12px; font-size: 15px; }
  /* 上の帯を1段に */
  #s-setup .bar:not(.bottom) { gap: 6px; }
  #s-setup .bar .cls { flex: 1 1 0; width: 0; min-width: 0; }
  #s-setup .bar .seg { padding: 6px 8px; font-size: 12px; }
}
/* 政策カード：説明の字を読みやすく（PCも） */
.pol small { font-size: 11.5px; line-height: 1.35; }
.pol.no { opacity: .45; }
/* 試合中のボタンを押しやすく */
.b-btns { gap: 8px; }
.b-btns .btn { padding: 10px 16px; font-size: 15px; border-radius: 12px; min-width: 64px; }
/* 検索：スマホではキーボードに隠れないよう、上に寄せる */
@media (max-aspect-ratio: 1/1) {
  #picker { align-items: flex-start; padding-top: max(10px, env(safe-area-inset-top)); }
  #picker .sheet-in { max-height: calc(100dvh - 20px); }
}
/* 結果：ボタンを2列にまとめる */
.res .row { flex-wrap: nowrap; gap: 8px; }
.res .row .btn { flex: 1 1 0; min-width: 0; padding: 11px 8px; font-size: 15px; }
.res .row .btn[hidden] { display: none; }
.res .row.r-main .btn { font-size: 16px; padding: 13px 8px; }
/* タイトルの説明：日本語は言葉の切れ目で折り返す */
html[data-lang="ja"] .sub { word-break: keep-all; overflow-wrap: anywhere; }
/* 録画しますか？ */
#recq { z-index: 26; }
.rq { padding: 18px 16px 16px; text-align: center; max-width: 420px; }
.rq h3 { font-family: 'Dela Gothic One'; font-weight: 400; font-size: 24px; margin: 0 0 6px; }
html[data-lang="ko"] .rq h3 { font-family: 'Black Han Sans','Dela Gothic One',sans-serif; }
.rq .row { flex-wrap: nowrap; }
.rq .row .btn { flex: 1 1 0; min-width: 0; padding: 14px 8px; }
.rq .btn.pick { outline: 3px solid var(--gold); outline-offset: 2px; }
/* 録画中の帯（動画には映らない） */
.rec-bar { position: absolute; left: 50%; top: calc(58px + env(safe-area-inset-top)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: rgba(20,15,11,.82); color: #fff; border-radius: 999px; padding: 5px 6px 5px 14px; font-size: 14px; white-space: nowrap; z-index: 5; }
.rec-bar[hidden] { display: none; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #ff3b30; animation: recBlink 1s steps(2) infinite; }
@keyframes recBlink { 50% { opacity: .25; } }
.rec-bar .btn { padding: 5px 12px; font-size: 13px; }
/* 試合の動画 */
#vidview { z-index: 25; background: rgba(15,11,8,.86); }
#vv { display: block; margin: 0 auto; max-width: 100%; max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px); border-radius: 10px; background: #000; box-shadow: 0 6px 16px rgba(0,0,0,.35); }
#vidview .row { flex-wrap: nowrap; gap: 8px; }
#vidview .row .btn { flex: 1 1 0; min-width: 0; padding: 11px 8px; font-size: 15px; }
html[data-lang="ko"] .res .row .btn, html[data-lang="ko"] .rq .btn, html[data-lang="ko"] #vidview .btn { word-break: keep-all; overflow-wrap: anywhere; }
/* 試合の大きな文字：外国語は長いので、はみ出さないように小さめ・折り返し */
.call { padding: 0 12px; overflow-wrap: anywhere; }
html:not([data-lang="ja"]) .call { font-size: clamp(30px, 8vw, 72px); }
