.hero {
  background-image: url(../img/header_wallpaper.jpg);
  background-color: rgba(0, 0, 0, 0.6);
  background-blend-mode: darken;
  background-size: cover;
  background-position: center;
}

.hero p {
  max-width: 90% !important;
}

.image-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
}

.image-wrap {
  position: relative;
  width: min(92vw, 620px);
  margin: 22px auto;
  border: 3px solid var(--fg);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 10px 10px 0 var(--shadow);
  padding: 18px 16px;
  text-align: left;
  font-size: 14px;
  line-height: 1.65;
  word-break: break-word;
}

.image-name {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.image-frame {
  position: relative;
  width: 100%;
  margin: 0;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.feed-image {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 150px);
  display: block;
  object-fit: contain;
  background: #000;
}

.image-text {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.image-meta-row,
.video-meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.image-tags,
.video-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  margin-top: 0;
  min-width: 0;
}

.image-reactions,
.video-reactions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.image-reaction-btn,
.video-reaction-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 46px;
  min-height: 30px;
  padding: 5px 8px;
  border: 2px solid var(--accent2);
  background: #000;
  color: var(--accent2);
  box-shadow: 3px 3px 0 var(--shadow);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

.image-reaction-btn:hover,
.image-reaction-btn.active,
.video-reaction-btn:hover,
.video-reaction-btn.active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--shadow);
}

.image-reaction-btn.like,
.video-reaction-btn.like {
  border-color: var(--accent);
  color: var(--accent);
}

.image-reaction-btn.like.active,
.image-reaction-btn.like:hover,
.video-reaction-btn.like.active,
.video-reaction-btn.like:hover {
  background: var(--accent);
  color: #000;
}

.image-reaction-btn.dislike,
.video-reaction-btn.dislike {
  border-color: #ff4b5f;
  color: #ff4b5f;
}

.image-reaction-btn.dislike.active,
.image-reaction-btn.dislike:hover,
.video-reaction-btn.dislike.active,
.video-reaction-btn.dislike:hover {
  background: #ff4b5f;
  color: #000;
}

.image-reaction-btn strong,
.video-reaction-btn strong {
  font-size: 12px;
  line-height: 1;
}

.image-view-count,
.video-view-count {
  margin-left: 0;
  margin-right: 15px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 38px;
  min-height: 30px;
  padding: 5px 8px;
  border: 2px solid var(--accent2);
  background: #000;
  box-shadow: 3px 3px 0 var(--shadow);
  white-space: nowrap;
  color: var(--accent2);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.image-view-count i,
.video-view-count i {
  font-size: 12px;
}

.image-tags span,
.video-tags span,
.tags {
  color: var(--accent2);
  border: 2px solid var(--accent2);
  background: #000;
  padding: 4px 8px;
  font-size: 12px;
  box-shadow: 3px 3px 0 var(--shadow);
}

.metaTagFilter.active {
  color: #ff3b3b;
  border-color: #ff3b3b;
}

#topBtn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  width: 46px;
  height: 46px;
  cursor: pointer;
  font-size: 26px;
  font-weight: 900;
  display: none;
  background: #000;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 0;
  box-shadow: 5px 5px 0 var(--shadow);
  font-family: inherit;
  text-transform: uppercase;
}

#topBtn.show {
  display: block;
}

#topBtn:hover,
.sort-buttons .btn:hover {
  background: var(--accent);
  color: #000;
}

.sort-buttons {
  position: fixed;
  top: 40px;
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  z-index: 9;
}

.sort-buttons .btn {
  width: 100%;
  text-align: center;
}

.tag-list {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list a {
  color: var(--fg);
  background: #000;
  border: 2px solid var(--fg);
  padding: 5px 9px;
  font-size: 12px;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--shadow);
}

.tag-list a:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

.tag-list a.active {
  border-color: var(--accent);
  color: var(--accent);
}

.global-tag-box {
  display: none;
  margin: 18px 0;
  border: 3px solid var(--fg);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 8px 8px 0 var(--shadow);
  padding: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.global-tag-box.show {
  display: flex;
}

.image-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.image-frame:hover .image-tools {
  opacity: 1;
  pointer-events: auto;
}

.shareBtn,
.downloadBtn,
.editBtn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.warning-active .image-item,
body.warning-active footer,
body.warning-active #topBtn {
  filter: blur(18px);
  pointer-events: none;
  user-select: none;
}

body.warning-active .hero {
  filter: none;
  pointer-events: auto;
}

#warningOverlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  padding: 20px;
}

.warningBox {
  position: relative;
  width: min(92vw, 520px);
  background: #000;
  color: var(--fg);
  border: 3px solid var(--fg);
  box-shadow: 10px 10px 0 var(--shadow);
  padding: 28px 24px 24px;
  text-align: center;
}

.warningBox h2 {
  margin: 0 0 14px;
  color: var(--accent);
  text-transform: uppercase;
}

.warningBox p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.warningText {
  display: none;
}

.warningText.active {
  display: block;
}

.warningActions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.warningActions button,
#langToggle {
  background: #000;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 0;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--shadow);
}

.warningActions button {
  padding: 10px 18px;
}

#langToggle {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 9px;
}

.warningActions button:hover,
#langToggle:hover {
  background: var(--accent);
  color: #000;
}

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.9);
}

#lightbox.show {
  display: flex;
}

#lightboxImage {
  max-width: 96vw;
  max-height: 94vh;
  object-fit: contain;
  border: 3px solid var(--fg);
  box-shadow: 10px 10px 0 var(--shadow);
  background: #000;
}

#lightboxClose {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1;
  width: 42px;
  height: 42px;
  padding: 0;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  z-index: 1;
  width: 54px;
  height: 72px;
  padding: 0;
  margin: 0;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: #000;
  color: var(--accent);
  border: 2px solid var(--accent);
  box-shadow: 5px 5px 0 var(--shadow);
}

.lightbox-nav:hover {
  background: var(--accent);
  color: #000;
}

.lightbox-prev {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

@media (max-width: 680px) {
  .lightbox-nav {
    width: 42px;
    height: 58px;
    font-size: 23px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }
}

@media (max-width: 1180px) {
  .sort-buttons {
    position: fixed;
    top: 10px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: auto;
    max-width: 98vw;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    z-index: 9999;
  }

  .sort-buttons .btn {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 11px;
    padding: 7px 10px;
    line-height: 1;
  }

  .image-tools {
    opacity: 1;
    pointer-events: auto;
  }

  .downloadBtn {
    display: none;
  }
}

@media (max-width: 680px) {
  .image-item {
    padding: 8px 0;
  }

  .image-wrap {
    width: min(94vw, 620px);
    padding: 14px 12px;
  }

  .image-tags span,
  .video-tags span {
    font-size: 9px;
    padding: 3px 6px;
    border-width: 1px;
  }

  .image-meta-row,
  .video-meta-row {
    flex-wrap: wrap;
  }

  .image-reactions,
  .video-reactions {
    margin-left: 0;
  }
}
