/* CASE//LAB 6.1 — Real Sketchfab gun model workshop */
.weapon3d-host{position:absolute;inset:0;overflow:hidden;display:block;background:radial-gradient(circle at 50% 42%,#1d2935 0%,#0b1219 78%)}
.weapon3d-host>iframe.gun-live-frame,.inspect3d-host>iframe.gun-live-frame{display:block;width:100%!important;height:100%!important;border:0;position:absolute;inset:0;background:#101823;z-index:2}
.weapon3d-host>.gun-local-canvas{display:block;position:absolute;inset:0;width:100%;height:100%;z-index:2;touch-action:none}
.gun-model-mode-row{display:flex;gap:8px;padding:12px 16px;background:#111923;border:1px solid rgba(148,173,193,.15);border-top:0;border-radius:0 0 10px 10px}
.gun-model-mode-row .btn{flex:1;min-width:0;font-size:11px;letter-spacing:.06em;white-space:normal}
.gun-model-mode-row .active{color:#e9f5ff;border-color:rgba(81,166,250,.55);background:rgba(55,130,220,.17)}
.gun-model-credit{font-size:10px;line-height:1.6;color:#92a8b9;padding:6px 17px 8px;letter-spacing:.03em}
.gun-model-workshop>p,.gun-material-workshop>p,.gun-local-import>p{line-height:1.6;color:#a5b5c4;font-size:12px}
.gun-workshop-actions{display:flex;flex-wrap:wrap;gap:8px;margin:9px 0}
.gun-workshop-actions>*{flex:1 1 140px;min-width:0;text-align:center}
.gun-workshop-actions>a{display:flex;align-items:center;justify-content:center;padding:11px 8px;color:#9ccbea;border:1px solid rgba(112,170,216,.23);border-radius:8px;text-decoration:none;font-size:11px;font-weight:600;letter-spacing:.05em}
.gun-workshop-actions>a:hover{border-color:#429cef;color:white}
.gun-model-workshop input[type=url]{width:100%;height:38px;padding:9px;background:#111924;border:1px solid #34485a;border-radius:8px;color:#eff7ff;min-width:0}
.gun-material-workshop,.gun-local-import{border-top:1px solid rgba(128,161,187,.16);padding-top:17px;margin-top:18px}
.gun-material-roles{display:flex;flex-direction:column;gap:8px;max-height:245px;overflow-y:auto;overscroll-behavior:contain}
.gun-role-row{display:grid;grid-template-columns:minmax(100px,1.15fr) minmax(132px,1fr);gap:8px;align-items:center;border:1px solid rgba(124,157,181,.16);background:rgba(6,12,18,.35);padding:7px 9px;border-radius:8px}
.gun-role-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:#d5e0eb}
.gun-role-row select{max-width:100%;min-width:0;border:1px solid #314555;background:#121c26;color:#bfe0fa;border-radius:6px;padding:6px 3px;font-size:10px}
#gunTextureSwatch{width:100%;max-width:100%;height:105px;object-fit:cover;display:block;border-radius:8px;border:1px solid rgba(109,155,192,.2);margin:12px 0 2px;background:#121822}
.gun-license-note{display:block;font-size:11px;line-height:1.5;color:#8da3b4;margin-top:10px}
.gun-no-model{position:absolute;inset:0;display:flex;flex-direction:column;gap:14px;align-items:center;justify-content:center;text-align:center;max-width:600px;margin:auto;padding:24px;color:#dfefff}
.gun-no-model strong{font-size:20px;letter-spacing:.13em}
.gun-no-model p{font-size:14px;line-height:1.6;color:#9cb2c5}
.gun-no-model span{font-size:11px;letter-spacing:.12em;color:#70afe0}
.inspect3d-host:has(.gun-live-frame){background:#101823}
@media(max-width:700px){.gun-role-row{grid-template-columns:minmax(80px,1fr) minmax(116px,1fr)}.gun-model-mode-row{flex-direction:column}}

.inspect3d-host.gun-inspect-host{position:absolute;inset:0;overflow:hidden;display:block;background:radial-gradient(circle at 50% 42%,#1d2935 0%,#0b1219 78%)}
.inspect3d-host.gun-inspect-host .gun-live-frame{min-width:100%;min-height:100%;}

/* 6.2: real full-frame gun inspect and source-UV editing */
#inspect3DHost.gun-inspect-host{inset:0!important;position:absolute!important;width:100%!important;height:100%!important;min-width:0;min-height:0;overflow:hidden;z-index:4;background:#101823}
#inspect3DHost.gun-inspect-host>iframe.gun-live-frame{width:100%!important;height:100%!important;min-width:100%;min-height:100%;position:absolute;inset:0;display:block;border:0}
.gun-uv-workshop{border-top:1px solid rgba(128,161,187,.22);margin-top:20px;padding-top:19px}
.gun-uv-workshop>p{font-size:12px;line-height:1.65;color:#a6b7c7;margin:12px 0}
.gun-uv-workshop .studio-field{display:grid;gap:7px;margin-bottom:10px}
.gun-uv-workshop .studio-field>select{height:40px;max-width:none;width:100%;min-width:0}
.gun-uv-files{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:12px 0}
.gun-uv-files label{min-width:0;display:grid;gap:5px;padding:11px;border:1px solid rgba(128,161,187,.23);border-radius:7px;background:#121f29;color:#d9e6ee;font-size:10px;letter-spacing:.06em;font-weight:800}
.gun-uv-files label small{color:#8296a6;font-size:9px;letter-spacing:0;font-weight:450}
.gun-uv-files input{width:100%;min-width:0;font-size:10px;color:#afc5d5}
.gun-uv-files input::file-selector-button{background:#2e4152;border:1px solid #546879;color:#dceaf2;padding:7px;border-radius:4px;margin-right:5px;cursor:pointer}
@media(max-width:650px){.gun-uv-files{grid-template-columns:1fr}}
.gun-reference{border:1px solid #39576a;background:#10212b;padding:13px;border-radius:9px;margin:12px 0}
.gun-reference[hidden]{display:none!important}
.gun-reference img{width:100%;max-height:175px;object-fit:contain;display:block;filter:drop-shadow(0 10px 12px rgba(0,0,0,.5));margin:6px 0}
.gun-reference p{font-size:10px;color:#a0b2c0;line-height:1.55;margin:8px 0 0}

/* 6.4 / Official Valve geometry importer */
.gun-model-mode-row{flex-wrap:wrap}
.gun-model-mode-row .btn{flex:1 1 140px}
.gun-model-mode-row #gunModelUseValve{border-color:#b7a472}
.gun-model-mode-row #gunModelUseValve.active{background:#dac58e;color:#152330;border-color:#f0daa3}
.gun-model-mode-row #gunModelUseValve.has-asset:not(.active){border-color:#7baa91}
.valve-official-box{border:1px solid rgba(220,197,129,.36);background:linear-gradient(150deg,rgba(41,48,49,.75),rgba(18,31,41,.8));margin-bottom:14px}
.valve-official-box .model-import-title span{color:#eed4a1}
.valve-official-box strong{color:#f2ddb0}
.valve-official-box .gun-workshop-actions .valve-download{flex:1 1 170px;background:#31443e;border-color:#bbd3b9;color:#ecf5da}
.valve-official-box #valveArchiveItems{width:100%;max-width:100%}
.valve-official-box #valveAssignModel{width:100%}
.valve-resources-link{display:inline-block;color:#d3e4ed;font-size:10px;letter-spacing:1px;margin-top:12px;text-decoration:underline}


/* 6.5 — show the actual catalogue image in the stage instead of falsely
   presenting a bare model as a named skin. */
.weapon-stage{isolation:isolate}
.gun-skin-reference-stage{position:absolute;inset:0;z-index:12;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:clamp(16px,3vw,40px);background:radial-gradient(ellipse at 50% 35%,#273c4b 0%,#111a25 82%);color:#eaf2f6;text-align:center}
.gun-skin-reference-stage[hidden]{display:none!important}
.gun-skin-reference-head{display:flex;flex-direction:column;align-items:center;gap:4px;line-height:1.25;max-width:92%}
.gun-skin-reference-head>span{font-size:10px;letter-spacing:1.7px;color:#efc77b;font-weight:800}
.gun-skin-reference-head>strong{font-size:clamp(19px,2.7vw,29px);font-weight:850;letter-spacing:.5px;overflow-wrap:anywhere}
.gun-skin-reference-stage img{width:min(90%,900px);height:min(62%,390px);min-height:100px;object-fit:contain;filter:drop-shadow(0 20px 24px #0008)}
.gun-skin-reference-stage p{font-size:11px;color:#b5c5d1;line-height:1.5;max-width:620px;margin:0}
.gun-skin-reference-stage button{background:#273947;color:#f4e3ba;border:1px solid #b69b66;border-radius:5px;font-size:11px;letter-spacing:1px;font-weight:800;min-height:34px;padding:8px 14px;cursor:pointer}
.gun-skin-reference-stage button:hover{background:#3b4f60}
.gun-skin-accuracy{display:flex;align-items:center;gap:12px;justify-content:space-between;flex-wrap:wrap;padding:9px 14px;background:#27323c;border:1px solid #5a6672;border-top:0;color:#e7d1a7;font:700 10px/1.55 var(--body);letter-spacing:.25px}
.gun-skin-accuracy.is-source{color:#a8deb8;border-color:#5b8274;background:#1b302c}
.gun-skin-accuracy.is-generated{color:#bfd7e9;border-color:#526b86;background:#223140}
.gun-skin-accuracy.is-warning{color:#efd198;border-color:#836e52;background:#302d29}
.gun-skin-accuracy-actions{display:flex;gap:7px;flex-wrap:wrap}
.gun-skin-accuracy-actions button{font:800 10px var(--body);letter-spacing:.35px;padding:8px 10px;border-radius:3px;border:1px solid #647484;color:#eef4f6;background:#304352;cursor:pointer}
.gun-skin-accuracy-actions button[hidden]{display:none!important}
.gun-skin-accuracy-actions button:hover{background:#455f70}
@media(max-width:700px){.gun-skin-reference-stage{padding:15px}.gun-skin-reference-head>strong{font-size:20px}.gun-skin-reference-stage img{height:min(55%,220px)}.gun-skin-accuracy{padding:10px}}

/* Local CS2 source layer integration */
.cs2-local-sync{border:1px solid #5a745d;background:linear-gradient(135deg,rgba(36,73,62,.18),rgba(12,22,32,.35));border-radius:10px;padding:16px;margin:16px 0;}
.cs2-local-sync p{font-size:11px;line-height:1.7;color:#b4c5ce}
.cs2-auto-toggle{display:flex;gap:9px;align-items:center;padding:13px 4px;color:#d8e9d3;font-weight:750;letter-spacing:.04em;font-size:10px;}
.cs2-auto-toggle input{accent-color:#cfc080;width:16px;height:16px;flex-shrink:0;}
.cs2-local-sync .cs2-source-caveat{color:#cbbf9b;background:rgba(11,18,23,.4);padding:12px;border-left:2px solid #ddbd83;}

/* 7.0 keyless embedded CS2 viewer */
.gun-model-mode-row{flex-wrap:wrap}
.gun-model-mode-row #gunModelUseReskins{border-color:rgba(96,165,250,.5);background:linear-gradient(145deg,#16437f,#172e50);color:#e6f4ff}
.reskins-source-box{border-color:rgba(96,165,250,.42)}
.reskins-source-box .gun-workshop-actions{display:flex;gap:10px;flex-wrap:wrap}
.reskins-source-box .gun-workshop-actions>*{flex:1 1 155px}
.reskins-source-box #reskinsShowSelected{width:100%;margin-top:8px}
.reskins-manual{margin-top:10px;border-top:1px solid rgba(255,255,255,.09);padding-top:12px}
.reskins-manual summary{cursor:pointer;font-size:11px;font-weight:700;letter-spacing:.07em;color:#a9c7ed}
.reskins-manual p{line-height:1.5}
.reskins-manual input,.reskins-manual textarea{width:100%;background:#0b111d;color:#e3ecf5;border:1px solid #34465a;border-radius:6px;padding:9px;box-sizing:border-box}
.reskins-manual textarea{resize:vertical;font:12px/1.4 Consolas,monospace}
.weapon3d-host>.reskins-no-preview,.inspect3d-host>.reskins-no-preview{position:absolute;inset:0;z-index:4;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;padding:25px;color:#d5e7f6;background:radial-gradient(circle at 50% 40%,#1f344c,#0b131d)}
.reskins-no-preview strong{font-size:14px;letter-spacing:.08em;color:#f7fbff}
.reskins-no-preview p{max-width:620px;font-size:13px;line-height:1.6;opacity:.85}
.reskins-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center}
.reskins-actions>a,.reskins-actions>button,.reskins-pending>button,.reskins-pending>a{padding:9px 14px;color:#eaf4ff;background:#224875;border:1px solid #4582b8;border-radius:7px;text-decoration:none;cursor:pointer;font-size:12px;font-weight:700}
.weapon3d-host>.reskins-pending,.inspect3d-host>.reskins-pending{position:absolute;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;background:rgba(9,15,23,.92);text-align:center;padding:24px;color:#dce8f4;font-weight:700;letter-spacing:.03em}
.reskins-pending.reskins-timeout{background:rgba(9,15,23,.96)}
.weapon3d-host>iframe.reskins-iframe,.inspect3d-host>iframe.reskins-iframe{width:100%!important;height:100%!important;position:absolute;inset:0;border:0}

/* CASE//LAB 7.1 — built-in WebGL renderer, no externally hosted skin iframe */
.native-renderer-box .gun-workshop-actions{display:flex;flex-wrap:wrap;gap:10px}
.native-renderer-box .gun-workshop-actions button{flex:1 1 190px}
.gun-model-mode-row{display:flex;gap:9px;flex-wrap:wrap}
.gun-no-model{max-width:700px;padding:28px;text-align:center;margin:auto}
.gun-no-model strong{display:block;font-size:1rem;letter-spacing:.08em}
.gun-no-model p{max-width:540px;margin:12px auto;line-height:1.5}
