.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
  overflow: hidden;
}

.container {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 90vh;
  max-height: 780px;
  display: flex;
  flex-direction: column;
  background: #111;
  border-radius: 16px;
  overflow: hidden;
  touch-action: pan-y;

  @media (max-width: 480px) {
    max-width: 100vw;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }
}

/* ── Outer nav ── */
.outerNav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background 0.15s, transform 0.15s;
  backdrop-filter: blur(4px);

  &:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-50%) scale(1.08);
  }
  &:active { transform: translateY(-50%) scale(0.95); }

  @media (max-width: 600px) { display: none; }
}

.outerNavLeft {
  left: calc(50% - 210px - 60px);
  @media (max-width: 700px) { left: 8px; }
}
.outerNavRight {
  right: calc(50% - 210px - 60px);
  @media (max-width: 700px) { right: 8px; }
}

/* ── Progress bars — JS driven, no CSS animation ── */
.progressBars {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 3px;
  padding: 10px 10px 0;
  z-index: 20;
}

.track {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

/* Single bar element — width set via inline style */
.bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #e53935;
  border-radius: 2px;
  /* No transition — rAF updates are fast enough */
}

/* ── Header ── */
.header {
  position: absolute;
  top: 22px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  z-index: 20;
  background: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, transparent 100%);
}

.identity {
  display: flex;
  align-items: center;
  gap: 9px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  overflow: hidden;
  flex-shrink: 0;

  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
  }
}

.name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}

.time {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  margin: 0;
  margin-top: 1px;
}

.close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
  flex-shrink: 0;

  &:hover { color: #fff; }
}

/* ── Media ── */
.media {
  flex: 1;
  position: relative;
  background: #000;
  overflow: hidden;
}

.slideInFromRight {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: slideInRight 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.slideInFromLeft {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: slideInLeft 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Tap zones */
.tap {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 10;

  &:disabled { pointer-events: none; }
}
.tapLeft { left: 0; }
.tapRight { right: 0; }

/* ── Footer ── */
.footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 16px 18px;
  background: linear-gradient(0deg, rgba(0,0,0,0.72) 0%, transparent 100%);
  z-index: 20;
}

.caption {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

/* ── Keyframes ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(5%) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-5%) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}