* {
  box-sizing: border-box;
}

body {
  margin: 10;
  /*background: linear-gradient(180deg,#f6f7fb 0%, #ffffff 60%);*/
  color: #0055ff;
  font-family: VCR_OsdMono, monospace;
}

/* GRID */

#topbar {
  padding: 18px 16px 6px 16px;
  text-align: center;
}

#topbar h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.2px;
}

main {
  padding: 12px;
}

#grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 0px;
  max-width: 1120px;
  margin: 0 auto auto auto;
}

.cell {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  /*border-radius: 12px;*/
  /*background: linear-gradient(180deg, #ffffff, #f7f9fc);*/
  /*box-shadow: 0 6px 16px rgba(11,18,32,0.06);*/
  /*transition: transform 180ms ease, box-shadow 180ms ease;*/
}

.cell img {
  width: 100%;
  height: 100%;
  object-fit: scale-down;
  display: block;
}
/*
.locked {
  filter: blur(4px) grayscale(0.35) contrast(0.95);
  opacity: 0.55;
}

.cell::after {
  content: attr(data-day);
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 11px;
  background: rgba(11,18,32,0.06);
  color: #0b1220;
  padding: 4px 8px;
  border-radius: 999px;
  display: inline-block;
}

.locked {
  filter: blur(8px);
  opacity: 0.4;
}*/

/* FULLSCREEN VIEWER */

#viewer {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(250,251,253,0.98));
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 16px;
}

#viewer.hidden {
  display: none;
}

#viewerImage {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 12px;
  /*box-shadow: 0 20px 40px rgba(11,18,32,0.08);*/
  transition: transform 200ms ease, opacity 200ms ease;
}

#viewerInfo {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  /*background: rgba(255,255,255,0.9);*/
  /*box-shadow: 0 10px 20px rgba(11,18,32,0.04);
  padding: 10px 14px;
  border-radius: 12px;
  color: #0b1220;*/
  text-align: center;
  min-width: 220px;
}

#viewerDay { font-size: 15px; }
#viewerName { font-size: 25px; font-weight: 800; color: #0055ff; position: absolute; top: 80px; }
#viewerProgress { font-size: 13px; color: limegreen; }

#viewerClose {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 80;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: rgba(11,18,32,0.03);
  color: #0b1220;
  border: none;
  border-radius: 12px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(11,18,32,0.06);
}

#viewerClose:active { transform: scale(0.98); }

.hidden { display: none; }

/* Mobile tweaks */
@media (max-width: 800px) {
  #grid { grid-template-columns: repeat(auto-fill, minmax(1vh, 3vh)); }
  #viewerImage { max-height: 72vh; border-radius: 10px; }
  #viewerClose { top: 12px; right: 12px; width: 44px; height: 44px; }
  #viewerInfo { min-width: 180px; padding: 10px; }
}
