/* 관리자페이지에서 보기 */
#admin { height:100vh; min-height:0; padding:0; overflow:hidden; }
#admin > .content { min-height:0; margin:0; overflow:hidden; }

/* 사용자페이지에서 보기 */
#pHelpButton, #jwTopBtn { display:none; }
body:has(.three-scene) { overflow:hidden; }

/* ##### .three-scene */
.three-scene { position:fixed; inset:0; z-index:95; width:100%; height:100dvh; min-height:620px; overflow:hidden; color:#f3f6fb; isolation:isolate; }
.three-scene * { box-sizing:border-box; }
.three-scene button, .three-scene input { font:inherit; color:inherit; }
.three-scene canvas { display:block; width:100%; height:100%; }
.three-scene .marble-loading { position:absolute; z-index:5; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; background:radial-gradient(circle at 50% 42%, #17345e 0, #0c1d36 46%, #071322 100%); text-align:center; }
.three-scene .marble-loading[hidden] { display:none; }
.three-scene .marble-loading-mark { color:#6aa9ff; font-size:28px; line-height:1; }
.three-scene .marble-loading strong { color:#f3f6fb; font-size:18px; font-weight:500; }
.three-scene .marble-loading p { max-width:360px; padding:0 24px; color:rgba(233,240,251,.6); font-size:12px; }
.three-scene .marble-loading-bar { width:180px; height:2px; margin-top:6px; overflow:hidden; background:rgba(106,169,255,.18); }
.three-scene .marble-loading-bar::after { content:""; display:block; width:40%; height:100%; background:#6aa9ff; animation:marble-loading 1.2s ease-in-out infinite; }
.three-scene .marble-noscript { position:absolute; z-index:6; inset:0; display:grid; place-items:center; padding:24px; background:#071322; color:#f3f6fb; font-size:14px; text-align:center; }
@keyframes marble-loading {
	0% { transform:translateX(-110%); }
	100% { transform:translateX(360%); }
}
.three-scene .p0 { --pc:#5a9bff; --pc-tone:rgba(90,155,255,.2); --pc-line:rgba(90,155,255,.42); }
.three-scene .p1 { --pc:#ff7262; --pc-tone:rgba(255,114,98,.2); --pc-line:rgba(255,114,98,.42); }
.three-scene .p2 { --pc:#52d184; --pc-tone:rgba(82,209,132,.2); --pc-line:rgba(82,209,132,.42); }
.three-scene .scene-card { position:absolute; top:24px; bottom:24px; z-index:2; display:flex; flex-direction:column; width:272px; padding:16px; border:1px solid rgba(150,190,240,.22); border-radius:16px; background:rgba(13,27,50,.82); color:#f3f6fb; box-shadow:0 18px 44px rgba(4,10,20,.45); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
.three-scene .scene-card.is-left { left:24px; }
.three-scene .scene-card.is-right { right:24px; bottom:260px; }
.three-scene .asset-block { display:flex; flex:1; min-height:0; flex-direction:column; }
.three-scene .scene-card-head { display:flex; flex:none; align-items:center; justify-content:flex-end; gap:8px; margin-bottom:10px; }
.three-scene .scene-exit { display:inline-flex; align-items:center; justify-content:center; height:28px; padding:0 11px; border:1px solid rgba(255,255,255,.2); border-radius:999px; background:rgba(255,255,255,.04); color:#dfe9f8; font-size:12px; font-weight:700; text-decoration:none; }
.three-scene .scene-exit:hover { border-color:#6aa9ff; color:#fff; background:rgba(106,169,255,.12); }
.three-scene .scene-exit:focus-visible { outline:2px solid #6aa9ff; outline-offset:2px; }
.three-scene .asset-list { display:flex; min-height:0; flex-direction:column; gap:8px; overflow-y:auto; padding-right:2px; scrollbar-color:rgba(255,255,255,.25) transparent; }
.three-scene .asset-item { padding:10px 12px; border:1px solid rgba(255,255,255,.1); border-radius:10px; }
.three-scene .asset-item.is-current { border-color:var(--pc); }
.three-scene .asset-head { display:flex; align-items:center; gap:6px; }
.three-scene .asset-chip { width:0; height:0; border:6px solid var(--pc); border-radius:50%; }
.three-scene .asset-name { color:var(--pc); font-size:14px; }
.three-scene .asset-badge { margin-left:auto; padding:1px 8px; border:1px solid var(--pc); border-radius:20px; color:var(--pc); font-size:12px; }
.three-scene .asset-money { margin-top:4px; font-size:18px; font-weight:700; font-variant-numeric:tabular-nums; }
.three-scene .asset-meta { color:rgba(233,240,251,.6); font-size:12px; }
.three-scene .asset-summary { margin-top:6px; color:rgba(233,240,251,.78); font-size:12px; }
.three-scene .asset-more { margin-top:6px; padding:0; border:0; color:#8fc0ff; font-size:12px; cursor:pointer; }
.three-scene .asset-more:hover { text-decoration:underline; }
.three-scene .asset-item.is-dead { opacity:.45; }
.three-scene .turn-dock { position:absolute; right:20px; bottom:20px; z-index:3; display:flex; flex-direction:column; align-items:flex-end; gap:10px; }
.three-scene .turn-dock-buttons { display:flex; align-items:center; gap:10px; }
.three-scene .turn-btn { display:flex; align-items:center; justify-content:center; border:0; border-radius:50%; cursor:pointer; transition:transform .15s, box-shadow .15s, opacity .15s; }
.three-scene .turn-btn svg { display:block; }
.three-scene .turn-btn.is-turn { position:relative; width:200px; height:200px; overflow:hidden; background:radial-gradient(circle at 30% 24%, rgba(255,255,255,.92) 0%, rgba(255,255,255,.2) 20%, rgba(255,255,255,0) 46%), radial-gradient(circle at 50% 58%, #5b86f0 0%, #2d5cd2 52%, #173a8f 100%); color:#fff; box-shadow:0 0 0 6px rgba(45,92,210,.14), 0 18px 42px rgba(5,12,24,.45), inset 0 2px 5px rgba(255,255,255,.55), inset 0 -12px 26px rgba(0,0,0,.28); }
.three-scene .turn-btn.is-turn::before { position:absolute; top:9%; left:14%; width:46%; height:32%; border-radius:50%; background:radial-gradient(circle at 28% 26%, rgba(255,255,255,.95) 0%, rgba(255,255,255,0) 20%), radial-gradient(ellipse at 50% 50%, rgba(255,255,255,.85), rgba(255,255,255,0) 72%); content:""; pointer-events:none; }
.three-scene .turn-btn.is-turn::after { position:absolute; inset:0; border-radius:50%; box-shadow:inset 0 0 0 2px rgba(255,255,255,.3), inset 0 -16px 30px rgba(0,0,0,.2); content:""; pointer-events:none; }
.three-scene .turn-btn.is-turn .is-roll-icon { position:relative; z-index:1; width:116px; height:116px; filter:drop-shadow(0 3px 6px rgba(6,20,50,.35)); }
.three-scene .turn-btn.is-turn .is-end-icon { position:relative; z-index:1; display:none; width:88px; height:88px; filter:drop-shadow(0 3px 6px rgba(60,10,6,.35)); }
.three-scene .turn-btn.is-turn.is-end { background:radial-gradient(circle at 30% 24%, rgba(255,255,255,.92) 0%, rgba(255,255,255,.18) 20%, rgba(255,255,255,0) 46%), radial-gradient(circle at 50% 58%, #f2674c 0%, #e0402b 52%, #9e1f10 100%); box-shadow:0 0 0 6px rgba(224,64,43,.16), 0 18px 42px rgba(5,12,24,.45), inset 0 2px 5px rgba(255,255,255,.55), inset 0 -12px 26px rgba(0,0,0,.28); }
.three-scene .turn-btn.is-turn.is-end .is-roll-icon { display:none; }
.three-scene .turn-btn.is-turn.is-end .is-end-icon { display:block; }
.three-scene .turn-btn.is-trade { position:relative; align-self:flex-start; width:50px; height:50px; overflow:hidden; background:radial-gradient(circle at 30% 24%, rgba(255,255,255,.5) 0%, rgba(255,255,255,.08) 22%, rgba(255,255,255,0) 50%), radial-gradient(circle at 50% 58%, #34507a 0%, #22314a 55%, #101b2c 100%); color:#9fc6ff; box-shadow:0 0 0 4px rgba(34,49,74,.16), 0 10px 24px rgba(5,12,24,.35), inset 0 2px 4px rgba(255,255,255,.3), inset 0 -8px 16px rgba(0,0,0,.3); }
.three-scene .turn-btn.is-trade::before { position:absolute; top:10%; left:16%; width:44%; height:30%; border-radius:50%; background:radial-gradient(ellipse at 50% 50%, rgba(255,255,255,.6), rgba(255,255,255,0) 72%); content:""; pointer-events:none; }
.three-scene .turn-btn.is-trade::after { position:absolute; inset:0; border-radius:50%; box-shadow:inset 0 0 0 1.5px rgba(255,255,255,.18), inset 0 -10px 18px rgba(0,0,0,.22); content:""; pointer-events:none; }
.three-scene .turn-btn.is-trade svg { position:relative; z-index:1; width:24px; height:24px; filter:drop-shadow(0 2px 4px rgba(3,10,20,.4)); }
.three-scene .turn-btn:hover:not(:disabled) { transform:translateY(-2px); }
.three-scene .turn-btn:disabled { opacity:.35; cursor:default; box-shadow:none; }
.three-scene .chat-panel { gap:12px; }
.three-scene .chat-log { display:flex; flex:1; min-height:0; flex-direction:column; gap:10px; overflow-y:auto; padding:0; border:0; scrollbar-color:rgba(255,255,255,.25) transparent; }
.three-scene .chat-entry { display:flex; width:100%; flex-direction:column; align-items:flex-start; gap:4px; text-align:left; }
.three-scene .chat-entry.sys { width:100%; color:rgba(233,240,251,.55); font-size:12px; text-align:left; }
.three-scene .chat-meta { display:flex; align-items:center; gap:5px; }
.three-scene .chat-dot { width:8px; height:8px; border:4px solid var(--pc); border-radius:50%; }
.three-scene .chat-name { color:rgba(233,240,251,.85); font-size:12px; font-weight:700; }
.three-scene .chat-bubble { width:100%; padding:9px 12px; border:0; border-radius:10px; background:var(--pc-tone); color:#f3f6fb; text-align:left; word-break:break-word; }
.three-scene .chat-form { display:flex; gap:6px; margin:0; }
.three-scene .chat-label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.three-scene .chat-input { flex:1; min-width:0; padding:8px 10px; border:1px solid rgba(255,255,255,.22); border-radius:10px; color:#f3f6fb; }
.three-scene .chat-input::placeholder { color:#f3f6fb; opacity:.5; }
.three-scene .chat-input:focus { border-color:#6aa9ff; outline:none; }
.three-scene .chat-form .jw-button { padding:8px 12px; border:1px solid rgba(255,255,255,.25); border-radius:10px; background:transparent; color:#f3f6fb; font-weight:700; cursor:pointer; }
.three-scene .chat-form .jw-button:hover { border-color:#6aa9ff; color:#fff; }

/* 공통: 게임 모달 */
.game-modal { display:flex; box-sizing:border-box; width:420px; max-width:calc(100vw - 48px); max-height:85vh; flex-direction:column; gap:14px; overflow-x:hidden; overflow-y:auto; padding:24px; color:#222; }
.game-modal.is-wide { width:540px; }
.game-modal.is-trade { width:620px; }
.game-modal h2 { margin:0; font-size:18px; font-weight:700; }
.game-modal h3 { margin:0 0 8px; font-size:14px; font-weight:700; }
.game-modal p { margin:0; }
.game-modal .game-modal-desc { font-size:14px; }
.game-modal .game-modal-meta { color:#6b7280; font-size:12px; }
.game-modal .game-modal-list { margin:0; padding-left:18px; color:#4b5563; font-size:12px; }
.game-modal .game-modal-list li + li { margin-top:4px; }
.game-modal .game-modal-info { display:flex; flex-direction:column; gap:6px; padding:12px; border:1px solid #e2e5ec; border-radius:10px; }
.game-modal .game-modal-info > div { display:flex; justify-content:space-between; gap:12px; font-size:14px; }
.game-modal .game-modal-info span { color:#6b7280; }
.game-modal .game-modal-info strong { text-align:right; }
.game-modal .game-modal-chance { padding:14px; border:1px solid #e0c8f5; border-radius:10px; font-size:14px; }
.game-modal .game-modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:4px; }
.game-modal .game-modal-actions .jw-button { min-width:88px; height:38px; padding:0 14px; border:1px solid #d5d9e2; border-radius:10px; color:#222; font-weight:700; cursor:pointer; }
.game-modal .game-modal-actions .jw-button.is-primary { border-color:#2b6de0; color:#2b6de0; }
.game-modal .game-modal-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:6px; }
.game-modal .game-modal-grid .jw-button { height:34px; padding:0 6px; overflow:hidden; border:1px solid #d5d9e2; border-radius:8px; color:#222; font-size:12px; text-overflow:ellipsis; cursor:pointer; }
.game-modal .game-modal-grid .jw-button:hover { border-color:#2b6de0; color:#2b6de0; }
.game-modal .game-modal-field { display:flex; align-items:center; gap:8px; font-size:14px; }
.game-modal .game-modal-field select { height:34px; padding:0 8px; border:1px solid #d5d9e2; border-radius:8px; }
.game-modal .game-modal-trade { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.game-modal .game-modal-checks { display:flex; min-height:80px; flex-direction:column; gap:6px; padding:10px; border:1px solid #e2e5ec; border-radius:10px; font-size:12px; }
.game-modal .game-modal-checks label { display:flex; align-items:center; gap:6px; cursor:pointer; }
.game-modal .game-modal-money { display:flex; align-items:center; gap:6px; margin-top:8px; font-size:12px; }
.game-modal .game-modal-money input { width:100%; min-width:0; height:32px; padding:0 8px; border:1px solid #d5d9e2; border-radius:8px; font-size:12px; }
.game-modal .game-modal-assets { display:flex; flex-direction:column; margin:0; padding:0; list-style:none; }
.game-modal .game-modal-assets li { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid #eef0f4; }
.game-modal .game-modal-assets li:last-child { border-bottom:0; }
.game-modal .game-modal-asset-level { flex:none; min-width:54px; padding:4px 10px; border:1px solid #d5d9e2; border-radius:20px; color:#4b5563; font-size:12px; text-align:center; }
.game-modal .game-modal-asset-name { flex:1; min-width:0; overflow:hidden; font-size:14px; text-overflow:ellipsis; white-space:nowrap; }
.game-modal .game-modal-asset-actions { display:flex; flex:none; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.game-modal .game-modal-asset-actions .jw-button { height:30px; padding:0 10px; border:1px solid #d5d9e2; border-radius:8px; color:#222; font-size:12px; cursor:pointer; }
.game-modal .game-modal-asset-actions .jw-button:hover:not(:disabled) { border-color:#2b6de0; color:#2b6de0; }
.game-modal .game-modal-asset-actions .jw-button:disabled { opacity:.4; cursor:default; }
.game-modal.is-assets { max-height:min(600px, 90vh); }

@media (max-width:1100px) {
	.three-scene .scene-card { top:auto; bottom:16px; width:calc(50% - 24px); height:190px; }
	.three-scene .scene-card.is-left { left:16px; }
	.three-scene .scene-card.is-right { right:16px; bottom:16px; }
	.three-scene .turn-dock { right:16px; bottom:220px; }
	.three-scene .turn-btn.is-turn { width:120px; height:120px; }
	.three-scene .turn-btn.is-turn .is-roll-icon { width:70px; height:70px; }
	.three-scene .turn-btn.is-turn .is-end-icon { width:52px; height:52px; }
	.game-modal .game-modal-grid { grid-template-columns:repeat(3, 1fr); }
	.game-modal .game-modal-trade { grid-template-columns:1fr; }
}
