html, body {
  margin: 0;
  height: 100%;
  background: #fff;
  font-family: sans-serif;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100%;
  background-color: #ddd;
  padding: 12px;
  overflow-y: auto;
  border-radius: 0 30px 30px 0;
}

#blockSidebar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: #f4f4f4;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.widget img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
  margin-bottom: 6px;
}

.widget span {
  font-size: 12px;
  text-align: center;
  color: #333;
}

.widget:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
}

.widget:active {
  transform: scale(0.95);
}


.main-content {
  margin-left: 200px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.grid-container {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-grid {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.cell {
  position: relative;
  background-color: #fff;
}

.image-grid, .cell, .cell img {
  user-select: none;
}

.cell > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

.cell > img.fadeout {
  opacity: .5;
  /* transition: opacity .2s ease-in-out; */
}

.cell:hover > img.fadeout {
  opacity: 1;
}

.cell .rotating {
  transition: transform .1s ease;
}



.context-menu {
  position: absolute;
  background: #2c2c2c;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 6px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  display: none;
  z-index: 1000;
  min-width: 160px;
  font-family: sans-serif;
  font-size: 14px;
  color: #fff;
  max-height: 200px;
  overflow: scroll;
}

.context-menu .section-title {
  padding: 6px 12px;
  font-weight: bold;
  font-size: 13px;
  color: #aaa;
  cursor: default;
}

.context-menu .option {
  padding: 6px 12px;
  cursor: pointer;
}

.context-menu .option:hover {
  background: #444;
}
