/* 推し課長 の 色と、このゲームだけの 画面 */
:root {
  --bg: #eef2f8; --bg2: #121a2c; --panel: #ffffff; --ink: #1d2433; --dim: #6b7487; --btn: #e6ebf3;
  --pri1: #ff7a3d; --pri2: #e5452a; --accent: #2a5fd6; --bar: #1f2a44; --logo-stroke: #1f2a44;
  --title-bg: linear-gradient(180deg, #4a8fe8 0%, #9cc8ff 45%, #f6d7a8 100%);
  --banner-bg: radial-gradient(circle at 70% 40%, #8fd0ff, #2a5fd6 50%, #142a6a);
}
#title::before { content: ""; position: absolute; inset: 0; background: url(img/bg/office.webp) center/cover; opacity: .55; }
.gold { color: #c88a00; font-weight: 800; }
.huge { font-size: 2.4em; font-weight: 900; margin: 0; color: var(--pri2); }

/* オフィス（ホーム） */
.office { position: relative; height: 58%; min-height: 330px; overflow: hidden; }
.obg { position: absolute; inset: 0; background: url(img/bg/office.webp) center 60%/cover, linear-gradient(180deg, #cfe4ff, #f3efe6 60%, #c9b89a); }
.omates img { position: absolute; bottom: 4%; height: 50%; filter: drop-shadow(0 4px 4px rgba(0,0,0,.3)) brightness(.95); cursor: pointer; }
.mate.m0 { left: -4%; } .mate.m1 { left: 14%; bottom: 10%; height: 44%; } .mate.m2 { right: 6%; bottom: 10%; height: 44%; } .mate.m3 { right: -6%; }
.oshi { position: absolute; left: 50%; bottom: 0; height: 88%; transform: translateX(-50%); filter: drop-shadow(0 6px 8px rgba(0,0,0,.4)); cursor: pointer; z-index: 3; }
.oshi.boing { animation: boing .5s; }
@keyframes boing { 30% { transform: translateX(-50%) scale(1.06, .94); } 60% { transform: translateX(-50%) translateY(-12px); } }
.bubble { position: absolute; left: 6%; top: 8%; max-width: 46%; background: #fff; border-radius: 14px; padding: 8px 12px; font-size: .82em; font-weight: 700; box-shadow: 0 3px 8px rgba(0,0,0,.2); z-index: 4; opacity: 0; transform: scale(.6); transition: .2s; }
.bubble.show { opacity: 1; transform: none; }
.bubble::after { content: ""; position: absolute; right: -8px; bottom: 12px; border: 8px solid transparent; border-left-color: #fff; }
.oname { position: absolute; left: 8px; bottom: 8px; z-index: 4; background: rgba(31,42,68,.85); color: #fff; padding: 4px 10px; border-radius: 10px; display: flex; flex-direction: column; line-height: 1.15; }
.oname small { color: #ff8ab0; font-size: var(--fs-xs); font-weight: 800; }
.ohud { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.orank { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: .85em; }
.bigbtn { border: 0; border-radius: 16px; padding: 10px 14px; color: #fff; display: grid; grid-template-columns: 1fr auto; text-align: left; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.bigbtn small { grid-column: 1 / 3; opacity: .9; font-size: .75em; }
.bigbtn b { font-size: 1.25em; } .bigbtn span { align-self: center; display: flex; align-items: center; gap: 2px; font-weight: 800; }
.bigbtn .ico { width: 18px; height: 18px; }
.bigbtn.go { background: linear-gradient(135deg, #ff9a3d, #e5452a); }
.bigbtn.ev { background: linear-gradient(135deg, #7a2ad6, #2a1a6a); }
.bigbtn.wide { margin: 8px; width: calc(100% - 16px); }
.limban { border: 0; border-radius: 14px; overflow: hidden; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 0; height: 64px; background: radial-gradient(circle at 20% 50%, #ffe27a, #ff6b3d 50%, #7a1b5a); color: #fff; text-align: left; animation: glow 2s infinite; }
.limban img { height: 130%; align-self: flex-start; margin-top: -4px; }
.limban span { display: flex; flex-direction: column; font-size: .85em; } .limban em { font-style: normal; color: #fff36b; font-weight: 900; }

/* 社員 */
.teamhead, .workhead { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 0; }
.slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px; }
.slot .empty { aspect-ratio: 3 / 4; border-radius: 10px; border: 2px dashed #9aa6bb; display: grid; place-items: center; font-size: 24px; color: #9aa6bb; cursor: pointer; }
.lvrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.lvrow .ico { width: 16px; height: 16px; vertical-align: middle; }

/* 案件 */
.stages { display: flex; flex-direction: column; gap: 6px; padding: 0 8px 8px; }
.stage { display: flex; align-items: center; gap: 8px; background: var(--panel); border-radius: 12px; padding: 6px 10px; box-shadow: 0 1px 3px rgba(0,0,0,.12); cursor: pointer; }
.stage.cur { border: 2px solid var(--pri1); background: #fff6ee; }
.stage.boss { background: linear-gradient(90deg, #fff, #ffe3e3); }
.sfoes { display: flex; width: 86px; height: 56px; overflow: hidden; }
.sfoes img { height: 150%; margin: -2px -16px 0 -10px; }
.sinfo { flex: 1; display: flex; flex-direction: column; } .sinfo small { color: var(--dim); font-size: .75em; }
.scost { display: flex; align-items: center; gap: 2px; font-weight: 800; } .scost .ico { width: 16px; height: 16px; }

/* バトル */
#battle { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; color: #fff; max-width: 520px; margin: 0 auto; overflow: hidden; }
.bbg { position: absolute; inset: 0; background: url(img/bg/office.webp) center/cover, #2a3550; filter: brightness(.55) saturate(1.1); z-index: -1; }
.btop { display: flex; gap: 8px; align-items: center; padding: max(8px, env(safe-area-inset-top)) 8px 6px; background: rgba(0,0,0,.45); font-size: .8em; }
.btitle { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bspd, .bquit { border: 0; border-radius: 8px; padding: 5px 10px; font-weight: 800; background: #ffd23f; color: #5a3a00; }
.bquit { background: rgba(255,255,255,.2); color: #fff; }
.bdealt { text-align: center; font-size: 1.5em; font-weight: 900; color: #ffd23f; text-shadow: 0 2px 4px #000; min-height: 1.4em; }
.bfoes { flex: 1.2; display: flex; justify-content: center; align-items: flex-end; gap: 4px; padding: 0 6px; }
.ballies { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 0 6px max(10px, env(safe-area-inset-bottom)); align-items: end; }
.blog { height: 8px; }
.bunit { position: relative; display: flex; flex-direction: column; align-items: center; transition: transform .15s, filter .3s; }
.bunit img { width: 100%; filter: drop-shadow(0 4px 4px rgba(0,0,0,.5)); }
.bunit.foe { flex: 1; max-width: 34%; } .bunit.foe img { height: 30vh; width: auto; max-width: 100%; object-fit: contain; }
.bunit.foe.boss { max-width: 56%; } .bunit.foe.boss img { height: 40vh; }
.bunit.ally img { height: 21vh; width: auto; max-width: 140%; object-fit: contain; }
.bunit.act { transform: translateY(-14px) scale(1.06); z-index: 2; }
.bunit.foe.act { transform: translateY(14px) scale(1.06); }
.bunit.hit img { animation: hit .3s; }
@keyframes hit { 25% { transform: translateX(-6px); filter: brightness(2.2) drop-shadow(0 0 6px red); } 75% { transform: translateX(6px); } }
.bunit.dead { filter: grayscale(1) brightness(.5); opacity: .6; transform: rotate(-8deg) translateY(10px); }
.hpbar { width: 90%; height: 7px; background: rgba(0,0,0,.6); border-radius: 99px; overflow: hidden; border: 1px solid rgba(255,255,255,.5); }
.hpbar i { display: block; height: 100%; background: linear-gradient(90deg, #4be38a, #b8f05a); transition: width .25s; }
.foe .hpbar i { background: linear-gradient(90deg, #ff5f5f, #ff9a3d); }
.gauge { display: flex; gap: 2px; margin-top: 2px; }
.gauge i { width: 10px; height: 5px; border-radius: 2px; background: rgba(255,255,255,.25); }
.gauge i.on { background: #ffd23f; box-shadow: 0 0 4px #ffd23f; }
.bname { font-size: var(--fs-xs); font-weight: 800; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.btype { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; font-size: 10px; display: grid; place-items: center; font-weight: 900; border: 1.5px solid #fff; }
.pop { position: absolute; top: 20%; left: 50%; transform: translateX(-50%); font-weight: 900; font-size: 20px; color: #fff; text-shadow: 0 0 4px #000, 0 2px 0 #000; animation: popup .9s forwards; pointer-events: none; white-space: nowrap; z-index: 5; }
.pop.good { color: #ffd23f; font-size: 26px; } .pop.weak { color: #aab4c4; font-size: 16px; } .pop.heal { color: #4be38a; }
@keyframes popup { from { transform: translate(-50%, 10px) scale(.6); } 30% { transform: translate(-50%, -14px) scale(1.15); } to { transform: translate(-50%, -40px); opacity: 0; } }
.cutin { position: absolute; left: 0; right: 0; top: 36%; height: 120px; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: linear-gradient(90deg, rgba(0,0,0,.85), rgba(42,95,214,.85)); animation: cut 1.1s; z-index: 8; overflow: hidden; }
.cutin.r-SSR { background: linear-gradient(90deg, rgba(0,0,0,.85), rgba(227,165,28,.9)); }
.cutin.r-UR { background: linear-gradient(90deg, #ff5f8f, #ffd23f, #4ab2ff, #b46bff); }
.cutin img { height: 230%; align-self: flex-start; margin-top: -10px; }
.cutin div { display: flex; flex-direction: column; } .cutin b { font-size: 28px; font-style: italic; text-shadow: 0 2px 0 #000; }
@keyframes cut { from { transform: translateX(100%); } 20% { transform: none; } 85% { transform: none; opacity: 1; } to { transform: translateX(-100%); opacity: 0; } }
.bresult { position: absolute; inset: 0; display: grid; place-items: center; font-size: 54px; font-weight: 900; font-style: italic; text-shadow: 0 4px 0 #000; animation: zoom .3s; z-index: 9; background: rgba(0,0,0,.35); }
.bresult.win { color: #ffd23f; } .bresult.lose { color: #9aa6bb; }

/* ---- 会話シーン ---- */
#scene { position: fixed; inset: 0; z-index: 80; max-width: 520px; margin: 0 auto; overflow: hidden; cursor: pointer; background: #000; animation: fade .3s; }
#scene.out { opacity: 0; transition: .25s; }
#scene.shake { animation: shakeS .4s; }
@keyframes shakeS { 20% { transform: translate(-8px, 4px); } 40% { transform: translate(8px, -4px); } 60% { transform: translate(-5px, 2px); } }
.scbg { position: absolute; inset: 0; background: center/cover; filter: brightness(.7) blur(1px); }
.scL, .scR { position: absolute; bottom: 18%; height: 62%; filter: brightness(.55) drop-shadow(0 6px 10px rgba(0,0,0,.5)); transition: .25s; }
.scL { left: -14%; } .scR { right: -14%; }
.scL.talk, .scR.talk { filter: drop-shadow(0 6px 12px rgba(0,0,0,.6)); transform: scale(1.04); z-index: 2; }
.scL.big, .scR.big { height: 74%; }
.scbox { position: absolute; left: 10px; right: 10px; bottom: max(14px, env(safe-area-inset-bottom)); min-height: 21%; background: rgba(255,255,255,.96); border-radius: 18px; padding: 26px 16px 18px; box-shadow: 0 6px 20px rgba(0,0,0,.4); z-index: 3; border: 3px solid var(--bar); }
.scname { position: absolute; top: -16px; left: 14px; background: var(--pri2); color: #fff; font-weight: 900; padding: 4px 14px; border-radius: 10px; }
.sctext { font-size: 1.12em; font-weight: 700; line-height: 1.55; }
.sctext.in { animation: textIn .35s; }
@keyframes textIn { from { opacity: 0; transform: translateY(6px); } }
.scnext { position: absolute; right: 14px; bottom: 6px; color: var(--pri2); animation: pop 1s infinite; }
.scskip { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 4; border: 0; background: rgba(0,0,0,.45); color: #fff; padding: 6px 12px; border-radius: 99px; font-weight: 700; }

/* ---- 指さし ---- */
#point { position: fixed; inset: 0; z-index: 75; pointer-events: none; }
.ptdim { position: fixed; background: rgba(8,10,30,.62); pointer-events: auto; }
.ptring { position: fixed; border-radius: 14px; box-shadow: 0 0 0 3px #ffd23f, 0 0 18px 6px rgba(255,210,63,.8); animation: pulseR 1s infinite; }
@keyframes pulseR { 50% { box-shadow: 0 0 0 5px #ffd23f, 0 0 26px 10px rgba(255,210,63,.6); } }
.pthand { position: fixed; font-size: 36px; animation: handBob .8s infinite; text-shadow: 0 2px 4px rgba(0,0,0,.5); }
@keyframes handBob { 50% { margin-top: 10px; } }
.ptbub { position: fixed; left: 12px; right: 12px; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 8px 12px 8px 6px; font-weight: 800; box-shadow: 0 6px 18px rgba(0,0,0,.35); pointer-events: auto; border: 3px solid #ffd23f; }
.ptbub img { width: 60px; height: 60px; object-fit: cover; object-position: 50% 6%; border-radius: 50%; background: #e9eef6; flex: 0 0 auto; }
.ptbub span { flex: 1; }
.nudge { animation: nudge 1.4s 3; }
@keyframes nudge { 30% { transform: scale(1.08); box-shadow: 0 0 0 3px #ffd23f, 0 0 16px #ffd23f; } }

/* ---- オフィス 追加 ---- */
.oname { cursor: pointer; }
.hearts { color: #ff5f8f; font-size: 10px; letter-spacing: -1px; }
.giftbtn { position: absolute; left: 8px; bottom: 74px; z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; font-size: 22px; box-shadow: 0 3px 6px rgba(0,0,0,.3); animation: pop 2s infinite; }
.climb { background: var(--panel); border-radius: 14px; padding: 8px 12px 12px; box-shadow: 0 1px 4px rgba(0,0,0,.12); cursor: pointer; }
.cl1 { display: flex; justify-content: space-between; align-items: baseline; } .cl1 b { font-size: 1.15em; } .cl1 small { color: var(--pri2); font-weight: 800; }
.clbar { position: relative; height: 12px; margin: 10px 14px 4px; background: linear-gradient(90deg, #dfe6f1, #ffe9a8); border-radius: 99px; }
.clbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, #ff9a3d, #e5452a); }
.clbar em { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; overflow: hidden; border: 2px solid #fff; background: #fde; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.clbar em img { width: 100%; height: 160%; object-fit: cover; object-position: 50% 4%; }
.clbar::after { content: "社長室"; position: absolute; right: -16px; top: 13px; font-size: var(--fs-xs); font-weight: 900; color: #b8860b; }
.orank { display: flex; justify-content: space-between; font-size: .8em; color: var(--dim); padding: 0 4px; }
.bigbtn.go.boss { background: linear-gradient(135deg, #3a1a5a, #d01d3a); animation: glow 1.6s infinite; }

/* ---- 本社ビル ---- */
.bldhead { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 12px 0; } .bldhead b { font-size: 1.2em; } .bldhead small { color: var(--pri2); font-weight: 800; }
.building { margin: 8px 30px 16px; background: linear-gradient(90deg, #8a96aa, #c8d2e2 20%, #c8d2e2 80%, #8a96aa); border-radius: 8px 8px 0 0; padding: 0 8px; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.roof { margin: 0 -18px; padding: 10px; text-align: center; font-weight: 900; color: #6a4a00; background: linear-gradient(180deg, #fff3b0, #f2b632); border-radius: 12px 12px 0 0; letter-spacing: .3em; }
.floor { position: relative; display: flex; align-items: center; gap: 8px; height: 46px; margin: 4px 0; padding: 0 10px; border-radius: 6px; background: linear-gradient(180deg, #2a3a5a, #1d2944); color: #9fb4d8; font-size: .82em; cursor: pointer; overflow: hidden; }
.floor .fno { font-weight: 900; width: 34px; color: #fff; } .floor .froom { flex: 1; }
.floor.done { background: linear-gradient(180deg, #fff4c8, #ffd98a); color: #6a4a00; } .floor.done .fno { color: #6a4a00; }
.floor.here { background: linear-gradient(180deg, #ff9a3d, #e5452a); color: #fff; box-shadow: 0 0 0 3px #ffd23f; animation: glow 1.4s infinite; }
.floor.lock { opacity: .85; }
.floor.boss .froom::before { content: "BOSS "; color: #ff5f8f; font-weight: 900; }
.floor.top { background: linear-gradient(180deg, #3a2a10, #1a1000); color: #ffd23f; }
.fboss { position: absolute; right: 54px; width: 38px; height: 38px; top: 4px; border-radius: 50%; object-fit: cover; object-position: 50% 6%; background: #ff5f8f; border: 2px solid #fff; } .floor.lock .fboss { filter: brightness(.3); }
.fme { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: 50% 5%; background: #fde; border: 2px solid #fff; }
.fstamp { color: #d01d1d; border: 2px solid #d01d1d; border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; font-weight: 900; font-size: 11px; transform: rotate(-14deg); }
.fgo { font-weight: 900; color: #fff36b; }
.ground { margin: 0 -18px; height: 18px; background: #6a7a5a; border-radius: 0 0 6px 6px; color: #fff; font-size: var(--fs-xs); text-align: center; }

/* ---- バトル 追加 ---- */
.bauto { border: 0; border-radius: 8px; padding: 5px 9px; font-weight: 800; background: rgba(255,255,255,.2); color: #fff; }
.bauto.on { background: #4be38a; color: #0a3a1a; }
.bunit.ally { cursor: pointer; }
.bunit .ready { display: none; position: absolute; top: 30%; left: 50%; transform: translateX(-50%); background: #ffd23f; color: #5a3a00; font-weight: 900; font-size: 11px; padding: 2px 8px; border-radius: 99px; animation: pop .7s infinite; white-space: nowrap; z-index: 4; }
.bunit.full .ready { display: block; }
.bunit.full img { filter: drop-shadow(0 0 10px #ffd23f) drop-shadow(0 0 4px #fff) brightness(1.15); animation: pop .9s infinite; }
.bunit.queued img { filter: drop-shadow(0 0 12px #ff5f8f) brightness(1.2); }
.bheart { position: absolute; top: 0; right: 2px; color: #ff5f8f; font-size: 16px; text-shadow: 0 0 4px #fff; animation: pop 1.2s infinite; }
.hpbar.no { position: relative; height: 10px; overflow: visible; } .hpbar.no span { position: absolute; left: -24px; top: -3px; font-size: var(--fs-xs); font-weight: 900; color: #ff5f5f; text-shadow: 0 1px 2px #000; }
.bsay { position: absolute; top: 30%; left: 10%; right: 10%; text-align: center; background: #fff; color: #2a1a1a; font-weight: 800; border-radius: 16px; padding: 10px 14px; z-index: 6; opacity: 0; transform: scale(.7); transition: .2s; pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.bsay.show { opacity: 1; transform: none; }
.cutin.oshi { background: linear-gradient(90deg, #ff5f8f, #ffb0c8, #ff5f8f); }
.cutin.oshi small { color: #fff; font-weight: 900; font-size: 14px; text-shadow: 0 1px 2px #a8204a; }
.stamp { position: absolute; left: 50%; top: 40%; z-index: 9; width: 190px; height: 190px; margin: -95px 0 0 -95px; border: 8px solid #d01d1d; border-radius: 50%; color: #d01d1d; background: rgba(255,250,240,.85); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 44px; font-weight: 900; line-height: 1.05; font-family: serif; animation: stamp .45s cubic-bezier(.2,1.6,.4,1); transform: rotate(-14deg); box-shadow: 0 0 0 4px rgba(208,29,29,.3); }
@keyframes stamp { from { transform: rotate(-14deg) scale(3); opacity: 0; } }

/* ---- 社員 追加 ---- */
.slot { position: relative; }
.oshitag { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: #ff5f8f; color: #fff; font-size: var(--fs-xs); font-weight: 900; padding: 0 6px; border-radius: 6px; white-space: nowrap; }
.pink { color: #ff5f8f !important; }
.coslist { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.coslist > b { flex: 1 1 100%; font-size: .85em; }
.cos { width: 30%; display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--btn); border-radius: 10px; padding: 4px; font-size: var(--fs-xs); text-align: center; }
.cos.on { outline: 3px solid #ff5f8f; }
.cos img { width: 100%; height: 90px; object-fit: cover; object-position: 50% 8%; }
.cos em { font-style: normal; color: #ff5f8f; font-weight: 800; }
.giftrow { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,.07); }
.giftrow small { grid-column: 1; color: var(--dim); } .giftrow .btn { grid-row: 1 / 3; grid-column: 2; }
.giftrow .ico { width: 14px; height: 14px; vertical-align: middle; }
.salesbig { text-align: center; font-size: 1.1em; } .salesbig b { font-size: 1.8em; color: #e5452a; }

/* ---- スマホ幅の 調整（推し課長） ---- */
.side .sidebtn span { white-space: nowrap; font-size: 9px; letter-spacing: -.04em; }
.bunit.ally .bname { margin-top: 2px; font-size: 9px; }
.bunit.ally .gauge { margin-top: 3px; }

/* anime portrait speech placement */
.office > .bubble { left: 3%; max-width: 37%; padding: 8px 10px; }

/* Office mascots keep a small natural size in the room. */
.office .oshi.mascot { height: 38%; bottom: 13%; }
.office .mate.mascot { height: 25%; bottom: 12%; }
