/* 3D preview on the mod page — stand.
   Everything takes the SITE's look: theme variables (--mgrey, --zgrey, --podl-br, --grey, --white-blue,
   --hint-bg, --btn-bg, --btn-green…) and the inherited Roboto, so the block follows any site theme.
   The model itself has NO background: poster (webp), clip (VP9 with alpha) and the live canvas are
   transparent, so whatever is set in --lc3d-stage shows through and the model sits on it. */
:root{--lc3d-stage:radial-gradient(ellipse at 50% 40%,color-mix(in srgb,var(--mgrey,#1c538b) 70%,#000) 0%,color-mix(in srgb,var(--mbg,#0e3c6a) 55%,#000) 80%)}

/* clip (transparent poster + looping transparent webm) on the stage background */
.lc3d_clip{position:relative;display:block;overflow:hidden;background:var(--lc3d-stage)}
.lc3d_clip video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
/* label like the site's "+N" overlay: same translucent black, same weight */
.lc3d_tag{position:absolute;left:8px;top:8px;padding:2px 8px;border-radius:var(--hint-br,12px);background:rgba(0,0,0,.6);
  color:#fff;font-weight:500;font-size:13px;line-height:20px;pointer-events:none}
.lc3d_bigcap{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);display:inline-flex;align-items:center;gap:6px;
  padding:6px 14px;border-radius:30px;background:rgba(0,0,0,.6);color:#fff;font-weight:500;font-size:14px;line-height:20px;white-space:nowrap;transition:background .2s}
.lc3d_bigcap svg{width:16px;height:16px}
.slide:hover .lc3d_bigcap{background:var(--btn-blue)}

/* live stage: transparent canvas over the same stage background */
.lc3d_stage{position:relative;overflow:hidden;background:var(--lc3d-stage)}
.lc3d_canvas{position:absolute;inset:0;width:100%;height:100%;display:block;cursor:grab;touch-action:none;outline:0}
.lc3d_canvas:active{cursor:grabbing}
.lc3d_hint{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);padding:4px 12px;border-radius:30px;
  background:rgba(0,0,0,.6);color:#fff;font-size:13px;line-height:18px;pointer-events:none;transition:opacity .4s;white-space:nowrap}
.lc3d_hint.gone{opacity:0}
.lc3d_load{position:absolute;left:50%;top:50%;width:56px;height:56px;margin:-28px 0 0 -28px;z-index:2;pointer-events:none;transition:opacity .4s}
.lc3d_load::before{content:'';position:absolute;inset:0;border-radius:50%;background:conic-gradient(var(--btn-green) var(--p,0%),rgba(127,127,127,.25) 0);
  -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 4px),#000 calc(100% - 3px));mask:radial-gradient(farthest-side,transparent calc(100% - 4px),#000 calc(100% - 3px))}
.lc3d_load span{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:500;color:var(--h-clr)}
.lc3d_load.done{opacity:0}

/* model passport over the stage: chips in the site's hint colours */
.lc3d_specs{position:absolute;left:12px;top:12px;right:56px;z-index:2;display:flex;flex-wrap:wrap;gap:6px;pointer-events:none}
.lc3d_chip{padding:2px 10px;border-radius:var(--hint-br,12px);background:var(--hint-bg);color:var(--grey);font-size:13px;line-height:22px;
  white-space:nowrap;pointer-events:auto;cursor:default}
.lc3d_chip b{color:var(--h-clr);font-weight:500}

/* footer: the honest note + the site's own green button */
.lc3d_foot{display:flex;align-items:center;gap:var(--spad,12px);padding:var(--spad,12px) var(--inner-pad,20px);background:var(--mgrey)}
.lc3d_note{flex:1;min-width:0;color:var(--grey);font-size:14px;line-height:20px}
.lc3d_foot .lc3d_cta{flex:0 0 auto;margin:0;white-space:nowrap}
.lc3d_x{position:absolute;right:12px;top:12px;width:36px;height:36px;border:0;border-radius:50%;background:var(--btn-bg);
  color:var(--btn-color,#fff);font:22px/36px Roboto,sans-serif;cursor:pointer;z-index:3;transition:background .2s}
.lc3d_x:hover{background:var(--btn-hov)}
.lc3d_flash{animation:lc3dFlash .5s ease-in-out 3}
@keyframes lc3dFlash{50%{box-shadow:0 0 0 6px var(--white-blue-und)}}

/* live view over the main gallery picture */
.lc3d_host{position:relative}
.lc3d_over{position:absolute;z-index:11;left:var(--x,0);top:var(--y,0);width:var(--w,100%);height:var(--h,100%);display:flex;flex-direction:column;border-radius:var(--podl-br,16px);overflow:hidden}
.lc3d_over .lc3d_stage{flex:1}

/* modal (placements 3, 4) */
.lc3d_lock,.lc3d_lock body{overflow:hidden}
.lc3d_modal{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(0,0,0,.8)}
.lc3d_mcard{position:relative;width:min(1100px,100%);border-radius:var(--podl-br,16px);overflow:hidden;box-shadow:var(--hint-sh)}
.lc3d_mcard .lc3d_stage{aspect-ratio:16/9;max-height:calc(100vh - 120px)}

/* strip cells: the site's .slide gives size, radius and background */
.lc3d_thumb{position:relative;aspect-ratio:16/9}
.lc3d_thumb .lc3d_clip{position:absolute;inset:0;border-radius:inherit}
.slides.lc3d_grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))}
.slides.lc3d_grid .slide{width:auto!important;max-width:none!important;margin:0!important}
.slides.lc3d_grid .slide:not(.lc3d_big):not(.lc3d_wide){aspect-ratio:16/9}
.slides.lc3d_grid .slide:not(.lc3d_big):not(.lc3d_wide) img{width:100%;height:100%;object-fit:cover}
.lc3d_big,.lc3d_wide{position:relative;overflow:hidden}
.lc3d_big{grid-row:1/3;aspect-ratio:16/9}
.lc3d_big.lc3d_right{grid-column:3/5}
.lc3d_big.lc3d_left{grid-column:1/3;order:-1}
.lc3d_wide{grid-column:span 2}
.lc3d_big .lc3d_clip,.lc3d_wide .lc3d_clip{position:absolute;inset:0}
.lc3d_big .lc3d_clip video,.lc3d_wide .lc3d_clip video{object-fit:contain}
.lc3d_wide .lc3d_bigcap{bottom:6px;padding:3px 10px;font-size:13px}

/* 2: corner window on the main picture */
.lc3d_pip{position:absolute;z-index:4;width:168px;aspect-ratio:16/9;transform:translateY(-100%);padding:0;border:2px solid var(--white-blue-und);
  border-radius:var(--hint-br,12px);overflow:hidden;cursor:pointer;box-shadow:var(--hint-sh)}
.lc3d_pip .lc3d_clip{position:absolute;inset:0}

/* 3: row in the file info table (the site's .gpw/.gp1/.gp2 give the row) */
.lc3d_rowbtn{display:inline-flex;align-items:center;padding:0;border:0;background:none;cursor:pointer}
.lc3d_rowbtn span{display:none}
.lc3d_rowbtn .lc3d_clip{width:96px;aspect-ratio:16/9;border-radius:8px}

/* 4: button by the download buttons (the site's .nbut .btn_big) */
.lc3d_dlbtn{display:inline-flex!important;align-items:center;gap:10px;padding-left:4px!important}
.lc3d_dlbtn .lc3d_clip{width:64px;aspect-ratio:16/9;border-radius:6px}

/* 5: strip under the gallery, card in the site's panel colour */
.lc3d_strip{margin:0 var(--inner-pad,20px) var(--spad,12px);border-radius:var(--podl-br,16px);overflow:hidden;background:var(--mgrey)}
.lc3d_shead{display:flex;align-items:center;gap:var(--spad,12px);width:100%;padding:8px;border:0;background:none;color:var(--h-clr);text-align:left;cursor:pointer;font:inherit}
.lc3d_shead .lc3d_clip{width:112px;aspect-ratio:16/9;border-radius:8px;flex:0 0 auto}
.lc3d_stext{display:flex;flex-direction:column;min-width:0;line-height:22px}
.lc3d_stext b{font-weight:500}
.lc3d_stext small{color:var(--grey);font-size:14px}
.lc3d_sbtn{margin-left:auto;display:inline-flex;align-items:center;gap:6px;padding:9px 16px;border-radius:8px;background:var(--btn-blue);color:#fff;font-weight:500;white-space:nowrap}
.lc3d_sbtn svg{width:16px;height:16px}
.lc3d_sbtn em{font-style:normal}
.lc3d_strip.open .lc3d_shead .lc3d_clip{display:none}
.lc3d_sbody .lc3d_stage{aspect-ratio:16/9}

/* 9: tabs over the main picture, in the site's button colours */
.lc3d_tabs{display:flex;gap:8px;margin:0 var(--inner-pad,20px) var(--spad,12px)}
.lc3d_tabs button{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 16px;border:0;border-radius:8px;
  background:var(--btn-bg);color:var(--btn-color,#fff);font:inherit;font-weight:500;cursor:pointer;transition:background .2s}
.lc3d_tabs button small{color:var(--grey);font-size:14px}
.lc3d_tabs button:hover{background:var(--btn-hov)}
.lc3d_tabs button.on{background:var(--btn-blue)}
.lc3d_tabs button.on small{color:#fff}
.lc3d_tabs .lc3d_tabclip{width:44px;height:25px;border-radius:5px;margin-left:-10px}

@media (max-width:600px){
  .lc3d_foot{flex-wrap:wrap;padding:var(--spad,12px)}.lc3d_note{flex-basis:100%}
  .lc3d_chip{font-size:12px}
  .lc3d_pip{width:120px}
  .lc3d_strip,.lc3d_tabs{margin-left:0;margin-right:0}.lc3d_shead .lc3d_clip{width:88px}.lc3d_stext small{display:none}
}

/* pack: several models in one mod — arrows on the stage + "2 / 4 · name" bottom-left */
.lc3d_arrow{position:absolute;top:50%;z-index:3;width:40px;height:40px;margin-top:-20px;border:0;border-radius:50%;background:var(--btn-bg);
  color:var(--btn-color,#fff);font:28px/38px Roboto,sans-serif;cursor:pointer;transition:background .2s}
.lc3d_arrow:hover{background:var(--btn-hov)}
.lc3d_prev{left:12px}.lc3d_next{right:12px}
.lc3d_mcount{position:absolute;left:12px;bottom:10px;z-index:2;max-width:45%;padding:2px 10px;border-radius:var(--hint-br,12px);
  background:var(--hint-bg);color:var(--grey);font-size:13px;line-height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lc3d_mcount b{color:var(--h-clr);font-weight:500}
.lc3d_pack .lc3d_hint{left:auto;right:12px;transform:none}
@media (max-width:600px){.lc3d_arrow{width:34px;height:34px;margin-top:-17px;font-size:24px;line-height:32px}.lc3d_pack .lc3d_hint{display:none}}
.lc3d_stage{container-type:inline-size}
@container (max-width:720px){.lc3d_pack .lc3d_hint{display:none}}

/* "Ошибка в 3D?" — report button + form, in the site's colours */
.lc3d_rep{position:absolute;right:12px;top:56px;z-index:3;display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border:0;
  border-radius:30px;background:var(--hint-bg);color:var(--grey);font:inherit;font-size:13px;cursor:pointer;transition:background .2s,color .2s}
.lc3d_rep:hover{background:var(--btn-bg);color:#fff}
.lc3d_rep svg{width:14px;height:14px}
@container (max-width:520px){.lc3d_rep{font-size:0;gap:0;padding:0 9px}.lc3d_rep svg{width:15px;height:15px}}

/* leave the report pill its own row under the close button: chips stop short of it */
.lc3d_stage .lc3d_specs{right:150px}
@container (max-width:520px){.lc3d_stage .lc3d_specs{right:56px}}
/* phone: the 3D view is full screen (the gallery picture is too small), the passport is one swipeable row */
@media (max-width:699px){
  .lc3d_modal{padding:0;align-items:stretch}
  .lc3d_mcard{width:100%;height:100vh;height:100dvh;border-radius:0;display:flex;flex-direction:column}
  .lc3d_mcard .lc3d_stage{flex:1;aspect-ratio:auto;max-height:none}
}
@container (max-width:520px){
  .lc3d_stage .lc3d_specs{right:56px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;pointer-events:auto;
    -webkit-mask-image:linear-gradient(90deg,#000 85%,transparent)}
  .lc3d_stage .lc3d_specs::-webkit-scrollbar{display:none}
  .lc3d_chip{flex:0 0 auto}
}
/* «Ошибка в 3D?» — the site's jQuery UI dialog; only its contents are ours */
.lc3d_repdlg form{display:flex;flex-direction:column;gap:12px}
.lc3d_kinds{display:flex;flex-wrap:wrap;gap:8px}
.lc3d_kind{padding:6px 14px;border:0;border-radius:30px;background:var(--hint-bg);color:var(--grey);font:inherit;font-size:14px;line-height:20px;cursor:pointer;transition:background .2s,color .2s}
.lc3d_kind:hover{color:var(--h-clr)}
.lc3d_kind.on{background:var(--btn-blue);color:#fff}
.lc3d_repdlg textarea{width:100%;min-height:72px;resize:vertical;box-sizing:border-box}
.lc3d_repdlg textarea:focus,.lc3d_repdlg textarea:focus-visible,.lc3d_kind:focus{outline:0;box-shadow:none}
.lc3d_repshot{display:flex;align-items:center;gap:10px}
.lc3d_repshot img{width:96px;height:auto;border-radius:8px;flex:0 0 auto;background:var(--lc3d-stage)}
.lc3d_repshot .usefulhint{margin:0}
/* full screen on a PC (button left of the close one) */
.lc3d_fs{position:absolute;right:56px;top:12px;z-index:3;width:36px;height:36px;display:flex;align-items:center;justify-content:center;border:0;border-radius:50%;
  background:var(--hint-bg);color:var(--grey);cursor:pointer;transition:background .2s,color .2s}
.lc3d_fs:hover{background:var(--btn-bg);color:#fff}
.lc3d_fs svg{width:18px;height:18px}
.lc3d_over:fullscreen{left:0;top:0;width:100%;height:100%;border-radius:0}
.lc3d_mcard:fullscreen{width:100%;max-width:none;height:100%;border-radius:0;display:flex;flex-direction:column}
.lc3d_mcard:fullscreen .lc3d_stage{flex:1;aspect-ratio:auto;max-height:none}
:fullscreen .lc3d_specs{right:200px}
