/* General page layout */
body {
  margin: 0;
  font-family: sans-serif;
  background: #f2f2f2;
  overflow: hidden;
}

#controls {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.6);
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#stepCounter {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: bold;
  font-family: sans-serif;
  z-index: 1000;
}

#controls button {
  margin-left: 10px;
  padding: 6px 12px;
  font-size: 0.9em;
  border-radius: 4px;
  border: none;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  cursor: pointer;
}

#gridWrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: auto;
}

#gridScaler {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: center center;
  transition: transform 1s ease;
}

#gridContainer {
  position: relative;
  width: 12000px;
  height: 12000px;
}

/* Tile styles */
.tile {
  position: absolute;
  width: 50px;
  height: 50px;
  margin: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8em;
  border-radius: 4px;
  cursor: pointer;
  background: rgba(200, 200, 200, 0.4);
  transition: background 0.3s;
  color: black;
}

.tile.grey { background: rgba(200, 200, 200, 0.4); }
.tile.black { background: rgba(0, 0, 0, 0.5); color: white; }

.tile span { pointer-events: none; }

/* Modal: Note */
#noteModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#noteContent {
  background: rgba(255, 255, 255, 0.75);
  padding: 20px;
  border-radius: 8px;
  width: 300px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#noteText {
  width: 100%;
  height: 100px;
  resize: none;
  font-family: sans-serif;
  font-size: 1em;
  padding: 8px;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  border-radius: 4px;
}

#closeNote {
  align-self: flex-end;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

/* Center Modal */
#centerModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

#centerContent {
  background: rgba(255, 255, 255, 0.75);
  color: black;
  padding: 2em 3em;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#centerLabel {
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 1em;
}

/* Completion Message */
#completionMessage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

#completionMessage.visible {
  opacity: 1;
  pointer-events: auto;
}

.modalBox,
.messageBox {
  background: rgba(0, 0, 0, 0.4);
  color: white;
  padding: 2em 3em;
  border-radius: 8px;
  text-align: center;
  font-size: 1.6em;
  animation: fadeInUp 1s ease-out;
  box-shadow: 0 4px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Zoom fallback */
#zoomOutView {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.8);
  color: black;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#zoomContent {
  text-align: center;
}

.hidden {
  display: none !important;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100px;
  height: 4px;
  background: rgba(200, 200, 200, 0.4);
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 20px;
  width: 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  margin-top: -8px;
}

input[type="range"]::-moz-range-thumb {
  height: 20px;
  width: 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

input[type="range"]::-ms-thumb {
  height: 20px;
  width: 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

input[type="checkbox"] {
  accent-color: black;
}

.tile-label {
  transition: opacity 0.3s ease;
}

#welcomeModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  display: block; /* ✅ Change from flex to block */
  overflow-y: auto; /* ✅ Enable scrolling */
  z-index: 300;
}


#welcomeModal .modal-content {
  background: rgba(0, 0, 0, 0.4);
  color: white;
  padding: 2em 3em;
  border-radius: 8px;
  max-width: 600px;
  margin: 5vh auto;           /* ✅ Vertically centers with spacing */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease-out;
  font-size: 1em;
  line-height: 1.6;
}


#welcomeModal h2,
#welcomeModal h3 {
  color: white;
  margin-top: 0;
}

#welcomeModal ul {
  text-align: left;
  padding-left: 1.2em;
  margin: 1em auto;
  max-width: 30em;
}

#welcomeModal button {
  margin-top: 2em;
  padding: 10px 20px;
  font-size: 1em;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid white;
  border-radius: 4px;
  cursor: pointer;
}

#welcomeModal blockquote {
  font-style: italic;
  margin-bottom: 1.5em;
  opacity: 0.9;
}

#welcomeModal blockquote div {
  font-size: 0.9em;
  opacity: 0.6;
}

.modal-link {
  display: inline-block;
  margin-top: 2em;
  font-size: 1em;
  color: white;
  text-decoration: underline;
  opacity: 0.9;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.modal-link:hover,
.modal-link:focus {
  opacity: 1;
  text-decoration: none;
}

#welcomeModal.hidden {
  display: none !important;
}

#reviewModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5); /* darker overlay */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#reviewContent {
  background: white;
  padding: 2em 3em;
  border-radius: 8px;
  text-align: center;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  color: black;
}



#reviewList {
  text-align: left;
  padding-left: 1.2em;
}

#closeReview {
  color: black;
  text-decoration: underline;
}

#closeReview:hover,
#closeReview:focus {
  color: black;
  text-decoration: none;
}

.button-link {
  display: inline-block;
  padding: 6px 12px;
  margin-left: 10px;
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.button-link:hover,
.button-link:focus {
  background: rgba(0, 0, 0, 0.6);
  text-decoration: none;
}

.floating-about {
  position: fixed;
  top: 10px;
  right: 20px;
  z-index: 999;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85em;
  transition: background 0.2s ease;
}

.floating-about:hover,
.floating-about:focus {
  background: rgba(0, 0, 0, 0.6);
  text-decoration: none;
}

.floating-past {
  position: fixed;
  top: 10px;
  right: 80px;
  z-index: 999;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85em;
  transition: background 0.2s ease;
}

.floating-past:hover,
.floating-about:focus {
  background: rgba(0, 0, 0, 0.6);
  text-decoration: none;
}

#welcomeModal.hidden,
#pastListsModal.hidden {
  display: none !important;
  opacity: 0;
}



.modalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.2); /* <-- Light translucent overlay */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow-y: auto;
  backdrop-filter: blur(2px); /* Optional: subtle blur of background */
}



.modalBox {
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.3s ease-out;
}


#pastListsContent ul {
  text-align: left;
  padding-left: 1.2em;
  margin-top: 0.5em;
}

.close-button {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  color: white;
  font-size: 1.5em;
  border: none;
  cursor: pointer;
  z-index: 1;
}

.close-button {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  color: black;
  font-size: 2em;
  font-weight: bold;
  border: none;
  cursor: pointer;
  z-index: 1;
}

.close-button:hover,
.close-button:focus {
  color: #333;
}

.floating-about,
.floating-past {
  z-index: 5; /* Lower than controls */
}

@media (max-width: 600px) {
  .floating-about,
  .floating-past {
    position: static;
    display: inline-block;
    margin-top: 10px;
    margin-left: 0;
  }

  .floating-button-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    padding: 10px;
  }
}

/* Normal text links: unclicked = bold + white; clicked = light grey */
a:not(.button-link):not(.floating-about):not(.floating-past):not(#closeReview):not(.modal-link):link {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
}

a:not(.button-link):not(.floating-about):not(.floating-past):not(#closeReview):not(.modal-link):visited {
  color: #bbb; /* light grey */
  text-decoration: underline;
}

/* Optional: consistent hover/focus */
a:hover,
a:focus {
  text-decoration: none;
}
