body {
      font-family: Arial, sans-serif;
      margin: 0;
      background: #494d64;        /* main background */
      color: #f0c6c6;             /* main writing */
}

header {
  padding: 1rem;
  background: #181926;        /* second background */
  color: #ed8796;             /* second writing */
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

header h1 {
  margin: 0;
  font-size: 1.2rem;
}

main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  padding: 1rem;
}

/* Canvas of memes */
#meme-canvas {
  background: #181926;        /* second background */
  color: #f0c6c6;
  border-radius: 8px;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-auto-rows: minmax(180px, auto);
  gap: 0.75rem;
  overflow-y: auto;
  max-height: calc(100vh - 90px);
}

.meme-item {
  position: relative;
  background: #494d64;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #c6a0f6;  /* active border */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.meme-item img,
.meme-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.meme-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.2rem 0.3rem;
  font-size: 0.7rem;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: #f0c6c6;
}

    /* Files list */
#file-list-wrapper {
  background: #181926;        /* second background */
  color: #ed8796;             /* second writing */
  border-radius: 8px;
  padding: 0.75rem;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}

#file-list-title {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #c6a0f6;  /* active border accent */
  padding-bottom: 0.3rem;
}

#file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

#file-list li {
  margin-bottom: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#file-list a {
  color: #f0c6c6;
  text-decoration: none;
  border-bottom: 1px dotted #c6a0f6;
}

#file-list a:hover {
  color: #ed8796;
  border-bottom-style: solid;
}

@media (max-width: 800px) {
  main {
    grid-template-columns: 1fr;
  }
  #meme-canvas, #file-list-wrapper {
    max-height: none;
  }
}
