*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  background: #000;
  height: 100%;
}

body {
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: calc(0.55rem + env(safe-area-inset-top, 0px)) 0.85rem 0.55rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.home-link,
.tag-nav {
  pointer-events: auto;
}

.home-link {
  color: #fff;
  text-decoration: none;
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}

.tag-nav {
  position: relative;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.tag-nav--hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

.tag-drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px dotted #35506a;
  border-radius: 2px;
  padding: 0.28rem 0.55rem;
  background: rgba(0, 0, 0, 0.35);
  color: #c8d6e3;
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.tag-drop-btn:hover,
.tag-drop-btn:focus-visible,
.tag-drop-btn[aria-expanded="true"] {
  color: #fff;
  border-color: #6fd4ff;
}

.tag-drop-caret {
  font-size: 0.62rem;
  opacity: 0.8;
}

.tag-drop-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 11rem;
  max-width: min(16rem, 90vw);
  max-height: min(18rem, 60vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px dotted #35506a;
  border-radius: 2px;
  background: rgba(8, 12, 18, 0.96);
  backdrop-filter: blur(8px);
  z-index: 40;
}

.tag-drop-panel[hidden] {
  display: none;
}

.tag-drop-search-wrap {
  padding: 0.35rem 0.4rem 0.25rem;
  border-bottom: 1px dotted #243444;
}

.tag-drop-search {
  width: 100%;
  border: 1px dotted #35506a;
  border-radius: 2px;
  padding: 0.35rem 0.45rem;
  background: rgba(0, 0, 0, 0.45);
  color: #c8d6e3;
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-size: 0.68rem;
}

.tag-drop-search::placeholder {
  color: #5f7388;
}

.tag-drop-search:focus {
  outline: none;
  border-color: #6fd4ff;
}

.tag-drop-list {
  overflow-y: auto;
  padding: 0.25rem 0;
}

.tag-drop-item {
  display: block;
  padding: 0.45rem 0.7rem;
  color: #5f7388;
  text-decoration: none;
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag-drop-item[hidden] {
  display: none;
}

.tag-drop-item:hover,
.tag-drop-item:focus-visible,
.tag-drop-item.is-active {
  color: #c8d6e3;
  background: rgba(111, 212, 255, 0.08);
}

.scroller {
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
  scroll-snap-type: y mandatory;
  scroll-padding-top: 0;
}

.feed {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100dvh;
  padding: 14px;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.45;
  transform: scale(0.97);
  transition:
    opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

.card.in-view .card-media {
  opacity: 1;
  transform: scale(1);
}

.img-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: calc(100dvh - 28px);
}

.card-img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 28px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  background: #111;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.card-chrome {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding:
    calc(54px + env(safe-area-inset-top, 0px))
    0.75rem
    calc(18px + env(safe-area-inset-bottom, 0px));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}

.card.show-chrome .card-chrome {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  max-width: 100%;
  margin: 0 auto;
}

.card-tag {
  border: 1px solid rgba(111, 212, 255, 0.35);
  border-radius: 999px;
  padding: 0.32rem 0.62rem;
  background: rgba(0, 0, 0, 0.72);
  color: #dce9f3;
  text-decoration: none;
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.card-tag:hover,
.card-tag:focus-visible,
.card-tag.is-active {
  color: #fff;
  border-color: #6fd4ff;
  background: rgba(12, 24, 36, 0.88);
}

.card-tags:empty,
.card-tags[hidden] {
  display: none;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.zoom-btn,
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #081018;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.zoom-btn {
  padding: 0.72rem 0.95rem;
}

.zoom-icon {
  display: block;
}

.share-btn:active,
.zoom-btn:active {
  transform: scale(0.96);
}

.share-btn.copied {
  background: #9dffb0;
}

.share-icon {
  font-size: 1rem;
  line-height: 1;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 0;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox-stage {
  width: 100vw;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
}

.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-out;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.lightbox-close {
  position: absolute;
  top: calc(0.65rem + env(safe-area-inset-top, 0px));
  right: 0.75rem;
  border: 1px dotted #35506a;
  border-radius: 2px;
  width: 2rem;
  height: 2rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.sentinel {
  width: 100%;
  height: 2px;
  scroll-snap-align: end;
}

.status {
  text-align: center;
  color: #666;
  font-size: 0.82rem;
  padding: 1.25rem 1rem 2rem;
  scroll-snap-align: center;
}

body.lightbox-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .scroller { scroll-behavior: auto; }
  .card-media, .tag-nav { transition: none; }
  .card-media { opacity: 1; transform: none; }
}