/* Add custom CSS styles below */ 
  #popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    transition: opacity 0.5s ease;
  }
  #popup-overlay.hidden {
    opacity: 0;
    pointer-events: none;
  }
  #popup-img {
    max-width: 85vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
  }
  #timer-bar-wrap {
    width: 300px;
    height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
  }
  #timer-bar {
    height: 100%;
    width: 100%;
    background: #fff;
    border-radius: 4px;
    animation: shrink 3s linear forwards;
  }
  @keyframes shrink { from { width:100%; } to { width:0%; } }

  #close-btn {
    position: absolute;
    top: 20px; right: 20px;
    background: rgba(255,255,255,0.15);
    border: none; color: #fff;
    font-size: 22px; width: 38px; height: 38px;
    border-radius: 50%; cursor: pointer;
  }

  #side-tab {
    position: fixed;
    left: 0; top: 50%;
    transform: translateY(-50%);
    z-index: 8888;
    background: #1a1a2e;
    color: #fff; border: none;
    border-radius: 0 10px 10px 0;
    padding: 14px 10px;
    cursor: pointer;
    writing-mode: vertical-rl;
    font-size: 12px; letter-spacing: 1px;
  }

<div id="popup-overlay">
  <button id="close-btn" onclick="closePopup()">✕</button>
  <img id="popup-img" src="https://cdn.salla.sa/nEOBve/56c53a2c-33f5-4c07-aee4-845a260a0ba5-1000x1000-1uAK20CVVaJNxdSLturdvxYPepEGwsNwMTKDJ4C5.png" alt="صورة" />
  <div id="timer-bar-wrap"><div id="timer-bar"></div></div>
</div>

<button id="side-tab" onclick="openPopup()">◉ عرض</button>