/* ===== 장면 뷰포트 ===== */
#scene { position: relative; overflow: hidden; background: #050b08; border-bottom: 1px solid var(--line); user-select: none; -webkit-user-select: none; }
#sceneCv, #fxCv { position: absolute; left: 0; top: 0; }
#fxCv { pointer-events: none; width: 100%; height: 100%; }
#sceneRoom { position: absolute; left: 10px; top: 8px; z-index: 3; font-size: 13px; font-weight: 700; color: #e8fff0; background: rgba(5,14,9,.62); padding: 3px 9px; border-radius: 10px; border: 1px solid rgba(109,242,154,.25); pointer-events: none; max-width: calc(50% - 34px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 출구 화살표 */
#sceneExits button { position: absolute; z-index: 4; width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 17px; background: rgba(8,22,14,.72); border: 1px solid rgba(109,242,154,.35); color: #6df29a; opacity: .28; touch-action: manipulation; }
#sceneExits button.on { opacity: 1; }
#sceneExits button.on:hover { background: #1f5a34; }
#sceneExits button:disabled { cursor: default; }
#sceneExits button.alert { border-color: #ff595e; color: #ff8c90; box-shadow: 0 0 0 2px rgba(255,89,94,.3); animation: exitPulse 1.1s ease-in-out infinite; }
#sceneExits button.calm { border-color: #8fe3a8; box-shadow: 0 0 0 2px rgba(143,227,168,.25); }
#sceneExits [data-dir=north] { left: 50%; top: 5px; margin-left: -18px; }
#sceneExits [data-dir=south] { left: 50%; bottom: 3px; margin-left: -18px; }
#sceneExits [data-dir=west] { left: 6px; top: 50%; margin-top: -18px; }
#sceneExits [data-dir=east] { right: 6px; top: 50%; margin-top: -18px; }
@keyframes exitPulse { 50% { box-shadow: 0 0 0 7px rgba(255,89,94,0); } }

/* 다른 생존자 */
#scenePeople { position: absolute; left: 8px; bottom: 8px; z-index: 3; font-size: 12px; color: #cfe9d6; background: rgba(5,14,9,.6); padding: 3px 8px; border-radius: 10px; max-width: calc(50% - 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 공룡 타겟 카드 (이름 줄 + HP 바) */
/* 방 이동 직후: 방 이름·공룡 카드·사람 목록이 살짝 늦게 떠오른다 (scene.js startTrans 가 .arrive 를 붙임) */
#scene.arrive #sceneRoom, #scene.arrive #sceneDinos, #scene.arrive #scenePeople, #scene.arrive #lobbyCards { animation: sceneArrive 420ms ease-out; }
#stepPill { position: absolute; left: 50%; bottom: 14px; z-index: 4; transform: translateX(-50%); font-size: 13px; font-weight: 700; color: #e8fff0; background: rgba(5,14,9,.74); border: 1px solid rgba(109,242,154,.3); border-radius: 12px; padding: 4px 12px 6px; pointer-events: none; white-space: nowrap; opacity: 0; transition: opacity .12s; overflow: hidden; }
#stepPill.on { opacity: 1; }
#stepPill.danger { color: #ffe3dc; background: rgba(40,8,6,.8); border-color: rgba(255,110,90,.5); }
#stepPill.danger i { background: #ff6e5a; }
#stepPill i { position: absolute; left: 10px; right: 10px; bottom: 2px; height: 2px; background: #6df29a; border-radius: 2px; transform-origin: left center; }
@keyframes sceneArrive { 0%, 35% { opacity: 0; transform: translateY(6px); } 100% { opacity: 1; transform: none; } }
#sceneDinos { position: absolute; left: 20%; right: 20%; bottom: 42px; z-index: 3; display: grid; gap: 6px; align-items: end; pointer-events: none; }
.dcard { pointer-events: auto; cursor: pointer; background: rgba(6,16,10,.84); border: 1px solid rgba(109,242,154,.28); border-radius: 9px; padding: 4px 6px 5px; max-width: 210px; justify-self: center; width: 100%; box-sizing: border-box; }
.dcard.sel { border-color: #ffd166; box-shadow: 0 0 0 1px #ffd166 inset; }
.dcard:not(.pas) { border-color: rgba(255,89,94,.45); }
.dcard.sel:not(.pas) { border-color: #ffd166; }
.dcard.wind { border-color: #ff3b2a; animation: cardWarn .5s ease-in-out infinite alternate; }
@keyframes cardWarn { to { background: rgba(70,8,8,.9); } }
.dname { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: #e8fff0; }
.dname b { flex: 1; min-width: 0; font-weight: 400; line-height: 1.35; padding: 1px 0; word-break: keep-all; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dname { align-items: flex-start; }
.dic { font-size: 12px; }
.dcard { border-left-width: 4px; }
.dcard.t1 { border-left-color: #6a8f77; } .dcard.t2 { border-left-color: #6a9bff; } .dcard.t3 { border-left-color: #ffb14a; } .dcard.t4 { border-left-color: #ff5a5a; }

.drow { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.drow .dhp { flex: 1; min-width: 0; margin: 0; }
.datk { flex-shrink: 0; width: 28px; height: 22px; padding: 0; font-size: 14px; border-radius: 6px; background: #4a2a14; color: #ff9f43; border-color: #7a4a24; touch-action: manipulation; }
.dhp { position: relative; height: 12px; margin: 3px 0 0; background: #1a2a20; border-radius: 6px; overflow: hidden; border: 1px solid rgba(255,255,255,.1); }
.dhp i { position: absolute; left: 0; top: 0; bottom: 0; display: block; }
.dhpg { background: #ffd166; transition: width .9s ease .35s; }
.dhpb { background: #2fb85f; transition: width .25s ease, background .3s; } .dhpb.mid { background: #d4a017; } .dhpb.low { background: #d63a3a; }
.dhp span { position: absolute; inset: 0; text-align: center; font-size: 12px; white-space: nowrap; line-height: 12px; color: #fff; text-shadow: 0 0 3px #000; }
.dstat { font-size: 12px; line-height: 1.2; } .dstat:empty { display: none; }
.dstat em { font-style: normal; color: #ff5a4a; font-weight: 700; }
/* 좁은 화면: 카드를 더 작게 */
@media (max-width: 520px) {
  .dname { font-size: 12px; }
  .dname { font-size: 12px; } .dstat { font-size: 12px; }
  #sceneRoom { font-size: 13px; max-width: calc(50% - 52px); }
}

/* 공룡이 3~4마리일 때: 카드를 촘촘하게 (이름이 한 글자씩 줄바꿈되지 않게) */
#sceneDinos.tight .dic { display: none; }
#sceneDinos.tight .dcard { padding: 3px 4px 4px; border-left-width: 3px; }
#sceneDinos.tight .dname { font-size: 12px; }
#sceneDinos.tight .datk { width: 24px; }
#sceneDinos.tighter .dname { font-size: 12px; letter-spacing: -.3px; }
#sceneDinos.tighter { gap: 4px; }
/* ───── 도감 비주얼 카드 ───── */
.dexGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.dexCard { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px 7px; min-height: 0; border-radius: 10px; background: linear-gradient(#0d1f16, #08140e); border: 1px solid rgba(109,242,154,.18); border-top: 3px solid var(--tc, #6df29a); color: #e8fff0; touch-action: manipulation; }
.dexCard canvas { max-width: 100%; height: auto !important; border-radius: 6px; background: radial-gradient(ellipse at 50% 90%, rgba(109,242,154,.12), transparent 70%); }
.dexCard.unseen { border-top-color: #2b3a30; color: #6f8577; opacity: .85; }
.dexCard.unseen:disabled { opacity: .85; }
.dexName { font-size: 12.5px; font-weight: 700; line-height: 1.25; word-break: keep-all; overflow-wrap: break-word; text-align: center; }
.dexSub { font-size: 12px; letter-spacing: -.3px; color: var(--tc, #9fb); opacity: .9; word-break: keep-all; overflow-wrap: normal; text-align: center; max-width: 100%; text-wrap: balance; line-height: 1.3; }
.dexCard.unseen .dexSub { color: #55665b; }
.dexDetail { margin: 6px 0; }
.dexHero { position: relative; display: flex; justify-content: center; padding: 10px 0; border-radius: 12px; background: radial-gradient(ellipse at 50% 85%, rgba(109,242,154,.16), #07110b 70%); border: 1px solid rgba(109,242,154,.2); }
.dexHero canvas { max-width: 100%; height: auto !important; }
.dexBadge { position: absolute; left: 8px; top: 8px; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; color: #04100a; background: var(--tc, #6df29a); }
.dexStat { margin: 10px 0 8px; font-size: 13px; line-height: 1.55; color: #cfe9d6; }
.dexStat div { padding: 3px 0; border-bottom: 1px dashed rgba(109,242,154,.12); }
.dexTip { padding: 8px 10px; border-radius: 9px; background: rgba(255,209,102,.1); border: 1px solid rgba(255,209,102,.35); color: #ffe7a8; font-size: 13px; line-height: 1.5; }
/* 장면과 로그 사이 여백 + 로그 위쪽 가장자리는 글자가 뚝 잘리지 않고 부드럽게 사라지게 */
body.connected #scene { margin-bottom: 8px; border-bottom: 1px solid var(--line); }
body.connected #log { padding-top: 12px; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px); mask-image: linear-gradient(to bottom, transparent 0, #000 14px); }
/* 아이템 설명 카드 · 도움말 카드 */
.itemCard { border: 1px solid #2c4a34; border-radius: 10px; background: rgba(8,20,13,.7); padding: 8px 10px; margin: 8px 0; }
.icHead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.icHead b { color: #e8fff0; font-weight: 700; }
.icBadge { font-size: 12px; color: #C6F24E; border: 1px solid #3f7a4a; border-radius: 999px; padding: 1px 8px; }
.icRow { display: grid; grid-template-columns: 78px 1fr; gap: 8px; padding: 3px 0; border-top: 1px dashed rgba(109,242,154,.15); line-height: 1.5; }
.icRow .k { color: #8fb09b; }
.icRow .v { color: #cfe9d6; }
.icLine { padding: 3px 0; border-top: 1px dashed rgba(109,242,154,.15); color: #cfe9d6; line-height: 1.55; }
.icTip { margin-top: 6px; color: #ffd166; }
.shRow button.info { min-width: 36px; padding: 0 6px; color: #9fd4ff; }
/* 로비: 지금 이 방에 있는 사람 카드(둥둥 떠다님) */
#lobbyCards { position: absolute; top: 46px; left: 0; right: 0; z-index: 3; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0 58px; pointer-events: none; }
#lobbyCards[hidden] { display: none; }
#lobbyCards .lc { background: rgba(8,16,12,.74); border: 1px solid rgba(155,225,93,.5); border-radius: 10px; padding: 4px 10px; font-size: 12px; color: #eaffef; text-align: center; line-height: 1.35; box-shadow: 0 4px 12px rgba(0,0,0,.5); animation: lcFloat 3.2s ease-in-out infinite; white-space: nowrap; }
#lobbyCards .lc b { font-size: 13px; }
#lobbyCards .lc small { display: block; font-size: 12px; color: #a9d2b6; }
#lobbyCards .lc i { font-style: normal; font-size: 12px; font-weight: 700; margin-left: 5px; padding: 0 5px; border-radius: 6px; background: #7fc4ff; color: #07141f; }
#lobbyCards .lc.me { border-color: #ffd166; }
#lobbyCards .lc.bot { border-color: #7fc4ff; }
#lobbyCards .lc.more { align-self: center; color: #c6d9cc; }
@keyframes lcFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { #lobbyCards .lc { animation: none; } }
