/* ヨツワケ（仮題）の見た目。可愛いアニメ調 × SF（金属と光）。 */
:root {
  --ink: #0b0d24;
  --panel: rgba(13, 16, 44, 0.78);
  --line: rgba(150, 175, 255, 0.22);
  --txt: #eef2ff;
  --dim: #a9b4dc;
  --cy: #4fe3ff;
  --pk: #ff7ab0;
  --yl: #ffd45a;
  --font: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  /* スマホの切り欠き・角の丸みを避ける余白 */
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --bs: 1;
  /* 画面の幅・高さの 1%（縦持ちで横向きに回して見せるときは、回した後の幅・高さに付け替える） */
  --vw: 1vw; --vh: 1vh;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); overflow: hidden; color: var(--txt); font-family: var(--font); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; overscroll-behavior: none; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ov { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; display: none; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; display: none; }
body.playing #ov, body.playing #hud { display: block; }
button { font-family: inherit; color: inherit; cursor: pointer; }
kbd { font-family: inherit; display: inline-block; min-width: 22px; padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.25); border-bottom-width: 2px; font-size: 11px; font-weight: 700; text-align: center; white-space: nowrap; }

/* ---------- 戦っている間 ---------- */
.h-top { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; }
.h-top .timer { min-width: 86px; text-align: center; font-size: 30px; font-weight: 800; letter-spacing: 1px; padding: 2px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.h-top .timer.low { color: var(--pk); animation: pulse 0.5s infinite alternate; }
.h-top .timer.wide { font-size: 18px; padding: 6px 18px; }
.h-top .timer small { display: block; font-size: 11px; font-weight: 600; color: var(--dim); letter-spacing: 0; }
.h-top .side { display: flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-weight: 800; font-size: 15px; }
.h-top .side.t0 { color: #7fd0ff; } .h-top .side.t1 { color: #ff8f98; }
/* 相手の名前の下の細い棒＝相手のエネルギー。空っぽ（どの道具も出せない）は点滅＝攻め時 */
.h-top .side { position: relative; }
.h-top .oen { position: absolute; left: 12px; right: 12px; bottom: 3px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); overflow: hidden; pointer-events: none; }
.h-top .oen b { display: block; height: 100%; width: 100%; border-radius: 2px; background: linear-gradient(180deg, #8ff3ff, #2fc0ff); transition: width 0.15s; }
.h-top .oen.empty { overflow: visible; background: rgba(255, 212, 90, 0.25); box-shadow: 0 0 0 1.5px #ffd45a; animation: oenBlink 0.4s infinite alternate; }
@keyframes oenBlink { from { opacity: 0.35; } to { opacity: 1; } }
.h-top .pips { letter-spacing: 3px; font-size: 16px; }
.h-top .team { display: flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 14px; background: var(--panel); border: 2px solid transparent; color: var(--c); font-weight: 800; font-size: 13px; }
.h-top .team.me { border-color: var(--c); }
.h-top .team b { font-size: 24px; color: #fff; font-variant-numeric: tabular-nums; min-width: 22px; text-align: center; }

.h-feed { position: absolute; top: 14px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.h-feed div { background: var(--panel); border-radius: 10px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.h-feed i { font-style: normal; color: var(--dim); margin: 0 8px; font-size: 11px; }
.h-feed i::before { content: "▸ "; } .h-feed i::after { content: " ▸"; }

.h-banner { position: absolute; top: 20%; left: 0; right: 0; margin: 0 auto; width: max-content; max-width: 72%; text-align: center; opacity: 0; transition: opacity 0.25s; }
.h-banner.on { opacity: 1; animation: pop 0.28s cubic-bezier(0.2, 1.6, 0.4, 1); }
.h-banner b { display: block; font-size: 62px; font-weight: 900; letter-spacing: 4px; color: #fff; text-shadow: 0 0 18px rgba(79, 227, 255, 0.9), 0 3px 0 rgba(11, 13, 36, 0.9), 0 0 4px #0b0d24; }
.h-banner span { display: inline-block; margin-top: 4px; font-size: 15px; font-weight: 700; color: #dfe8ff; text-shadow: 0 1px 4px #0b0d24, 0 0 3px #0b0d24; }
.h-banner.count b { font-size: 96px; }
.h-banner.go b { color: var(--yl); text-shadow: 0 0 22px rgba(255, 212, 90, 0.9), 0 3px 0 rgba(11, 13, 36, 0.9); }
.h-banner.win b { color: var(--yl); text-shadow: 0 0 22px rgba(255, 212, 90, 0.9), 0 3px 0 rgba(11, 13, 36, 0.9); }
.h-banner.lose b { color: #ff9aa8; text-shadow: 0 0 22px rgba(255, 90, 120, 0.8), 0 3px 0 rgba(11, 13, 36, 0.9); }

.h-sub { position: absolute; top: 64%; left: 50%; transform: translateX(-50%); padding: 5px 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; font-weight: 700; opacity: 0; transition: opacity 0.2s; white-space: nowrap; }
.h-sub.on { opacity: 1; }
.h-sub.warn { border-color: rgba(255, 122, 150, 0.8); color: #ffc2cc; }
.h-sub.good { border-color: rgba(255, 212, 90, 0.8); color: var(--yl); }

.h-bottom { position: absolute; left: 20px; right: 16px; bottom: 16px; display: grid; grid-template-columns: minmax(250px, 1fr) auto minmax(0, 1fr); align-items: end; gap: 14px; }
.h-vitals { max-width: 340px; }
.h-tip { justify-self: end; font-size: 11px; color: var(--dim); font-weight: 700; opacity: 0; white-space: nowrap; overflow: hidden; text-shadow: 0 1px 3px #0b0d24; }
.h-tip.on { opacity: 0.9; }
.h-who { white-space: nowrap; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 800; font-size: 14px; text-shadow: 0 1px 3px #0b0d24; }
.h-abil { white-space: nowrap; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--dim); }
.h-abil.on { color: #1a1030; background: var(--yl); border-color: #fff; box-shadow: 0 0 14px rgba(255, 212, 90, 0.9); animation: pulse 0.4s infinite alternate; }
.h-abil.flash { animation: flash 0.5s; }
.bar { position: relative; height: 22px; border-radius: 11px; background: rgba(8, 10, 28, 0.82); border: 1px solid var(--line); overflow: hidden; margin-bottom: 5px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 10px; transition: width 0.08s linear; }
.bar.hp i { background: linear-gradient(180deg, #ff9db0, #ff5f85); }
.bar.hp i.low { background: linear-gradient(180deg, #ff6a6a, #d82a4a); animation: pulse 0.35s infinite alternate; }
.bar.en i { background: linear-gradient(180deg, #8ff3ff, #2fc0ff); box-shadow: 0 0 10px rgba(79, 227, 255, 0.6); }
.bar.en i.low { background: linear-gradient(180deg, #ffe08a, #ffad3a); box-shadow: 0 0 10px rgba(255, 190, 70, 0.6); }
.bar u { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.95) 0 4px, rgba(255, 255, 255, 0.55) 4px 8px); animation: pulse 0.18s infinite alternate; text-decoration: none; }
.bar s { position: absolute; left: 25%; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, 0.75); text-decoration: none; }
.bar q { display: none; position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: #ffd34a; box-shadow: 0 0 0 1px rgba(8, 10, 26, 0.85), 0 0 6px rgba(255, 211, 74, 0.8); quotes: none; z-index: 2; }
.bar q.on { display: block; }
.bar q::before, .bar q::after { content: none; }
.bar em { position: absolute; left: 10px; top: 0; line-height: 20px; font-size: 11px; font-style: normal; font-weight: 800; color: rgba(11, 13, 36, 0.85); mix-blend-mode: normal; text-shadow: 0 0 3px rgba(255, 255, 255, 0.6); }
.bar b { position: absolute; right: 10px; top: 0; line-height: 20px; font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px #0b0d24, 0 0 3px #0b0d24; font-variant-numeric: tabular-nums; }
.bar.en { overflow: visible; }
.bar.en i, .bar.en u { border-radius: 10px; }
.bar .pop { position: absolute; right: 0; top: -22px; font-size: 13px; font-weight: 800; color: #9ffff0; text-shadow: 0 1px 3px #0b0d24; opacity: 0; }
.bar .pop.on { animation: rise 1.1s ease-out; }
.bar.shake { animation: shake 0.3s; border-color: var(--pk); }
.h-rule { font-size: 10.5px; color: var(--dim); font-weight: 600; text-shadow: 0 1px 3px #0b0d24; }

.h-slots { display: flex; gap: 8px; align-items: flex-end; }
.slot { position: relative; width: 104px; height: 62px; padding: 6px 8px 8px; border-radius: 12px; background: var(--panel); border: 2px solid rgba(255, 255, 255, 0.14); transition: transform 0.1s, border-color 0.1s; overflow: hidden; }
.slot .k { position: absolute; left: 6px; top: 4px; font-size: 10px; font-weight: 800; color: var(--dim); }
.slot .n { display: block; margin-top: 12px; font-size: 14px; font-weight: 800; color: var(--c); white-space: nowrap; }
.slot .d { display: block; font-size: 10.5px; font-weight: 700; color: #dfe6ff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.slot .d q { quotes: none; display: inline-block; padding: 0 3px; margin-right: 1px; border-radius: 4px; color: var(--dim); }
.slot .d q.on { background: var(--c); color: #0b0d24; }
.slot .d em { font-style: normal; color: #ff9aa8; }
.slot .cd { position: absolute; left: 0; bottom: 0; height: 3px; background: #fff; opacity: 0.8; }
.slot.cur { transform: translateY(-8px); border-color: var(--c); box-shadow: 0 0 16px color-mix(in srgb, var(--c) 60%, transparent); }
.slot.dry { opacity: 0.55; filter: saturate(0.3); }
.slot.act { border-style: dashed; }
.slot.small { width: 96px; margin-left: 12px; }
.slot.small .n { font-size: 13px; }
.slot.small.urge { border-color: #fff; animation: urge 0.5s infinite alternate; }

.h-keys { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); display: none; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 11.5px; }
.h-keys.on { display: flex; }
.h-keys div { display: flex; gap: 8px; align-items: center; }
.h-keys kbd { min-width: 148px; }
.h-keys span { color: #dfe6ff; }

.h-dead { position: absolute; top: 34%; left: 0; right: 0; text-align: center; font-size: 34px; font-weight: 900; color: #ffb1bd; text-shadow: 0 0 16px rgba(255, 80, 110, 0.8), 0 2px 0 #0b0d24; display: none; }
.h-dead.on { display: block; }
.h-dead small { display: block; font-size: 16px; color: #fff; margin-top: 6px; }

.h-board { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: none; padding: 14px 18px; border-radius: 16px; background: rgba(11, 13, 36, 0.9); border: 1px solid var(--line); }
.h-board.on { display: block; }
table { border-collapse: collapse; font-size: 13px; }
th { font-size: 11px; color: var(--dim); font-weight: 700; padding: 3px 12px; text-align: right; }
td { padding: 4px 12px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
td:nth-child(1), td:nth-child(2), th:nth-child(1), th:nth-child(2) { text-align: left; }
tr.me td { background: rgba(255, 255, 255, 0.1); }
tr.me td:first-child { border-radius: 8px 0 0 8px; } tr.me td:last-child { border-radius: 0 8px 8px 0; }

/* ---------- 選ぶ画面 ---------- */
#menu { position: fixed; inset: 0; display: none; z-index: 10; }
#menu.on { display: block; }
#menu.setup { background: linear-gradient(90deg, rgba(10, 12, 34, 0.9) 0, rgba(10, 12, 34, 0.7) 24%, rgba(10, 12, 34, 0) 38%, rgba(10, 12, 34, 0) 60%, rgba(10, 12, 34, 0.7) 72%, rgba(10, 12, 34, 0.9) 100%); }
.m-setup { display: grid; grid-template-columns: 330px minmax(260px, 1fr) 430px; grid-template-rows: auto minmax(0, 1fr); height: 100%; gap: 6px 18px; padding: 14px 20px 16px; }
.m-setup header { grid-column: 1 / 4; display: flex; align-items: baseline; gap: 20px; }
.m-setup h1 { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: 3px; color: #fff; text-shadow: 0 0 16px rgba(79, 227, 255, 0.8); }
.m-setup h1 small { font-size: 12px; font-weight: 700; color: var(--cy); margin-left: 10px; letter-spacing: 1px; text-shadow: none; }
.m-setup header p { margin: 0; font-size: 12.5px; color: var(--dim); }
.col { min-height: 0; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent; }
h2 { margin: 10px 0 5px; font-size: 12.5px; font-weight: 800; color: var(--cy); letter-spacing: 1px; }
h2 small { font-size: 11px; font-weight: 600; color: var(--dim); margin-left: 8px; letter-spacing: 0; }
.col h2:first-child { margin-top: 2px; }
.opts { display: flex; gap: 5px; }
.opts.col { flex-direction: column; overflow: visible; padding: 0; }
.opts.grid2 { display: grid; grid-template-columns: 1fr 1fr; }
.opts.seg .opt { flex: 1; text-align: center; padding: 7px 4px; }
.opts.wrap { flex-wrap: wrap; gap: 4px; } .opts.wrap .opt { flex: 1 1 20%; padding: 5px 2px; font-size: 12px; }
.opt { text-align: left; padding: 6px 11px; border-radius: 11px; background: var(--panel); border: 1.5px solid var(--line); font-size: 13px; font-weight: 700; transition: border-color 0.1s, background 0.1s, transform 0.05s; }
.opt small { display: block; font-size: 10.5px; font-weight: 600; color: var(--dim); margin-top: 1px; }
.opt:hover { border-color: rgba(255, 255, 255, 0.55); }
.opt:active { transform: scale(0.98); }
.opt.on { background: linear-gradient(180deg, rgba(79, 227, 255, 0.3), rgba(79, 227, 255, 0.14)); border-color: var(--cy); box-shadow: 0 0 12px rgba(79, 227, 255, 0.35); }
.opt.on small { color: #d6f6ff; }
.checks { display: flex; gap: 6px; margin-top: 2px; }
.chk { flex: 1; padding: 7px 8px 7px 30px; border-radius: 11px; background: var(--panel); border: 1.5px solid var(--line); font-size: 12px; font-weight: 700; text-align: left; position: relative; }
.chk::before { content: ""; position: absolute; left: 9px; top: 50%; width: 13px; height: 13px; margin-top: -8px; border-radius: 4px; border: 1.5px solid var(--dim); }
.chk.on { border-color: var(--yl); background: rgba(255, 212, 90, 0.14); }
.chk.on::before { background: var(--yl); border-color: var(--yl); box-shadow: inset 0 0 0 2px #0b0d24; }

.col.mid { display: flex; flex-direction: column; justify-content: space-between; align-items: center; overflow: visible; pointer-events: none; }
.col.mid > * { pointer-events: auto; }
.charinfo { width: min(430px, 100%); padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.charinfo .nm { font-size: 24px; font-weight: 900; letter-spacing: 2px; }
.charinfo .nm small { font-size: 12px; margin-left: 10px; padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #fff; letter-spacing: 0; }
.charinfo p { margin: 2px 0 7px; font-size: 12px; color: #dfe6ff; }
.stat { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; margin: 3px 0; }
.stat span { width: 62px; color: var(--dim); } .stat em { width: 44px; font-style: normal; text-align: right; }
.stat i { flex: 1; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; } .stat i b { display: block; height: 100%; border-radius: 4px; }
.abil { margin-top: 7px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 212, 90, 0.12); border: 1px solid rgba(255, 212, 90, 0.4); font-size: 11.5px; color: #fff3cf; }
.abil b { display: block; color: var(--yl); font-size: 12px; }
.midbot { display: flex; flex-direction: column; align-items: center; }
.chars { display: flex; gap: 6px; margin-bottom: 10px; }
.chr { width: 68px; padding: 7px 2px 6px; border-radius: 12px; background: var(--panel); border: 2px solid var(--line); text-align: center; }
.chr i { display: block; width: 26px; height: 26px; margin: 0 auto 3px; border-radius: 50%; background: radial-gradient(circle at 50% 62%, #ffe6d8 0 42%, var(--h) 44% 100%); box-shadow: 0 0 0 2px var(--c); }
.chr b { display: block; font-size: 13px; } .chr small { font-size: 10px; color: var(--dim); }
.chr:hover { border-color: rgba(255, 255, 255, 0.6); }
.chr.on { border-color: var(--c); background: rgba(255, 255, 255, 0.14); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 55%, transparent); transform: translateY(-3px); }
.start { display: block; min-width: 260px; padding: 12px 34px; border: 0; border-radius: 999px; font-size: 20px; font-weight: 900; letter-spacing: 4px; color: #10122c; background: linear-gradient(180deg, #fff3a8, #ffc23d); box-shadow: 0 4px 0 #b9791a, 0 0 22px rgba(255, 200, 70, 0.6); transition: transform 0.06s, box-shadow 0.06s; }
.start small { font-size: 10px; letter-spacing: 0; margin-left: 10px; opacity: 0.6; }
.start:hover { filter: brightness(1.08); }
.start:active { transform: translateY(3px); box-shadow: 0 1px 0 #b9791a, 0 0 22px rgba(255, 200, 70, 0.6); }

.myslots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.myslots.shake { animation: shake 0.3s; }
.ms { min-height: 62px; border-radius: 12px; border: 1.5px dashed var(--line); display: flex; flex-direction: column; justify-content: center; text-align: center; font-size: 11px; color: var(--dim); }
.ms.lock { opacity: 0.35; }
.ms.on { border: 2px solid var(--c); background: var(--panel); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 40%, transparent); }
.ms.on button { position: relative; width: 100%; background: none; border: 0; padding: 6px 2px 4px; }
.ms.on button i, .tl i { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 8px; background: var(--c); color: #0b0d24; font-style: normal; font-weight: 900; font-size: 13px; }
.ms.on button b { display: block; font-size: 12px; margin-top: 3px; color: #fff; white-space: nowrap; }
.ms.on button span { position: absolute; left: 6px; top: 3px; font-size: 10px; font-weight: 800; color: var(--dim); }
.ms.on button:hover b { text-decoration: line-through; opacity: 0.7; }
.ms label { display: block; padding: 0 5px 5px; }
.ms input[type="range"] { width: 100%; margin: 0; accent-color: var(--c); }
.ms label em { display: block; font-size: 10px; line-height: 1.35; font-style: normal; color: #dfe6ff; overflow: hidden; }
.msnote { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11px; color: var(--dim); margin: 6px 0 8px; }
.mini { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 11px; font-weight: 700; }
.mini:hover { border-color: #fff; }
.toollist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tl { position: relative; display: flex; align-items: center; gap: 7px; padding: 6px 7px; border-radius: 11px; background: var(--panel); border: 1.5px solid var(--line); text-align: left; }
.tl b { font-size: 12.5px; white-space: nowrap; }
.tl u { position: absolute; right: 5px; top: -6px; font-size: 9px; text-decoration: none; padding: 0 6px; border-radius: 999px; background: var(--pk); color: #20061a; font-weight: 800; }
.tl u.add { background: rgba(255, 255, 255, 0.25); color: #fff; }
.tl:hover { border-color: rgba(255, 255, 255, 0.6); }
.tl.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, rgba(13, 16, 44, 0.8)); }
.tl.solo { grid-column: span 3; }
.tooldetail { margin-top: 8px; padding: 9px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); min-height: 86px; font-size: 12px; }
.tooldetail b { font-size: 14px; } .tooldetail p { margin: 3px 0 6px; color: #dfe6ff; line-height: 1.5; }
.tooldetail .rng { display: flex; gap: 14px; font-size: 11px; color: var(--yl); font-weight: 700; }

/* ---------- 止めた画面・結果 ---------- */
#menu.pause, #menu.result { background: rgba(8, 10, 30, 0.62); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); overflow-y: auto; }
#menu.click { background: rgba(8, 10, 30, 0.35); cursor: pointer; }
.m-click { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; padding: 20px 32px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); max-width: 80%; }
.m-click b { display: block; font-size: 20px; } .m-click span { font-size: 12px; color: var(--dim); }
.m-pause, .m-result { width: min(980px, 94%); margin: calc(3 * var(--vh)) auto; padding: 18px 24px 22px; border-radius: 20px; background: rgba(13, 16, 44, 0.92); border: 1px solid var(--line); }
.m-pause h1, .m-result h1 { margin: 0 0 10px; font-size: 30px; font-weight: 900; letter-spacing: 3px; text-align: center; }
.m-result h1 { font-size: 46px; margin-bottom: 0; }
.m-result h1.win { color: var(--yl); text-shadow: 0 0 22px rgba(255, 212, 90, 0.8); }
.m-result h1.lose { color: #ff9aa8; } .m-result h1.draw { color: #fff; }
.m-result .score { text-align: center; margin: 2px 0 8px; font-size: 22px; font-weight: 900; }
.m-result .score small { display: block; font-size: 12px; color: var(--dim); font-weight: 600; }
.btns { display: flex; gap: 12px; justify-content: center; align-items: center; margin: 10px 0 6px; flex-wrap: wrap; }
.btns .start { min-width: 200px; font-size: 17px; padding: 10px 26px; }
.sec { padding: 10px 20px; border-radius: 999px; background: var(--panel); border: 1.5px solid var(--line); font-size: 14px; font-weight: 800; }
.sec:hover { border-color: #fff; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 26px; }
.keys { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.keys div { display: flex; gap: 10px; align-items: center; }
.keys kbd { min-width: 150px; }
.sl { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 700; margin: 6px 0; }
.sl span { width: 86px; } .sl input { flex: 1; accent-color: var(--cy); } .sl em { width: 36px; text-align: right; font-style: normal; }
.note { font-size: 11.5px; color: var(--dim); margin: 10px 0 0; }
.opts + .note { margin-top: 5px; line-height: 1.5; }
.note kbd { min-width: 0; padding: 0 5px; font-size: 10.5px; }
.er { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 700; margin: 5px 0; }
.er span { width: 92px; white-space: nowrap; } .er em { width: 190px; font-style: normal; color: #dfe6ff; font-size: 11.5px; white-space: nowrap; }
.er i { flex: 1; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); overflow: hidden; } .er i b { display: block; height: 100%; border-radius: 5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips span { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); font-size: 11.5px; color: var(--dim); }
.chips b { color: #fff; font-size: 13px; }

@keyframes pulse { from { opacity: 1; } to { opacity: 0.55; } }
@keyframes pop { from { transform: scale(1.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { 0% { opacity: 0; transform: translateY(8px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes flash { 0% { background: #fff; color: #0b0d24; box-shadow: 0 0 16px #fff; } 100% { background: var(--panel); } }
@keyframes urge { from { box-shadow: 0 0 4px rgba(255, 255, 255, 0.4); } to { box-shadow: 0 0 20px rgba(190, 240, 255, 1); transform: translateY(-5px); } }
@media (max-height: 760px) {
  .m-setup { padding-top: 8px; gap: 4px 14px; }
  .opt { padding: 6px 10px; } h2 { margin: 9px 0 5px; }
  .charinfo p { display: none; }
}
@media (max-width: 1180px) {
  .slot { width: 86px; } .slot.small { width: 84px; margin-left: 6px; } .slot .n { font-size: 13px; }
  .h-keys { font-size: 10.5px; padding: 8px 10px; } .h-keys kbd { min-width: 134px; }
  .m-setup { grid-template-columns: 290px minmax(220px, 1fr) 360px; }
  .toollist { grid-template-columns: repeat(2, 1fr); } .tl.solo { grid-column: span 2; }
}

#boot { position: fixed; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 24px; color: var(--dim); font-size: 14px; }
#boot b { font-size: 28px; color: #fff; letter-spacing: 3px; margin-bottom: 8px; }
#boot p { margin: 2px 0; } #boot code { color: var(--cy); font-size: 14px; }
#bootErr { color: #ff9aa8; font-size: 12px; }

/* せまい窓（アプリ内のプレビューなど）：二列にして、キャラ選びと開始は下の帯へ */
@media (max-width: 1020px) {
  #menu.setup { background: rgba(10, 12, 34, 0.74); }
  .m-setup { grid-template-columns: 270px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; padding: 10px 12px 12px; gap: 6px 12px; }
  .m-setup header { grid-column: 1 / 3; } .m-setup header p { display: none; }
  .col.left { grid-column: 1; grid-row: 2; }
  .col.right { grid-column: 2; grid-row: 2; }
  .col.mid { grid-column: 1 / 3; grid-row: 3; gap: 6px; justify-content: flex-end; }
  .charinfo { width: 100%; display: flex; align-items: center; gap: 12px; padding: 6px 12px; }
  .charinfo p, .charinfo .stat { display: none; }
  .charinfo .nm { font-size: 18px; white-space: nowrap; }
  .charinfo .abil { margin-top: 0; flex: 1; }
  .midbot { flex-direction: row; gap: 14px; align-items: center; }
  .chars { margin-bottom: 0; } .chr { width: 60px; padding: 5px 2px 4px; }
  .start { min-width: 170px; padding: 10px 18px; font-size: 17px; letter-spacing: 2px; }
  .h-vitals { max-width: 260px; } .h-rule { display: none; }
}


/* ================= スマホ・タブレット（指で遊ぶ） ================= */
#touch { position: fixed; inset: 0; z-index: 3; display: none; touch-action: none; -webkit-user-select: none; user-select: none; }
body.touch.playing #touch.on { display: block; }
body.touch #hud .slot[data-i], body.touch #hud .h-top { pointer-events: auto; touch-action: none; }
body.touch .h-keys, body.touch .h-tip, body.touch .slot.small, body.touch .h-slots { display: none !important; }
body.touch .start small { display: none; }

/* ボタン：中心の位置を、右下の角からの距離（--x・--y）で決める。--bs で全体の大きさが変わる */
.t-b { position: absolute; width: calc(var(--d) * var(--bs) * 1px); height: calc(var(--d) * var(--bs) * 1px); right: calc(var(--sr) + var(--x) * var(--bs) * 1px); bottom: calc(var(--sb) + var(--y) * var(--bs) * 1px); transform: translate(50%, 50%);
  border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.1;
  background: rgba(13, 16, 44, 0.42); border: 2px solid rgba(255, 255, 255, 0.38); color: #fff; font-weight: 800; text-shadow: 0 1px 2px #0b0d24; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); transition: background 0.06s, border-color 0.06s, opacity 0.15s; }
.t-b::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; } /* 押せる範囲は見た目より少し広い */
.t-b b { font-size: calc(13px * var(--bs)); pointer-events: none; }
.t-b.on { background: rgba(255, 255, 255, 0.32); border-color: #fff; }
/* 右下の菱形に、四つの道具（下・左・上・右の順に 1〜4）。大きさと位置は touch.js が画面に合わせて --td・--tx・--ty に入れる */
.t-tool { --c: #4fe3ff; --td: 74px; width: var(--td); height: var(--td); right: calc(var(--sr) + var(--tx, 120px)); bottom: calc(var(--sb) + var(--ty, 120px)); border-width: 3px; border-color: var(--c); background: radial-gradient(circle, rgba(13, 16, 44, 0.26) 52%, rgba(13, 16, 44, 0.6)); }
.t-tool::after { inset: -6px; }
/* 外の輪：濃い所＝いま注いでいる量、薄い所＝いま注げる分（字の「〜30」の代わり） */
.t-tool i { position: absolute; inset: -8px; border-radius: 50%; pointer-events: none; background: conic-gradient(var(--c) 0 var(--p, 0%), color-mix(in srgb, var(--c) 34%, transparent) 0 var(--a, 0%), rgba(255, 255, 255, 0.07) 0); -webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 6px), #000 calc(100% - 5.5px)); mask: radial-gradient(circle closest-side, transparent calc(100% - 6px), #000 calc(100% - 5.5px)); }
.t-tool u { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(8, 10, 26, 0.6) var(--cd, 0%), transparent 0); pointer-events: none; }
.t-tool b { position: relative; display: flex; flex-direction: column; align-items: center; gap: calc(var(--td) * 0.03); margin-top: calc(var(--td) * 0.02); line-height: 1; color: var(--c); text-shadow: 0 1px 3px rgba(8, 10, 26, 0.95); }
.t-tool b svg { width: calc(var(--td) * 0.4); height: calc(var(--td) * 0.4); display: block; filter: drop-shadow(0 1px 2px rgba(8, 10, 26, 0.9)); }
.t-tool b span { font-size: max(10px, calc(var(--td) * 0.16)); font-weight: 900; letter-spacing: 0; white-space: nowrap; color: #fff; }
.t-tool s { display: none; position: relative; width: 56%; height: 56%; color: #e6f6ff; pointer-events: none; }
.t-tool s svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 2px rgba(8, 10, 26, 0.9)); }
.t-tool .x { display: none; position: absolute; inset: 0; flex-direction: column; align-items: center; justify-content: center; font-size: calc(var(--td) * 0.36); line-height: 1; color: #fff; pointer-events: none; }
.t-tool .x small { margin-top: 2px; font-size: calc(var(--td) * 0.15); font-weight: 900; letter-spacing: 1px; }
.t-tool.cur { box-shadow: 0 0 10px color-mix(in srgb, var(--c) 40%, transparent); }
.t-tool.on { background: radial-gradient(circle, color-mix(in srgb, var(--c) 34%, rgba(13, 16, 44, 0.3)) 52%, rgba(13, 16, 44, 0.6)); transform: translate(50%, 50%) scale(1.07); }
.t-tool.full { animation: fullPulse 0.22s infinite alternate; }
@keyframes fullPulse { from { box-shadow: 0 0 6px var(--c); } to { box-shadow: 0 0 26px var(--c), 0 0 4px #fff inset; } }
/* 足りない道具：色が抜けて「小剣」の印。押している間、小剣を振り続ける */
.t-tool.dry { border-color: rgba(215, 232, 255, 0.6); background: radial-gradient(circle, rgba(60, 68, 96, 0.34) 52%, rgba(20, 24, 44, 0.62)); box-shadow: none; }
.t-tool.dry b { display: none; } .t-tool.dry s { display: block; }
.t-tool.dry.on { background: radial-gradient(circle, rgba(200, 230, 255, 0.36) 52%, rgba(20, 24, 44, 0.6)); border-color: #fff; }
.t-tool.dry.on s { animation: smSwing 0.2s ease-in-out infinite alternate; }
@keyframes smSwing { from { transform: rotate(-24deg); } to { transform: rotate(18deg); } }
.t-tool.dry.urge { animation: dryUrge 0.55s infinite alternate; }
@keyframes dryUrge { from { box-shadow: 0 0 3px rgba(220, 240, 255, 0.4); } to { box-shadow: 0 0 20px rgba(200, 238, 255, 0.95); border-color: #fff; } }
/* 指をボタンの外へ大きくずらした：離すと取り消し */
.t-tool.cancel { border-color: #ff7a96 !important; background: rgba(110, 14, 40, 0.72) !important; animation: none !important; box-shadow: 0 0 16px rgba(255, 90, 120, 0.6) !important; }
.t-tool.cancel b, .t-tool.cancel s, .t-tool.cancel i { opacity: 0.18; }
.t-tool.cancel .x { display: flex; }
/* 「段を先に決める」だけ：押したまま上下で段（大・中・小） */
.t-tool .lv { display: none; position: absolute; right: 112%; top: 50%; transform: translateY(-50%); flex-direction: column; gap: 2px; pointer-events: none; font-style: normal; }
.t-tool .lv q { display: block; width: calc(24px * var(--bs)); padding: 2px 0; border-radius: 6px; background: rgba(13, 16, 44, 0.7); font-size: calc(11px * var(--bs)); color: rgba(255, 255, 255, 0.55); quotes: none; }
.t-tool .lv q::before, .t-tool .lv q::after { content: none; }
.t-tool.lvon .lv { display: flex; }
.t-tool.lv2 .lv q:nth-child(1), .t-tool.lv1 .lv q:nth-child(2), .t-tool.lv0 .lv q:nth-child(3) { background: var(--c); color: #0b0d24; }
.t-pause { --d: 42; left: calc(var(--sl) + 10px); top: calc(var(--st) + 8px); right: auto; bottom: auto; transform: none; border-radius: 12px; }
.t-pause b { font-size: 16px; }
#touch.dead .t-b:not(.t-pause) { opacity: 0.3; }
body.cine #touch, body.cine .h-bottom { opacity: 0; pointer-events: none; }
#touch, .h-bottom { transition: opacity 0.25s; }
/* スティック：触れていないときは、親指を置く場所の目印だけ出す。はじいてステップしたら一瞬光る */
.t-stick { position: absolute; left: calc(var(--sl) + 118px); bottom: calc(var(--sb) + 68px + 54px * var(--bs)); width: calc(108px * var(--bs)); height: calc(108px * var(--bs)); transform: translate(-50%, 50%); border-radius: 50%; border: 2px dashed rgba(255, 255, 255, 0.28); pointer-events: none; }
.t-stick i { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02) 70%); }
.t-stick b { position: absolute; left: 50%; top: 50%; width: calc(48px * var(--bs)); height: calc(48px * var(--bs)); margin: calc(-24px * var(--bs)) 0 0 calc(-24px * var(--bs)); border-radius: 50%; background: rgba(255, 255, 255, 0.22); border: 2px solid rgba(255, 255, 255, 0.5); }
.t-stick.on { transform: translate(-50%, -50%); border-style: solid; border-color: rgba(255, 255, 255, 0.45); }
.t-stick.on b { background: rgba(255, 255, 255, 0.45); }
.t-stick.dash i { animation: stDash 0.3s ease-out; }
@keyframes stDash { from { background: radial-gradient(circle, rgba(79, 227, 255, 0.55), rgba(79, 227, 255, 0.1) 70%); } to { background: radial-gradient(circle, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02) 70%); } }

/* 戦っている間の表示を、指のじゃまにならない所へ寄せる */
body.touch .h-top { top: calc(var(--st) + 4px); transform: translateX(-50%) scale(0.78); transform-origin: top center; }
body.touch .h-feed { top: calc(var(--st) + 6px); right: calc(var(--sr) + 8px); transform: scale(0.85); transform-origin: top right; }
/* 体力とエネルギーの棒：広い画面では真ん中より少し左。狭い画面・大きいボタンでは、右の四つより左に寄せて、重ならないようにする */
/*  右の四つの菱形の幅（--tw。touch.js が入れる）より左に置く */
body.touch .h-bottom { left: auto; right: max(calc(var(--sr) + var(--tw, 240px)), calc(59 * var(--vw) - 135px)); bottom: calc(var(--sb) + 6px); transform: none; display: flex; flex-direction: column; align-items: center; gap: 2px; }
body.touch .h-vitals { width: min(270px, calc(34 * var(--vw)), calc(100 * var(--vw) - max(calc(var(--sr) + var(--tw, 240px)), calc(59 * var(--vw) - 135px)) - var(--sl) - 12px)); max-width: none; }
body.touch .h-who { justify-content: center; margin-bottom: 2px; } body.touch #hName { display: none; }
body.touch .h-abil { font-size: 10px; padding: 1px 8px; }
body.touch .bar { height: 14px; margin-bottom: 3px; border-radius: 7px; }
body.touch .bar em, body.touch .bar b { line-height: 12px; font-size: 9.5px; }
body.touch .bar .pop { top: -18px; font-size: 11px; }
body.touch .h-rule { display: none; }
body.touch .h-slots { gap: 6px; }
body.touch .slot { width: 68px; height: 46px; padding: 3px 5px; border-radius: 10px; }
body.touch .slot .k { font-size: 9px; top: 2px; left: 5px; }
body.touch .slot .n { margin-top: 10px; font-size: 12px; }
body.touch .slot .d { font-size: 9px; }
body.touch .slot.cur { transform: translateY(-4px); }
/* 「はじめ！」などの大きな字は、真ん中に見える相手の名札にかぶらないよう、上の帯のすぐ下へ */
body.touch .h-banner { top: calc(var(--st) + 13%); } body.touch .h-banner b { font-size: 42px; } body.touch .h-banner.count b { font-size: 64px; }
/* 「はじめ！」の間は相手へ寄った絵（goFov）で名札が上へ来るので、字を一回り小さくして名札にかぶらないように */
body.touch .h-banner.go { top: calc(var(--st) + max(11%, 44px)); } body.touch .h-banner.go b { font-size: 34px; }
body.touch .h-dead { font-size: 26px; top: 30%; }
body.touch .h-sub { top: calc(var(--st) + 58px); max-width: min(560px, calc(76 * var(--vw))); white-space: normal; text-align: center; font-size: 12px; }
body.touch .h-board { transform: translate(-50%, -50%) scale(0.85); }
.tkeys kbd { min-width: 128px; }

/* 縦向きのときは、横にしてもらう */
#rotate { display: none; position: fixed; inset: 0; z-index: 60; background: var(--ink); flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff; text-align: center; }
#rotate b { font-size: 54px; color: var(--cy); animation: turn 1.6s ease-in-out infinite; }
#rotate p { margin: 0; font-size: 16px; font-weight: 800; }
@keyframes turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(90deg); } }
@media (orientation: portrait) { body.touch #rotate { display: flex; } }

/* 背の低い画面（スマホを横にしたとき）：選ぶ画面・止めた画面・結果を詰める */
@media (max-height: 500px) {
  #menu.setup { background: rgba(10, 12, 34, 0.8); }
  .m-setup { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); grid-template-rows: auto minmax(0, 1fr) auto; padding: calc(var(--st) + 6px) calc(var(--sr) + 10px) calc(var(--sb) + 6px) calc(var(--sl) + 10px); gap: 4px 10px; }
  .m-setup header { grid-column: 1 / 3; } .m-setup header p { display: none; }
  .m-setup h1 { font-size: 18px; letter-spacing: 2px; }
  .col.left { grid-column: 1; grid-row: 2; } .col.right { grid-column: 2; grid-row: 2; }
  .col { -webkit-overflow-scrolling: touch; touch-action: pan-y; }
  .col.mid { grid-column: 1 / 3; grid-row: 3; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
  .charinfo { flex: 1; min-width: 0; width: auto; display: flex; align-items: center; gap: 8px; padding: 4px 10px; }
  .charinfo p, .charinfo .stat { display: none; }
  .charinfo .nm { font-size: 15px; white-space: nowrap; letter-spacing: 1px; } .charinfo .nm small { font-size: 10px; margin-left: 4px; }
  .charinfo .abil { margin-top: 0; flex: 1; min-width: 0; padding: 3px 8px; font-size: 10px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .charinfo .abil b { font-size: 10.5px; display: inline; margin-right: 4px; }
  .midbot { flex-direction: row; gap: 8px; align-items: center; }
  .chars { margin: 0; gap: 4px; } .chr { width: 46px; padding: 4px 1px 3px; border-radius: 10px; } .chr i { width: 20px; height: 20px; margin-bottom: 2px; } .chr b { font-size: 11px; } .chr small { display: none; }
  .chr.on { transform: translateY(-2px); }
  .start { min-width: 0; padding: 10px 18px; font-size: 16px; letter-spacing: 2px; }
  h2 { margin: 7px 0 4px; font-size: 11.5px; }
  .opt { padding: 6px 8px; font-size: 12px; } .opt small { font-size: 9.5px; }
  .opts.seg .opt { padding: 7px 2px; } .opts.wrap .opt { font-size: 11px; padding: 6px 1px; }
  .ms { min-height: 48px; } .ms.on button { padding: 4px 2px 3px; }
  .toollist { grid-template-columns: repeat(3, 1fr); gap: 5px; } .tl.solo { grid-column: span 3; }
  .tl { padding: 6px 5px; gap: 5px; } .tl b { font-size: 11px; } .tl i, .ms.on button i { width: 20px; height: 20px; font-size: 11px; }
  .tooldetail { min-height: 0; font-size: 11px; padding: 7px 10px; }
  .m-pause, .m-result { width: auto; margin: calc(var(--st) + 6px) calc(var(--sr) + 10px) calc(var(--sb) + 10px) calc(var(--sl) + 10px); padding: 10px 14px 14px; border-radius: 16px; }
  .m-pause h1 { font-size: 20px; margin-bottom: 2px; } .m-result h1 { font-size: 30px; } .m-result .score { font-size: 17px; }
  .btns { margin: 6px 0 4px; gap: 8px; } .btns .start { min-width: 150px; font-size: 15px; padding: 9px 20px; } .sec { padding: 8px 14px; font-size: 12.5px; }
  .cols { gap: 4px 18px; } .keys { font-size: 11px; gap: 3px; } .keys kbd { min-width: 120px; font-size: 10px; } .tkeys kbd { min-width: 110px; }
  .er em { width: auto; } table { font-size: 11.5px; } td, th { padding: 3px 7px; }
  .sl span { width: 104px; white-space: nowrap; } .sl { margin: 4px 0; }
  /* 結果：「もう一度」を見える所へ */
  .m-result { display: flex; flex-direction: column; } .m-result > * { order: 3; }
  .m-result h1 { order: 0; } .m-result .score { order: 1; margin-bottom: 0; } .m-result .btns { order: 2; margin-bottom: 8px; }
}
@media (max-height: 500px) and (max-width: 720px) {
  .m-setup { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .chr { width: 40px; } .chr b { font-size: 10px; }
  .toollist { grid-template-columns: repeat(2, 1fr); } .tl.solo { grid-column: span 2; }
  .charinfo .abil { display: none; }
}

/* ================= 手軽に遊ぶ入口（タイトル・キャラと道具・結果） ================= */
#menu.title { background: radial-gradient(ellipse 60% 80% at 28% 55%, rgba(10, 12, 34, 0) 0, rgba(10, 12, 34, 0.25) 55%, rgba(10, 12, 34, 0.72) 100%); }
.m-title { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; padding: calc(var(--st) + 14px) calc(var(--sr) + max(18px, calc(5 * var(--vw)))) calc(var(--sb) + 40px) calc(var(--sl) + 18px); }
.tt-main { width: min(470px, calc(54 * var(--vw))); display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.logo { margin: 0 auto; display: flex; gap: 8px; }
.logo span { --c: #4fe3ff; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 20px; font-size: 50px; font-weight: 900; color: #fff; line-height: 1;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 92%, #fff), color-mix(in srgb, var(--c) 55%, #0b0d24)); box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 40%, #0b0d24), 0 0 26px color-mix(in srgb, var(--c) 55%, transparent);
  text-shadow: 0 3px 0 rgba(8, 10, 26, 0.35); animation: tile 0.6s calc(var(--i) * 0.08s) both cubic-bezier(0.3, 1.6, 0.5, 1), bob 3.2s calc(var(--i) * 0.4s + 0.8s) ease-in-out infinite; }
.logo span:nth-child(1) { --c: #34d8ff; transform: rotate(-4deg); } .logo span:nth-child(2) { --c: #ffc93a; transform: rotate(3deg); }
.logo span:nth-child(3) { --c: #ff6fae; transform: rotate(-2deg); } .logo span:nth-child(4) { --c: #3ff2b4; transform: rotate(4deg); }
@keyframes tile { from { opacity: 0; transform: translateY(-40px) scale(0.6); } }
@keyframes bob { 50% { translate: 0 -5px; } }
.tag { margin: 2px 0 6px; text-align: center; font-size: 15px; font-weight: 800; letter-spacing: 2px; color: #fff; text-shadow: 0 2px 8px rgba(8, 10, 26, 0.9); }
.tt-play { position: relative; border: 0; border-radius: 999px; padding: 12px 20px 11px; display: flex; flex-direction: column; align-items: center; gap: 1px; color: #2a1600;
  background: linear-gradient(180deg, #ffe58a, #ffb627 60%, #ff8f1f); box-shadow: 0 6px 0 #b45a0a, 0 10px 30px rgba(255, 170, 40, 0.45); animation: playGlow 1.6s ease-in-out infinite; }
.tt-play b { font-size: 30px; font-weight: 900; letter-spacing: 10px; text-indent: 10px; }
.tt-play small { font-size: 12px; font-weight: 800; opacity: 0.85; }
.tt-play:active { transform: translateY(4px); box-shadow: 0 2px 0 #b45a0a, 0 6px 20px rgba(255, 170, 40, 0.4); }
@keyframes playGlow { 50% { box-shadow: 0 6px 0 #b45a0a, 0 10px 42px rgba(255, 190, 60, 0.75); } }
.tt-row { display: grid; grid-template-columns: 1.25fr 1fr; gap: 8px; }
.tt-row button { border-radius: 16px; border: 1px solid var(--line); background: var(--panel); padding: 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 58px; justify-content: center; }
.tt-row button:active { transform: translateY(2px); }
.tt-kit .who { font-size: 15px; font-weight: 900; } .tt-kit .gl { display: flex; gap: 3px; }
.tt-kit .gl i { font-style: normal; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #0b0d24; background: var(--c); }
.tt-kit em { font-style: normal; font-size: 10.5px; color: var(--dim); font-weight: 700; }
.tt-daily b { font-size: 15px; font-weight: 900; color: var(--yl); } .tt-daily small { font-size: 10.5px; color: var(--dim); font-weight: 700; }
.tt-next { margin: 0; text-align: center; font-size: 12px; font-weight: 700; color: #dfe6ff; text-shadow: 0 1px 4px #0b0d24; } .tt-next b { color: var(--yl); font-size: 15px; }
.tt-foot { position: absolute; right: calc(var(--sr) + 12px); bottom: calc(var(--sb) + 8px); display: flex; gap: 6px; }
.tt-foot button, .back { border: 1px solid var(--line); background: rgba(13, 16, 44, 0.66); border-radius: 999px; padding: 6px 12px; font-size: 11.5px; font-weight: 700; color: var(--dim); }
.m-title.first .tt-main { gap: 14px; } .m-title.first .tt-play { padding: 16px 20px 14px; } .m-title.first .tt-play b { font-size: 34px; }

.m-kit { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(120px, 0.7fr) minmax(0, 1.05fr); grid-template-rows: auto minmax(0, 1fr); gap: 6px 12px;
  padding: calc(var(--st) + 10px) calc(var(--sr) + 14px) calc(var(--sb) + 10px) calc(var(--sl) + 14px); }
#menu.kit { background: linear-gradient(90deg, rgba(10, 12, 34, 0.88) 0, rgba(10, 12, 34, 0.55) 33%, rgba(10, 12, 34, 0) 42%, rgba(10, 12, 34, 0) 58%, rgba(10, 12, 34, 0.6) 66%, rgba(10, 12, 34, 0.9) 100%); }
.m-kit header { grid-column: 1 / 4; display: flex; align-items: center; gap: 12px; }
.m-kit header h1 { margin: 0; font-size: 20px; font-weight: 900; letter-spacing: 2px; flex: 1; }
.m-kit header .start { min-width: 0; padding: 9px 22px; font-size: 16px; }
.m-kit .kl { grid-column: 1; grid-row: 2; } .m-kit .kr { grid-column: 3; grid-row: 2; }
.kchars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kchars .chr { width: auto; }
.chr.lock, .tl.lock { opacity: 0.55; filter: grayscale(0.7); }
.chr.lock i { background: #2a2f55 !important; box-shadow: none !important; }
.kinfo { margin-top: 8px; }
.m-kit .col { overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }

@keyframes recPop { from { transform: scale(0.3); opacity: 0; } }
@keyframes recGlow { from { text-shadow: 0 0 4px rgba(255, 212, 90, 0.35), 0 2px 4px #0b0d24; } to { text-shadow: 0 0 16px rgba(255, 212, 90, 1), 0 2px 4px #0b0d24; transform: translateY(-2px); } }
.m-pause.casual .cols { grid-template-columns: 1fr 1fr; }
.toast { position: fixed; left: 50%; bottom: 16%; transform: translateX(-50%); padding: 8px 18px; border-radius: 999px; background: rgba(13, 16, 44, 0.94); border: 1px solid var(--line); font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; z-index: 20; white-space: nowrap; }
.toast.on { animation: toast 2s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 8px); } 10%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.m-setup header .back { margin-right: -8px; }

/* 戦っている間：何人目の札・全注ぎの札・上の帯（勝ち抜き） */
.h-vs { position: absolute; left: calc(var(--sl) + 7%); bottom: 20%; opacity: 0; transform: translateX(-30px); transition: opacity 0.25s, transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1); pointer-events: none; }
.h-vs.on { opacity: 1; transform: none; }
.h-vs small { display: block; font-size: 14px; font-weight: 900; color: var(--yl); letter-spacing: 3px; text-shadow: 0 2px 6px #0b0d24; }
.h-vs b { display: block; font-size: 60px; font-weight: 900; line-height: 1.05; color: #fff; letter-spacing: 4px; text-shadow: 0 0 22px rgba(79, 227, 255, 0.75), 0 4px 0 rgba(8, 10, 26, 0.55); }
.h-vs span { display: inline-block; margin-top: 4px; padding: 3px 14px; border-radius: 999px; background: rgba(13, 16, 44, 0.75); font-size: 14px; font-weight: 800; }
.h-vs.boss b { color: #ffb1bd; text-shadow: 0 0 24px rgba(255, 80, 120, 0.8), 0 4px 0 rgba(8, 10, 26, 0.55); }
.h-stamp { --c: #ffd45a; position: absolute; left: 50%; top: 62%; transform: translate(-50%, -50%); opacity: 0; pointer-events: none; }
.h-stamp b { display: block; font-size: 46px; font-weight: 900; font-style: italic; letter-spacing: 8px; color: #fff; -webkit-text-stroke: 2px var(--c); text-shadow: 0 0 20px var(--c), 0 5px 0 rgba(8, 10, 26, 0.55); white-space: nowrap; }
.h-stamp.on { animation: stamp 0.9s ease-out forwards; }
@keyframes stamp { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.9) rotate(-8deg); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-5deg); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1.05) rotate(-5deg); } 100% { opacity: 0; transform: translate(-50%, -64%) scale(1.1) rotate(-5deg); } }
.h-top .side.run .nm { color: var(--cy); } .h-top .side.run .pips { color: var(--yl); }
body.touch .h-vs b { font-size: 46px; } body.touch .h-stamp b { font-size: 38px; }

/* 背の低い画面（スマホを横にしたとき） */
@media (max-height: 500px) {
  .logo span { width: 60px; height: 60px; font-size: 40px; border-radius: 16px; }
  .tt-main { gap: 7px; } .tag { font-size: 13px; margin-bottom: 2px; }
  .tt-play { padding: 9px 16px 8px; } .tt-play b { font-size: 26px; }
  .m-title.first .tt-play { padding: 13px 18px 12px; } .m-title.first .tt-play b { font-size: 30px; }
  .tt-row button { min-height: 50px; padding: 6px 8px; }
  .m-kit { gap: 4px 8px; padding: calc(var(--st) + 6px) calc(var(--sr) + 10px) calc(var(--sb) + 6px) calc(var(--sl) + 10px); grid-template-columns: minmax(0, 0.95fr) minmax(70px, 0.45fr) minmax(0, 1.15fr); }
  .m-kit header h1 { font-size: 16px; } .m-kit header .start { padding: 7px 16px; font-size: 14px; }
  .kchars { gap: 4px; } .kchars .chr { width: auto; padding: 4px 1px 3px; } .kchars .chr small { display: block; font-size: 9px; }
  .kinfo { display: block; margin-top: 6px; padding: 6px 10px; } .kinfo p { display: none; } .kinfo .stat { display: flex; }
  .kinfo .abil { display: block; -webkit-line-clamp: unset; }
  /* 一時停止：横長の画面では、左に操作・右に設定を並べて、ほぼ一画面に収める */
  .m-pause.casual .cols { grid-template-columns: 1.1fr 1fr; gap: 4px 14px; align-items: start; }
  .m-pause.casual .keys { font-size: 10.5px; gap: 2px; } .m-pause.casual .keys kbd { min-width: 92px; font-size: 9.5px; padding: 1px 4px; }
  .m-pause.casual .btns { margin: 2px 0 6px; } .m-pause.casual h1 { font-size: 18px; margin: 0; }
  .m-pause.casual .set .sl { margin: 0; } .m-pause.casual .checks { gap: 4px; flex-wrap: wrap; } .m-pause.casual .checks .chk { flex: 1 1 46%; padding: 6px 8px 6px 28px; font-size: 11.5px; }
}
@media (max-height: 500px) and (max-width: 720px) {
  .logo span { width: 52px; height: 52px; font-size: 34px; }
  .tt-main { width: min(400px, calc(58 * var(--vw))); }
  .m-kit .toollist { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 初めての人への案内（大きな手） ---------- */
#coach { position: fixed; inset: 0; pointer-events: none; z-index: 6; display: none; }
#coach.on { display: block; }
body.cine #coach { display: none; }
/* 手は、指先（--x, --y）を軸に --rot だけ回す（四つの丸は左から、スティックは下から指す） */
#coach .co-rot { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; transform: rotate(var(--rot, 0deg)); }
#coach .co-hand { position: absolute; left: 0; top: 0; width: calc(var(--h) * 0.81); height: var(--h); margin-left: calc(var(--h) * -0.38); margin-top: calc(var(--h) * -0.05); transform-origin: 47% 5%; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
#coach .co-hand svg { width: 100%; height: 100%; display: block; }
#coach .co-ring { position: absolute; left: var(--x2, var(--x)); top: var(--y2, var(--y)); width: calc(var(--s) * 1.34); height: calc(var(--s) * 1.34); transform: translate(-50%, -50%); opacity: 0; }
#coach .co-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
#coach .co-ring circle { fill: none; stroke: #ffd34a; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 290 290; stroke-dashoffset: 290; filter: drop-shadow(0 0 6px rgba(255, 211, 74, 0.8)); }
#coach .co-pop { position: absolute; left: var(--x2, var(--x)); top: var(--y2, var(--y)); width: var(--s); height: var(--s); border-radius: 50%; border: 5px solid #fff; transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
#coach .co-trail { display: none; position: absolute; left: var(--x2, var(--x)); top: var(--y2, var(--y)); width: calc(var(--s) * 0.62); height: 12px; margin-top: -6px; border-radius: 6px; background: linear-gradient(90deg, rgba(255, 211, 74, 0), #ffd34a); transform-origin: 0 50%; transform: rotate(-28deg) scaleX(0); }
#coach .co-trail::after { content: ""; position: absolute; right: -14px; top: -9px; border-left: 20px solid #ffd34a; border-top: 15px solid transparent; border-bottom: 15px solid transparent; }
/* 押したまま溜めて、離す */
#coach.hold .co-hand { animation: coHold 2.2s ease-in-out infinite; }
#coach.hold .co-ring { animation: coRingShow 2.2s linear infinite; }
#coach.hold .co-ring circle { animation: coRing 2.2s linear infinite; }
#coach.hold .co-pop { animation: coPopHold 2.2s ease-out infinite; }
@keyframes coHold {
  0% { transform: translate(26px, 34px); opacity: 0; }
  10% { transform: translate(14px, 20px); opacity: 1; }
  20%, 70% { transform: translate(0, 0) scale(0.9); opacity: 1; }
  80% { transform: translate(16px, 22px) scale(1); opacity: 1; }
  100% { transform: translate(26px, 34px); opacity: 0; }
}
@keyframes coRingShow { 0%, 19% { opacity: 0; } 20%, 74% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes coRing { 0%, 20% { stroke-dashoffset: 290; } 68%, 100% { stroke-dashoffset: 0; } }
@keyframes coPopHold { 0%, 72% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; } 74% { opacity: 1; } 92%, 100% { transform: translate(-50%, -50%) scale(1.9); opacity: 0; } }
/* とんとん */
#coach.tap .co-hand { animation: coTap 1.2s ease-in-out infinite; }
#coach.tap .co-pop { animation: coPopTap 0.6s ease-out infinite; }
@keyframes coTap {
  0%, 100% { transform: translate(14px, 20px); }
  25% { transform: translate(0, 0) scale(0.9); }
  45% { transform: translate(14px, 20px); }
  70% { transform: translate(0, 0) scale(0.9); }
}
@keyframes coPopTap { 0%, 40% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; } 45% { opacity: 0.9; } 90%, 100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
/* 親指を置いて、ずらす */
#coach.drag .co-hand { animation: coDrag 2s ease-in-out infinite; }
#coach.drag .co-trail { display: block; animation: coTrail 2s ease-in-out infinite; }
#coach.drag .co-pop { animation: coPopDrag 2s ease-out infinite; }
@keyframes coDrag {
  0% { transform: translate(14px, 24px); opacity: 0; }
  12% { transform: translate(0, 0) scale(0.92); opacity: 1; }
  25% { transform: translate(0, 0) scale(0.92); }
  70% { transform: translate(calc(var(--s) * 0.55), calc(var(--s) * -0.29)) scale(0.92); opacity: 1; }
  85%, 100% { transform: translate(calc(var(--s) * 0.6), calc(var(--s) * -0.25)); opacity: 0; }
}
#coach.drag.side .co-hand { animation: coSide 2s ease-in-out infinite; }
@keyframes coSide { 0% { transform: translateY(16px); opacity: 0; } 14% { transform: translateY(0); opacity: 1; } 45% { transform: translateY(-6px) scale(0.95); } 75% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(4px); opacity: 0; } }
@keyframes coTrail { 0%, 25% { transform: rotate(-28deg) scaleX(0); opacity: 0.9; } 70% { transform: rotate(-28deg) scaleX(1); opacity: 0.9; } 90%, 100% { transform: rotate(-28deg) scaleX(1); opacity: 0; } }
@keyframes coPopDrag { 0%, 10% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; } 14% { opacity: 0.9; } 40%, 100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } }
/* 案内の間は、ほかのボタンを薄くして、押す所を光らせる */
#touch.coaching .t-b:not(.coach-t):not(.t-pause):not(.t-tool) { opacity: 0.32; }
/* 案内が指していない道具の丸は、中身だけ薄くする。下の暗い円と細い縁は残して、明るい壁の前でも四つあると分かるように */
#touch.coaching .t-tool:not(.coach-t) { border-color: color-mix(in srgb, var(--c) 42%, rgba(8, 10, 26, 0.7)); background: radial-gradient(circle, rgba(8, 10, 26, 0.5) 52%, rgba(8, 10, 26, 0.74)); box-shadow: 0 0 0 3px rgba(8, 10, 26, 0.32); animation: none; }
#touch.coaching .t-tool:not(.coach-t) > * { opacity: 0.38; }
#touch .t-tool > * { transition: opacity 0.25s; }
#touch .t-b { transition: opacity 0.25s; }
.t-b.coach-t { box-shadow: 0 0 0 4px rgba(255, 211, 74, 0.95), 0 0 26px rgba(255, 211, 74, 0.75) !important; animation: coGlow 1.1s ease-in-out infinite alternate; }
@keyframes coGlow { from { box-shadow: 0 0 0 3px rgba(255, 211, 74, 0.9), 0 0 14px rgba(255, 211, 74, 0.5); } to { box-shadow: 0 0 0 6px rgba(255, 211, 74, 1), 0 0 30px rgba(255, 211, 74, 0.85); } }
@media (prefers-reduced-motion: reduce) {
  #coach .co-hand, #coach .co-ring, #coach .co-ring circle, #coach .co-pop, #coach .co-trail, .t-b.coach-t { animation-duration: 3s !important; }
}

/* ---------- 宣伝用の一枚（?poster=og / icon）。遊びの画面には出ない ---------- */
body.poster #touch, body.poster #hud, body.poster #rotate { display: none !important; }
#menu.poster { display: block; background: radial-gradient(ellipse 52% 95% at 20% 50%, rgba(11, 13, 36, 0.82), rgba(11, 13, 36, 0) 72%); }
.po { position: absolute; left: 3%; top: 0; bottom: 0; width: 46%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; }
.po .logo { gap: 14px; }
.po .logo span { width: 120px; height: 120px; font-size: 82px; border-radius: 30px; }
.po-tag { margin: 14px 0 0; font-size: 42px; font-weight: 900; line-height: 1.32; text-align: center; color: #fff; text-shadow: 0 3px 14px rgba(8, 10, 26, 0.95); letter-spacing: 2px; }
.po-sub { margin: 0; padding: 8px 20px; border-radius: 999px; background: rgba(255, 212, 90, 0.14); border: 2px solid rgba(255, 212, 90, 0.6); font-size: 22px; font-weight: 800; color: #ffd45a; letter-spacing: 1px; }
body.poster-icon canvas { display: none; }
#menu.poster .pi { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 5%; padding: 10%; background: radial-gradient(circle at 50% 38%, #232a78, #0b0d24 78%); }
.pi span { display: grid; place-items: center; border-radius: 24%; font-weight: 900; color: #fff; font-size: 27vw; line-height: 1; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 92%, #fff), color-mix(in srgb, var(--c) 55%, #0b0d24)); box-shadow: 0 2vw 0 color-mix(in srgb, var(--c) 40%, #0b0d24); text-shadow: 0 1vw 0 rgba(8, 10, 26, 0.35); }
/* 負けたときの「相手の体力 あと N%」 */
.m-kit [data-a="kreco"] { min-height: 34px; padding: 6px 12px; }
/* 上の帯は折り返さない（小さい画面では字を少し小さく） */
.h-top .side, .h-top .side * { white-space: nowrap; }
@media (max-width: 720px) { .h-top { gap: 6px; } .h-top .side { font-size: 12.5px; padding: 4px 10px; gap: 5px; } .h-top .timer { font-size: 24px; min-width: 70px; padding: 2px 10px; } }
/* 縦持ち：スマホが横に回る絵で見せる */
#rotate { background: radial-gradient(circle at 50% 35%, #232a78, #0b0d24 75%); gap: 22px; }
#rotate .logo span { width: 54px; height: 54px; font-size: 36px; border-radius: 15px; }
#rotate .phone { position: relative; width: 58px; height: 100px; border: 5px solid #fff; border-radius: 14px; box-shadow: 0 0 24px rgba(79, 227, 255, 0.6); animation: phoneRot 2.6s ease-in-out infinite; }
#rotate .phone::before { content: ""; position: absolute; left: 50%; top: 5px; width: 14px; height: 3px; margin-left: -7px; border-radius: 2px; background: #fff; }
#rotate .phone i { position: absolute; inset: 14px 6px; border-radius: 4px; background: linear-gradient(160deg, #34d8ff, #ff6fae); opacity: 0.85; }
#rotate .phone i::after { content: ""; position: absolute; left: 50%; top: 50%; margin: -9px 0 0 -5px; border-left: 15px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
#rotate p { margin: 0; font-size: 20px; font-weight: 900; letter-spacing: 3px; color: #fff; }
@keyframes phoneRot { 0%, 22% { transform: rotate(0deg); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0deg); } }
/* 挑戦状 */
.tt-ch { position: relative; padding: 8px 40px 8px 14px; border-radius: 14px; background: linear-gradient(100deg, rgba(255, 111, 174, 0.28), rgba(255, 212, 90, 0.18)); border: 1.5px solid rgba(255, 212, 90, 0.7); text-align: center; animation: recPop 0.6s 0.2s both cubic-bezier(0.3, 1.7, 0.5, 1); }
.tt-ch small { display: block; font-size: 11px; font-weight: 800; color: #ffd45a; letter-spacing: 2px; }
.tt-ch p { margin: 2px 0; font-size: 16px; font-weight: 900; } .tt-ch p b { font-size: 22px; color: #ffd45a; }
.tt-ch em { font-style: normal; font-size: 12px; font-weight: 800; color: #fff; }
.tt-ch .x { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; font-size: 14px; }
.tt-ch .x::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; border: 1px solid var(--line); background: rgba(13, 16, 44, 0.6); z-index: -1; }
.tt-ch .x { z-index: 0; isolation: isolate; }

/* ---- 称号と星（12 勝で全部そろった後の目標） ---- */
.stars { font-style: normal; color: var(--yl); letter-spacing: 1px; text-shadow: 0 0 8px rgba(255, 212, 90, 0.55); }
.chr em.stars { display: block; font-size: 10px; line-height: 1.1; margin-top: 1px; }
.chr em.stars.none { color: rgba(255, 255, 255, 0.28); text-shadow: none; }
.tt-next .stars { font-size: 13px; }
/* 場所が変わった一本目：相手の紹介の上に場所の名前 */
.h-vs .area { display: block; font-style: normal; font-size: 13px; font-weight: 900; letter-spacing: 4px; color: var(--ac, #4fe3ff); text-shadow: 0 0 12px var(--ac, #4fe3ff); margin-bottom: 2px; }
@media (max-height: 500px) {
  .kchars .chr em.stars { font-size: 9px; }
}

/* ---------- 縦持ちのまま（回転ロック中でも）遊べるように、横向きの画面を 90° 回して見せる ----------
   スマホを左へ倒す（右の縁が上になる）と、まっすぐ見える。中身の大きさは JS が --rw・--rh に入れる。 */
html.rot body { position: fixed; left: 0; top: 0; width: var(--rw); height: var(--rh); transform-origin: 0 0; transform: translateX(var(--rh)) rotate(90deg); }
html.rot { --sl: env(safe-area-inset-top, 0px); --sr: env(safe-area-inset-bottom, 0px); --st: env(safe-area-inset-right, 0px); --sb: env(safe-area-inset-left, 0px); }
html.rot #rotate { display: none !important; }
/* 縦持ちで回して見せ始めた最初の数秒だけ出す「横にして」の札（縦の画面に対してまっすぐ見える向き。左へ倒す動き） */
#rotHint { display: none; }
html.rot.rothint #rotHint { display: flex; position: fixed; left: 15%; top: 50%; z-index: 70; pointer-events: none; transform: translate(-50%, -50%) rotate(-90deg); flex-direction: column; align-items: center; gap: 10px; padding: 16px 22px 14px; border-radius: 22px; background: rgba(11, 13, 36, 0.84); border: 1.5px solid rgba(79, 227, 255, 0.55); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); animation: rotHintIn 4.2s both; }
#rotHint .phone { position: relative; width: 40px; height: 68px; border: 4px solid #fff; border-radius: 10px; box-shadow: 0 0 18px rgba(79, 227, 255, 0.6); animation: phoneRot 2s ease-in-out infinite; }
#rotHint .phone i { position: absolute; inset: 9px 4px; border-radius: 3px; background: linear-gradient(160deg, #34d8ff, #ff6fae); opacity: 0.85; }
#rotHint p { margin: 0; font-size: 15px; font-weight: 900; letter-spacing: 2px; color: #fff; white-space: nowrap; }
@keyframes rotHintIn { 0% { opacity: 0; } 8%, 85% { opacity: 1; } 100% { opacity: 0; } }
/* 回して見せているときは、なぞる向きの決まりが画面の縦横のまま効くので、両方の向きを許す（一覧を指で送れるように） */
html.rot .col, html.rot #menu { touch-action: pan-x pan-y !important; }
/* とどめの動画のボタン（録れた端末だけ出る） */

/* ================= 結果の画面（第3版）：左に記録・まん中に自分のキャラ（何も重ねない）・右にボタン =================
   ボタンは「もどる」（左上・小）「シェア」「もう一回」（右下・いちばん大きい）の三つだけ。キャラの位置は main.js が二つの列のあいだに合わせる。 */
#menu.run { background: linear-gradient(90deg, rgba(10, 12, 34, 0.92) 0, rgba(10, 12, 34, 0.8) 33%, rgba(10, 12, 34, 0.06) 50%, rgba(10, 12, 34, 0.04) 64%, rgba(10, 12, 34, 0.55) 100%); }
.m-run { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; padding: calc(var(--st) + 10px) calc(var(--sr) + 16px) calc(var(--sb) + 14px) calc(var(--sl) + 20px); }
.rn-back { flex: none; min-height: 34px; min-width: 76px; }
.rn-main { position: relative; flex: 1; min-height: 0; width: min(460px, calc(44 * var(--vw))); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; padding-bottom: 6px; }
.m-run .rk { margin: 0; font-size: 13px; font-weight: 800; color: var(--cy); letter-spacing: 3px; }
.m-run h1 { position: relative; margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; line-height: 0.92; animation: rnIn 0.45s both cubic-bezier(0.3, 1.4, 0.5, 1); }
.m-run h1 b { font-size: 108px; font-weight: 900; font-family: "Hiragino Sans", var(--font); -webkit-text-stroke: 0.02em currentColor; color: #fff; letter-spacing: -2px; font-variant-numeric: tabular-nums; text-shadow: 0 0 26px rgba(79, 227, 255, 0.7), 0 5px 0 rgba(8, 10, 26, 0.6); }
.m-run h1 > span { font-size: 30px; font-weight: 900; }
.m-run h1 em.ttl { position: relative; font-style: normal; align-self: center; font-size: 17px; font-weight: 900; padding: 4px 13px; border-radius: 999px; color: #2a1600; background: linear-gradient(180deg, #ffe48a, #ffbf3a); box-shadow: 0 0 14px rgba(255, 200, 70, 0.6); white-space: nowrap; }
.m-run.party h1 b { color: var(--yl); text-shadow: 0 0 30px rgba(255, 212, 90, 0.9), 0 5px 0 rgba(8, 10, 26, 0.6); }
.m-run.party h1 { animation: recPop 0.7s both cubic-bezier(0.3, 1.7, 0.5, 1); }
/* 0 連勝：「次は 1 勝！」（負けた感じより、次を見せる。数の字は、勝った時と同じ太さ・大きさ） */
/* 印（自己ベスト・解放・星・全注ぎでとどめ） */
.rn-bd { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; max-width: 100%; }
.rn-bd .sub { font-size: 14px; font-weight: 800; color: var(--dim); }
.bd { font-style: normal; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 900; white-space: nowrap; color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.28); animation: bdIn 0.5s calc(0.25s + var(--i, 0) * 0.09s) both cubic-bezier(0.3, 1.7, 0.5, 1); }
.bd.gold { color: #2a1600; background: linear-gradient(180deg, #ffe48a, #ffbf3a); border-color: transparent; box-shadow: 0 0 16px rgba(255, 200, 70, 0.6); }
.bd.new { background: rgba(255, 111, 174, 0.2); border-color: rgba(255, 150, 200, 0.85); }
.bd.new u { display: inline-block; margin-right: 5px; vertical-align: 1px; text-decoration: none; font-size: 9.5px; line-height: 1.3; padding: 0 5px; border-radius: 5px; background: #ff6fae; color: #fff; }
.bd.ttl { color: var(--yl); background: rgba(255, 212, 90, 0.16); border-color: rgba(255, 212, 90, 0.85); }
.bd.star { background: rgba(255, 212, 90, 0.14); border-color: rgba(255, 212, 90, 0.7); } .bd.star .stars { font-size: 14px; }
.bd.full { color: #ffe7a0; border-color: rgba(255, 212, 90, 0.5); }
@keyframes bdIn { from { opacity: 0; transform: scale(0.5); } }
@keyframes rnIn { from { opacity: 0; transform: translateX(-16px); } }
/* 一行ずつ：最後の相手・おしい・挑戦状・次の目標 */
.rn-last { margin: 2px 0 0; font-size: 14.5px; font-weight: 800; color: #ffc2cc; white-space: nowrap; } .rn-last b { color: #fff; } .rn-last.win { color: var(--yl); }
.rn-last { max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 2px 0; }
.rn-by { font-style: normal; display: inline-flex; align-items: center; gap: 4px; margin-left: 7px; vertical-align: 1px; }
.rn-by small { font-size: 10px; font-weight: 800; color: var(--dim); }
.rn-last .rn-by b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 3px; border-radius: 6px; font-size: 11.5px; font-weight: 900; line-height: 1; color: #0b0d24; background: var(--c); }
.rn-last .rn-by.full b { box-shadow: 0 0 0 2px var(--yl), 0 0 10px rgba(255, 212, 90, 0.8); }
.rn-last .rn-by.full small { color: var(--yl); }
.rn-last .rn-by.t b { padding: 0 7px; font-size: 10.5px; color: #fff; background: rgba(255, 255, 255, 0.16); }
@media (max-width: 600px) { .rn-by small { display: none; } .rn-by { margin-left: 5px; } .bd .k { display: none; } }
.rn-left { margin: 0; width: 100%; max-width: 340px; display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 800; color: #ffb1c8; }
.rn-left span { white-space: nowrap; } .rn-left.close span { color: var(--yl); font-size: 15px; } .rn-left b { font-size: 1.12em; }
.rn-left i { flex: 1; min-width: 34px; max-width: 120px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.rn-left i b { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #ff5f8f, #ff9ab8); }
.rn-ch { margin: 0; font-size: 14px; font-weight: 900; color: #ffb1c8; white-space: nowrap; } .rn-ch.win { color: var(--yl); font-size: 15px; text-shadow: 0 0 12px rgba(255, 212, 90, 0.6); }
.rn-goal { margin-top: 4px; width: 100%; max-width: 340px; }
.rn-goal p { margin: 0 0 5px; font-size: 13.5px; font-weight: 800; color: #dfe6ff; white-space: nowrap; } .rn-goal p b { color: var(--yl); font-size: 17px; } .rn-goal .stars { font-size: 13px; }
.rn-goal i { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.rn-goal i b { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--cy), #b6f6ff); }
/* 右の列：とどめの動画・シェア・もう一回 */
.rn-side { position: absolute; right: calc(var(--sr) + 16px); bottom: calc(var(--sb) + 14px); width: min(300px, calc(28 * var(--vw))); display: flex; flex-direction: column; align-items: stretch; gap: 9px; }
.rn-vid { position: relative; align-self: flex-end; width: 100%; border-radius: 14px; overflow: hidden; line-height: 0; background: #0b0d24; border: 1.5px solid rgba(255, 150, 200, 0.75); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
.rn-vid video { display: block; width: 100%; height: auto; max-height: calc(28 * var(--vh)); object-fit: cover; pointer-events: none; }
.rn-vid em { position: absolute; right: 6px; top: 6px; font-style: normal; font-size: 10px; font-weight: 900; line-height: 1; padding: 3px 7px; border-radius: 999px; color: #fff; background: rgba(255, 111, 174, 0.85); }
.rn-share { position: relative; }
.rn-sh { width: 100%; min-height: 46px; padding: 8px 10px; font-size: 16px; letter-spacing: 3px; color: #fff; background: rgba(13, 16, 44, 0.78); border-color: rgba(150, 175, 255, 0.45); }
.rn-sh::before { content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 6px; vertical-align: -0.1em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l5 5h-3.5v8h-3V7H7z M4 13h3v6h10v-6h3v9H4z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l5 5h-3.5v8h-3V7H7z M4 13h3v6h10v-6h3v9H4z'/%3E%3C/svg%3E") center / contain no-repeat; }
.rn-share.open .rn-sh { border-color: var(--cy); color: var(--cy); }
.rn-sheet { display: none; position: absolute; right: 0; bottom: calc(100% + 6px); width: 100%; min-width: 172px; flex-direction: column; gap: 6px; padding: 8px; border-radius: 16px; background: rgba(13, 16, 44, 0.97); border: 1px solid rgba(150, 175, 255, 0.4); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55); z-index: 3; }
.rn-share.open .rn-sheet { display: flex; animation: shIn 0.16s ease-out both; }
@keyframes shIn { from { opacity: 0; transform: translateY(8px); } }
.rn-sheet .sec { width: 100%; min-height: 40px; padding: 7px 10px; font-size: 14px; }
.rn-sheet .sec.x { background: #0f1419; border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.rn-sheet .sec.vid { background: linear-gradient(100deg, rgba(255, 111, 174, 0.32), rgba(79, 227, 255, 0.22)); border-color: rgba(255, 150, 200, 0.85); color: #fff; }
.rn-sheet .sec.vid::before { content: "▶ "; font-size: 0.8em; color: #ffd1e4; }
/* もう一回：タイトルの「あそぶ」と同じ見た目（いちばん大きく、右の親指が届く右下） */
.rn-again { position: relative; width: 100%; border: 0; border-radius: 999px; padding: 17px 10px 16px; font-size: 30px; font-weight: 900; letter-spacing: 8px; text-indent: 8px; line-height: 1.1; color: #2a1600;
  background: linear-gradient(180deg, #ffe58a, #ffb627 60%, #ff8f1f); box-shadow: 0 6px 0 #b45a0a, 0 10px 30px rgba(255, 170, 40, 0.45); animation: playGlow 1.6s ease-in-out infinite; }
.rn-again:active { transform: translateY(4px); box-shadow: 0 2px 0 #b45a0a, 0 6px 20px rgba(255, 170, 40, 0.4); }
/* 紙吹雪（祝う時だけ・一度だけ） */
.rn-conf { position: absolute; left: 46px; top: 46%; width: 0; height: 0; pointer-events: none; z-index: 2; }
.rn-conf i { position: absolute; left: -4px; top: -6px; width: 8px; height: 12px; border-radius: 2px; background: var(--c); opacity: 0; animation: conf 1.7s var(--d) cubic-bezier(0.15, 0.75, 0.35, 1) both; }
@keyframes conf { 0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(0.3); } 55% { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); } 100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 80px)) rotate(var(--r)) scale(0.9); } }
@media (prefers-reduced-motion: reduce) {
  .m-run *, .m-run *::before, .m-run *::after { animation: none !important; transition: none !important; }
  .rn-conf { display: none; }
}
/* スマホを横にした高さ */
@media (max-height: 500px) {
  .m-run { padding: calc(var(--st) + 8px) calc(var(--sr) + 14px) calc(var(--sb) + 12px) calc(var(--sl) + 18px); }
  .rn-main { gap: 4px; }
  .m-run .rk { font-size: 12px; }
  .m-run h1 b { font-size: 84px; } .m-run h1 > span { font-size: 24px; } .m-run h1 em.ttl { font-size: 14px; padding: 3px 10px; }
  .rn-side { width: min(250px, calc(28 * var(--vw))); gap: 8px; }
  .rn-sh { min-height: 42px; font-size: 15px; }
  .rn-again { font-size: 25px; padding: 13px 8px 12px; letter-spacing: 6px; text-indent: 6px; }
  .rn-sheet .sec { min-height: 38px; font-size: 13px; padding: 6px 8px; }
  .bd { font-size: 12px; padding: 3px 9px; } .rn-bd .sub { font-size: 13px; }
  .rn-last { font-size: 13.5px; } .rn-left { font-size: 12.5px; } .rn-left.close span { font-size: 14px; } .rn-ch { font-size: 13px; } .rn-ch.win { font-size: 14px; }
  .rn-goal p { font-size: 12.5px; } .rn-goal p b { font-size: 15px; }
}
@media (max-height: 360px) {
  .rn-back { min-height: 32px; }
  .m-run h1 b { font-size: 70px; } .m-run h1 > span { font-size: 21px; }
  .rn-main { gap: 3px; }
  .rn-again { font-size: 23px; padding: 11px 8px 10px; }
  .rn-sh { min-height: 40px; }
  .rn-sheet { gap: 5px; padding: 6px; } .rn-sheet .sec { min-height: 36px; padding: 5px 8px; }
}
/* 幅の狭い画面（小さいスマホ・縦持ちを回したとき） */
@media (max-width: 700px) {
  .m-run { padding-left: calc(var(--sl) + 14px); padding-right: calc(var(--sr) + 12px); }
  .rn-main { width: calc(46 * var(--vw)); }
  .rn-side { right: calc(var(--sr) + 12px); width: max(200px, calc(28 * var(--vw))); }
  .m-run h1 b { font-size: 72px; } .m-run h1 > span { font-size: 20px; }
  .m-run h1 em.ttl { font-size: 12.5px; padding: 3px 9px; }
  .bd { font-size: 11px; padding: 3px 8px; } .rn-bd .sub { font-size: 12px; }
  .rn-last, .rn-goal p { font-size: 12px; } .rn-goal p b { font-size: 14px; } .rn-left, .rn-ch { font-size: 12px; } .rn-left.close span, .rn-ch.win { font-size: 12.5px; }
  .rn-again { font-size: 21px; letter-spacing: 4px; text-indent: 4px; }
  .rn-sh { font-size: 14px; letter-spacing: 1px; }
}
/* いちばん狭い（縦持ちを回した 553 幅）：記録の列を少し詰めて、動画の窓を幅 200px 以上に */
@media (max-width: 600px) {
  .m-run { padding-left: calc(var(--sl) + 12px); }
  .rn-main { width: calc(40 * var(--vw)); }
  .m-run h1 b { font-size: 66px; } .m-run h1 > span { font-size: 18px; } .m-run .rk { font-size: 11px; letter-spacing: 2px; }
  .bd { font-size: 10.5px; padding: 3px 7px; } .rn-bd .sub { font-size: 11px; }
  .rn-last, .rn-left, .rn-ch, .rn-goal p { font-size: 11px; } .rn-left.close span, .rn-ch.win { font-size: 11.5px; } .rn-goal p b { font-size: 13px; }
  .rn-left { gap: 6px; } .rn-left i { min-width: 28px; }
}

/* ---------- キャラと道具（第2版）：初めての人が 10 秒で選べるように ----------
   右の列：持つ道具 4 つ → おすすめ → 選べる道具（左の色の帯と小さな字で「何をする物か」。同じ色＝同じ働き）
   → まだの物は「あと N 勝」の小さな札にまとめる → 選んだ道具の説明（1〜2 行。列の下にいつも全部見える） */
.m-kit { grid-template-columns: minmax(0, 0.9fr) minmax(90px, 0.5fr) minmax(0, 1.2fr); }
.m-kit .kr { display: flex; flex-direction: column; gap: 6px; overflow-x: hidden; }
.m-kit .kr > * { flex: none; margin: 0; }
.m-kit .myslots { gap: 5px; }
.m-kit .ms { min-height: 44px; }
.m-kit .ms.on button { padding: 3px 2px 3px; }
.m-kit .ms.on button i { width: 20px; height: 20px; font-size: 11px; }
.m-kit .ms.on button b { font-size: 11px; margin-top: 2px; }
.m-kit .msnote { gap: 6px; font-size: 11px; line-height: 1.3; }
.m-kit .msnote small { margin-left: 4px; font-size: 10px; }
.m-kit [data-a="kreco"] { min-height: 30px; padding: 4px 12px; }
.m-kit .toollist { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.m-kit .tl { min-width: 0; min-height: 36px; gap: 4px; padding: 3px 3px 3px 4px; border-left: 4px solid var(--k); border-radius: 9px; }
.m-kit .tl.on { border-left-color: var(--k); }
.m-kit .tl.solo { grid-column: span 2; }
.m-kit .tl i { flex: none; width: 20px; height: 20px; font-size: 11px; border-radius: 6px; }
.m-kit .tl > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.m-kit .tl b { font-size: 11.5px; }
.m-kit .tl em { font-style: normal; font-size: 9.5px; font-weight: 800; color: var(--k); white-space: nowrap; }
.m-kit .klock { display: flex; flex-wrap: wrap; gap: 4px; }
.m-kit .klock span { display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px dashed var(--line); font-size: 10.5px; color: var(--dim); white-space: nowrap; }
.m-kit .klock b { color: #fff; font-size: 12px; margin: 0 1px; }
.m-kit .klock i { width: 7px; height: 7px; border-radius: 50%; background: var(--k); }
.m-kit .klock i:first-of-type { margin-left: 2px; }
.m-kit .tooldetail { min-height: 0; padding: 5px 10px; font-size: 11.5px; }
.m-kit .tooldetail p { margin: 0; line-height: 1.42; min-height: 2.84em; color: #dfe6ff; }
.m-kit .tooldetail b { font-size: 13px; margin-right: 6px; }
.m-kit .tooldetail em { display: inline-block; font-style: normal; font-size: 10px; font-weight: 800; line-height: 1.55; padding: 0 7px; margin-right: 6px; border-radius: 999px; color: #0b0d24; background: var(--k); vertical-align: 1px; }
.m-kit .tooldetail .hint { color: var(--dim); }
@media (max-height: 360px) {
  .m-kit .kr { gap: 3px; }
  .m-kit .ms { min-height: 38px; } .m-kit .ms.on button { padding: 2px 2px; }
  .m-kit .toollist { gap: 4px; }
  .m-kit .tl { min-height: 32px; }
  .m-kit .tooldetail { padding: 3px 9px; font-size: 11px; } .m-kit .tooldetail p { line-height: 1.36; min-height: 2.72em; }
  /* 左の列：キャラの札の型の字は下の欄にもあるので省く */
  .m-kit .kchars .chr small { display: none; } .m-kit .kchars .chr { padding: 3px 1px 2px; }
  .m-kit .kinfo { margin-top: 4px; padding: 4px 9px; } .m-kit .kinfo .nm { font-size: 16px; }
}
/* 幅の狭い画面：道具の札は 3 つずつ。名前（いちばん長い「隠密マント」）が札に収まるように、印と字を少し小さく */
@media (max-width: 720px) {
  .m-kit .tl { padding-left: 3px; gap: 3px; } .m-kit .tl i { width: 18px; height: 18px; font-size: 10.5px; }
  .m-kit .tl b { font-size: 10.5px; }
}
/* いちばん狭い（縦持ちを回した 553 幅）：右の列を広げて、道具の名前が切れないように */
@media (max-width: 600px) {
  .m-kit { grid-template-columns: minmax(0, 0.8fr) minmax(60px, 0.3fr) minmax(0, 1.25fr); }
  .m-kit .tl b { font-size: 10px; } .m-kit .tl em { font-size: 9px; }
  .m-kit .ms.on button b { font-size: 10px; }
}

/* 結果：負けた一行（誰の・どの道具で・どう注いだか）と「次は」の一言 */
.rn-last.lose em { font-style: normal; font-weight: 900; }
.rn-last.lose u { text-decoration: none; color: var(--yl); }
.rn-last.lose .lv { font-size: 0.85em; color: #ffc2cc; }
.rn-hint { margin: 3px 0 0; font-size: 12.5px; font-weight: 700; color: #d7ecff; line-height: 1.35; }
.rn-hint i { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 999px; font-style: normal; font-size: 10.5px; font-weight: 900; line-height: 1.6; color: #0b0d24; background: var(--cy); vertical-align: 1px; }
.rn-hint b { color: #fff; margin: 0 1px; }
@media (max-width: 720px) { .rn-last.lose .lv { display: none; } .rn-hint { font-size: 11.5px; } }
@media (max-width: 600px) { .rn-last.lose .st { display: none; } .rn-hint { font-size: 10.5px; border-left: 3px solid var(--cy); padding-left: 6px; } .rn-hint i { display: none; } }
/* 0 連勝：いちばん大きい字は今回の連勝数（0）。「次は 1 勝！」は札の行に */
.m-run h1.zero b { color: #e8eeff; }
.rn-bd .sub .nx { color: var(--cy); font-size: 1.12em; font-weight: 900; }
/* 顔の絵（髪・肌・目）：次に増えるキャラ・キャラの札 */
.face, .chr i, .rn-goal p i.face { background:
  radial-gradient(circle at 37% 64%, var(--e, #3a2d55) 0 7%, transparent 8%),
  radial-gradient(circle at 63% 64%, var(--e, #3a2d55) 0 7%, transparent 8%),
  radial-gradient(ellipse 58% 34% at 50% 26%, var(--h) 0 97%, transparent 100%),
  radial-gradient(circle at 50% 60%, var(--s, #ffe6d8) 0 43%, var(--h) 45% 100%); }
.face, .rn-goal p i.face { display: inline-block; width: 18px; height: 18px; margin: 0 1px 0 4px; border-radius: 50%; overflow: visible; vertical-align: -4px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.75); }
.rn-goal p i.tg, .tt-next .tg { display: inline-grid; place-items: center; width: 17px; height: 17px; margin: 0 1px 0 4px; border-radius: 5px; background: var(--c); color: #0b0d24; font-size: 10px; font-weight: 900; font-style: normal; line-height: 1; vertical-align: 1px; }
@media (max-width: 600px) { .rn-side { width: max(206px, calc(28 * var(--vw))); } }

/* ---------- 縦持ち：タイトルと結果は回さずに、縦の並びでまっすぐ描く（html.up。回すのは戦いに入る時から） ----------
   タイトル：上に題字、まん中にキャラ、下（親指の届く所）に「あそぶ」。結果：上に記録、まん中にキャラ、下に動画とボタン */
@media (orientation: portrait) {
  #menu.title { background: linear-gradient(180deg, rgba(10, 12, 34, 0.6) 0, rgba(10, 12, 34, 0) 24%, rgba(10, 12, 34, 0) 58%, rgba(10, 12, 34, 0.78) 100%); }
  .m-title { align-items: center; justify-content: flex-start; padding: calc(var(--st) + 16px) calc(var(--sr) + 16px) calc(var(--sb) + 10px) calc(var(--sl) + 16px); }
  .tt-main { width: 100%; max-width: 440px; flex: 1; min-height: 0; gap: 8px; }
  .logo span { width: 58px; height: 58px; font-size: 38px; border-radius: 15px; }
  .tag { margin: 0; font-size: 12.5px; letter-spacing: 1px; }
  .tt-main > .tag + * { margin-top: auto; }
  .tt-play b { font-size: 30px; } .m-title.first .tt-play b { font-size: 32px; }
  .tt-row button { min-height: 52px; }
  .tt-foot { position: static; margin-top: 8px; justify-content: center; }
  /* 結果：左に記録の列（幅 58%）・右にキャラ・下に動画とボタン */
  #menu.run { background: linear-gradient(90deg, rgba(10, 12, 34, 0.9) 0, rgba(10, 12, 34, 0.7) 50%, rgba(10, 12, 34, 0) 64%), linear-gradient(180deg, rgba(10, 12, 34, 0) 70%, rgba(10, 12, 34, 0.8) 100%); }
  .m-run { padding: calc(var(--st) + 10px) calc(var(--sr) + 12px) calc(var(--sb) + 150px) calc(var(--sl) + 12px); }
  .rn-main { width: calc(58 * var(--vw)); gap: 4px; }
  .m-run h1 b { font-size: 84px; } .m-run h1 > span { font-size: 24px; }
  .rn-side { left: calc(var(--sl) + 14px); right: calc(var(--sr) + 14px); bottom: calc(var(--sb) + 12px); width: auto; display: grid; grid-template-columns: minmax(206px, 1.25fr) minmax(0, 1fr); align-items: end; gap: 8px 10px; }
  .rn-side .rn-vid { grid-column: 1; grid-row: 1 / span 2; align-self: end; }
  .rn-side .rn-share { grid-column: 2; grid-row: 1; }
  .rn-side .rn-again { grid-column: 2; grid-row: 2; font-size: 22px; padding: 14px 6px 13px; letter-spacing: 3px; text-indent: 3px; white-space: nowrap; }
  .rn-side:not(:has(.rn-vid)) .rn-share, .rn-side:not(:has(.rn-vid)) .rn-again { grid-column: 1 / -1; }
  .rn-sheet { min-width: 0; }
  .rn-conf { display: none; }
}
@media (orientation: portrait) and (max-height: 600px) {
  .logo span { width: 50px; height: 50px; font-size: 33px; border-radius: 13px; }
  .tt-main { gap: 6px; } .tt-row button { min-height: 48px; }
  .m-run h1 b { font-size: 70px; }
  .rn-side .rn-again { font-size: 20px; padding: 12px 6px 11px; }
}
/* 「横にして」の札：戦いに入る時に一回だけ、紹介の間（約 2.6 秒）。キャラの前ではなく、画面のまん中に小さく */
html.rot.rothint #rotHint { left: 50%; top: 50%; padding: 12px 18px 10px; animation-duration: 2.6s; }
/* まっすぐ描く縦の画面では、全面の「横にして」は出さない（回す案内は戦いに入る時の札だけ） */
html.up #rotate { display: none !important; }
/* とどめのカメラの間は、上の帯（連勝の数・時計）を隠す（DRAMA） */
body.ko-cam #hud .h-top, body.ko-hide #hud .h-top { opacity: 0; transition: opacity 0.15s; }
/* 溜めが切られた：失った分がエネルギーの棒から赤く落ちる（0.5 秒） */
#hEnBrk { background: #ff4d6a; box-shadow: 0 0 8px rgba(255, 77, 106, 0.8); opacity: 0; animation: none; }
#hEnBrk.on { animation: enBrk 0.5s ease-in forwards; }
@keyframes enBrk { 0% { opacity: 1; transform: none; } 30% { opacity: 1; transform: translateY(2px); } 100% { opacity: 0; transform: translateY(18px) rotate(4deg); } }
/* 札の箱は字の幅だけ（横長の箱が左右の丸に重ならない）。低い画面では字を小さく */
@media (max-height: 360px) { body.touch .h-banner { top: calc(var(--st) + 15%); } body.touch .h-banner b { font-size: 34px; } body.touch .h-banner.count b { font-size: 52px; } }
