@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
    margin: 0;
          background: #f0f0f0;
    background-size: cover;
         font-family: Tahoma, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: -1;
}
html, body {
    overflow-x: hidden;
    max-width: 100%;
}
h1 {
    font-size: 24px;
    margin-top: 30px;
    text-shadow: 2px 2px #000;
}
@media (max-width: 768px) {
    .main-h {
        margin-left: 20px;
        margin-right: 20px;
    }
}
.header-box {
    background: #e5ddc3;
    padding: 15px;
    border: 3px solid #000;
    margin-top: 10px;
    box-shadow: 4px 4px #000;
    text-align: center;
}

.header-box h2 {
    font-size: 16px;
    margin: 0;
    margin-bottom: 10px;
    color: black;
}
@media (max-width: 768px) {
    .header-box {
    margin-left: 20px;
    margin-right: 20px;
}
}
.btn-main {
    background: #001f4d;
    color: white;
    border: 3px solid black;
    padding: 10px 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    box-shadow: 3px 3px #000;
}

.btn-main:hover {
    background: #003080;
}

.search-bar {
    margin: 20px;
    display: flex;
    justify-content: flex-end;
    width: 90%;
}

.search-bar input {
    padding: 5px;
    font-family: inherit;
    font-size: 10px;
    border: 2px solid black;
    background: #fff;
    width: 200px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px;
    padding: 30px;
    width: 90%;
    justify-items: center;
}

.gallery-item {
    background: #fff;
    border: 3px solid #000;
    text-align: center;
    padding: 5px;
    box-shadow: 2px 2px #000;
    cursor: pointer;
    width: 100%; 
    height: auto; 
}

.gallery-item img {
    width: 100%;
    background: white;
    border: 2px solid #000;
}

.gallery-item p {
    margin: 4px 0;
    font-size: 10px;
    color: black;
}
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr); 
        margin: 20px;
        width: 70vw;
    }
}
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #e5ddc3;
    padding: 15px;
    border: 3px solid #000;
    box-shadow: 4px 4px #000;
    width: 80%;
    text-align: center;
    display: flex;
    flex-direction: column;
}

#uploadModal .modal-content {
    display: flex;
    flex-direction: column; 
    gap: 15px;
    align-items: center;
}

#uploadModal .form-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
@media (max-width: 768px) {
    #uploadModal .form-row {
        flex-direction: column;
    }
}
#uploadModal input,
#uploadModal textarea,
#uploadModal button {
    height: 40px;
    font-size: 14px;
}

#uploadModal textarea {
    resize: none;
}
.modal img {
    max-width: 100%;
    border: 3px solid #000;
    background: white;
    margin-bottom: 10px;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 20px;
    cursor: pointer;
    color: black;
}
















.paint-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#paintCanvas {
    margin-top: auto;
    margin-bottom: auto;
    border: 3px solid #000;
    background: white;
    cursor: crosshair;
    width: 80vw;
    aspect-ratio: 2 / 1;
    height: auto;
}
.palette {
  display: grid;
  grid-template-columns: repeat(10, 24px);
  gap: 6px;
  padding: 6px 0;
}

.swatch {
  width: 24px;
  height: 24px;
  border: 2px solid #000;
  box-shadow: inset 1px 0 0 black, inset 0 1px 0 black;
  padding: 0;
  cursor: pointer;
  outline: none;  
  background-color: var(--swatch-color, #000);
}
.swatch.active {
  outline: 2px solid #fff;          
  box-shadow: 0 0 0 2px #1d3e74;     
}


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

.tools label {
    font-size: 10px;
    color: black;
}
.modal-close {
    background: #001f4d;
    color: white;
    border: 2px solid black;
    font-family: inherit;
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    box-shadow: 2px 2px #000;
    margin-bottom: 10px;
    margin-left: auto;
    width: 150px;
}

.modal-close:hover {
    background: #003080;
}


.workarea {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #d4d0c8;
}
.toolbox {
  width: 43px;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: #d4d0c8;
  border: 2px solid #808080;
  box-shadow: inset 0 1px #fff, inset -1px -1px #808080;
  padding: 8px;
}
.tool {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  padding: 0;
  padding-left: 2.5px;
  height: 20px;
  width: 20px;
  background: linear-gradient(#ffffff, #cfcfcf);
  border: 1px solid #808080;
  box-shadow: inset 0 1px #fff, inset 0 -1px #999;
  cursor: pointer;
  font-family: Tahoma, sans-serif;
  user-select: none;
}
.tool img { width: 15px; height: 15px; object-fit: contain; }
.tool:hover { background: linear-gradient(#ffffff, #dcdcdc); }
.tool:active { box-shadow: inset 0 -1px #fff, inset 0 1px #999; }

.tool.active {
  border: 1px inset #808080;
  background: #d4d0c8;
}

.tool.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.work-top{
  display: flex;
  align-items: flex-start;
  background: #d4d0c8;
}
.work-bottom{
    margin-left: 10px;
}

.toolbar {
      background: linear-gradient(to bottom, #f0f0f0, #cfcfcf);
      border-bottom: 2px solid #999;
      display: flex;
      padding: 3px;
      align-items: center;
      gap: 20px;
      width: 100%;
      padding-left: 10px;
 }

.toolbar img {
      width: 20px;
      height: 20px;
}
    .toolbar span:hover{
        background-color: #8f8f8f;
        cursor: pointer;
    }