:root {
  --acc-light2: #5f7f9f;
  /* --98:
        background: #c0c0c0; */
  --bg-dark: #121212;
  --bg-light: #ddd;
  --card-bg-dark: #222;
  --card-bg-light: #dfdfdf;
  --acc-light: #708090;
  --acc-dark: #f5deb3;
  --sdw-light: 0 0 10px rgba(0, 0, 0, 0.1), 0 0 6px rgba(0, 0, 0, 0.1),
    0 0 8px rgba(255, 255, 255, 0.6);
  --sdw-dark: 0 0 3px rgba(255, 255, 255, 0.2),
    0 0 6px rgba(255, 255, 255, 0.15);
}

#lbFtContainer strong {
  font-weight: normal;
  font-size: 1.1em;
}

#lbFt {
  margin-left: 0.7em;
  padding-left: 0.6em;
  font-weight: normal;
  font-size: 0.8em;
}

.lb-ft-member {
  display: block;
  font-size: 1.1em;
  text-decoration: none;
  color: inherit;
  transition: color 0.2s, text-decoration 0.2s;
  position: relative;
}

.lb-ft-member::before {
  content: "└─ ";
  color: #888;
  position: absolute;
  left: -1.2em;
}

.lb-ft-member:not(:last-child)::before {
  content: "├─ ";
}

.lb-ft-member:hover {
  color: var(--acc-light2);
  text-decoration: underline;
}

html.dark .lb-ft-member:hover {
  color: var(--acc-dark);
}

.current-member {
  font-weight: bold;
  color: var(--acc-light2) !important;
  text-decoration: underline;
}

/* Keep the pink color on visited and hover */
.current-member:visited,
.current-member:hover {
  color: var(--acc-light2) !important;
}

/* Dark mode tweaks */
html.dark .current-member {
  color: var(--acc-dark) !important;
}

html.dark .current-member:visited,
html.dark .current-member:hover {
  color: var(--acc-dark) !important;
}

.folder-toggle:hover {
  background: transparent;
  color: var(--acc-light2) !important;
  text-decoration: underline !important;
  transform: none !important;
}

html.dark .folder-toggle:hover {
  color: var(--acc-dark) !important;
}

.sidebar hr {
  border: 1px solid #555;
  margin: 0;
}

.sidebar-container {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  align-items: stretch;
  z-index: 99;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -60px;
  bottom: 0;
  width: 250px;
  font-family: Tahoma, monospace, monospace;
  background: var(--card-bg-light);
  border-right: none;
  z-index: 999;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-shadow: var(--sdw-light);
  border-right: 2px groove #aaa;
}

html.dark .sidebar {
  background: var(--card-bg-dark);
  border-right: none;
  box-shadow: var(--sdw-dark);
}

.search-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0px 5px 70px;
  background: transparent;
  z-index: 2;
}

html.dark .search-container {
  background: transparent;
}

.searchandbuttons {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
}

.buttons {
  display: flex;
  justify-content: space-around;
  margin-left: 55px;
  padding-left: 15px;
  padding-right: 15px;
  padding-top: 5px;
  align-items: center;
  box-sizing: border-box;
}

#sidebarSearch {
  width: 120px;
  font-size: 12px;
  padding: 4px 6px;
  font-family: Tahoma, sans-serif;
  border: 2px inset #fff;
  border-right-color: #ffffff;
  border-bottom-color: #ffffff;
  background: white;
  color: black;
  outline: none;
}

html.dark #sidebarSearch {
  background: #222;
  color: #eee;
  border-color: #444;
}

.search-container a {
  cursor: pointer;
  user-select: none;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

/* Scrollable part of sidebar */
.sidebar-scroll {
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  z-index: 99;
}

/* Custom scrollbars (modern browsers) */
.sidebar-scroll::-webkit-scrollbar {
  width: 0;
}

.sidebar-scroll:hover::-webkit-scrollbar {
  width: 10px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background-color: #999;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.sidebar-scroll:hover::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border: 2px outset #fff;
  border-right-color: #7a7a7a;
  border-bottom-color: #7a7a7a;
}

.sidebar-scroll:hover::-webkit-scrollbar-track {
  background: #e0e0e0;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #666;
}

/* Folder tree base */
.folder-tree,
.folder-tree ul {
  list-style: none;
  margin: 0;
  padding-left: 20px;
  white-space: nowrap;
  color: #000;
}

html.dark .folder-tree,
html.dark .folder-tree ul {
  color: #ddd;
}

/* Each list item */
.folder-tree li {
  position: relative;
  margin: 0;
  padding-left: 24px;
}

/* No vertical line on top-level groups */
.folder-tree > li::before {
  content: none;
}

.folder-tree ul > li:last-child::before {
  bottom: 12px;
}

/* Horizontal branch lines */
.folder-tree ul > li > a::before {
  content: "├──";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-weight: normal;
  user-select: none;
  z-index: 1;
  padding-right: 8px;
}

.folder-tree ul > li:last-child > a::before {
  content: "└──";
}

/* Group label with trailing slash */
.folder-tree > li > button.folder-toggle::after {
  content: "/";
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-weight: normal;
  user-select: none;
  z-index: 1;
}

button.folder-toggle {
  font-weight: bold;
  height: 25px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0 4px 37px;
  color: #000;
  position: relative;
  user-select: none;
  white-space: nowrap;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

button.folder-toggle,
button.folder-toggle:focus,
button.folder-toggle:focus-visible,
button.folder-toggle:focus-within,
button.folder-toggle *:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  background: transparent !important;
}

html.dark button.folder-toggle {
  color: #eee;
}

button.folder-toggle:focus,
button.folder-toggle:focus-visible,
button.folder-toggle:focus-within {
  outline: none !important;
  box-shadow: none !important;
}

button.folder-toggle::-moz-focus-inner {
  border: 0;
}

/* === CUSTOM SCROLLBAR === */

.member-list li a {
  color: #000;
  text-decoration: none;
  font-size: 13px;
  font-weight: normal;
  /* Make ALL links bold to prevent shift */
  padding: 2px 0 2px 32px;
  position: relative;
  user-select: none;
  white-space: nowrap;
  z-index: 2;
}

html.dark .member-list li a {
  color: #ddd;
}

.member-list li a:hover {
  text-decoration: underline;
  color: var(--acc-light2);
}

html.dark .member-list li a:hover {
  color: var(--acc-dark) !important;
}

html,
body {
  margin: 0;
  padding: 0px;
  font-family: Arial, sans-serif;
  background: var(--bg-light);
  color: #333;
  height: 100%;
  overflow: hidden;
}

body {
  padding-left: 220px;
}

html.dark,
html.dark body {
  background: #121212;
  color: #eee;
}

h1 {
  text-align: center;
}

#controls {
  text-align: center;
  margin-bottom: 20px;
  margin-top: 20px;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

#controls input[type="text"] {
  padding: 6px 10px;
  font-size: 1rem;
  width: 160px;
  background: #c0c0c0;
  color: black;
  font-family: "Tahoma", Arial, sans-serif;
  box-sizing: border-box;
  box-shadow: none !important;
  cursor: text;
  min-height: 37px;
  max-height: 37px;
  outline: none !important;
  border-color: none !important;
  border: none !important;
}

#controls input[type="text"]:focus {
  outline: none !important;
}

html.dark #controls input[type="text"] {
  background: #2d2d2d;
  color: #eee;
}

html.dark #controls input[type="text"]:focus {
  background: #3a3a3a;
  color: #fff;
}

button:not(#toggle-darkmode, .folder-toggle),
.layout-toggle {
  font-family: Tahoma, sans-serif;
  font-weight: 500;
  font-size: clamp(10px, 1.2vw, 14px);
  padding: 10px 16px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  background: #c0c0c0;
  color: #222;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(6px);
  transition: transform 0.25s ease;
  user-select: none;
  min-height: 37px;
  max-height: 37px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.dark button:not(#toggle-darkmode),
html.dark .layout-toggle:not(#toggle-darkmode) {
  background: #2d2d2d;
  color: #eee;
  /* box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); */
}

button:hover:not(#toggle-darkmode),
.layout-toggle:hover:not(#toggle-darkmode) {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 1),
    rgba(240, 240, 240, 0.9)
  );
  transition: ease 0.25s background;
}

html.dark button:hover:not(#toggle-darkmode),
html.dark .layout-toggle:hover:not(#toggle-darkmode) {
  transform: translateY(-2px);
  /* box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7); */
  background: linear-gradient(
    145deg,
    rgba(50, 50, 50, 0.9),
    rgba(35, 35, 35, 0.8)
  );
}

button:active,
.layout-toggle:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

html.dark button:active,
html.dark .layout-toggle:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.chunk-wrapper {
  display: block;
}

.gallery {
  gap: 10px;
  position: relative;
}

.flex-layout {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.flex-layout .item {
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.flex-layout .item img {
  width: 100%;
  height: 250px;
  display: block;
  object-fit: contain;
}

.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.grid-layout .item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.item {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.2s;
  cursor: pointer;
}

html.dark .item {
  background: #1e1e1e;
}

.item:hover {
  transform: scale(1.05);
  z-index: 10;
}

.item img {
  background: #000;
}

.filename {
  padding: 8px 6px 0px 6px;
  margin-bottom: 0px;
  font-size: 0.8rem;
  color: var(--acc-light2);
  
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  align-self: center;
}

html.dark .filename {
  color: var(--acc-dark);
}

.date {
  font-size: 0.75rem;
  color: #252525;
  line-height: 1.2;
  padding: 0;
  margin: 0;
}

.dates {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 36px;
  padding-bottom: 0px;
}

html.dark .date {
  color: #aaa;
}

.unassigned {
  color: #eb5e5e;
  font-style: italic;
  font-weight: 400;
}

.unassigned .emoji {
  color: inherit;
  filter: none;
}

#lbAssignedDate .unassigned {
  color: #e25555;
  font-weight: 500;
}

#lbAssignedDate .unassigned .emoji {
  color: inherit;
}

.highlight {
  animation: highlightFade 2s ease;
}

@keyframes highlightFade {
  from {
    background-color: pink;
  }

  to {
    background-color: transparent;
  }
}

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  /* backdrop-filter: blur(2px); */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  transition: opacity 0.3s ease;
}

.lightbox.hidden {
  display: none;
  opacity: 0;
}

.lb-container {
  position: relative;
  display: inline-block;
  max-width: calc(100vw - 40px);
  pointer-events: none;
}

.lb-glow {
  position: absolute;
  inset: 0;
  border-radius: 0.7rem;
  overflow: hidden;
  /* clips the shine, but not your metabox */
  pointer-events: none;
  /* doesn’t block clicks */
  z-index: 0;
  display: none;
}

.lb-glow::before {
  content: "";
  position: absolute;
  inset: -3px;
  /* expand slightly outside */
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.2),
    rgba(255, 215, 150, 0.3),
    rgba(255, 255, 255, 0.2)
  );
  filter: blur(40px) brightness(1);
  opacity: 0.4;
  z-index: -1;
  /* stays behind content */
  animation: glow-move 45s linear infinite;
}

/* Animation: moves gradient around for “shine” */
@keyframes glow-move {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 0.6;
  }

  50% {
    transform: rotate(180deg) scale(1.05);
    opacity: 1;
  }

  100% {
    transform: rotate(360deg) scale(1);
    opacity: 0.6;
  }
}

.lb-glow-2 {
  position: absolute;
  inset: 0;
  border-radius: 0.7rem;
  overflow: hidden;
  /* clips the shine, but not your metabox */
  pointer-events: none;
  /* doesn’t block clicks */
  z-index: 0;
  pointer-events: auto;
}

.lb-glow-2::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 70%, white, transparent 70%);
  filter: blur(60px);
  animation: glow-move 30s ease-in-out infinite;
}

.lb-glow-3 {
  position: absolute;
  inset: 0;
  border-radius: 0.7rem;
  overflow: hidden;
  /* clips the shine, but not your metabox */
  pointer-events: none;
  /* doesn’t block clicks */
  z-index: 0;
}

.lb-glow-3::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(300deg, var(--acc-light2), transparent 100%);
  filter: blur(50px);
  animation: glow-move 40s linear infinite reverse;
}

#lightbox .lb-content {
  position: relative;
  max-width: calc(100vw - 40px);
  max-height: fit-content;
  text-align: center;
  background: hsla(0, 0%, 0%, 0.475);
  /*0.875*/
  border: 2px solid rgba(255, 255, 255, 0.222);
  padding: 10px;
  border-radius: 0.9rem;
  user-select: none;
  backdrop-filter: blur(20px) brightness(2) saturate(250%);
  -webkit-backdrop-filter: blur(20px) brightness(2) saturate(250%);
  z-index: 99999;
  /*border-bottom: 4px inset #ffffff45;*/
  /*border-right: 4px inset var(--acc-light);*/
  justify-content: center;
  align-items: center;
  margin-left: 300px;
  margin-right: clamp(0px, (100vw - 1000px), 300px);
}

#lightbox .lb-content img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 0;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #7a7a7a;
  user-select: none;
  pointer-events: none;
}

#lightbox .lb-caption {
  margin-top: 15px;
  font-size: 1rem;
  line-height: 1.2;
  color: black;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

#lightbox .lb-caption #lbFilename {
  font-weight: 600;
  user-select: text;
  color: white;
  padding: 0px;
  max-width: fit-content;
}

#lightbox .lb-caption #lbDate {
  opacity: 0.75;
  margin-top: 0px;
  user-select: text;
  color: white;
  max-width: fit-content;
}

/* Download button */
#lightbox .lb-caption .lb-download {
  display: inline-block;
  margin-top: 0px;
  padding: 4px 10px;
  background: #c0c0c0;
  border: 2px outset #fff;
  border-right-color: #7a7a7a;
  border-bottom-color: #7a7a7a;
  color: black;
  font-family: "Tahoma", sans-serif;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  max-width: fit-content;
}

#lightbox .lb-caption .lb-download:active {
  border: 2px inset #000;
}

/* Glassy Close Button */
#lightbox #lbClose {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 30px;
  height: 30px;

  /* Glassy background */
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);

  /* Rounded, subtle border */
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;

  /* Flex centering for "×" */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Text style */
  font-size: 18px;
  font-weight: bold;
  color: rgb(0, 0, 0);
  line-height: 1;

  /* Interaction */
  cursor: pointer;
  user-select: none;
  z-index: 15;
  transition: all 0.2s ease;
  pointer-events: auto;
}

/* Hover effect for subtle glow */
#lightbox #lbClose:hover {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

/* Active click feedback */
#lightbox #lbClose:active {
  transform: scale(0.95);
}

/* Buttons for next/prev rgb(255, 147, 214); */
.lb-btn {
  background: rgba(255, 255, 255, 0.05);
  z-index: 9999;
  border: none;
  color: black;
  font-size: 2.5rem;
  cursor: pointer;
  user-select: none;
  padding: 8px 12px;
  border-radius: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0.7);
  font-weight: bold;
  text-shadow: 1px 1px 0 #ffffff72, -1px -1px 0 #7a7a7a77;

  border-radius: 8px;
  backdrop-filter: blur(2px) saturate(300%);
  -webkit-backdrop-filter: blur(2px) saturate(300%);

  transition: background 0.2s ease, transform 0.2s ease;
}

.lb-btn:active {
  background: rgba(255, 255, 255, 0.05);
  /* slightly stronger glass */
  backdrop-filter: brightness(0.95) blur(1px) saturate(300%);
  -webkit-backdrop-filter: brightness(0.95) blur(1px) saturate(300%);
  transform: translateY(-50%) scale(0.8);
  /* pressed in */
  box-shadow: inset 0 0 15px 6px rgba(255, 255, 255, 0.25);
  /* subtle inset shadow */
  border: none !important;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: brightness(1.05) blur(2px) saturate(400%);
  -webkit-backdrop-filter: brightness(1.05) blur(2px) saturate(400%);
  transform: translateY(-50%) scale(0.8);
}

#lbPrev {
  left: 15px;
  pointer-events: auto;
}

#lbNext {
  right: 15px;
  pointer-events: auto;
}

.sidebar a svg {
  fill: #444;
  transition: fill 0.3s ease;
}

html.dark .sidebar a svg {
  fill: #fff;
}

.home-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(1.2);
}

.home-icon-link svg {
  transition: none !important;
}

.home-icon-link:hover {
  background: none !important;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transform: scale(1.3);
  transition: ease 0.2s;
}

.stats-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-icon svg {
  transition: none !important;
}

html.dark .stats-icon svg {
  filter: invert(1);
  transition: ease 0.3s;
}

.stats-icon:hover {
  background: none !important;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: ease 0.2s;
  transform: scale(1.1);
}

.header-section {
  position: sticky;
  text-align: center;
  /* margin-top: -40px; */
  background: var(--bg-light);
  overflow: hidden;
}

html.dark .header-section {
  background: var(--bg-dark);
}

.header1 {
  font-size: 24px;
  font-weight: bold;
  display: inline-block;
}

.image-count {
  font-weight: normal;
  font-size: 0.7rem;
  color: #888;
  line-height: 1;
  margin-top: 10px;
}

html.dark .image-count {
  color: #aaa;
}

.header2 {
  position: absolute;
  left: 20px;
  top: 0;
  font-size: 16px;
  text-align: left;
  margin-top: 25px;
}

/* @media (max-width: 1350px) {
  .header2 {
    margin-top: 5px;
    top: 0;
  }
} */


html.dark #settings-box {
  color: #eee;
  background: rgba(0, 0, 0, 0.25);
  border-left: 2px solid var(--acc-dark);
}

html.dark #settings-box strong {
  color: var(--acc-dark);
  font-weight: 600;
}

#settings-box {
  font-family: "Consolas", monospace;
  font-size: 12px;
  padding: 8px 12px;
  color: #222;
  background: rgba(255, 255, 255, 0.4);
  border-left: 2px solid var(--acc-light);
  backdrop-filter: blur(2px);
}

#settings-box strong {
  color: var(--acc-light);
  font-weight: 600;
}

.windows98-title {
  position: relative;
  display: inline-block;
  font-family: "MS Sans Serif", Tahoma, Geneva, sans-serif;
  font-weight: bold;
  font-size: 2rem;
  background: transparent !important;
  color: var(--acc-light2);
  margin-top: auto;
  margin-bottom: auto;
}

html.dark .windows98-title {
  color: var(--acc-dark);
}

.member-info {
    display: flex;
    flex-wrap: wrap;           
    justify-content: center;   
    align-items: center;
    gap: 0.3rem;               
    margin: 10px 0;            
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, sans-serif;
    font-size: 13px;           
    font-weight: bold;         
    color: #555;              
    user-select: text;
    white-space: normal;
    overflow: visible;
}

html.dark .member-info {
    color: #aaa;              
}

.member-info .dot {
    opacity: 0.6;              
}

.member-info img.flag {
    width: 1.25em;             
    height: 0.9em;
    object-fit: cover;
    vertical-align: middle;    
    border-radius: 2px;        
}

.member-info .flag + .flag {
  margin-left: 2px;
}


.icon-button {
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: black;
  transition: color 0.2s ease;
}

.icon-button:active {
  opacity: 0.8;
}

.icon-button svg {
  width: 24px;
  height: 24px;
}

html.dark .icon-button svg {
  filter: invert(1);
}

#toggle-darkmode {
  display: inline-flex;
  cursor: pointer;
  align-items: center;
  align-content: center;
  z-index: 9999;
  justify-items: center;
  justify-content: center;
  max-width: 100%;
}

#toggle-darkmode:hover {
  color: #000;
  transform: scale(1.1);
  transition: ease 0.2s;
}

#toggle-sidebar {
  position: fixed;
  top: 78px;
  left: 145px;
  z-index: 9999;
  width: 50px;
  height: 50px;
  margin-top: 10px;
  transform: rotate(45deg);
}

#scrollToTop {
  position: absolute;
  bottom: 20px;
  right: -5px;
  padding: 10px;
  z-index: 9999;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

#scrollToTop svg {
  width: 44px;
  height: 44px;
  display: block;
  fill: currentColor;
  color: #444;
  /* Adjust as needed, or use white for dark bg */
}

#scrollToTop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Optional: Add a safe "hitbox" */
#scrollToTop::after {
  content: "";
  position: absolute;
  inset: -5px;
  /* expands clickable area without affecting visuals */
}

html.dark #scrollToTop svg {
  filter: invert(1);
}

#sort-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-weight: bold;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 9999;
  display: none;
}

#sort-overlay.show {
  opacity: 1;
}

#lbImage {
  opacity: 0;
  transition: opacity 0.2s ease;
}

#lightbox:not(.hidden) #lbImage[src]:not([src=""]) {
  opacity: 1;
}

.lightbox-image-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: 70vh;
  z-index: 3;
  pointer-events: auto;
}

#lightboxSpinner {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;

  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: rgba(255, 255, 255, 0.35);
  border-radius: 50%;

  background: transparent;

  box-shadow:
    inset 0 0 4px rgba(255, 255, 255, 0.12),
    0 0 10px rgba(0, 0, 0, 0.25);

  animation: spin 0.8s linear infinite;

  opacity: 0;
  transition: opacity 0.15s ease;

  pointer-events: none;
  z-index: 99999;
}




@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#lbMetaBox {
  position: absolute;
  top: 50px;
  left: 0px;
  color: white;
  font-size: 12px;
  padding: 0;
  background: hsla(0, 0%, 0%, 0.475);
  /*0.875*/
  border: 2px solid rgba(255, 255, 255, 0.222);
  border-radius: 0.9rem;
  backdrop-filter: blur(20px) brightness(2) saturate(250%);
  -webkit-backdrop-filter: blur(20px) brightness(2) saturate(250%);
  z-index: 50;
  text-align: left;
  display: none;
  user-select: none;
  width: 285px;
  font-family: Arial, sans-serif;
  pointer-events: auto;
}

#lbMetaBox.visible {
  display: block;
}

#lbMetaBox .titlebar {
  background: rgba(255, 255, 255, 0);
  color: white;
  padding-top: 10px;
  padding-left: 10px;
  padding-right: 10px;
  font-weight: bold;
  font-size: 13px;
  font-family: Arial, sans-serif;
  border-bottom: 0px solid #000;
  border-radius: 0.9rem;
}

#lbMetaBox .content {
  padding: 10px;
  font-family: Arial, sans-serif;
  user-select: text;
  border-radius: 3px;
  padding: 8px 14px;
  margin: 5px;
  border-radius: 0.9rem;
}

#donate-button {
  position: absolute !important;
  top: 0px !important;
  right: 0px !important;
  background: transparent;
  user-select: none;
  filter: invert(1);
}

html.dark #donate-button {
  filter: none;
}

#donate-button input[type="image"] {
  width: clamp(100px, 15vw, 200px);
  height: auto;
  display: block;

  user-select: none;
  -webkit-user-drag: none;
}


.caption-wrapper {
  outline: none;
  pointer-events: auto;
}

.namedate-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: 3px;

  /* Glassy background */
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);

  /* Subtle border to define the edges */
  border: 1px solid rgba(255, 255, 255, 0.25);

  /* Optional soft shadow to lift it off the background */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);

  padding: 8px 14px;
  /* give some breathing room */
  border-top: 1px solid rgba(0, 0, 0, 0.5);
  border-left: 1px solid rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  border-right: 1px solid rgba(255, 255, 255, 0.5);
}

.download-btn {
  color: rgba(255, 255, 255, 0.5);
  padding: 5px 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 600;
  gap: 8px;
  border-radius: 5px;
  margin: 0 5px;
  transition: 0.2s;
  border: 1px solid transparent;
  z-index: 3;
}

.download-btn:hover {
  border-color: rgba(255, 255, 255, 0.623);
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.144),
    rgba(255, 255, 255, 0.247),
    rgba(255, 255, 255, 0.39)
  );
  box-shadow: 0 6px rgba(255, 255, 255, 0.623);
  transform: translateY(-6px);
  color: white;
}

html.dark .download-btn:hover {
  color: white;
}

.download-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

#center,
#mask-rays,
#mask-center {
  transform-origin: center;
  transition: transform 250ms ease-out;
}

#center {
  fill: #000;
  transform: rotate(-35deg);
}

#rays {
  stroke: #000;
  stroke-width: 2px;
}

html.dark #center {
  transform: rotate(-35deg) scale(2);
}

html.dark #mask-rays {
  transform: scale(0.5);
}

html.dark #mask-center {
  transform: translateX(-18px);
}

html.dark .all hr {
  border: 1px solid #555;
}

.all hr {
  border: 1px solid #555;
  margin: 0px 0;
}

.all {
  display: block;
  height: 100vh;
  overflow: auto;
  scrollbar-width: none;
  padding: 20px;
  padding-right: 40px;
}

#lbLens {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999999;

  border: 3px solid rgba(255, 255, 255, 0.8);

  /* Soft outer glow */
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.25),
    0 0 40px rgba(255, 255, 255, 0.15);

  /* Inner shadow for depth */
  inset: 0 0 30px rgba(0, 0, 0, 0.25);
  transition: box-shadow 0.6s ease-out;
  opacity: 0;
}

#lbLens::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(
    circle at 30% 70%,
    rgba(255, 0, 0, 0.1),
    rgba(0, 255, 255, 0.1)
  );
}

#lbLens.zooming {
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.623);
}

/* #lbLens::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    pointer-events: none;
} */

/* can add stuff */
#lbLens.active {
  animation: none;
}

#lbLens::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;

  background: radial-gradient(
    circle at var(--hx, 50%) var(--hy, 50%),
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 60%,
    rgba(163, 253, 235, 0.082) 70%,
    rgba(251, 177, 247, 0.468) 100%
  );
}

.mag-tooltip {
  position: absolute !important;
  top: 12px;
  left: 12px;

  display: flex;
  flex-direction: column;
  gap: 6px;

  pointer-events: none;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.mag-tooltip.show {
  opacity: 1;
  transform: scale(1);
}

.mag-tooltip.fade-out {
  opacity: 0;
  transform: scale(0.97);
}

.mag-tooltip-text {
  padding: 6px 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);

  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  border-radius: 4px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}

html.dark #randomBtn svg {
  fill: white;
}

#randomBtn svg {
  fill: black;
}

#randomBtn .dice-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-4px);
}

.thumb {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.18);
  transform: scale(1.01);
  opacity: 0.85;
  transition: transform 1.2s ease, opacity 0.25s ease;
}

/* Grain layer */
.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.8;
  transition: opacity 0.5s ease;

  background-image: repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.05) 0px,
      rgba(0, 0, 0, 0.05) 1px,
      transparent 1px,
      transparent 2px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.05) 0px,
      rgba(0, 0, 0, 0.05) 1px,
      transparent 1px,
      transparent 2px
    ),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.03) 0px,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 3px
    );
}

.thumb:not(.loading)::after {
  opacity: 0;
}

.thumb img {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.thumb:not(.loading) {
  transform: none;
  opacity: 1;
}

.thumb:not(.loading) img {
  opacity: 1;
}
/* .thumb::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.08), transparent 60%);
    pointer-events: none;
    opacity: 0.4;
} */

.sig-icon {
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translate(10px, -50%);
  height: 90px;
  filter: invert(1);
}

html.dark .sig-icon {
  filter: none;
}


#gallery-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(calc(-50% + 100px), -50%);
    background: none;
    padding: 20px 30px;
    border-radius: 8px;
    color: #000000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, sans-serif;
    pointer-events: none;
}


html.dark #gallery-loading {
    color: #fff;
}


#gallery-loading.hidden {
    opacity: 0;
    user-select: none;
    pointer-events: none;
}

.gl-title {
    display: inline-flex; 
    align-items: center;
    transform: translateX(0.8ch);
    font-size: 20px;
}

.gl-title-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    padding-bottom: 15px;
}

.gl-title-wrap::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 12px;
    background: var(--acc-light);
    opacity: 1;
}

html.dark .gl-title-wrap::after {
    background: var(--acc-dark);
}

.dots {
    display: inline-block;
    width: 1.5em;       
    text-align: left;   
}

.dots::after {
    content: "";
    display: inline-block;
    animation: dots 2s steps(4, end) infinite;
}

@keyframes dots {
    0%   { content: ""; }
    25%  { content: "."; }
    50%  { content: ".."; }
    75%  { content: "..."; }
    100% { content: ""; }
}

#gallery-loading .gl-progress {
    font-size: 14px;
    opacity: 1;
}

.gallery.dimmed {
    filter: blur(3px);
    transition: filter 0.3s ease;
    pointer-events: none;
    user-select: none;
}

html.dark .gallery.dimmed {
    filter: blur(3px);
    transition: filter 0.3s ease;
    pointer-events: none;
}

.gallery::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 1;
  background: rgba(255, 255, 255, 0.7);
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.4s ease;
}

html.dark .gallery::before {
  background: rgba(0,0,0,0.7);
}


.gallery.dimmed::before {
  opacity: 1;
}


.gallery:not(.dimmed)::before {
  opacity: 0;
}





.gl-bar-wrap {
    position: relative;
    width: 240px;
    margin-top: 5px;
}

.gl-bar {
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.15);
    border-radius: 3px;
    overflow: hidden;
}

html.dark .gl-bar {
    background: rgba(255,255,255,0.15);
}

.gl-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--acc-light);
    transition: width 0.2s ease;
    position: relative;
    overflow: hidden;
}


/* Light theme shimmer */
.gl-bar-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: -50%;
    width: 40%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(209,195,152,0.45),
        transparent
    );
    animation: shimmer-light 2.0s linear infinite;
    pointer-events: none;
}

/* Dark theme shimmer */
html.dark .gl-bar-fill::after {
    background: linear-gradient(
        120deg,
        transparent,
        rgba(145, 213, 229, 0.55),
        transparent
    );
}

@keyframes shimmer-light {
    0% { left: -50%; }
    100% { left: 110%; }
}

@keyframes shimmer-dark {
    0% { left: -50%; }
    100% { left: 110%; }
}



html.dark .gl-bar-fill {
    background: var(--acc-dark);
}

.gl-bar-percent {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 12px;
    opacity: 0.8;
    pointer-events: none;
}

.gl-bar-circle {
    position: absolute;
    bottom: -22px;
    left: 0;
    width: 16px;
    height: 16px;
    transform: rotate(-90deg);
}

.gl-bar-circle circle {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
}

.gl-bar-circle .bg {
    stroke: rgba(255,255,255,0.65);
}

html.dark .gl-bar-circle .bg {
    stroke: rgba(0,0,0,0.65);
}

.gl-bar-circle .fg {
    stroke: black;
    stroke-dasharray: 50.24;
    stroke-dashoffset: 50.24;
    transition: stroke-dashoffset 0.2s ease;
    opacity: 0.8;
}

html.dark .gl-bar-circle .fg {
    stroke: white;
}


.gl-status {
    margin-top: 5px;
    font-size: 0.75rem;
    opacity: 0.55;
    text-align: center;
    height: 45px;
    font-family: 'IBM Plex Mono', 'Consolas', 'Courier New', monospace;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: break-word;
    width: 180px;
    transition: opacity 0.4s ease;
    pointer-events: none;
    overflow: hidden;
}

html.dark .gl-status {
    opacity: 0.65;
}

.rare-message {
    color: #594d0b; /* gold */
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    font-weight: bold;
}
html.dark .rare-message {
  color: #ffd700;
}

.upgrade-message {
    position: relative;
    font-weight: bold;
    color: #8e8e8e;
    display: inline-block;
}

.upgrade-message::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;

    white-space: pre-wrap;
    word-break: break-word;
    display: block;

    background: linear-gradient(
        120deg,
        transparent 42%,
        rgba(255,255,255,0.8) 50%,
        transparent 58%
    );

    background-size: 250% 100%;
    background-position: 250% 0;

    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    mix-blend-mode: screen;
    pointer-events: none;

    animation: lightSweepReverse 6s linear infinite;
    will-change: background-position;
    transform: translateZ(0);
}

@keyframes lightSweepReverse {
    from { background-position: 250% 0; }
    to   { background-position: -250% 0; }
}



.mid-message {
    position: relative;
    display: inline-block;
    color: #c5c9cc;

    /* slightly stronger modulation */
    filter: brightness(0.95) hue-rotate(0deg);

    animation:
        midBrightness 1.5s ease-in-out infinite,
        midHue 4s ease-in-out infinite;
}

.mid-message::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    pointer-events: none;

    /* stronger internal shimmer */
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.05),
        rgba(255,255,255,0.12),
        rgba(255,255,255,0.05)
    );
    background-size: 100% 220%;
    background-position: 0 0;

    mix-blend-mode: overlay;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    animation: midSubsurface 1s linear infinite;
}

@keyframes midBrightness {
    0%, 100% { filter: brightness(0.65) hue-rotate(0deg); }
    50%      { filter: brightness(1.25) hue-rotate(0deg); }
}

@keyframes midHue {
    50% { filter: brightness(1.00) hue-rotate(32deg); }
}

@keyframes midSubsurface {
    50% { background-position: 0 100%; }
}




