/* ProZagadka V162 — mobile solver/camera reliability overrides.
   Loaded last on public and account solver screens. */

/* Photo preview remove button: center the X independently of font metrics. */
.photo-preview-item button[data-remove-photo]{
  display:grid!important;
  place-items:center!important;
  box-sizing:border-box!important;
  padding:0!important;
  font-size:0!important;
  line-height:0!important;
  text-align:center!important;
  touch-action:manipulation!important;
  -webkit-tap-highlight-color:transparent!important;
}
.photo-preview-item button[data-remove-photo]::before{
  content:"×"!important;
  display:block!important;
  margin:0!important;
  padding:0!important;
  font:700 20px/1 Arial,Helvetica,sans-serif!important;
  transform:translateY(-1px)!important;
}

/* Camera is fully self-contained here so cabinet and public pages behave identically. */
html.pz-camera-open,
html.pz-camera-open body,
body.pz-camera-open{
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
.pz-camera-layer{
  position:fixed!important;
  inset:0!important;
  z-index:10000!important;
  display:grid!important;
  place-items:center!important;
  box-sizing:border-box!important;
  padding:18px!important;
  background:rgba(12,10,40,.78)!important;
  backdrop-filter:blur(10px)!important;
  touch-action:none!important;
}
.pz-camera-dialog{
  width:min(820px,100%)!important;
  max-height:calc(100vh - 36px)!important;
  max-height:calc(100dvh - 36px)!important;
  overflow:hidden!important;
  border:1px solid #e5dcff!important;
  border-radius:24px!important;
  background:#fff!important;
  box-shadow:0 30px 90px rgba(29,18,79,.38)!important;
  pointer-events:auto!important;
}
.pz-camera-head{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:16px!important;
  padding:15px 18px!important;
  color:#11175a!important;
}
.pz-camera-head b{font-size:17px!important;line-height:1.35!important}
.pz-camera-close[data-camera-close]{
  position:relative!important;
  display:block!important;
  flex:0 0 50px!important;
  width:50px!important;
  height:50px!important;
  min-width:50px!important;
  min-height:50px!important;
  box-sizing:border-box!important;
  padding:0!important;
  border:1px solid #e2d7ff!important;
  border-radius:50%!important;
  background:#f4efff!important;
  color:transparent!important;
  font-size:0!important;
  line-height:0!important;
  cursor:pointer!important;
  box-shadow:0 5px 16px rgba(58,38,130,.10)!important;
  touch-action:manipulation!important;
  -webkit-tap-highlight-color:transparent!important;
}
.pz-camera-close[data-camera-close]::before,
.pz-camera-close[data-camera-close]::after{
  content:""!important;
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  width:24px!important;
  height:3px!important;
  margin:0!important;
  border-radius:99px!important;
  background:#6f49ef!important;
  transform-origin:center!important;
  pointer-events:none!important;
}
.pz-camera-close[data-camera-close]::before{transform:translate(-50%,-50%) rotate(45deg)!important}
.pz-camera-close[data-camera-close]::after{transform:translate(-50%,-50%) rotate(-45deg)!important}
.pz-camera-video-wrap{
  position:relative!important;
  display:grid!important;
  place-items:center!important;
  width:100%!important;
  aspect-ratio:4/3!important;
  background:#090d20!important;
  overflow:hidden!important;
}
.pz-camera-video-wrap video{
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  background:#090d20!important;
}
.pz-camera-hint{
  position:absolute!important;
  left:12px!important;
  right:12px!important;
  bottom:12px!important;
  margin:0!important;
  padding:8px 10px!important;
  border-radius:11px!important;
  background:rgba(17,23,90,.72)!important;
  color:#fff!important;
  font-size:12px!important;
  line-height:1.35!important;
  text-align:center!important;
  backdrop-filter:blur(6px)!important;
  pointer-events:none!important;
}
.pz-camera-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:10px!important;
  padding:14px 18px 18px!important;
}
.pz-camera-actions button{
  min-height:50px!important;
  padding:0 20px!important;
  border-radius:14px!important;
  font-weight:900!important;
  cursor:pointer!important;
  touch-action:manipulation!important;
  -webkit-tap-highlight-color:transparent!important;
}
.pz-camera-cancel{border:1px solid #e1d8f7!important;background:#fff!important;color:#655f7d!important}
.pz-camera-shot{border:0!important;background:linear-gradient(135deg,#8056f4 0%,#5e3be7 100%)!important;color:#fff!important;box-shadow:0 12px 26px rgba(96,60,231,.25)!important}
.pz-camera-shot:disabled{opacity:.55!important;cursor:wait!important}

/* One scroll container: the white solver modal itself. */
.solver-progress-backdrop-v116{
  position:fixed!important;
  inset:0!important;
  z-index:1220!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  height:100vh!important;
  height:100dvh!important;
  box-sizing:border-box!important;
  padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))!important;
  overflow:hidden!important;
  touch-action:auto!important;
}
.solver-progress-backdrop-v116[hidden]{display:none!important}
.solver-progress-modal-v116{
  position:relative!important;
  width:min(680px,100%)!important;
  max-width:680px!important;
  height:auto!important;
  max-height:calc(100vh - 16px)!important;
  max-height:calc(100dvh - 16px)!important;
  min-height:0!important;
  box-sizing:border-box!important;
  margin:0!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior:contain!important;
  touch-action:pan-y!important;
  scrollbar-gutter:stable!important;
}
.solver-task-selection,
.solver-task-selection-list{
  width:100%!important;
  max-height:none!important;
  min-height:0!important;
  box-sizing:border-box!important;
  overflow:visible!important;
  touch-action:pan-y!important;
}
.solver-task-selection-list{
  display:flex!important;
  flex-direction:column!important;
  gap:8px!important;
}
.solver-task-selection-list>button{
  width:100%!important;
  min-height:52px!important;
  height:auto!important;
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:max-content minmax(0,1fr)!important;
  align-items:start!important;
  gap:10px!important;
  padding:11px 12px!important;
  text-align:left!important;
  white-space:normal!important;
  overflow:visible!important;
}
.solver-task-selection-list>button strong{
  min-width:28px!important;
  width:auto!important;
  white-space:nowrap!important;
  overflow:visible!important;
  font-variant-numeric:tabular-nums!important;
}
.solver-task-selection-list>button span{
  min-width:0!important;
  white-space:normal!important;
  overflow:visible!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
  line-height:1.4!important;
}
.solver-selection-notice{
  margin:8px 0!important;
  padding:9px 11px!important;
  border:1px solid #f0d49b!important;
  border-radius:10px!important;
  background:#fff9ed!important;
  color:#70531b!important;
  font-size:12px!important;
  line-height:1.45!important;
}

/* No automatic caret/keyboard. Editing starts only after an explicit tap handled in JS. */
.solver-confirm-editor-v130 textarea[data-confirm-task][readonly]{
  caret-color:transparent!important;
  -webkit-user-modify:read-only!important;
  cursor:text!important;
  -webkit-user-select:text!important;
  user-select:text!important;
  touch-action:pan-y!important;
}
.solver-confirm-editor-v130 textarea[data-confirm-task]:not([readonly]){
  -webkit-user-modify:read-write!important;
  caret-color:auto!important;
  touch-action:auto!important;
}

/* Main solver close control: intentionally much larger on touch screens. */
.solver-progress-close-v116{
  width:72px!important;
  height:72px!important;
  min-width:72px!important;
  min-height:72px!important;
  right:10px!important;
  top:10px!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  overflow:visible!important;
  touch-action:manipulation!important;
  -webkit-tap-highlight-color:transparent!important;
}
.solver-progress-close-v116 img{
  width:68px!important;
  height:68px!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:contain!important;
  display:block!important;
}

@media(max-width:720px){
  .solver-progress-backdrop-v116{
    align-items:center!important;
    padding:max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left))!important;
  }
  .solver-progress-modal-v116{
    width:100%!important;
    max-width:none!important;
    max-height:calc(100vh - 12px)!important;
    max-height:calc(100dvh - 12px)!important;
    min-height:0!important;
    border-radius:18px!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-y!important;
    padding-top:max(24px,env(safe-area-inset-top))!important;
    padding-bottom:max(22px,env(safe-area-inset-bottom))!important;
  }
}

@media(max-width:700px){
  .pz-camera-layer{padding:0!important}
  .pz-camera-dialog{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:100vh!important;
    height:100dvh!important;
    max-height:none!important;
    border:0!important;
    border-radius:0!important;
  }
  .pz-camera-head{align-items:flex-start!important;padding:12px 14px!important}
  .pz-camera-head b{font-size:15px!important;padding-top:5px!important}
  .pz-camera-close[data-camera-close]{
    flex-basis:52px!important;
    width:52px!important;
    height:52px!important;
    min-width:52px!important;
    min-height:52px!important;
  }
  .pz-camera-video-wrap{flex:1!important;min-height:0!important;aspect-ratio:auto!important}
  .pz-camera-actions{padding:12px 14px calc(12px + env(safe-area-inset-bottom))!important;background:#fff!important}
  .pz-camera-actions button{min-height:54px!important}
  .pz-camera-shot{flex:1!important}
  .pz-camera-cancel{padding-inline:16px!important}
}

@media(max-width:520px){
  .solver-progress-close-v116{
    width:66px!important;
    height:66px!important;
    min-width:66px!important;
    min-height:66px!important;
    right:6px!important;
    top:6px!important;
  }
  .solver-progress-close-v116 img{width:62px!important;height:62px!important}
}
