/* Detective Agency visual layer */
.detective-lobby{width:min(1500px,calc(100vw - 36px));min-height:min(860px,calc(100vh - 42px));grid-template-columns:minmax(250px,305px) minmax(0,1fr);gap:16px;align-items:stretch;margin:auto}
.detective-join-panel,.detective-agency-panel{border:1px solid rgba(151,126,255,.30);background:linear-gradient(180deg,rgba(30,24,70,.83),rgba(14,14,43,.88));box-shadow:0 24px 65px rgba(0,0,0,.32),inset 0 1px 0 rgba(255,255,255,.06);backdrop-filter:blur(18px)}
.detective-join-panel{border-radius:27px;padding:18px 16px;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:12px}
.detective-join-title{display:flex;align-items:center;gap:10px;font-size:20px;font-weight:950;white-space:nowrap;margin:0 2px 2px}
.detective-icon{width:46px;height:46px;display:grid;place-items:center;border-radius:15px;background:linear-gradient(145deg,#7058ef,#34227c);box-shadow:0 0 24px rgba(126,91,255,.45);font-size:23px}
.detective-qr{width:min(210px,100%);margin:4px auto 0;padding:12px;background:#fff;border-radius:20px;box-shadow:0 0 0 2px rgba(129,91,255,.42),0 0 28px rgba(98,65,255,.28)}
.detective-qr img{display:block;width:100%;aspect-ratio:1;object-fit:contain}
.detective-code-box,.detective-domain,.detective-game-counts{border:1px solid rgba(151,126,255,.23);background:rgba(255,255,255,.045);border-radius:17px}
.detective-code-box{position:relative;padding:9px 10px 7px;text-align:center}
.detective-code-label{display:block;font-size:10px;letter-spacing:.08em;color:#aaa0e9;font-weight:900;margin-bottom:1px}
.detective-code-box .code{font-size:38px;line-height:1.05;letter-spacing:.09em;margin:0;text-shadow:0 0 16px rgba(154,124,255,.55)}
.detective-domain{display:flex;align-items:center;justify-content:center;gap:8px;padding:10px 8px;font-size:13px;font-weight:800;color:#f0edff}
.detective-game-counts{padding:10px 12px;text-align:center;font-weight:900;font-size:15px}.detective-game-counts>span{display:inline-block;width:1px;height:18px;background:rgba(255,255,255,.19);margin:0 12px;vertical-align:middle}
.detective-go{width:100%;margin-top:auto!important;padding:14px 16px!important;border-radius:17px!important;font-size:19px!important;box-shadow:0 0 24px rgba(255,153,50,.34)}
.detective-agency-panel{border-radius:27px;padding:16px 16px 18px;min-width:0;overflow:hidden;display:flex;flex-direction:column}
.agency-heading{display:flex;align-items:center;min-height:86px;padding:0 20px;position:relative;z-index:5}.agency-title{font-size:clamp(34px,4.1vw,68px);font-weight:950;line-height:.92;letter-spacing:-.035em;text-shadow:0 0 28px rgba(141,124,255,.27)}.agency-count{font-size:clamp(16px,1.7vw,27px);font-weight:700;color:#b8afe9;margin-top:9px}
.detective-board{position:relative;flex:1;min-height:600px;border-radius:22px;overflow:hidden;background:radial-gradient(circle at 50% 48%,rgba(98,65,167,.28),transparent 35%),linear-gradient(rgba(21,17,55,.76),rgba(12,13,37,.84)),repeating-linear-gradient(18deg,rgba(255,255,255,.015) 0 1px,transparent 1px 12px);border:1px solid rgba(255,255,255,.055);isolation:isolate}
.detective-board:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 18% 18%,rgba(182,128,255,.10),transparent 27%),radial-gradient(circle at 82% 74%,rgba(255,86,119,.08),transparent 30%);pointer-events:none}
.case-paper{position:absolute;width:150px;height:100px;background:rgba(219,208,193,.06);border:1px solid rgba(255,255,255,.04);transform:rotate(-9deg);z-index:0}.case-paper-a{left:4%;top:9%}.case-paper-b{right:6%;bottom:8%;transform:rotate(7deg)}.case-fingerprint{position:absolute;right:5%;top:10%;font-size:92px;opacity:.035;transform:rotate(14deg)}
.thread-layer{position:absolute;inset:0;width:100%;height:100%;z-index:1;overflow:visible}.thread-layer line{stroke:#ef233c;stroke-width:3.2;opacity:.92;filter:drop-shadow(0 0 4px rgba(255,31,66,.42))}.thread-layer circle{fill:#c91834;stroke:#ff6178;stroke-width:2}
.agent-polaroid,.spy-polaroid{position:absolute;background:#f5f0e8;color:#17131c;box-shadow:0 13px 27px rgba(0,0,0,.43),0 0 0 1px rgba(255,255,255,.42);transform-origin:center;z-index:3}
.agent-polaroid{width:var(--card);padding:7px 7px 24px;transform:translate(-50%,-50%) rotate(var(--turn));transition:width .25s ease,transform .25s ease}
.polaroid-photo{width:100%;aspect-ratio:1/1;background:#211b2f;overflow:hidden}.polaroid-photo img{display:block;width:100%;height:100%;object-fit:cover}.polaroid-fallback{width:100%;height:100%;display:grid;place-items:center;background:linear-gradient(145deg,#17142e,#33245d);font-size:44px}
.polaroid-name,.spy-name{position:absolute;left:5px;right:5px;bottom:5px;text-align:center;font-family:"Segoe Print","Comic Sans MS",cursive;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.polaroid-name{font-size:clamp(10px,calc(var(--card)*.12),17px)}.polaroid-reactions{position:absolute;left:6px;right:6px;bottom:-17px;text-align:center;color:#e9e5ff;font:800 10px/1.2 system-ui;text-shadow:0 2px 5px #000;white-space:nowrap}
.polaroid-pin{position:absolute;left:50%;top:-8px;width:15px;height:15px;border-radius:50%;transform:translateX(-50%);background:radial-gradient(circle at 35% 30%,#ff7281 0 18%,#d81736 32% 72%,#7a0618 100%);box-shadow:0 3px 5px rgba(0,0,0,.45),0 0 7px rgba(255,23,55,.5);z-index:5}
.agent-polaroid .display-remove{position:absolute;right:-9px;top:-9px;width:25px!important;height:25px;padding:0!important;margin:0!important;border-radius:50%!important;font-size:17px!important;line-height:25px;background:#ff4967!important;color:#fff!important;opacity:0;transition:.15s opacity;box-shadow:0 4px 10px rgba(0,0,0,.35)}.agent-polaroid:hover .display-remove{opacity:1}
.spy-polaroid{left:50%;top:50%;width:178px;padding:9px 9px 34px;transform:translate(-50%,-50%) rotate(-1deg);z-index:4;box-shadow:0 20px 40px rgba(0,0,0,.5),0 0 28px rgba(160,83,255,.19)}.spy-polaroid .spy-name{font-size:25px;bottom:5px;letter-spacing:.035em}.spy-pin{width:19px;height:19px;top:-10px}

/* phone avatar picker */
.phone #join.card{padding:16px}.detective-avatar-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}.detective-avbtn{min-height:0!important;padding:8px!important;display:grid!important;grid-template-columns:58px minmax(0,1fr);align-items:center!important;justify-items:start!important;gap:9px!important;text-align:left;border-radius:15px!important;transition:.16s transform,.16s background,.16s border-color}.detective-avbtn:hover{transform:translateY(-1px);background:rgba(255,255,255,.09)}.detective-avbtn.active{outline:none!important;border-color:#ffac4d!important;background:linear-gradient(135deg,rgba(255,159,67,.17),rgba(141,124,255,.15))!important;box-shadow:0 0 0 2px rgba(255,159,67,.28)}.detective-avatar-img{width:58px;height:58px;object-fit:cover;border-radius:13px;border:1px solid rgba(255,255,255,.16)}.detective-avbtn .avlabel{font-size:11px!important;line-height:1.15!important;color:#f3f0ff!important;text-align:left!important}.detective-game-avatar{overflow:hidden;padding:0!important}.detective-game-avatar img{width:100%;height:100%;object-fit:cover;border-radius:50%}.detective-self{display:flex;align-items:center;justify-content:center;gap:8px}.detective-self img{width:30px;height:30px;object-fit:cover;border-radius:50%}

@media(max-width:1180px){.detective-lobby{grid-template-columns:250px minmax(0,1fr)}.detective-join-title{font-size:17px}.detective-icon{width:40px;height:40px}.detective-qr{width:180px}.detective-board{min-height:560px}.agency-title{font-size:42px}}
@media(max-width:900px){.detective-lobby{grid-template-columns:1fr;width:min(700px,calc(100vw - 24px));min-height:auto}.detective-join-panel{display:grid;grid-template-columns:1fr 180px;align-items:center}.detective-join-title,.detective-code-box,.detective-domain,.detective-game-counts,.detective-go{grid-column:1}.detective-qr{grid-column:2;grid-row:1/6}.detective-agency-panel{min-height:720px}.detective-board{min-height:600px}.agency-title{font-size:38px}}
@media(max-width:560px){.detective-avatar-grid{grid-template-columns:1fr!important}.detective-join-panel{display:flex}.detective-qr{width:190px}.detective-agency-panel{padding:10px;min-height:650px}.agency-heading{padding:0 8px;min-height:72px}.agency-title{font-size:30px}.detective-board{min-height:530px}.spy-polaroid{width:135px}.agent-polaroid{max-width:92px}}
