* { box-sizing: border-box; }

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 4px 0 6px;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
}

#stage {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#main-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.sidebar {
  width: 185px;
  flex-shrink: 0;
  display: block;
  overflow: hidden;
  background: #fff;
}

#sidebar-right {
  background: #fff;
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  position: relative;
}

#gallery-label {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: sans-serif;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.28);
  z-index: 2;
  pointer-events: none;
}

#canvas { display: block; }

#controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 52px;
  padding: 2px 0 2px;
  width: 1024px;
}

#controls-row button {
  background: none;
  border: none;
  color: ##9a999c;
  font-family: sans-serif;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0.6;
  transition: opacity 0.1s;
}

#controls-row button:hover { opacity: 1; }
#btn-reload { font-size: 32px; opacity: 0.7; }

#thumb-wrap {
  position: relative;
  width: 185px;
  height: 768px;
  overflow: hidden;
}

/* gallery fade when too many are in there lol. */
#thumb-wrap::before,
#thumb-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 50px;
  z-index: 1;
  pointer-events: none;
}

#thumb-wrap::before { top: 0;    background: linear-gradient(to bottom, #fff 30%, transparent); }
#thumb-wrap::after  { bottom: 0; background: linear-gradient(to top,   #fff 30%, transparent); }

#thumb-strip {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 185px;
  height: 768px;
  padding: 44px 8px;
  scrollbar-width: none;
}

#thumb-strip::-webkit-scrollbar { display: none; }

.thumb {
  flex-shrink: 0;
  width: calc(50% - 3px);
  height: 63px;
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 5px 7px;
  font-family: sans-serif;
  font-size: 8px;
  color: rgba(0, 0, 0, 0.4);
  line-height: 1.3;
  position: relative;
  overflow: hidden;
  transition: border-color 0.12s;
}

.thumb-index {
  position: absolute;
  top: 5px;
  right: 7px;
  font-family: monospace;
  font-size: 7px;
  opacity: 0.25;
  line-height: 1;
}

.thumb:hover { border-color: rgba(0, 0, 0, 0.28); }
.thumb:hover .thumb-index { opacity: 0.5; }

.thumb.active {
  border: 2.5px solid #1c1410;
  color: #1c1410;
}

.thumb.active .thumb-index { opacity: 0.65; }
