body {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  background-image: url("images/window.png");
  background-size: 100% auto;
  background-position: center center;
}

.desk {
  height: 100%;
  width: 100%;
  background-image: url("images/desk.png");
  background-position: center bottom;
  background-size: cover;
  display: grid;
  place-items: center;
}

.table {
  position: relative;
  width: 100%;
  height: 100%;
  display:flex;
}

.corner-button {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #222;
  color: #111;
  text-decoration: none;
  font: inherit;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: background 0.15s ease, transform 0.05s ease;
}
.corner-button:hover {
  background: rgba(255, 255, 255, 1);
}
.corner-button:active {
  transform: translateY(1px);
}

.viewer {
  position: absolute;
  inset: 10% 10% 18% 10%;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  z-index: 20;
  margin: 6vh;
}

.viewer-inner {
  display: grid;
  place-items: center;
  padding: 1rem;
}

#viewerMsg {
  display: block; 
  font-size: clamp(14px, 2.2vw, 22px);
  color: #111;
  font-weight: 400;
  font-family: "Courier New", Courier, monospace;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
}

#viewerImg {
  display: none;
  max-width: 100%;
  max-height: 100%;
  height: 50vh;
  border-radius: 10px;
  user-select: none;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem 1rem;
}

.controls button {
  min-width: 3rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #222;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  font-weight: 600;
}
.controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.controls button:active {
  transform: translateY(1px);
}

.page-indicator {
  font-size: 0.95rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed rgba(0, 0, 0, 0.25);
}

.stacks {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0.0001; /* keep images loadable but invisible */
  pointer-events: none;
}

.chooseSketch {
  position: fixed;
  left: 3vw;
  right: 3vw;
  bottom: 3vh;
  display: flex;
  align-items: center;
  justify-content: space-around; 
  background: rgba(255, 255, 255, 0.3);
  padding: clamp(8px, 1.2vw, 16px);
  border-radius: 12px;
  z-index: 30;
  backdrop-filter: blur(1px);
}


.choice {
  display: grid;
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: center;
  gap: 0.35rem;
}

.chooseSketch img.thumb,
.chooseSketch img {
  height: 15vh;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.chooseSketch img:hover {
  transform: translateY(-2px);
}
.chooseSketch img:focus {
  outline: 3px solid #111;
  outline-offset: 3px;
}

.chooseSketch p {
  margin: 0;
  margin-top: 0.1rem;
  font-size: clamp(12px, 1.2vw, 16px);
  color: #111;
  font-family: "Courier New", Courier, monospace;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
}

.to-gallery {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #222;
  font-weight: 600;
  cursor: pointer;
  background: rgb(0,0,0,0);
  border: none;
}

.to-gallery p {
  margin: 0;
  margin-top: 0.1rem;
  font-size: clamp(12px, 1.2vw, 16px);
  color: #111;
  font-family: "Courier New", Courier, monospace;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
}


.to-gallery:active {
  transform: translateY(3px);
}


@media (max-width: 900px) {
  .viewer {
    inset: 8% 5% 22% 5%;
  }
  .chooseSketch {
    gap: 2vw;
  }
  .chooseSketch img {
    height: 16vh;
  }
}

@media (max-width: 600px) {
  .viewer {
    inset: 7% 4% 26% 4%;
  }
  .chooseSketch {
    bottom: 2vh;
    padding: 8px 10px;
  }
}
