/* 甲板の空色と夜の海。ゲームは1画面、メニューは中央の1列。色はトークンから */
:root {
  --bg: #a9d8ff; --fg: #14162a; --panel: rgba(18, 20, 42, .82); --panel-fg: #ffffff; --line: #8a90bd; --card: #e9ecf5; --box: #c9cfdd;
  --accent: #2f6bff; --imp: #c0282d; --jt: #7b3fb8; --kn: #18857a; --ok: #4bd36b; --warn: #c8201e; --gold: #ffd23f;
  --font: "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #1b2140; --fg: #eceaf7; --card: #2a3060; --box: #262c52; color-scheme: dark; } }
:root[data-theme="dark"] { --bg: #1b2140; --fg: #eceaf7; --card: #2a3060; --box: #262c52; color-scheme: dark; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); overflow: hidden; -webkit-user-select: none; user-select: none; }
#app { height: 100%; }
.loading { padding: 40px max(16px, env(safe-area-inset-left, 0px)); }

/* タイトル・キャラ選択 */
.page { height: 100%; overflow: auto; padding-block: 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 640px; margin: 0 auto; display: grid; align-content: start; gap: 12px; }
.page h1 { margin: 0; font-size: clamp(24px, 5vw, 34px); text-wrap: balance; }
.page h2 { margin: 0; }
.sub { margin: 0; opacity: .8; line-height: 1.6; }
.menu, .row { display: grid; gap: 8px; }
.row { grid-template-columns: 1fr 1fr; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button { padding: 10px 6px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); color: var(--fg); font: inherit; font-weight: 700; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn { display: block; width: 100%; padding: 13px; font: 700 15px var(--font); background: var(--card); color: var(--fg); border: 3px solid var(--line); border-radius: 12px; cursor: pointer; }
.btn.main { background: var(--accent); color: #fff; border-color: #9db8ff; }
.btn.imp { background: var(--imp); border-color: #ff9a9a; }
.btn.jt { background: var(--jt); border-color: #d28bff; }
.btn.kn { background: var(--kn); border-color: #6fe3d0; }
.btn.gm { background: #2a2f55; color: #fff; }
.btn:focus-visible, .seg button:focus-visible, .card:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.card { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--fg); font: inherit; cursor: pointer; min-width: 0; }
.card .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--c); grid-row: span 2; }
.card small { font-size: 11px; opacity: .8; }

/* 試合画面 */
.game { position: fixed; inset: 0; }
.game canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.tl { position: absolute; left: max(12px, env(safe-area-inset-left, 0px)); top: max(10px, env(safe-area-inset-top, 0px)); width: min(240px, 52vw); background: rgba(14, 16, 36, .92); border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 11px; color: var(--panel-fg); }
.bar { height: 16px; background: #2a2e52; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; position: relative; margin-bottom: 6px; }
.bar i { display: block; height: 100%; background: var(--ok); transition: width .4s; }
.bar span { position: absolute; inset: 0; font-size: 10px; line-height: 12px; text-align: center; }
.tt { font-weight: 700; margin-bottom: 3px; }
.tasks { max-height: 26vh; overflow: auto; }
.tasks div { padding: 1px 0; color: #fff; font-weight: 700; }
.tasks .dn { color: #7fe39a; text-decoration: line-through; }
.where { position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); top: max(10px, env(safe-area-inset-top, 0px)); background: var(--panel); color: var(--panel-fg); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); }
.alert { position: absolute; left: 50%; top: max(84px, calc(env(safe-area-inset-top, 0px) + 78px)); transform: translateX(-50%); background: var(--warn); color: #fff; font-weight: 700; padding: 8px 14px; border-radius: 10px; border: 2px solid #ffb4a8; font-size: 13px; text-align: center; width: max-content; max-width: 92vw; }
.toasts { position: absolute; left: 50%; bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 120px); transform: translateX(-50%); display: grid; gap: 4px; justify-items: center; pointer-events: none; width: min(92vw, 520px); }
.toasts div { background: rgba(20, 24, 50, .9); color: #fff; padding: 6px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; text-align: center; }
.btns { position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); bottom: max(14px, env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: repeat(2, auto); gap: 8px; justify-items: end; align-items: end; }
.ab { width: 74px; height: 74px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: rgba(28, 32, 64, .9); color: #fff; border: 3px solid #9aa0d0; border-radius: 18px; cursor: pointer; font-family: inherit; position: relative; }
.ab .ic { font-size: 26px; line-height: 1; }
.ab small { font-size: 10px; }
.ab b { position: absolute; font-size: 30px; text-shadow: 0 0 6px #000; }
.ab.use { width: 94px; height: 94px; grid-column: 2; }
.ab.sk { border-color: #6fe3d0; }
.banner { position: absolute; left: 50%; top: max(52px, calc(env(safe-area-inset-top, 0px) + 46px)); transform: translateX(-50%); background: rgba(20, 24, 50, .8); color: var(--gold); font-weight: 700; font-size: 14px; padding: 4px 14px; border-radius: 8px; max-width: 92vw; text-align: center; }
.ab.kill { border-color: #ff6a6a; } .ab.sab { border-color: #ffb347; } .ab.vent { border-color: #c28bff; }
.ab:disabled { opacity: .38; cursor: default; }
.ab:not(:disabled):active { transform: scale(.94); }
.ab:focus-visible { outline: 3px solid var(--gold); }
.hint { position: absolute; left: max(12px, env(safe-area-inset-left, 0px)); bottom: max(14px, env(safe-area-inset-bottom, 0px)); font-size: 11px; color: #fff; max-width: 40vw; line-height: 1.5; text-shadow: 0 0 4px #000; }
.ov { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 14px max(14px, env(safe-area-inset-left, 0px)); background: rgba(6, 7, 16, .78); z-index: 9; }
.box { width: 100%; max-width: 520px; max-height: 100%; overflow: auto; background: var(--box); color: var(--fg); border: 4px solid #5a6088; border-radius: 18px; padding: 16px; display: grid; gap: 8px; }
.box h1, .box h2, .box p { margin: 0; }
.box p { line-height: 1.6; }
.box .note { font-size: 13px; opacity: .85; }
.result { text-align: center; }
.result h1 { font-size: 42px; }
.result .win { color: #2e9e4f; } .result .lose { color: #d23a2a; } .result .gm { color: #5a74d8; }
.gmp { position: absolute; left: max(8px, env(safe-area-inset-left, 0px)); right: max(8px, env(safe-area-inset-right, 0px)); bottom: max(8px, env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; gap: 4px; background: var(--panel); border-radius: 12px; padding: 8px; color: #fff; font-size: 12px; }
.gmp button { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: #2a2f55; color: #fff; font: inherit; cursor: pointer; }
.gmp button.on { background: var(--accent); }
.gmp button.imp { color: #ff8a8a; }
.gmp button.dead { opacity: .45; text-decoration: line-through; }
.gmi { width: 100%; opacity: .8; }
/* 会議 */
.box.meet { max-width: 620px; gap: 6px; }
.mh { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 16px; }
.mh .mt { font-size: 13px; font-weight: 700; color: var(--accent); }
.mi { font-size: 13px; }
.chips { font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.chat { display: flex; flex-direction: column; gap: 4px; height: min(38vh, 300px); overflow-y: auto; background: var(--card); border-radius: 10px; padding: 8px; -webkit-user-select: text; user-select: text; }
.msg { border-left: 4px solid var(--c, var(--line)); padding: 2px 8px; font-size: 13px; line-height: 1.5; display: grid; }
.msg b { font-size: 11px; opacity: .8; }
.msg.sys { border: 0; text-align: center; font-size: 11px; opacity: .8; background: var(--box); border-radius: 999px; padding: 2px 10px; justify-self: center; display: block; }
.msg.mine { background: rgba(47, 107, 255, .14); border-radius: 0 8px 8px 0; }
.msg.me { background: rgba(255, 210, 63, .22); border-radius: 0 8px 8px 0; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.row2 .btn { margin: 0; padding: 10px; font-size: 13px; }
.btn.gold { background: var(--gold); color: #3a2a00; border-color: #e0b000; }
.qcp { background: var(--card); border-radius: 10px; padding: 8px; display: grid; gap: 6px; max-height: 34vh; overflow: auto; }
.qt { display: flex; flex-wrap: wrap; gap: 4px; }
.qtb { font: 700 12px var(--font); padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--box); color: var(--fg); cursor: pointer; }
.qtb.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.qg { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; }
.qb { font: 12px var(--font); text-align: left; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--box); color: var(--fg); cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.qb .dot, .cd .dot, .vl .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); vertical-align: middle; margin-right: 4px; }
.qh { font-size: 12px; font-weight: 700; }
.vg { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.cd { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; text-align: left; padding: 8px; border-radius: 10px; border: 2px solid var(--line); background: var(--card); color: var(--fg); font: 13px var(--font); cursor: pointer; }
.cd em { font-style: normal; font-size: 10px; color: #2e9e4f; width: 100%; }
.cd.off { opacity: .45; }
.cd.pick { border-color: var(--ok); }
.cd:disabled { cursor: default; }
.res { display: grid; gap: 4px; font-size: 13px; }
.out { text-align: center; font-size: 18px; }
#blazor-error-ui { display: none; position: fixed; inset: auto 0 0 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--warn); color: #fff; }

/* タスクのミニゲーム（TaskGame.razor） */
.tg { max-width: 460px; user-select: none; touch-action: pan-y; }
.tg .lv, .tg .mop, .tg .ring, .tg .bar { touch-action: none; }
.tg .th { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tg .th .btn { width: auto; padding: 6px 10px; }
.tg .tgm { margin: 0; font-size: 13px; opacity: .9; }
.tg .pm { min-height: 1.3em; text-align: center; font-weight: 800; color: var(--fg); }
.tg .pm:not(:empty) { background: rgba(255, 210, 63, .45); border-radius: 8px; padding: 2px 8px; }
.tg .big { padding: 18px; font-size: 18px; }
.tg .gg { position: relative; height: 26px; background: #1a1d33; border: 3px solid var(--line); border-radius: 10px; overflow: hidden; }
.tg .gg.tall { height: 120px; }
.tg .gg i { position: absolute; left: 0; top: 0; bottom: 0; background: #4bd36b; }
.tg .gg u { position: absolute; top: 0; bottom: 0; background: rgba(75, 211, 107, .35); border: 2px solid #4bd36b; }
.tg .bar { position: relative; height: 44px; background: #1f5d8a; border-radius: 10px; }
.tg .bar.dark { background: #24283f; height: 28px; }
.tg .bar u { position: absolute; top: 0; bottom: 0; background: rgba(75, 211, 107, .55); }
.tg .bar b { position: absolute; top: 8px; width: 4%; height: 28px; background: #e53935; border-radius: 50%; }
.tg .lv { display: flex; justify-content: center; gap: 18px; }
.tg .lt { position: relative; width: 44px; height: 150px; background: #24283f; border: 3px solid var(--line); border-radius: 12px; touch-action: none; }
.tg .lk { position: absolute; left: 3px; width: 32px; height: 30px; border-radius: 8px; pointer-events: none; }
.tg .ln { text-align: center; font-weight: 700; }
.tg .big-emoji { font-size: 90px; text-align: center; }
.tg .ring { position: relative; height: 210px; }
.tg .ring > div { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; }
.tg .target { width: 90px; height: 90px; border: 8px solid #4bd36b; }
.tg .shrink { border: 4px solid #f2c230; pointer-events: none; }
.tg .cmp { position: relative; width: 180px; height: 180px; margin: 0 auto; border-radius: 50%; background: #e8dcc0; border: 6px solid #8a6a3a; }
.tg .cmp i { position: absolute; left: 50%; top: 10px; width: 6px; height: 80px; margin-left: -3px; transform-origin: 50% 80px; border-radius: 3px; }
.tg .cmp .tgm { background: #e53935; opacity: .6; width: 14px; margin-left: -7px; transform-origin: 50% 80px; }
.tg .cmp .ndl { background: #1a1d33; }
.tg .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tg .flexw { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tg .wanted { width: 30%; padding: 6px; background: #f3e2b8; color: #3a2a10; }
.tg .wanted div { font-size: 26px; }
.tg .sea { position: relative; height: 240px; background: #2a6ea8; border-radius: 12px; }
.tg .isle { position: absolute; width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; font-weight: 700; }
.tg .g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tg .g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tg .g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tg .note { height: 80px; color: #fff; font-size: 22px; }
.tg .emo { font-size: 26px; padding: 8px; }
.tg .rc, .tg .dsp { text-align: center; font-size: 26px; color: #fff; background: #1a1d33; border-radius: 10px; padding: 8px; }
.tg .dsp { font: 700 22px monospace; }
.tg .kp { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tg .qb { padding: 12px; font: 700 18px var(--font); border-radius: 10px; border: 3px solid var(--line); background: var(--card); color: var(--fg); }
.tg .sh { display: flex; gap: 4px; justify-content: center; align-items: flex-end; height: 120px; }
.tg .bk { width: 11%; height: 100%; color: #fff; font: 700 18px var(--font); border: 2px solid #0006; border-radius: 4px; }
.tg .bk.on { transform: translateY(-14px); outline: 3px solid #fff; }
.tg .range { position: relative; height: 210px; background: linear-gradient(#8fd0ff, #d8f0ff); border-radius: 12px; overflow: hidden; }
.tg .tgt { position: absolute; width: 40px; height: 40px; font-size: 28px; border: 0; background: none; padding: 0; }
.tg .bx { height: 90px; font-size: 54px; text-align: center; border-radius: 12px; }
.tg .sw { height: 80px; border-radius: 12px; border: 3px solid var(--line); display: flex; align-items: flex-end; justify-content: center; }
.tg .sw small { background: #0008; color: #fff; padding: 0 6px; border-radius: 6px; }
.tg .sl { display: grid; font-size: 13px; }
.tg input[type=range] { width: 100%; }
.tg .mop { position: relative; width: 300px; height: 180px; margin: 0 auto; background: #c9a36a; border-radius: 10px; overflow: hidden; touch-action: none; }
.tg .mop { background: repeating-linear-gradient(90deg, #d2ad72 0 58px, #b58f56 58px 60px); }
.tg .mop .mud { position: absolute; inset: 0; filter: blur(4px); opacity: .8; pointer-events: none; } /* 泥のしみ：四角を隙間なく敷いてぼかし、点々に見えないように */
.tg .mop .mud i { position: absolute; width: calc(100% / 30 + 1px); height: calc(100% / 18 + 1px); background: #6a4a24; }
.tg .wire { position: relative; height: 230px; background: #1a1d33; border-radius: 12px; }
.tg .wire svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tg .wl, .tg .wr { position: absolute; top: 12px; display: grid; gap: 18px; }
.tg .wl { left: 10px; } .tg .wr { right: 10px; }
.tg .wl button, .tg .wr button { width: 44px; height: 36px; border: 2px solid #000; border-radius: 6px; }

/* 地図・アドミン・バイタル（ShipScreen.razor）とベントの矢印 */
.scr { max-width: 640px; }
.shipmap { width: 100%; border-radius: 10px; display: block; }
.shipmap text { font: 700 9px var(--font); }
.shipmap .fl { font-size: 11px; fill: #fff; }
.shipmap .mk { font-size: 9px; fill: #10203a; }
.shipmap .me { font-size: 12px; fill: #fff; stroke: #10203a; stroke-width: 3px; paint-order: stroke; }
.shipmap .pulse { animation: pulse 1s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { from { transform: scale(.8); } to { transform: scale(1.15); } }
.scr .vc { margin: 0; font-weight: 700; font-size: 13px; }
.vit { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.vit .cd { display: flex; align-items: center; gap: 6px; padding: 8px; background: var(--card); border-radius: 10px; font-weight: 700; font-size: 13px; }
.vit .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.vit b { margin-left: auto; } .vit .ok { color: #1a8f3c; } .vit .ng { color: #c62828; }
.ventarrows { position: fixed; inset: 0; pointer-events: none; z-index: 8; }
.ventarrows button { position: absolute; width: 68px; height: 68px; border-radius: 50%; border: 3px solid #fff; background: rgba(192, 40, 45, .85); color: #fff; font: 900 30px sans-serif; pointer-events: auto; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.ventarrows button span { display: inline-block; }
.ventarrows small { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); white-space: nowrap; font: 700 11px sans-serif; background: rgba(20, 24, 50, .85); padding: 2px 6px; border-radius: 8px; }

/* 設定画面（SettingsView.razor） */
.setp { max-width: 560px; }
.setl { max-height: 64vh; overflow: auto; display: grid; gap: 4px; padding-right: 4px; }
.srow { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; border-bottom: 1px solid rgba(128, 128, 160, .25); }
.srow span { flex: 1; display: grid; }
.srow small { font-weight: 400; opacity: .8; }
.srow input { width: 120px; }
.srow em { width: 54px; text-align: right; font-style: normal; font-weight: 700; }
.srow .tgb { width: 110px; padding: 8px; background: #ccc; color: #222; }
.srow .tgb.on { background: #4bd36b; color: #10301a; }
.srow .tgb.warn { background: #ffd9a8; color: #4a3000; }

/* 会議の情報整理（MeetingInfo.razor）・日ごとのログ（DayLogView.razor）・色の点（Dot.razor） */
.msum { font-size: 12px; line-height: 1.55; border-radius: 10px; padding: 6px 10px; background: #e9ecf6; color: #14162a; border: 2px solid #7b82b0; }
.cdot { white-space: nowrap; }
.cdot i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 3px; vertical-align: -1px; border: 1px solid #fff; }
.dayov { z-index: 11; }
.daylog { max-width: 640px; }
.dtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.dtabs .qb { padding: 6px 10px; font-size: 13px; }
.dtabs .qb.on { background: #4a5a88; color: #fff; }
.cross { background: #ffe9b0; color: #4a3000; border-radius: 8px; padding: 6px 8px; font-size: 12px; }
.dtxt { font-size: 12px; line-height: 1.7; }
.shipmap .mk2 { font-size: 8px; fill: #fff; }
.shipmap .rl { font-size: 9px; }
/* カメラのミニマップ（ガンテツ） */
.minimap { position: absolute; left: 12px; bottom: 120px; width: min(220px, 42vw); background: rgba(18,20,42,.78); border: 2px solid #8a90bd; border-radius: 10px; pointer-events: none; }
.minimap .mmf { fill: #fff; font: bold 10px sans-serif; }
.aist { text-align: center; font-size: 13px; opacity: .85; margin: 4px 0 8px; }
/* オープンチャット */
.ochips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.ochips .qb { padding: 4px 8px; font-size: 12px; }
.ochips .ph { border-color: #ffd23f; }
.oin { display: flex; gap: 6px; margin-bottom: 6px; }
.oin input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 2px solid #8a90bd; background: #fff; color: #222; font-size: 15px; }
.oin .btn { width: auto; margin: 0; padding: 8px 14px; }
.msg.typ { opacity: .7; font-style: italic; }
/* クイックチャット：経路の確認・経路を作る */
.qedit { width: 100%; box-sizing: border-box; border-radius: 10px; border: 2px solid #8a90bd; padding: 8px; font-size: 14px; resize: vertical; }
.qroute { background: rgba(255,255,255,.7); color: #14162a; border-radius: 8px; padding: 6px 8px; font-size: 13px; margin: 4px 0; }
.qb.on { outline: 3px solid #4bd36b; }
.qb.main { background: #3b6dff; color: #fff; }
.qb.dead { opacity: .7; }
/* 役職カード */
.rcard { text-align: center; color: #fff; border-radius: 18px; padding: 22px 14px; max-width: 520px; }
.rcard.crew { background: #10315e; } .rcard.imp { background: #4a0f12; } .rcard.jt { background: #3a1257; } .rcard.kn { background: #0f4a45; }
.rcard h1 { margin: 4px 0 8px; font-size: 34px; }
.rcard.crew h1 { color: #6fb0ff; } .rcard.imp h1 { color: #ff5a5a; } .rcard.jt h1 { color: #d28bff; } .rcard.kn h1 { color: #6fe3d0; }
.rcard .rabs { text-align: left; font-size: 12px; margin: 8px 0; background: rgba(255,255,255,.08); border-radius: 10px; padding: 6px 10px; }
.rcard .rabs div { margin: 3px 0; }
.rcard .rhow { font-size: 13px; line-height: 1.6; }
.rcard .rpp { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 8px 0; }
.rcard .pp { font-size: 12px; background: rgba(255,255,255,.12); border-radius: 10px; padding: 2px 8px; }
.rcard .pp i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.rcard .btn.main { max-width: 240px; margin: 14px auto 0; }
/* フリールーム */
.freebar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; background: rgba(20,24,50,.82); color: #fff; padding: 6px 10px; border-radius: 12px; z-index: 5; font-size: 13px; max-width: calc(100vw - 32px); }
.freebar .btn { width: auto; margin: 0; padding: 6px 10px; font-size: 12px; }
/* チュートリアルの帯 */
.tut { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: min(580px, calc(100vw - 32px)); z-index: 6; background: rgba(20,24,50,.96); color: #fff; font: 700 14px/1.5 sans-serif; border: 2px solid #ffd23f; border-radius: 14px; padding: 8px 12px; box-sizing: border-box; }
.tut .th { color: #ffd23f; font-size: 12px; }
.tut .tb { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.tut .btn { width: auto; margin: 0; padding: 3px 10px; font-size: 12px; }
.tut .btn.end { background: #4a1a1a; border-color: #ff9a9a; }

/* キャラの全身（CharPic）：64×80 の箱、足元が下の真ん中 */
.cp { position: relative; width: 64px; height: 80px; transform: scale(calc(var(--z, 1) * var(--f, 1)), var(--z, 1)); transform-origin: 50% 100%; }
.cp b { position: absolute; left: 0; top: 0; width: 64px; height: 72px; background-size: 100% 100%; }
.cp .lg { position: absolute; top: 67px; width: 6px; height: 11px; border-radius: 2.5px; }
.cp .sh { position: absolute; top: 75px; width: 8px; height: 5px; border-radius: 2.5px; }

/* 始まりの演出（IntroView） */
.intro { position: fixed; inset: 0; z-index: 40; overflow: hidden; cursor: pointer; color: #fff; text-align: center; background: radial-gradient(circle at 50% 55%, #0c2a55, #030a1c 70%); transition: opacity .5s; }
.intro.imp { background: radial-gradient(circle at 50% 55%, #3a0a0e, #12030a 70%); }
.intro.out { opacity: 0; }
.intro .st, .ej .st { position: absolute; background: #fff; border-radius: 1px; animation: twk 2.4s ease-in-out infinite alternate; }
@keyframes twk { from { opacity: .2; } to { opacity: .8; } }
.intro h1 { position: relative; margin: 14vh 0 0; font-size: min(64px, 12vw); font-weight: 900; color: #5fa8ff; text-shadow: 0 0 24px #5fa8ff; animation: ipop .7s .25s both cubic-bezier(.2, .8, .3, 1); }
.intro.imp h1 { color: #ff4a4a; text-shadow: 0 0 24px #ff4a4a; }
@keyframes ipop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.intro .sub { position: relative; font-weight: 700; font-size: min(22px, 4.5vw); animation: ifade .6s 1.1s both; }
.intro .how { position: absolute; left: 0; right: 0; bottom: 8vh; font-weight: 700; font-size: min(17px, 4vw); opacity: .9; animation: ifade .5s 2.5s both; }
.intro.imp .how { color: #ffb0b0; }
@keyframes ifade { from { opacity: 0; } to { opacity: 1; } }
.intro .row { position: absolute; left: 0; right: 0; top: 40vh; display: flex; justify-content: center; align-items: flex-start; gap: min(36px, 2vw); }
.intro .ip { display: flex; flex-direction: column; align-items: center; animation: irise .45s both cubic-bezier(.2, .8, .3, 1); }
.intro .ip span { margin-top: 6px; font-weight: 700; font-size: 13px; white-space: nowrap; } .intro .ip span.me { color: #ffe36a; }
@keyframes irise { from { opacity: 0; transform: translateY(140px); } to { opacity: 1; transform: none; } }

/* 開票（MeetingView）：入れた先に色の玉が順に出る */
.vg.rv .cd em, .cd.skp em { display: inline-flex; flex-wrap: wrap; gap: 2px; margin-left: 4px; }
.cd.skp { margin-top: 6px; display: flex; align-items: center; justify-content: center; }
.vb { width: 13px; height: 13px; border-radius: 50%; background: var(--c); border: 2px solid #fff; font-size: 8px; line-height: 9px; color: #fff; font-style: normal; text-align: center; animation: vpop .5s both cubic-bezier(.3, 1.6, .5, 1); }
@keyframes vpop { from { opacity: 0; transform: translateY(-30px) scale(.3); } to { opacity: 1; transform: none; } }

/* 追放（MeetingView）：船べりの板から海へ投げ捨てられ、水しぶきを上げて沈む */
.ej { position: relative; height: 230px; overflow: hidden; border-radius: 12px; margin: 6px 0; background: linear-gradient(#f3b06a, #e98a63 40%, #9cc3dc 58%); }
.ej .sun { position: absolute; right: 18%; top: 62px; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(#fff3c4, #ffd27a 60%, transparent 72%); }
.ej .wave { position: absolute; left: -40px; right: -40px; bottom: 0; height: 44%; background: linear-gradient(#2f7bb5, #0f3b66); animation: ejwave 3s ease-in-out infinite alternate; }
.ej .wave::before { content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 18px; background: radial-gradient(circle at 20px 18px, #2f7bb5 13px, transparent 14px) 0 0 / 40px 18px repeat-x; }
.ej .w2 { height: 30%; opacity: .85; background: linear-gradient(#1f5f94, #0b2f55); animation-duration: 2.2s; animation-direction: alternate-reverse; }
.ej .w2::before { background: radial-gradient(circle at 20px 18px, #1f5f94 13px, transparent 14px) 0 0 / 40px 18px repeat-x; }
@keyframes ejwave { from { transform: translateX(0); } to { transform: translateX(-20px); } }
.ej .hull { position: absolute; left: -30px; bottom: 26%; width: 130px; height: 108px; background: linear-gradient(#a8703a, #6e4320); border-radius: 0 0 60px 0; box-shadow: inset 0 10px 0 #5a3418; animation: ejbob 3s ease-in-out infinite alternate; }
.ej .plank { position: absolute; left: 92px; top: 92px; width: 92px; height: 9px; background: #c8925a; border-radius: 2px; box-shadow: 0 3px 0 #7a4c22; animation: ejbob 3s ease-in-out infinite alternate; }
@keyframes ejbob { from { transform: translateY(0); } to { transform: translateY(4px); } }
.ej .fly { position: absolute; top: 12px; left: 96px; animation: ejfly 3.8s both; }
.ej .fly .cp { animation: ejspin 3.8s both; transform-origin: 50% 60%; }
@keyframes ejfly { 0% { transform: translate(0, 0); } 28% { transform: translate(52px, 0); animation-timing-function: ease-out; } 42% { transform: translate(110px, -12px); animation-timing-function: ease-in; } 60% { transform: translate(176px, 112px); opacity: 1; } 68% { transform: translate(180px, 150px); opacity: 0; } 100% { transform: translate(180px, 150px); opacity: 0; } }
@keyframes ejspin { 0%, 28% { rotate: 0deg; } 12% { rotate: -6deg; } 20% { rotate: 6deg; } 60%, 100% { rotate: 200deg; } } /* .cp の transform（大きさ）を消さないよう rotate で回す */
.ej .splash { position: absolute; left: 269px; top: 79px; width: 70px; height: 50px; background: radial-gradient(ellipse at 50% 100%, #ffffff 0 30%, rgba(255,255,255,.6) 45%, transparent 70%); transform-origin: 50% 100%; opacity: 0; animation: ejsplash 3.8s both; }
@keyframes ejsplash { 0%, 58% { opacity: 0; transform: scale(.2, .2); } 64% { opacity: 1; transform: scale(1.2, 1.4); } 80% { opacity: 0; transform: scale(1.4, .6); } 100% { opacity: 0; } }
.ej .ring { position: absolute; left: 274px; top: 122px; width: 60px; height: 14px; border: 2px solid rgba(255,255,255,.85); border-radius: 50%; opacity: 0; animation: ejring 3.8s both; }
.ej .r2 { animation-delay: .35s; }
@keyframes ejring { 0%, 60% { opacity: 0; transform: scale(.3); } 66% { opacity: 1; } 100% { opacity: 0; transform: scale(2.4); } }
.ej h2 { position: absolute; left: 0; right: 0; bottom: 14px; margin: 0; font-size: 19px; color: #fff; text-align: center; }

/* スマホ：左下はスティック（game.js が描く）なので操作の説明は出さない */
@media (pointer: coarse) { .hint { display: none; } }

/* オンライン対戦（OnlineView・試合中の通信の知らせ） */
.btn.online { background: #1f7a5a; color: #fff; }
input.code { flex: 1; min-width: 0; font-size: 18px; padding: 10px; border-radius: 10px; border: 2px solid #5a6088; text-transform: lowercase; }
.big-code { font-size: 20px; } .big-code b { font-size: 30px; letter-spacing: .15em; }
.people { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.people .pp { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 12px; background: var(--card); }
.people .pp .dot, .card .dot { background: var(--c); }
.card.on { outline: 3px solid #4bd36b; }
.netw { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); background: rgba(120, 20, 20, .85); color: #fff; padding: 6px 14px; border-radius: 12px; font-size: 13px; z-index: 5; }
.spawn { text-align: center; font-size: 18px; font-weight: 700; margin: 8px 0; } .spawn b { font-size: 26px; color: var(--accent); margin-left: 6px; }

/* キャラ選び（CharPicker）：真ん中にキャラ、左右の矢印、下に能力 */
.cpk { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0; }
.cpk .arr { width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--c); background: var(--card); color: var(--fg); font-size: 22px; flex: none; }
.cpc { text-align: center; min-width: 170px; }
.cpc .cpf { height: 190px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; }
.cpc h3 { margin: 4px 0 0; font-size: 24px; color: var(--c); text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.cpc small { opacity: .7; }
.cpa { display: grid; gap: 6px; max-width: 520px; margin: 4px auto 10px; }
.cpa div { background: var(--card); border-left: 6px solid var(--c, #888); border-radius: 10px; padding: 8px 12px; display: grid; gap: 2px; font-size: 13px; text-align: left; }
.cpa b { font-size: 15px; }

/* キャラ選びの舞台：空と海、回る光、雲、甲板の床とスポットライト */
.cpk { position: relative; overflow: hidden; border-radius: 22px; padding: 18px 10px 14px; border: 4px solid #5a6088;
  background: linear-gradient(#ffcf7a 0%, #ff9e6b 34%, #7cc8f0 34.5%, #3a8fd0 62%, #1f5d9a 100%); box-shadow: inset 0 -40px 60px rgba(0,0,0,.18); }
.cpk::before { content: ""; position: absolute; left: 50%; top: 30%; width: 900px; height: 900px; margin: -450px 0 0 -450px; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.22) 0 10deg, transparent 10deg 20deg); animation: cpspin 40s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 0, transparent 60%); mask: radial-gradient(circle, #000 0, transparent 60%); }
@keyframes cpspin { to { transform: rotate(360deg); } }
.cpk::after { content: ""; position: absolute; left: -10%; right: -10%; bottom: -30px; height: 90px; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0, #c99a5b 0 55%, transparent 56%), repeating-linear-gradient(90deg, rgba(0,0,0,.12) 0 2px, transparent 2px 38px); }
.cpk > * { position: relative; z-index: 1; }
.cpk .arr { background: rgba(255,255,255,.85); color: #2a1b3d; box-shadow: 0 4px 0 rgba(0,0,0,.25); transition: transform .1s; }
.cpk .arr:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.cpc .cpf { position: relative; }
.cpc .cpf::before { content: ""; position: absolute; left: 50%; bottom: 0; width: 150px; height: 34px; margin-left: -75px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,250,210,.95), rgba(255,240,170,.35) 60%, transparent 70%); }
.cpc .cpf .cp { animation: cpbob 2.4s ease-in-out infinite; }
@keyframes cpbob { 50% { translate: 0 -6px; } }
.cpc h3 { color: #fff; -webkit-text-stroke: 1px rgba(0,0,0,.35); text-shadow: 0 3px 0 var(--c), 0 6px 12px rgba(0,0,0,.35); font-size: 28px; }
.cpc small { color: #fff; opacity: .85; }
.cpk .cl { position: absolute; top: 14%; width: 90px; height: 26px; border-radius: 20px; background: rgba(255,255,255,.75); z-index: 0; animation: cpcloud 26s linear infinite; }
.cpk .cl::before { content: ""; position: absolute; left: 18px; top: -12px; width: 40px; height: 30px; border-radius: 50%; background: inherit; }
.cpk .cl.c2 { top: 6%; width: 60px; animation-duration: 34s; animation-delay: -12s; opacity: .8; }
@keyframes cpcloud { from { left: -20%; } to { left: 110%; } }
.cpk { min-height: 290px; flex-shrink: 0; }

/* タイトル・キャラ選び・ロビーの背景：空と水平線、遠くの船、雲、手前の波（試合中はキャンバスが全面を覆う） */
html { background: #1d6fb8; }
body {
  background:
    radial-gradient(circle at 78% 40%, rgba(255, 244, 200, .95) 0 34px, rgba(255, 230, 160, .45) 35px 90px, transparent 160px),
    linear-gradient(#5cc4ff 0%, #a8e2ff 38%, #ffe8b0 55%, #3d9be0 55.4%, #2580c8 72%, #145c9e 100%);
}
body::before, body::after { content: ""; position: fixed; left: 0; right: 0; pointer-events: none; z-index: 0; }
/* 遠くを進むタル丸の影と雲 */
body::before {
  top: 0; height: 56%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 70'%3E%3Cpath d='M58 6v44M58 8l28 14-28 14zM58 22l-22 12 22 8z' fill='%23fff' fill-opacity='.85' stroke='%23224a78' stroke-width='2'/%3E%3Cpath d='M14 50h92l-10 14H26z' fill='%23224a78'/%3E%3Ccircle cx='96' cy='50' r='6' fill='%23ffd23f'/%3E%3C/svg%3E") no-repeat 18% 100% / 110px auto,
    radial-gradient(ellipse 70px 22px at 20% 22%, rgba(255,255,255,.9) 60%, transparent 62%),
    radial-gradient(ellipse 46px 26px at 23% 18%, rgba(255,255,255,.9) 60%, transparent 62%),
    radial-gradient(ellipse 90px 24px at 62% 12%, rgba(255,255,255,.8) 60%, transparent 62%),
    radial-gradient(ellipse 52px 28px at 66% 8%, rgba(255,255,255,.8) 60%, transparent 62%);
  animation: bgship 9s ease-in-out infinite;
}
@keyframes bgship { 50% { transform: translateY(4px); } }
/* 手前の波（2層を逆向きに流す） */
body::after {
  bottom: 0; height: 30%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40'%3E%3Cpath d='M0 20q25-16 50 0t50 0 50 0 50 0v20H0z' fill='%23ffffff' fill-opacity='.18'/%3E%3C/svg%3E") repeat-x 0 0 / 260px 52px,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 40'%3E%3Cpath d='M0 22q25-14 50 0t50 0 50 0 50 0v18H0z' fill='%230d4f8f' fill-opacity='.55'/%3E%3C/svg%3E") repeat-x 0 26px / 200px 44px,
    linear-gradient(transparent 60px, rgba(8, 50, 100, .55));
  animation: bgwave 14s linear infinite;
}
@keyframes bgwave { to { background-position: 260px 0, -200px 26px, 0 0; } }
.page { position: relative; z-index: 1; }
.page > h1, .page > h2 { color: #fff; text-shadow: 0 2px 0 #224a78, 0 0 12px rgba(0, 40, 90, .45); }
.page > .sub, .page > .note { color: #fff; text-shadow: 0 1px 3px rgba(0, 30, 70, .7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body {
  background: radial-gradient(circle at 78% 30%, rgba(255, 250, 220, .9) 0 26px, rgba(200, 220, 255, .2) 27px 80px, transparent 140px),
    radial-gradient(1px 1px at 20% 10%, #fff, transparent), radial-gradient(1px 1px at 40% 25%, #fff, transparent), radial-gradient(1.5px 1.5px at 60% 8%, #fff, transparent), radial-gradient(1px 1px at 85% 18%, #fff, transparent),
    linear-gradient(#0b1130 0%, #1c2a5c 50%, #33467e 55%, #12305e 55.4%, #0b2246 100%); } }
body:has(.game)::before, body:has(.game)::after { display: none; }

/* 右上：部屋の名前と、その下の地図ボタン／左上：タスク一覧を閉じるボタン */
.where { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; background: none; border: 0; padding: 0; }
.where > div { background: var(--panel); color: var(--panel-fg); padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); }
.wmap { background: var(--panel); color: var(--panel-fg); border: 2px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer; }
.wmap:active { transform: translateY(1px); }
.tt { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tt .fold { background: rgba(255,255,255,.12); color: var(--panel-fg); border: 1px solid var(--line); border-radius: 6px; font-size: 10px; padding: 2px 6px; cursor: pointer; flex: none; }

/* 船長命令の1票：「○○、お前もう船降りろ！」を大きく */
.captbig { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 60; pointer-events: none; text-align: center; width: min(92vw, 720px);
  padding: 18px 16px; border-radius: 18px; background: rgba(20, 10, 0, .82); border: 3px solid var(--gold); box-shadow: 0 0 40px rgba(255, 200, 0, .45);
  animation: captIn .55s cubic-bezier(.2, 1.6, .4, 1) both, captOut .6s ease-in 3.4s forwards; }
.captbig small { display: block; color: var(--gold); font-weight: 700; font-size: 15px; letter-spacing: .1em; }
.captbig b { display: block; margin-top: 6px; color: #fff; font-size: clamp(26px, 6.5vw, 52px); line-height: 1.2; text-shadow: 0 3px 0 var(--c, #c00), 0 0 18px rgba(255, 80, 0, .7); }
@keyframes captIn { from { opacity: 0; transform: translate(-50%, -50%) scale(2.4) rotate(-4deg); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes captOut { to { opacity: 0; transform: translate(-50%, -60%) scale(.9); } }

/* 会議の地図 */
.shipmap .mml { font-size: 10px; font-weight: 700; fill: #fff; stroke: #10203a; stroke-width: 3px; paint-order: stroke; }
.mmlist { font-size: 12px; line-height: 1.7; margin: 8px 0; text-align: left; }
.btn.flash { animation: mmFlash 1s ease-in-out 3; }
@keyframes mmFlash { 50% { background: var(--gold); color: #3a2a00; } }

/* 会議の席の絵（MeetSeats。JS 版 drawMeet）：700×260 の舞台を幅に合わせて縮める */
.seats { container-type: inline-size; width: 100%; max-width: 700px; aspect-ratio: 700 / 260; margin: 0 auto 6px; overflow: hidden; border-radius: 12px; position: relative;
  background: radial-gradient(1.5px 1.5px at 12% 20%, #fff8, transparent), radial-gradient(1.5px 1.5px at 37% 12%, #fff6, transparent), radial-gradient(1.5px 1.5px at 63% 28%, #fff8, transparent),
    radial-gradient(1.5px 1.5px at 85% 15%, #fff6, transparent), radial-gradient(1.5px 1.5px at 92% 60%, #fff5, transparent), radial-gradient(1.5px 1.5px at 6% 70%, #fff5, transparent), linear-gradient(#0c0f2c, #262d62); }
.seats .stage { position: absolute; left: 0; top: 0; width: 700px; height: 260px; transform: scale(tan(atan2(100cqw, 700px))); transform-origin: 0 0; }
.seats .tbl { position: absolute; left: 138px; top: 110px; width: 424px; height: 100px; border-radius: 50%; background: #2a1b3d; }
.seats .tbl::before { content: ""; position: absolute; left: 8px; top: 1px; right: 8px; height: 88px; border-radius: 50%; background: #6b4528; }
.seats .tbl::after { content: ""; position: absolute; left: 62px; top: 13px; right: 62px; height: 56px; border-radius: 50%; background: #8a5a36; }
.seats .tbl span { position: absolute; left: 0; right: 0; top: 36px; z-index: 1; text-align: center; font: bold 14px sans-serif; color: rgba(255,255,255,.35); }
.seat { position: absolute; width: 0; height: 0; }
.seat .bd { position: absolute; left: -32px; bottom: 0; }
.seat.sp .bd { animation: spbob .24s ease-in-out infinite alternate; }
.seat.sp::before { content: ""; position: absolute; left: -30px; top: -2px; width: 60px; height: 18px; border-radius: 50%; background: rgba(255,210,63,.28); }
@keyframes spbob { to { translate: 0 -5px; } }
.seat em { position: absolute; left: 0; bottom: 52px; transform: translateX(-50%); white-space: nowrap; font: bold 12px sans-serif; font-style: normal; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.seat em.me { color: #ffd23f; } .seat em.imp { color: #ff5a5a; } .seat.dead em { color: #999; bottom: 40px; }
.seat .bub { position: absolute; left: -16px; bottom: 68px; width: 32px; height: 18px; border-radius: 9px; background: #fff; display: flex; gap: 3px; align-items: center; justify-content: center; }
.seat .bub b { width: 4.4px; height: 4.4px; border-radius: 50%; background: #556; animation: bubdot .9s ease-in-out infinite; }
.seat .bub b:nth-child(2) { animation-delay: .15s; } .seat .bub b:nth-child(3) { animation-delay: .3s; }
@keyframes bubdot { 50% { opacity: .35; } }
.seat .gh { position: absolute; left: -14px; bottom: 6px; font-size: 26px; opacity: .7; animation: ghfl 1.9s ease-in-out infinite alternate; }
@keyframes ghfl { to { translate: 0 -6px; } }
.seat .ok { position: absolute; left: 14px; bottom: 36px; font: bold 13px sans-serif; font-style: normal; color: #4bd36b; }
.seat .rp { position: absolute; left: -10px; bottom: 82px; font-size: 16px; font-style: normal; animation: ghfl .3s ease-in-out infinite alternate; }

/* GM の役決め（GameView の screen "gm"） */
.seg.two { grid-template-columns: repeat(2, 1fr); }
.gmroles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin: 8px 0; }
.gmr { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--fg); font: inherit; cursor: pointer; }
.gmr .cp { margin-top: -18px; }
.gmr b { font-size: 13px; } .gmr small { font-size: 11px; font-weight: 700; }
.gmr.ri { border-color: #e04848; background: color-mix(in srgb, #e04848 16%, var(--card)); } .gmr.ri small { color: #e04848; }
.gmr.rj { border-color: #b05be0; background: color-mix(in srgb, #b05be0 16%, var(--card)); } .gmr.rj small { color: #b05be0; }
.gmr.rk { border-color: #3a8ee0; background: color-mix(in srgb, #3a8ee0 16%, var(--card)); } .gmr.rk small { color: #3a8ee0; }

/* 会議を本家 Among Us 風に：金属の枠のタブレット・名札の投票板・✔✖ で確定・「投票済み」スタンプ */
.box.meet.au { --fg: #14162a; --card: #eef3f7; --box: #c9d4de; --line: #6f8193; color-scheme: light; background: linear-gradient(#a9bccb, #8ea3b5); border: 6px solid #3e4f60; border-radius: 20px; box-shadow: inset 0 0 0 3px #d2dee8, 0 10px 30px rgba(0,0,0,.5); color: #10161d; }
.au .mh .who { font-size: 20px; font-weight: 900; color: #fff; -webkit-text-stroke: 1px #10161d; paint-order: stroke fill; text-shadow: 0 2px 0 #10161d; letter-spacing: .04em; }
.au .mh .mt { color: #10161d; background: rgba(255,255,255,.55); padding: 2px 8px; border-radius: 10px; }
.au .mi, .au .chips { color: #10161d; }
.au .chat { background: rgba(255,255,255,.82); border: 2px solid #3e4f60; border-radius: 10px; }
.au.ph-vote .chat, .au.ph-done .chat { height: min(16vh, 110px); }
.plates { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.plate { position: relative; display: flex; align-items: center; gap: 4px; min-height: 46px; padding: 2px 6px 2px 2px; background: linear-gradient(#fbfdff, #d8e3ec); border: 2px solid #2f3d4b; border-radius: 9px; color: #10161d; font-weight: 800; font-size: 13px; overflow: hidden; }
.plate .hd { flex: none; width: 36px; height: 40px; overflow: hidden; border-radius: 6px; background: color-mix(in srgb, var(--c) 25%, #fff); }
.plate .hd .cp { margin: -40px 0 0 -14px; }
.plate .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate .nm.imp { color: #d42a2a; }
.plate.dead { background: linear-gradient(#7c8893, #5f6b76); color: #d9e0e6; }
.plate.dead .hd { filter: grayscale(1) brightness(.7); }
.plate.dead::after { content: "✕"; position: absolute; left: 4px; top: -4px; font-size: 40px; font-weight: 900; color: #e02424; text-shadow: 0 0 2px #000; pointer-events: none; }
.plate.can { cursor: pointer; }
.plate.can:hover { box-shadow: 0 0 0 3px #ffd23f; }
.plate.pick { box-shadow: 0 0 0 3px #2fbf55; }
.plate.spk { box-shadow: 0 0 0 3px #ffd23f; }
.plate .iv { position: absolute; right: 4px; top: 2px; font-style: normal; font-size: 10px; font-weight: 900; color: #c81e1e; border: 2px solid #c81e1e; border-radius: 4px; padding: 0 3px; background: #fff; transform: rotate(-8deg); animation: ivst .25s both cubic-bezier(.3, 1.6, .5, 1); }
@keyframes ivst { from { transform: scale(2.2) rotate(-8deg); opacity: 0; } }
.plate .vs { display: inline-flex; flex-wrap: wrap; gap: 2px; font-style: normal; max-width: 50%; }
.cf { display: inline-flex; gap: 4px; align-items: center; margin-left: auto; }
.cf button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #10161d; font: 900 16px sans-serif; color: #fff; cursor: pointer; padding: 0; }
.cf .y { background: #2fbf55; } .cf .n { background: #e02424; }
.plate .cf { position: absolute; right: 4px; top: 50%; translate: 0 -50%; }
.afoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; min-height: 34px; }
.skipb { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border-radius: 8px; border: 2px solid #2f3d4b; background: linear-gradient(#fbfdff, #d8e3ec); font: 900 14px var(--font); color: #10161d; cursor: pointer; }
.skipb:disabled { opacity: .55; cursor: default; }
.skipb.rvs { cursor: default; }
.vend { font-weight: 800; color: #10161d; font-size: 14px; } .vend b { font-size: 18px; }

/* ミニゲームの色つきボタンの文字（本・箱・音符）：どの色の上でも読めるよう白に黒い縁 */
.tg .bk, .tg .note, .tg .kp .qb[style*="background"] { color: #fff; text-shadow: 0 0 2px #000, 0 1px 2px #000, 0 0 4px rgba(0,0,0,.6); font-weight: 800; }

/* ドラッグで遊ぶ配線と本 */
.tg .wire { width: 320px; margin: 0 auto; touch-action: none; }
.tg .wire .plug { width: 44px; height: 36px; border: 3px solid #000; border-radius: 6px; touch-action: none; cursor: grab; box-shadow: inset 0 -6px 0 rgba(0,0,0,.25); }
.tg .wr .plug { cursor: default; } .tg .wr .plug.on { box-shadow: 0 0 0 3px #fff; }
.tg .sh { touch-action: none; }
.tg .bk { display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; cursor: grab; touch-action: none; }
.tg .bk.on { z-index: 2; cursor: grabbing; box-shadow: 0 8px 14px rgba(0,0,0,.35); }

/* 絵文字は色つきの字で（Windows などで白黒の字になって真っ黒に見えるのを防ぐ） */
.tg .emo, .tg .rc, .tg .big-emoji, .tg .bx, .tg .tgt, .tg .kp .qb, .qb.emo { font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", var(--font); }
.tg .emo:disabled { opacity: 1; }

/* 本家風の新しいタスク（望遠鏡・宝の地図・錠前・舵・落ち葉・補強パネル・海水サンプル） */
.tg .scref { text-align: center; font-weight: 800; } .tg .scref b { font-size: 26px; vertical-align: middle; }
.tg .scope { position: relative; width: 300px; height: 200px; margin: 0 auto; overflow: hidden; border-radius: 50% / 50%; background: #2f8fd0; border: 6px solid #6a4a2a; touch-action: none; cursor: grab; box-shadow: inset 0 0 30px 10px rgba(0,0,0,.7); }
.tg .skyv { position: absolute; left: 0; top: 0; width: 900px; height: 600px; background: linear-gradient(#5fb8f0, #bfe6ff 178px, #e8f6ff 180px, #2f8fd0 182px, #1d6aa8 400px, #124a80); } /* 空と海（水平線は y=180） */
.tg .skyv i { position: absolute; height: 3px; border-radius: 3px; background: #fff; opacity: .55; } /* 波頭 */
.tg .skyv b { position: absolute; width: 40px; height: 40px; font-size: 32px; line-height: 40px; text-align: center; }
.tg .slot { position: relative; width: 300px; height: 70px; margin: 10px auto; background: linear-gradient(#2a1b3d, #463070); border-radius: 10px; border: 3px solid #1a1030; touch-action: none; }
.tg .slot .bcard { position: absolute; top: 8px; width: 70px; height: 50px; border-radius: 6px; background: #fff8e8; color: #3a2a10; border: 2px solid #8a6a3a; font-size: 11px; font-weight: 800; display: grid; place-items: center; text-align: center; touch-action: none; cursor: grab; }
.tg .g5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tg .g5 .ul { font-size: 20px; font-weight: 900; padding: 12px 0; text-align: center; } .tg .g5 .ul.on { background: #4bd36b; color: #fff; }
.tg .steer { position: relative; width: 200px; height: 200px; margin: 0 auto; border-radius: 50%; background: radial-gradient(#2e6ea8, #12305a); border: 6px solid #6a4a2a; touch-action: none; cursor: crosshair; }
.tg .steer .cx { position: absolute; left: 88px; top: 88px; width: 24px; height: 24px; border: 3px dashed #fff; border-radius: 50%; }
.tg .steer b { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; font-size: 30px; line-height: 30px; text-align: center; color: #ffd23f; text-shadow: 0 0 3px #000; pointer-events: none; }
.tg .leaves { position: relative; width: 300px; height: 180px; margin: 0 auto; background: #6fae4a; border-radius: 10px; touch-action: none; overflow: hidden; }
.tg .leaves .chute { position: absolute; left: 0; top: 0; bottom: 0; width: 46px; background: rgba(0,0,0,.35); color: #fff; font-style: normal; font-weight: 800; font-size: 12px; display: grid; place-items: center; text-align: center; }
.tg .leaves b { position: absolute; width: 36px; height: 36px; font-size: 30px; line-height: 36px; text-align: center; touch-action: none; cursor: grab; }
.tg .hexes { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.tg .hx { position: absolute; width: 64px; height: 56px; margin: -28px 0 0 -32px; border: 0; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background: #e53935; cursor: pointer; }
.tg .hx.ok { background: #f4f8fb; box-shadow: inset 0 0 0 4px #4bd36b; }
.tg .tubes { display: flex; justify-content: center; gap: 12px; margin: 8px 0; }
.tg .tube { width: 34px; height: 110px; padding: 0; border: 3px solid #4a5270; border-radius: 0 0 16px 16px; background: #eef6ff; position: relative; overflow: hidden; }
.tg .tube i { position: absolute; left: 0; right: 0; bottom: 0; height: 60%; }
.tg .tube:disabled { opacity: 1; }

/* タスクの画面：見出しの装置の絵・クリアの判子 */
.tg { position: relative; }
.tg .th b { display: inline-flex; align-items: center; gap: 6px; }
.tg .tart { width: 40px; height: 37px; flex: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.tg .clr { position: absolute; left: 50%; top: 45%; z-index: 5; transform: translate(-50%, -50%) rotate(-8deg); padding: 6px 22px; border: 5px solid #2fbf55; border-radius: 14px; color: #2fbf55; background: rgba(255,255,255,.92); font: 900 34px var(--font); pointer-events: none; animation: clrin .35s both cubic-bezier(.3, 1.6, .5, 1); }
@keyframes clrin { from { transform: translate(-50%, -50%) rotate(-8deg) scale(2.4); opacity: 0; } }

/* 修理のミニゲーム：水汲み・消火・排水 */
.tg .pump { position: relative; width: 300px; height: 190px; margin: 0 auto; background: linear-gradient(#cfe8ff, #9cc8ea); border-radius: 12px; touch-action: none; cursor: grab; }
.tg .pump .ph { position: absolute; left: 30px; top: 14px; width: 120px; padding: 10px 0; text-align: center; background: #7a4a2a; color: #fff; font-weight: 800; border-radius: 10px; box-shadow: 0 4px 0 #4a2a14; pointer-events: none; }
.tg .pump .pb { position: absolute; right: 30px; bottom: 14px; width: 90px; height: 110px; border: 4px solid #6a7a8a; border-top: 0; border-radius: 0 0 18px 18px; background: #eef6ff; overflow: hidden; display: grid; place-items: center; font-size: 34px; pointer-events: none; }
.tg .pump .pb i { position: absolute; left: 0; right: 0; bottom: 0; background: #3b9cff; opacity: .75; transition: height .2s; }
.tg .fires { position: relative; width: 300px; height: 180px; margin: 0 auto; border-radius: 12px; background: linear-gradient(#5a3a2a, #3a2418); overflow: hidden; touch-action: none; }
.tg .fires b { position: absolute; line-height: 1; cursor: pointer; animation: flick .35s ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes flick { to { transform: scale(1.12, .92); } }
.tg .seaw { position: relative; width: 300px; height: 160px; margin: 0 auto 8px; border-radius: 12px; background: #c9b08a; overflow: hidden; }
.tg .seaw > i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(#5fb0e8, #2a6ea8); transition: height .25s; }
.tg .vv { position: absolute; left: 14px; top: 14px; z-index: 1; font-size: 30px; border: 3px solid #4a5270; border-radius: 50%; width: 64px; height: 64px; background: #eef3f7; display: grid; place-items: center; line-height: 1; padding: 0; }
.tg .vv.r { left: auto; right: 14px; } .tg .vv small { font-size: 10px; font-weight: 800; }

/* モフの変装先えらび */
.disg { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 6; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: min(92vw, 520px); padding: 10px 12px; background: var(--panel); color: var(--panel-fg); border-radius: 12px; }
.disg b { width: 100%; text-align: center; }
.seatsw { min-width: 0; } /* 席の絵の入れ物（.seats の container-type で高さが 0 と見積もられ、下と重なるのを防ぐ） */
.rsum { max-height: min(55vh, 420px); overflow: auto; } .rsum b { margin-top: 6px; display: block; }

/* ガンテツのドローン：見るのをやめる */
.droneoff { position: absolute; left: 50%; top: max(86px, calc(env(safe-area-inset-top, 0px) + 80px)); transform: translateX(-50%); z-index: 6; padding: 6px 16px; font-size: 14px; }

/* タスクの動き（TaskGame）：押した手ごたえ・結果の文・クリアの紙ふぶき・タスクごとの動き */
.tg .btn, .tg .qb, .tg .emo, .tg .isle, .tg .tgt, .tg .hx, .tg .tube, .tg .vv { transition: transform .08s; }
.tg .btn:active:not(:disabled), .tg .qb:active, .tg .emo:active, .tg .isle:active, .tg .hx:active, .tg .tube:active:not(:disabled), .tg .vv:active { transform: scale(.92); }
.tg .pm.ok { animation: pmok .35s ease-out; }
.tg .pm.ng { animation: pmng .4s ease-in-out; background: rgba(229, 57, 53, .35); }
@keyframes pmok { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes pmng { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.tg .confetti { position: absolute; left: 50%; top: 45%; z-index: 4; pointer-events: none; }
.tg .confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; background: hsl(calc(var(--i) * 47deg), 85%, 58%); animation: cfly .9s ease-out both; --a: calc(var(--i) * 22.5deg); }
@keyframes cfly { from { transform: rotate(var(--a)) translateY(0) rotate(0); opacity: 1; } to { transform: rotate(var(--a)) translateY(-120px) rotate(540deg); opacity: 0; } }
/* 長押し（給油・水やり・ネジ）：絵が動き、ゲージに流れる縞 */
.tg .hico { text-align: center; font-size: 44px; line-height: 1.2; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", var(--font); }
.tg .hico.k-nuts.on { animation: tgspin .5s linear infinite; }
.tg .hico.k-fuel.on { animation: tgglug .3s ease-in-out infinite alternate; }
.tg .hico.k-plant { transform: scale(calc(.7 + var(--v) / 160)); transform-origin: 50% 100%; transition: transform .1s; }
.tg .hico.k-plant.on { animation: tgsway .5s ease-in-out infinite alternate; }
@keyframes tgspin { to { transform: rotate(360deg); } }
@keyframes tgglug { from { transform: rotate(-8deg); } to { transform: rotate(8deg) translateY(-3px); } }
@keyframes tgsway { from { rotate: -6deg; } to { rotate: 6deg; } }
.tg .gg.on i, .tg .gg.chain i { background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.28) 0 8px, transparent 8px 16px); background-size: 23px 23px; animation: tgstripe .5s linear infinite; }
@keyframes tgstripe { to { background-position: 23px 0; } }
.tg .gg.err { animation: tgerr .4s steps(2) infinite; } .tg .gg.err i { background: #e53935; }
@keyframes tgerr { 50% { border-color: #e53935; } }
.tg .gg.chain i { background-color: #8a96a8; background-image: radial-gradient(ellipse 7px 5px at 50% 50%, transparent 4px, #5a6474 5px, transparent 6px); background-size: 14px 100%; animation: none; }
.tg .gg.bub i { overflow: hidden; }
.tg .gg.bub i::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255,255,255,.55) 2px, transparent 3px) 0 0 / 18px 22px, radial-gradient(circle, rgba(255,255,255,.4) 1.5px, transparent 2.5px) 9px 11px / 18px 22px; animation: tgbub 1s linear infinite; }
@keyframes tgbub { to { background-position: 0 -22px, 9px -11px; } }
/* レバー：止まったら光る */
.tg .lk { transition: bottom .06s, top .06s; } .tg .lk.ok { animation: tglock .5s ease-out; box-shadow: 0 0 10px #4bd36b; }
@keyframes tglock { 0% { transform: scale(1.3); } 100% { transform: scale(1); } }
/* 肉：ジュージュー揺れて湯気 */
.tg .big-emoji.sizzle { animation: tgsizzle .18s ease-in-out infinite alternate; }
@keyframes tgsizzle { from { transform: translateX(-1px) rotate(-1deg); } to { transform: translateX(1px) rotate(1deg); } }
.tg .steam { position: relative; height: 0; } .tg .steam i { position: absolute; left: 44%; top: -120px; width: 10px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.55); filter: blur(3px); animation: tgsteam 1.6s ease-out infinite; }
.tg .steam i:nth-child(2) { left: 52%; animation-delay: .5s; } .tg .steam i:nth-child(3) { left: 60%; animation-delay: 1s; }
@keyframes tgsteam { from { transform: translateY(20px) scale(.6); opacity: 0; } 30% { opacity: .9; } to { transform: translateY(-30px) scale(1.3); opacity: 0; } }
/* 鍛錬の輪・羅針盤と舵の目印：脈打つ */
.tg .target { animation: tgpulse 1s ease-in-out infinite alternate; }
.tg .cmp .tgm { animation: tgglow 1s ease-in-out infinite alternate; }
@keyframes tgpulse { to { box-shadow: 0 0 16px #4bd36b; } }
@keyframes tgglow { to { opacity: .95; } }
/* 釣り：浮きが揺れ、水面が流れる・帆の風：明るくなる */
.tg .bar b { animation: tgbob .7s ease-in-out infinite alternate; }
@keyframes tgbob { to { translate: 0 5px; } }
.tg .bar:not(.dark) { background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.12) 0 2px, transparent 2px 28px); animation: tgflow 2s linear infinite; }
.tg .bar.dark u { animation: tgwind 1.2s ease-in-out infinite alternate; }
@keyframes tgflow { to { background-position: 28px 0; } }
@keyframes tgwind { to { filter: brightness(1.4); } }
/* 手配書：ゆらゆら・地図の島：ぷかぷか・料理の材料：はねる */
.tg .wanted:not(:disabled) { animation: tgsway 1.6s ease-in-out infinite alternate; } .tg .wanted:nth-child(2n) { animation-delay: -.8s; }
.tg .wanted:disabled { animation: tggone .4s ease-out both; }
@keyframes tggone { to { transform: translateY(-10px) scale(.85); opacity: .35; } }
.tg .isle { animation: tgfloat 1.8s ease-in-out infinite alternate; } .tg .isle:nth-child(2n) { animation-delay: -.9s; }
@keyframes tgfloat { to { translate: 0 -4px; } }
.tg .g3 .emo:not(:disabled) { animation: tghop 1.4s ease-in-out infinite; } .tg .g3 .emo:nth-child(3n+1) { animation-delay: -.45s; } .tg .g3 .emo:nth-child(3n+2) { animation-delay: -.9s; }
.tg .g3 .emo:disabled { animation: tglock .4s ease-out; }
@keyframes tghop { 0%, 70%, 100% { translate: 0 0; } 80% { translate: 0 -6px; } }
/* 演奏：光った音が大きく */
.tg .note.lit { animation: tglock .35s ease-out; box-shadow: 0 0 18px #fff; }
/* レシピ・カード：めくる */
.tg .rc { animation: tgflip .35s ease-out; }
.tg .card span { display: inline-block; animation: tgflip .3s ease-out; }
@keyframes tgflip { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
/* もぐらたたき・的：ぴょこっと出る */
.tg .whk span { display: inline-block; animation: tgpop .25s ease-out; }
.tg .tgt { animation: tgpop .25s ease-out, tgfloat .9s ease-in-out .25s infinite alternate; }
@keyframes tgpop { from { transform: scale(0); } 70% { transform: scale(1.2); } to { transform: scale(1); } }
/* 箱：上から落ちてくる・薬の色：じわっと変わる */
.tg .bx { animation: tgdrop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tgdrop { from { transform: translateY(-40px); opacity: 0; } }
.tg .sw { transition: background-color .25s; }
/* モップ：床がきらり */
.tg .mop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.25) 50%, transparent 60%) -300px 0 / 200% 100% no-repeat; animation: tgshine 3s linear infinite; pointer-events: none; }
@keyframes tgshine { to { background-position: 300px 0; } }
/* 水：波打つ（水汲み・排水）・バルブ：回る */
.tg .pump .pb i::before, .tg .seaw > i::before { content: ""; position: absolute; left: 0; right: 0; top: -6px; height: 12px; background: radial-gradient(circle at 10px 12px, rgba(255,255,255,.5) 7px, transparent 8px) 0 0 / 20px 12px repeat-x; animation: tgwave 1s linear infinite; }
@keyframes tgwave { to { background-position: 20px 0; } }
.tg .vv.on { animation: tgspin .6s ease-out; }
/* 消火：火の粉が舞う */
.tg .fires::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, #ffb347 1.5px, transparent 2.5px) 0 0 / 40px 50px, radial-gradient(circle, #ff7043 1px, transparent 2px) 20px 25px / 40px 50px; animation: tgember 2s linear infinite; pointer-events: none; opacity: .8; }
@keyframes tgember { to { background-position: 10px -50px, 30px -25px; } }
/* 望遠鏡：波頭がきらめく・宝の地図：光る・錠前と補強パネル：決まると弾む */
.tg .skyv i { animation: twk 1.4s ease-in-out infinite alternate; } .tg .skyv i:nth-child(3n) { animation-delay: -.7s; }
.tg .slot .bcard { animation: tgcard 1.2s ease-in-out infinite alternate; }
@keyframes tgcard { to { box-shadow: 0 0 14px #ffd23f; } }
.tg .g5 .ul.on, .tg .hx.ok { animation: tglock .4s ease-out; }
/* 舵：照準が回る・落ち葉：揺れる */
.tg .steer .cx { animation: tgspin 3s linear infinite; }
.tg .leaves b { animation: tgsway 1.1s ease-in-out infinite alternate; } .tg .leaves b:nth-child(2n) { animation-delay: -.55s; }
/* 海水サンプル：検査中は泡立つ */
.tg .tubes.run .tube i { background-image: radial-gradient(circle, rgba(255,255,255,.7) 2px, transparent 3px); background-size: 10px 14px; animation: tgbub2 .6s linear infinite; }
@keyframes tgbub2 { to { background-position: 0 -14px; } }
/* 配線：つないだ線が伸びて、差し込み口が光る */
.tg .wire line.drawn { stroke-dasharray: 260; animation: tgdraw .35s ease-out; }
@keyframes tgdraw { from { stroke-dashoffset: 260; } }
.tg .wr .plug.on { animation: tglock .4s ease-out; }
/* 待っている間も動く：長押しの絵・処理の装置・次に引くレバー・錨・本・薬・錠前・試験管・配線の差し込み口・金庫の表示 */
.tg .hico.k-fuel:not(.on), .tg .hico.k-nuts:not(.on) { animation: tgfloat 1.2s ease-in-out infinite alternate; }
.tg .hico.k-plant:not(.on) { animation: tgsway 2s ease-in-out infinite alternate; }
.tg .hico.k-bed.on { animation: tgglug .4s ease-in-out infinite alternate; } .tg .hico.k-dish { animation: tgsway 2.4s ease-in-out infinite alternate; } .tg .hico.k-dish.on { animation: tgspin 1s linear infinite; }
.tg .hico.k-bed:not(.on) { animation: tgfloat 1.4s ease-in-out infinite alternate; }
.tg .lt.nx { animation: tgnext .8s ease-in-out infinite alternate; }
@keyframes tgnext { to { border-color: #ffd23f; box-shadow: 0 0 12px #ffd23f; } }
.tg .hico.k-anchor span { display: inline-block; animation: tglift .35s ease-out, tgsway 1.6s ease-in-out .35s infinite alternate; transform-origin: 50% 0; }
@keyframes tglift { from { transform: translateY(14px); } }
.tg .bk:not(.on) { animation: tgsway 2.2s ease-in-out infinite alternate; } .tg .bk:nth-child(2n) { animation-delay: -1.1s; }
.tg .bk:not(.on) { animation-name: tgtilt; } @keyframes tgtilt { from { rotate: -1.5deg; } to { rotate: 1.5deg; } }
.tg .sw { background-image: linear-gradient(120deg, transparent 35%, rgba(255,255,255,.3) 50%, transparent 65%); background-size: 250% 100%; animation: tgshine2 2.4s linear infinite; }
@keyframes tgshine2 { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.tg .g5 .ul:not(.on) { animation: tgfloat 1.5s ease-in-out infinite alternate; } .tg .g5 .ul:nth-child(2n) { animation-delay: -.75s; }
.tg .tubes:not(.run) .tube i { animation: tgslosh 1.8s ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes tgslosh { to { transform: skewY(4deg); } }
.tg .wl .plug { animation: tgnext .9s ease-in-out infinite alternate; }
.tg .dsp { animation: tgglow2 1s steps(2) infinite; } @keyframes tgglow2 { 50% { box-shadow: inset 0 0 0 2px #4bd36b; } }
@media (prefers-reduced-motion: reduce) { .tg *, .tg *::before, .tg *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; } }
/* 会議のチャット（タブレットの上に重ねて開く） */
.chatov { position: absolute; inset: 0; z-index: 3; display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 6px; padding: 12px; background: linear-gradient(#a9bccb, #8ea3b5); border-radius: 14px; overflow: auto; }
.chatov .chat { height: auto; min-height: 120px; }
.box.meet { position: relative; }
.afoot .chatb { width: auto; flex: none; margin: 0; padding: 8px 12px; font-size: 13px; }
.afoot .vend, .afoot .skipb { white-space: nowrap; }
.afoot .btn.gold, .afoot .btn.main { flex: 1; margin: 0; padding: 8px 12px; font-size: 13px; }
.chatov .mh .btn { width: auto; flex: none; margin: 0; padding: 6px 12px; font-size: 13px; }
.chatov .mh .who { white-space: nowrap; }
/* 人形使い：会議の名札の糸（前の会議の後に付いた人は NEW）・糸ボタン */
.plate .thr { flex: none; font-style: normal; font-size: 12px; font-weight: 900; color: #6a3fc0; background: #fff; border: 2px solid #6a3fc0; border-radius: 6px; padding: 0 4px; white-space: nowrap; }
.ab.ito { background: linear-gradient(#efe6ff, #b9a2e8); }
.ab.ito.hold { box-shadow: 0 0 0 3px #fff, 0 0 14px #b38cff; }
.ab.ito.pull { background: linear-gradient(#fff, #d8c6ff); animation: flash 1s infinite; }
/* 人形使いの勝ち：鳥カゴが画面を覆う（5秒で消える） */
.cage { position: fixed; inset: 0; z-index: 30; pointer-events: none; background: radial-gradient(circle at 50% 0, rgba(40,10,60,.15), rgba(20,0,40,.75)); animation: cagefade 6s forwards; display: grid; place-items: center; }
.cage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cage path { fill: none; stroke: #f5f0ff; stroke-width: .5; stroke-dasharray: 260; stroke-dashoffset: 260; filter: drop-shadow(0 0 1px #c9a8ff); animation: cagedraw 1.6s forwards ease-out; }
.cage b { position: relative; font-size: clamp(26px, 7vw, 54px); color: #fff; text-shadow: 0 0 12px #b38cff, 0 3px 0 #2a0a40; animation: cagepop .6s 1.2s both cubic-bezier(.3, 1.6, .5, 1); }
@keyframes cagedraw { to { stroke-dashoffset: 0; } }
@keyframes cagepop { from { transform: scale(.3); opacity: 0; } }
@keyframes cagefade { 0%, 80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
/* 会議の画面は大きく（画面いっぱい近く）。名札は広ければ3〜4列、チャットは残りの高さを全部使う */
.box.meet { max-width: min(1100px, 100%); height: 100%; align-content: start; }
.box.meet .plates { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.box.meet .plate { min-height: 52px; font-size: 14px; }
.chatov { display: flex; flex-direction: column; gap: 6px; }
.chatov .chat { flex: 1 1 auto; min-height: 96px; height: auto; }
.chatov .qcp { flex: none; }

/* 糸車（人形使いの糸作り） */
.tg .itow { display: block; width: min(320px, 100%); margin: 0 auto 6px; }
.tg .itow .thr.on { animation: tgthr .18s linear infinite alternate; }
@keyframes tgthr { to { stroke-dashoffset: 2; transform: translateY(.6px); } }
.tg .gg + .gg { margin-top: 6px; height: 14px; }
.intro.ito { background: radial-gradient(circle at 50% 55%, #3a1257, #10051c 70%); }
.intro.ito h1 { color: #d28bff; text-shadow: 0 0 24px #b06ad8; }
.intro.ito .how { color: #e3c4ff; }
/* サボタージュの地図（印を押して選ぶ） */
.sabmap h2 { color: #ff6a6a; }
.sabmap .sabst { margin: 0 0 6px; font-size: 13px; font-weight: 700; }
.sabmap .sb { cursor: pointer; }
.sabmap .sb.off { opacity: .35; cursor: default; }
.sabmap .sb.on:hover circle { fill: #7a2030; }
.sabmap .sb.on circle { animation: sabpulse 1.2s ease-in-out infinite alternate; }
@keyframes sabpulse { to { stroke-width: 3.5; } }
.sabmap .si { font-size: 11px; text-anchor: middle; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.sabmap .si.big { font-size: 16px; }
.sabmap .sabkey { font-size: 11px; line-height: 1.6; margin: 6px 0; opacity: .9; }

/* 扉を開けるミニゲーム（ボルトを外す） */
.tg .doorg { position: relative; height: 170px; margin: 6px 0; border-radius: 10px; background: repeating-linear-gradient(90deg, #6b4a2e 0 22px, #5a3c24 22px 24px); border: 3px solid #3a2616; }
.tg .doorg .dpl { position: absolute; inset: 0; display: grid; place-items: center; font-size: 56px; opacity: .25; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.tg .doorg .bolt { position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 3px solid #cfd6e6; background: #8a93a8; font-size: 22px; cursor: pointer; animation: tgfloat 1s ease-in-out infinite alternate; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.tg .doorg .bolt:active { transform: scale(.85); }
.sabmap .droom.on { cursor: pointer; } .sabmap .droom.on:hover { fill: #4a8cf0; }

/* TARU TRAITOR（アプリ版）だけの見た目：ポップな丸文字（Mochiy Pop One・SIL OFL）・押すと沈むボタン・横画面のタイトル。
   app.css の後に読む。tools/app-skin.js が index.html につなぐ */
@font-face { font-family: "TaruPop"; src: url("taru-pop.woff2") format("woff2"); font-display: block; }
:root { --font: "TaruPop", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif; --wood: #c9822f; --ink: #22182e; }
* { font-synthesis: none; }
body, button, input, textarea { font-family: var(--font); font-weight: 400; }
b, strong, h1, h2, h3, .btn, .seg button { font-weight: 400; }

/* ボタン：ぷっくり・下に影・押すと沈む */
.btn, .seg button {
  border: 3px solid var(--ink); border-radius: 18px; letter-spacing: .02em;
  box-shadow: 0 5px 0 var(--ink), inset 0 -5px 0 rgba(0, 0, 0, .18), inset 0 3px 0 rgba(255, 255, 255, .35);
  transition: transform .08s, box-shadow .08s;
}
.btn:active, .seg button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink), inset 0 -3px 0 rgba(0, 0, 0, .18), inset 0 3px 0 rgba(255, 255, 255, .35); }
.btn { padding: 12px 14px; font-size: 16px; }
.btn.main { border-color: var(--ink); }
.seg button { padding: 8px 6px; }
.seg button.on { background: #ffd23f; color: var(--ink); border-color: var(--ink); }

/* タイトル：左にロゴと乗組員の行列、右にボタン（縦長の画面では1列） */
.taru-title { max-width: 1100px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 28px; align-content: center; min-height: 100%; }
.taru-title > * { grid-column: 2; }
.taru-title > .taru-hero { grid-column: 1; grid-row: 1 / 5; align-self: center; text-align: center; }
@media (max-aspect-ratio: 1/1) { .taru-title { grid-template-columns: 1fr; } .taru-title > *, .taru-title > .taru-hero { grid-column: 1; grid-row: auto; } }
.taru-logo { width: 100%; max-width: 520px; display: block; margin: 0 auto; filter: drop-shadow(0 6px 0 rgba(10, 20, 50, .35)); animation: taruIn .7s cubic-bezier(.2, 1.4, .4, 1) both; }

.taru-tag { margin: 4px 0 0; color: #fff; font-size: 14px; text-shadow: 0 2px 0 #10305e; }
.taru-crew { display: flex; justify-content: center; align-items: flex-end; gap: 2px; margin-top: 10px; height: 76px; }
.taru-crew i { width: 44px; height: 50px; background: center bottom / contain no-repeat; animation: taruBob 1.2s ease-in-out infinite alternate; animation-delay: calc(var(--k) * -.17s); }
.taru-crew i:nth-child(even) { transform: scaleX(-1); }
.taru-title .menu { grid-template-columns: 1fr 1fr; gap: 10px 8px; }
.taru-title .menu .btn { padding: 9px 8px; font-size: 15px; }
.taru-title .menu .btn:first-child { grid-column: 1 / -1; font-size: 22px; padding: 13px; animation: taruPulse 1.6s ease-in-out infinite; }
.taru-title { padding-block: 8px; row-gap: 10px; }
@keyframes taruBob { from { translate: 0 0; } to { translate: 0 -8px; } }
@keyframes taruPulse { 50% { scale: 1.03; } }
@keyframes taruIn { from { opacity: 0; scale: .6; } }
@media (prefers-reduced-motion: reduce) { .taru-crew i, .taru-title .menu .btn:first-child, .taru-logo { animation: none; } }
.taru-title .seg button { padding: 5px 4px; font-size: 13px; border-width: 2px; box-shadow: 0 3px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, .35); white-space: nowrap; }
.taru-title .seg { gap: 6px; }

/* ロゴの文字：順にぴょこっと跳ねる（tools/make-logo.js の g.lt） */
.taru-logo .lt { animation: taruHop 2.6s ease-in-out infinite; animation-delay: calc(var(--n) * .11s); }
@keyframes taruHop { 0%, 64%, 100% { translate: 0 0; } 74% { translate: 0 -12px; } 84% { translate: 0 3px; } 90% { translate: 0 0; } }

/* 最初の画面：大きなロゴ・回る光・海・「タッチしてはじめる」。どこを押してもメニューへ */
.taru-splash { position: fixed; inset: 0; z-index: 50; display: grid; justify-items: center; align-content: center; gap: 4px; overflow: hidden; cursor: pointer;
  background: radial-gradient(circle at 50% 38%, #fff7c2 0, #ffd23f 16%, #5ec8ff 46%, #2b7fd0 100%); animation: taruFade .25s both; }
.taru-rays { position: absolute; left: 50%; top: 38%; width: 260vmax; height: 260vmax; translate: -50% -50%; background: repeating-conic-gradient(rgba(255, 255, 255, .2) 0 9deg, transparent 9deg 18deg); animation: taruSpin 40s linear infinite; }
.taru-splash .taru-logo { position: relative; width: min(64vw, 92vh, 600px); max-width: none; }
.taru-splash .taru-crew { position: relative; z-index: 1; margin-top: -4px; }
.taru-splash .taru-crew i { width: 48px; height: 56px; }
.taru-tap { position: relative; z-index: 1; margin: 4px 0 0; color: #fff; font-size: clamp(18px, 3.4vw, 28px); letter-spacing: .08em;
  text-shadow: 0 3px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink), 0 6px 0 rgba(0, 0, 0, .25); animation: taruBlink 1.2s ease-in-out infinite; }
.taru-waves { position: absolute; left: 0; right: 0; bottom: 0; height: 16vh;
  background: radial-gradient(circle at 20px -6px, transparent 22px, #1f63b8 23px) 0 0 / 40px 100% repeat-x; }
@keyframes taruSpin { to { rotate: 360deg; } }
@keyframes taruBlink { 50% { opacity: .35; scale: .97; } }
@keyframes taruFade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .taru-logo .lt, .taru-rays, .taru-tap { animation: none; } }
