:root { --paper: #f3ead6; --paper2: #fbf6ea; --ink: #2a1f17; --sumi: #1f1a17; --red: #d8402f; --red-d: #8e1d14; --blue: #3f6fc9; --blue-d: #16357a; --gold: #ffcf3a; --bg: #2a211b; --t0: #f0a542; --t1: #f3ead6; --t2: #5fb3a1; --muted: #7a6a55; }
* { 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; touch-action: manipulation; }
#arena3, #arena2 { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; -webkit-user-select: text; user-select: text; }
.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; white-space: nowrap; }
.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.sm2 { font-size: 14px; padding: 9px 14px; border-radius: 12px; }
.btn.ghost { background: rgba(255,255,255,.14); color: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.btn.ghost.on { background: var(--gold); color: var(--ink); }
.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; overflow-y: auto; background: radial-gradient(circle at 50% 45%, rgba(42,33,27,.05), rgba(42,33,27,.7)); }
.t-wrap { text-align: center; padding: max(16px, env(safe-area-inset-top)) 16px 16px; max-width: 560px; margin: auto; }
.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(34px, min(10vw, 10vh), 62px); letter-spacing: .3em; padding-left: .3em; }
.logo .l2 { display: block; font-size: clamp(64px, min(21vw, 21vh), 140px); color: var(--gold); 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,.8); }
.sub b { color: var(--gold); }
.t-btns { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.t-btns .btn.big { min-width: 260px; }
.jimoto { color: #e9dcc0; font-size: 13px; margin-top: 6px; text-shadow: 0 1px 3px #000; }
.loading { color: #e9dcc0; font-size: 13px; margin-top: 12px; text-shadow: 0 1px 3px #000; }
@media (max-height: 500px) { .logo .l2 { font-size: 64px; } .logo .l1 { font-size: 30px; } .sub { margin: 6px 0 8px; font-size: 13px; } .t-btns { gap: 6px; } .btn.big { padding: 10px 18px; font-size: 16px; } }

/* 共通のバー */
.bar { display: flex; align-items: center; gap: 8px; 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; flex: none; }
.bar.bottom { justify-content: center; padding-top: 8px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.v-title { font-size: 18px; }

/* 作る */
#s-build { flex-direction: column; background: var(--bg); }
.b-name { flex: 1; min-width: 0; font-family: 'Dela Gothic One'; font-size: 20px; color: var(--gold); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 0 var(--sumi); }
.b-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); }
.b-top { display: flex; gap: 8px; flex: none; }
.b-prev { position: relative; flex: none; width: min(46vw, 34vh, 230px); aspect-ratio: 1; background: var(--paper2); border-radius: 16px; overflow: hidden; }
.b-prev canvas { width: 100%; height: 100%; display: block; }
.b-out { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.chip { font-size: 10px; padding: 1px 6px; border-radius: 999px; color: var(--ink); border: 1px solid rgba(42,31,23,.4); white-space: nowrap; }
.b-stats { flex: 1; min-width: 0; background: var(--paper); border-radius: 16px; padding: 8px 10px; display: flex; flex-direction: column; justify-content: space-around; }
.st { display: grid; grid-template-columns: 3.6em 1fr 3.4em; align-items: center; gap: 6px; font-size: 13px; }
.st .bar2 { height: 9px; background: #e2d3b3; border-radius: 6px; overflow: hidden; }
.st .bar2 i { display: block; height: 100%; background: var(--red); border-radius: 6px; transition: width .25s; }
.st .d { font-size: 11px; text-align: right; white-space: nowrap; }
.st .d.up { color: #2f8a4b; } .st .d.dn { color: #c0392b; }
.st-note { font-size: 11px; color: var(--muted); line-height: 1.3; }
.b-edit { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.tabs { display: flex; gap: 4px; flex: none; }
.tab { flex: 1; min-width: 0; border: 0; border-radius: 12px 12px 0 0; padding: 7px 6px 6px; background: rgba(255,255,255,.12); color: #e9dcc0; font-size: 13px; text-align: center; }
.tab .tn { display: block; font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.35); }
.tab.on { background: var(--paper); color: var(--ink); }
.b-panel { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--paper); border-radius: 0 0 16px 16px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.b-cur { display: flex; gap: 10px; flex: none; }
.b-hole { position: relative; flex: none; width: min(36vw, 22vh, 170px); aspect-ratio: 1; background: var(--paper2); border-radius: 12px; }
.b-hole canvas { width: 100%; height: 100%; display: block; touch-action: manipulation; }
.b-hlab { position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; font-size: 11px; color: var(--muted); }
.b-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.b-cname { font-size: 18px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-all; }
.b-cname small { display: block; font-size: 11px; color: var(--muted); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-meta { font-size: 11px; color: var(--muted); display: flex; gap: 4px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #2f8a4b; color: #fff; }
.tag.old { background: #8a6a3a; } .tag.h0 { background: #f3a645; color: var(--ink); } .tag.h1 { background: #ec6a52; color: #fff; } .tag.h2 { background: #52b48a; color: var(--ink); } .tag.lab { background: #b9a27c; color: var(--ink); }
.b-rot { display: flex; align-items: center; gap: 8px; }
.b-rot span { min-width: 3em; text-align: center; font-size: 15px; }
.b-rot .btn { font-size: 18px; padding: 4px 14px; }
.b-tip { font-size: 11px; color: var(--muted); }
.b-search input { width: 100%; border: 2px solid #c9b48c; border-radius: 12px; padding: 9px 12px; font-size: 16px; background: #fff; color: var(--ink); outline: none; }
.b-search input:focus { border-color: var(--red); }
.b-list { flex: 1 0 140px; min-height: 140px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; -webkit-overflow-scrolling: touch; }
.it { display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: var(--paper2); border-radius: 10px; padding: 8px 10px; box-shadow: 0 2px 0 #d9c8a4; }
.it.on { outline: 3px solid var(--red); }
.it .nm { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it .nm small { font-size: 11px; color: var(--muted); margin-left: 4px; }
.it .tag { flex: none; }
.b-lhead { font-size: 12px; color: var(--muted); padding: 2px 4px; }
@media (min-aspect-ratio: 1/1) {
  .b-main { flex-direction: row; }
  .b-top { flex-direction: column; width: min(40vw, 360px); }
  .b-prev { width: 100%; max-height: 55vh; aspect-ratio: auto; flex: 1; }
  .b-stats { flex: none; }
  .b-edit { flex: 1; }
}
@media (min-aspect-ratio: 1/1) and (max-height: 520px) { .b-stats .st-note { display: none; } .st { font-size: 12px; } .b-hole { width: 120px; } }

/* 対戦の相手えらび */
#s-vs { flex-direction: column; background: rgba(42,33,27,.92); }
.v-slots { flex: 1; min-height: 0; display: flex; gap: 8px; padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); overflow-y: auto; }
.v-mid { display: flex; align-items: center; justify-content: center; font-family: 'Dela Gothic One'; color: var(--gold); font-size: 24px; text-shadow: 0 3px 0 var(--sumi); }
.v-slot { flex: 1; min-width: 0; background: var(--paper); border-radius: 16px; padding: 10px; box-shadow: inset 0 0 0 3px var(--red); display: flex; flex-direction: column; gap: 8px; align-items: center; }
#v-s1 { box-shadow: inset 0 0 0 3px var(--blue); }
.v-side { align-self: flex-start; flex: none; font-size: 11px; color: #fff; background: var(--red); border-radius: 6px; padding: 1px 8px; }
#v-s1 .v-side { background: var(--blue); }
.v-cv { width: min(100%, 220px); aspect-ratio: 1; background: var(--paper2); border-radius: 12px; display: block; }
.v-name { font-size: 18px; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-parts { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.4; }
.v-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
@media (max-aspect-ratio: 1/1) { .v-slots { flex-direction: column; } .v-slot { flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; } .v-slot .v-side { width: auto; flex-basis: 100%; max-width: max-content; } .v-cv { width: 120px; } .v-info { flex: 1; min-width: 0; } .v-name { text-align: left; } .v-parts { text-align: left; } .v-btns { width: 100%; } .v-mid { font-size: 18px; } }
.v-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; }

/* 保存したコマ */
#s-saved { flex-direction: column; background: rgba(42,33,27,.94); }
.sv-list { flex: 1; overflow-y: auto; padding: 0 max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; align-content: start; }
.sv { background: var(--paper); border-radius: 14px; padding: 8px; display: flex; gap: 8px; align-items: center; }
.sv canvas { width: 76px; height: 76px; background: var(--paper2); border-radius: 10px; flex: none; }
.sv .sv-i { flex: 1; min-width: 0; }
.sv .v-name { text-align: left; font-size: 15px; }
.sv .v-parts { text-align: left; }
.sv .v-btns { justify-content: flex-start; margin-top: 4px; }
.sv-empty { color: #e9dcc0; text-align: center; padding: 30px 10px; grid-column: 1 / -1; }

/* 合体 */
#s-merge { align-items: center; justify-content: center; background: rgba(20,15,12,.55); }
.mg { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 16px; }
.mg-side { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; max-width: 46vw; }
.mg-p { font-size: 15px; padding: 6px 14px; border-radius: 10px; color: var(--ink); opacity: 0; transform: translateY(-60px) scale(1.2); transition: transform .28s cubic-bezier(.3,1.6,.6,1), opacity .2s; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-p.in { opacity: 1; transform: none; }
.mg-n { font-family: 'Dela Gothic One'; font-size: clamp(22px, 6vw, 44px); color: #fff; -webkit-text-stroke: 2px var(--sumi); paint-order: stroke fill; text-shadow: 0 4px 0 var(--sumi); opacity: 0; transform: scale(2.2); transition: transform .35s cubic-bezier(.3,1.5,.6,1), opacity .2s; text-align: center; word-break: break-all; max-width: 46vw; }
.mg-n.in { opacity: 1; transform: none; }
.mg-side.s0 .mg-n { color: #ffd2c9; } .mg-side.s1 .mg-n { color: #cfe0ff; }
.mg-vs { font-family: 'Dela Gothic One'; color: var(--gold); font-size: 30px; text-shadow: 0 3px 0 var(--sumi); }
@media (max-aspect-ratio: 1/1) { .mg { flex-direction: column; } .mg-side, .mg-n { max-width: 92vw; } }

/* 試合 */
#s-battle { pointer-events: none; }
#s-battle .btn, #s-battle .pl { pointer-events: auto; }
.hud { position: absolute; left: 0; right: 0; top: 0; display: flex; gap: 6px; align-items: flex-start; padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); }
.pl { flex: 1; min-width: 0; background: rgba(251,246,234,.93); border-radius: 12px; padding: 6px 8px; box-shadow: inset 0 0 0 3px var(--red); }
.pl.p1 { box-shadow: inset 0 0 0 3px var(--blue); text-align: right; }
.pl .nm { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl .hp { height: 18px; background: #3a2e25; border-radius: 7px; overflow: hidden; margin: 4px 0; position: relative; box-shadow: inset 0 0 0 2px rgba(0,0,0,.35); }
.pl .hp i, .pl .hp u { position: absolute; top: 2px; bottom: 2px; left: 2px; max-width: calc(100% - 4px); border-radius: 5px; }
.pl .hp i { background: #3e9a55; transition: width .12s, background-color .3s; }
.pl .hp u { background: #fff3c4; transition: width .7s ease-in .35s; }   /* 減った分が少し残って、あとから追いかけて減る */
.pl.p1 .hp i, .pl.p1 .hp u { left: auto; right: 2px; }
.pl .hp .hpn { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; font-weight: 900; letter-spacing: .03em; }
.pl.pinch .hp { animation: pinch .5s infinite alternate; }
@keyframes pinch { from { box-shadow: inset 0 0 0 2px rgba(0,0,0,.35); } to { box-shadow: inset 0 0 0 2px #ff5a3c, 0 0 10px #ff5a3c; } }
body.slow #s-battle::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px rgba(0,0,0,.65); }
.pl .ly { display: flex; gap: 3px; }
.pl.p1 .ly { flex-direction: row-reverse; }
.pl .ly span { flex: 1; min-width: 0; font-size: 10px; border-radius: 5px; padding: 1px 3px; overflow: hidden; white-space: nowrap; text-overflow: clip; position: relative; background: #e2d3b3; text-align: center; }
.pl .ly span i { position: absolute; left: 0; top: 0; bottom: 0; opacity: .8; }
.pl .ly span em { position: relative; font-style: normal; }
.pl .ly span.burst { background: #555; color: #fff; text-decoration: line-through; }
.pl .pct { font-size: 12px; color: var(--muted); }
.clock { flex: none; min-width: 52px; text-align: center; font-family: 'Dela Gothic One'; font-size: 26px; color: #fff; text-shadow: 0 3px 0 var(--sumi); padding-top: 6px; }
.callout { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font-family: 'Dela Gothic One'; font-size: clamp(30px, 9vw, 64px); color: var(--gold); -webkit-text-stroke: 2px var(--sumi); paint-order: stroke fill; text-shadow: 0 4px 0 var(--sumi); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.callout.in { opacity: 1; transform: scale(1.06); }
.cam { position: absolute; right: max(8px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.quit { position: absolute; left: max(8px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); }
.hint3d { position: absolute; left: 0; right: 0; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 44px); text-align: center; color: #e9dcc0; font-size: 12px; text-shadow: 0 1px 3px #000; transition: opacity .6s; }

/* 結果 */
#s-result { align-items: center; justify-content: center; background: rgba(20,15,12,.5); overflow-y: auto; padding: 16px; }
.card { background: var(--paper); border-radius: 18px; padding: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.5); max-width: 560px; width: 100%; margin: auto; }
.res h2 .wn { display: block; font-size: .8em; word-break: break-all; }
.res h2 { margin: 0 0 4px; text-align: center; font-family: 'Dela Gothic One'; font-size: clamp(22px, 6vw, 34px); font-weight: 400; }
.res .w0 { color: var(--red); } .res .w1 { color: var(--blue); }
.res .why { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.res table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.res th, .res td { padding: 5px 4px; border-bottom: 1px solid #dccba6; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res th:first-child, .res td:first-child { text-align: left; color: var(--muted); width: 7.5em; }
.res th.c0 { color: var(--red); } .res th.c1 { color: var(--blue); }
.res .row .btn { min-width: 120px; }

/* あそびかた */
.modal { position: fixed; inset: 0; background: rgba(20,15,12,.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; overflow-y: auto; }
.modal h2 { margin: 0 0 8px; font-family: 'Dela Gothic One'; font-weight: 400; }
.modal p { margin: 6px 0; font-size: 14px; line-height: 1.55; font-weight: 800; }
.modal b { color: var(--red); }
.toast { position: fixed; left: 50%; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 60px); transform: translateX(-50%); background: rgba(20,15,12,.9); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 30; max-width: 90vw; text-align: center; }
.toast.in { opacity: 1; }

/* ---------- 本番版で足したもの ---------- */
.btn.gold { background: var(--gold); color: var(--ink); box-shadow: 0 4px 0 #9a7410; }
.t-row2 { margin-top: 0; gap: 8px; }
.chal-mine { color: #f3e7cf; font-size: 13px; margin: 2px 0 0; text-shadow: 0 1px 3px #000; }
.chal-mine:empty { display: none; }
.news { border: 0; background: var(--gold); 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; } }
.qm-cnt { color: #f3e7cf; font-size: 12.5px; text-shadow: 0 1px 3px #000; }
@media (max-height: 640px) { .t-btns { gap: 6px; } .t-btns .btn.big { padding: 10px 18px; font-size: 16px; } .t-row2 .btn { padding: 6px 11px; font-size: 13px; } .sub { display: none; } }
/* 作る：並べかえ */
.b-modes { display: flex; background: rgba(42,31,23,.08); border-radius: 10px; padding: 3px; margin-top: 6px; }
.seg { flex: 1; border: 0; background: none; color: var(--muted); padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.seg.on { background: var(--paper2); color: var(--ink); box-shadow: 0 1px 0 #d9c8a4; }
.b-sort { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.b-sort select { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 6px 8px; border-radius: 10px; border: 2px solid #c9b48c; background: #fff; color: var(--ink); }
.it .val { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
/* あいことば対戦 */
#s-online { align-items: center; justify-content: center; background: rgba(42,33,27,.85); padding: 16px; overflow-y: auto; }
.on-card h2 { margin: 0 0 6px; font-family: 'Dela Gothic One'; font-weight: 400; text-align: center; }
.on-card { text-align: center; max-width: 440px; }
.note { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 6px 0; }
.big-note { font-size: 18px; margin: 14px 0 6px; }
.fld { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-size: 14px; justify-content: center; }
.fld input { flex: 1; max-width: 240px; font-size: 17px; padding: 9px 12px; border-radius: 12px; border: 2px solid #c9b48c; background: #fff; color: var(--ink); }
.btn.wide { width: 100%; margin-top: 4px; }
.err { color: #c0392b; font-size: 13px; min-height: 1em; margin: 8px 0; }
.btn.ghost.dark { background: rgba(42,31,23,.12); color: var(--ink); box-shadow: 0 3px 0 rgba(0,0,0,.18); }
/* えらぶ（30秒） */
#s-pick { flex-direction: column; background: rgba(42,33,27,.94); }
.pk-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.pk-time { font-family: 'Dela Gothic One'; font-size: 28px; color: var(--gold); min-width: 44px; text-align: right; text-shadow: 0 2px 0 var(--sumi); }
.pk-st { color: #f3e7cf; font-size: 13px; margin: 0 14px 8px; text-align: center; }
.sv.pk { border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.sv.pk.on { outline: 4px solid var(--red); }
.sv .tag { margin-top: 4px; }
.mg-who { color: #fff; font-size: 13px; background: rgba(0,0,0,.35); border-radius: 999px; padding: 2px 12px; }
.pl .nm small { font-size: 11px; color: var(--muted); }
.res-note { text-align: center; font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.res-note:empty { display: none; }
#res-qm:empty { display: none; }
/* あなたの挑戦状・番付 */
#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: inherit; font-size: 14px; padding: 7px 8px; border-radius: 10px; }
.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: 17px; 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-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-code { font-family: 'Dela Gothic One'; font-size: 34px !important; letter-spacing: .08em; margin: 6px 0; color: var(--ink); -webkit-user-select: all; user-select: all; line-height: 1.2; }
.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: 'Dela Gothic One'; font-size: 16px; 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: 19px; }
.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: 16px; word-break: break-all; }
.bz-w { font-size: 12px; color: #4a3a2a; display: flex; flex-wrap: wrap; column-gap: 8px; }
.bz-w > span { white-space: nowrap; }
.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; }
/* タイトルが入りきらない画面では、上が切れずにスクロールできるように */
#s-title { align-items: flex-start; -webkit-overflow-scrolling: touch; }
.logo { margin-bottom: 6px; }
@media (max-height: 500px) { .logo .l2 { font-size: 56px; } .logo .l1 { font-size: 26px; } .t-btns .btn.big { padding: 8px 18px; font-size: 15px; } .t-row2 .btn { padding: 5px 10px; font-size: 12.5px; } .t-btns { gap: 5px; } }

/* 試合の速さ */
.spd { position: absolute; left: 0; right: 0; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 46px); display: flex; gap: 5px; justify-content: center; align-items: center; pointer-events: none; }
.spd > * { pointer-events: auto; }
.spd span { color: #fff; font-size: 12px; text-shadow: 0 1px 3px #000; margin-right: 2px; }
.spd .btn { padding: 6px 10px; font-size: 13px; }
.hint3d { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 92px); }

/* 結果画像 */
.img-btn { display: block; margin: 10px auto 0; min-width: 240px; }
#imgview { z-index: 25; background: rgba(15,11,8,.86); }
.iv { padding: 12px; text-align: center; max-width: min(940px, 100%); }
.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; }
