.cert-modal-overlay,
.cert-viewer-close,
.cert-viewer-footer {
  display: none !important;
}

.cert-image-viewer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(3, 8, 5, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.cert-image-viewer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cert-viewer-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 96vw;
  max-height: 92vh;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: default;
  transform: scale(0.95);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.cert-image-viewer.is-open .cert-viewer-card {
  transform: scale(1);
}

.cert-win-frame {
  display: inline-flex;
  flex-direction: column;
  background: #07130c;
  border: 2px solid #00ff66;
  box-shadow:
    0 0 0 2px #020804,
    0 20px 55px rgba(0, 0, 0, 0.9),
    0 0 24px rgba(0, 255, 102, 0.22);
  max-width: min(920px, 94vw);
  overflow: hidden;
  clip-path: polygon(
    0px 6px, 6px 6px, 6px 0px,
    calc(100% - 6px) 0px, calc(100% - 6px) 6px, 100% 6px,
    100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%,
    6px 100%, 6px calc(100% - 6px), 0px calc(100% - 6px)
  );
  transition: max-width 0.2s ease;
}

.cert-win-frame.is-maximized {
  max-width: 96vw;
}

.cert-win-frame.is-maximized .cert-direct-stage img {
  max-width: 94vw;
  max-height: 82vh;
}

.cert-win-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: linear-gradient(90deg, #0b2916 0%, #07190e 100%);
  border-bottom: 2px solid #00d959;
  user-select: none;
}

.cert-win-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.cert-win-pixel-dot {
  width: 10px;
  height: 10px;
  background: #00ff66;
  border: 1.5px solid #020804;
  box-shadow: 0 0 6px #00ff66;
  flex-shrink: 0;
}

.cert-win-title-text {
  font-family: 'Silkscreen', 'Share Tech Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: #e8fff0;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 1px 1px 0 #020804;
}

.cert-win-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.cert-win-verify-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  margin-right: 4px;
  background: rgba(0, 255, 102, 0.14);
  border: 1.5px solid #00ff66;
  color: #00ff66;
  font-family: 'Silkscreen', monospace;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 2px 2px 0 #020804;
  transition: all 0.15s steps(2);
}

.cert-win-verify-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
  display: block;
}

.cert-win-verify-btn:hover,
.cert-win-verify-btn:focus-visible {
  background: #00ff66;
  color: #031207;
  border-color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 2px 3px 0 #020804, 0 0 12px rgba(0, 255, 102, 0.6);
  outline: none;
}

.cert-win-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #102418;
  border: 1.5px solid #2e6b43;
  color: #d6f5e0;
  padding: 0;
  cursor: pointer;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.15), 2px 2px 0 #020804;
  transition: all 0.14s steps(2);
}

.cert-win-btn svg {
  display: block;
  pointer-events: none;
}

.cert-win-btn:hover {
  background: #1c3f2a;
  border-color: #00ff66;
  color: #ffffff;
  transform: translateY(-1px);
}

.cert-win-close {
  background: #2b1116;
  border-color: #8c2d38;
  color: #ffb3ba;
}

.cert-win-close:hover,
.cert-win-close:focus-visible {
  background: #ff3b3b;
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 2px 2px 0 #020804, 0 0 12px rgba(255, 59, 59, 0.65);
  outline: none;
}

.cert-direct-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #040a06;
  padding: 6px;
}

.cert-direct-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(880px, 90vw);
  max-height: 74vh;
  object-fit: contain !important;
  border-radius: 2px;
  background: transparent !important;
  border: 1px solid rgba(0, 255, 102, 0.18);
}

.cert-direct-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 7px 14px;
  background: rgba(6, 16, 10, 0.94);
  border: 1.5px solid #00d959;
  box-shadow: 4px 4px 0 #020804;
  z-index: 10;
  clip-path: polygon(
    0px 4px, 4px 4px, 4px 0px,
    calc(100% - 4px) 0px, calc(100% - 4px) 4px, 100% 4px,
    100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%,
    4px 100%, 4px calc(100% - 4px), 0px calc(100% - 4px)
  );
}

.cert-direct-nav-btn {
  padding: 5px 12px;
  background: rgba(0, 255, 102, 0.1);
  border: 1.5px solid #00ff66;
  color: #00ff66;
  font-family: 'Silkscreen', monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s steps(2);
}

.cert-direct-nav-btn:hover {
  background: #00ff66;
  color: #031008;
}

.cert-direct-counter {
  color: #e2f1ff;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  min-width: 44px;
  text-align: center;
}

@media (max-width: 640px) {
  .cert-image-viewer {
    padding: 10px;
  }

  .cert-win-frame {
    max-width: 96vw;
  }

  .cert-win-titlebar {
    padding: 6px 8px;
    gap: 6px;
  }

  .cert-win-title-text {
    font-size: 9.5px;
  }

  .cert-win-verify-btn {
    height: 24px;
    padding: 0 7px;
    font-size: 9px;
    margin-right: 2px;
  }

  .cert-win-btn {
    width: 24px;
    height: 24px;
  }

  .cert-direct-stage {
    padding: 4px;
  }

  .cert-direct-stage img {
    max-width: 92vw;
    max-height: 70vh;
  }
}
