body {
  background-color: rgb(248, 165, 223);
  margin: 0px;
  padding: 0px;
  display: flex;
  flex-direction: column;
}

.container {
  display: flex;
  justify-content: center;
  flex-direction: row;
}
.mainbox {
  background-color: hotpink;
  width: 1000px;
  height: 40px;
  border: 2px black;
  border-style: solid;
  justify-content: center;
  align-items: center;
  display: flex;
  flex-grow: 1;
  margin: 5px;
}
.middletext {
  display: flex;
  background-color: rgb(255, 79, 158);
  border: 2px black;
  border-style: solid;
  font-weight: bold;
  font-size: 40px;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
}

p {
  margin: 0;
  padding: 0;
}

a {
  color: black;
  text-decoration: none;
  display: flex;
}

ul {
  list-style-type: none;
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

.photospagephotos ul {
  gap: 3px;
}

.right-links {
  margin-right: auto;
  padding: 15px;
}
.left-links {
  margin-left: auto;
  padding: 15px;
}
img.mainpagephoto {
  height: 378px;
  border: 2px;
  border-style: solid;
  flex-shrink: 1;
  margin: 10px;
  margin-left: 5px;
  margin-right: 5px;
}

.image-text-container {
  display: flex;
  justify-content: flex-start;
  flex-grow: 1;
  flex: 1;
  font-size: 21px;
  margin-right: 5px;
  margin-left: 5px;
}

.image-text-container p {
  align-items: center;
  margin-top: 10px;
}

.SidePagePhotos {
  display: flex;
  flex-direction: column;
  margin: 5px;
  margin-right: 8px;
}

.SidePageBigText {
  font-size: 45px;
  font-weight: bold;
  margin: 5px;
}

.photospagephotos {
  display: flex;
  height: 100%;
  width: 100%;
  flex-wrap: wrap;
  flex-direction: column;
}

.photospagephotos li {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex-wrap: wrap;
}

.singular-photo-ppage {
  width: 100%;
  height: auto;
  border: 2px black solid;
  flex: 1;
}

.subtextforphotospage {
  margin-bottom: 10px;
}

.footer {
  display: flex;
  background-color: rgb(127, 64, 96);
  width: 100%;
  height: 20px;
  margin: 0;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  gap: 5px;
  border: 2px black solid;
  border-bottom: 0px;
  border-right: 0;
  border-left: 0;
}

.leftfooter {
  font-size: 10px;
  font-weight: lighter;
}

.memorybox {
  display: flex;
  flex-direction: column;
  margin: 5px;
  width: auto;
  align-items: center;
}

.memoryboxheadertext {
  font-size: 20px;
  background-color: rgb(158, 63, 111);
  border: 2px black solid;
  width: 98%;
  display: flex;
  font-weight: bold;
  justify-content: space-between;
  padding-left: 2px;
  padding-right: 5px;
  align-items: center;
  margin-bottom: 0;
}

.memoryboxphotosandtext {
  display: flex;
  flex-direction: column;
  border: 2px black solid;
  border-top: 0px;
  background-color: rgba(0, 0, 0, 0.183);
  height: auto;
  width: 100%;
  margin: 5px;
  margin-top: 0px;
  flex-wrap: wrap;
  justify-content: center;
}

.memoryboxtext {
  background-color: rgb(158, 63, 111);
  font-size: 16px;
  width: 100%;
}

.memoryboxphoto {
  display: flex;
  height: auto;
  width: 100%;
  flex-wrap: wrap;
  flex-direction: row;
  border-bottom: 1px black solid;
  margin-top: 0px;
}

.miniphoto {
  width: 50%;
  margin-top: 0px;
}

/* Grid Container for Pixel Art */
.grid-container {
  display: flex;
  flex-wrap: wrap;
  width: 500px;
  height: 500px;
  margin: 20px auto;
  background-color: white;
  border: 10px solid #333;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

/* Individual Grid Cells */
.cell {
  box-sizing: border-box; /* Ensure padding/border doesn't affect width */
  margin: 0;
  padding: 0;
  /* border: 1px solid rgba(0, 0, 0, 0.05); Optional: subtle grid lines */
}

/* Ensure controls are centered better if needed */
.content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}

.tools {
  margin: 10px 0;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* --- Pixel Art Tool Styles (Ported) --- */

.pixel-art-wrapper {
  /* Scope the dark theme here or finding a way to blend it */
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  background-color: transparent;
  padding: 20px;
  border-radius: 10px;
  width: fit-content;
  margin: 20px auto;
  color: black;
}

.pixel-header {
  font-weight: bold;
  font-size: 35px;
  text-align: center;
  width: 100%;
  margin-bottom: 20px;
}

.grid-container {
  display: flex;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  background-color: #222;
  width: 500px; /* Fixed size for desktop default */
  height: 500px;
  flex-wrap: wrap;
  margin: 0 auto 20px auto;
  touch-action: none;
  border: 4px solid #444;
}

.pixel-tools {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  margin-top: 20px;
  width: 100%;
}

.pixel-tools > :nth-child(1) {
  justify-self: end;
}
.pixel-tools > :nth-child(2) {
  justify-self: center;
}
.pixel-tools > :nth-child(3) {
  justify-self: start;
}

.pixel-btn,
.pixel-tools button {
  background-color: rgb(255, 79, 158);
  color: black;
  padding: 0 15px;
  height: 50px;
  border: 2px solid black;
  font-weight: bold;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pixel-btn:hover,
.pixel-tools button:hover {
  border-color: black;
  background-color: rgb(205, 29, 108);
  color: white;
}

#eraserBtn.active {
  background-color: white;
  color: black;
  border-color: white;
}

#resetBtn {
  margin-top: 20px;
  width: 150px;
  /* border-color removed to inherit black from pixel-btn */
}

#resetBtn:hover {
  background-color: #d32f2f;
  border-color: #d32f2f;
}

#colorPicker {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 50px;
  height: 50px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

#colorPicker::-webkit-color-swatch-wrapper {
  padding: 0;
}
#colorPicker::-webkit-color-swatch {
  border: 1px solid rgb(120, 120, 120);
}
#colorPicker::-moz-color-swatch {
  border: 1px solid rgb(120, 120, 120);
}

.pixel-footer {
  margin-top: 20px;
  color: black;
  display: flex;
  justify-content: center;
  width: 100%;
}

/* Ensure cells work correctly */
.grid-container .cell {
  border: 1px solid white; /* Repo style */
  flex-wrap: wrap;
  display: flex;
  box-sizing: border-box;
}

.grid-container .cell:hover {
  background-color: rgb(107, 107, 107); /* Repo hover effect */
}

/* Responsive tweak */
@media (max-width: 600px) {
  .grid-container {
    width: 90vw;
    height: 90vw;
  }
}
