/* -----------------------------------------------------
   NakedButtz.org  –  Family-friendly cheeky fun!
   ----------------------------------------------------- */

/* === Base Layout === */
html, body {
  margin: 0;
  padding: 0;
  font-family: "Comic Sans MS", "Poppins", sans-serif;
  background: #fffaf3;
  color: #333;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
}

/* === Header & Footer === */
header, footer {
  width: 100%;
  text-align: center;
  padding: 12px 0;
  background: #ffe6d4;
  color: #5a4030;
  font-weight: bold;
  letter-spacing: 0.5px;
}

header img.logo {
  height: 80px;
  width: auto;
  margin: 4px auto;
  display: block;
}

/* === Tagline === */
.tagline {
  font-size: 1rem;
  color: #8c6b52;
  margin: 4px 0 10px;
  font-style: italic;
}

/* === Image Display Area === */
#buttContainer {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 800px;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
}

/* --- Fade-in animation --- */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1); }
}

.fade-in {
  animation: fadeIn 0.6s ease-in-out both;
}

#buttImage {
  width: 100%;
  height: auto;
  max-width: 800px;
  max-height: 800px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  background: #fff;
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

/* === Caption === */
#caption {
  font-size: 1.1rem;
  color: #444;
  margin: 10px auto;
  padding: 0 12px;
  max-width: 600px;
  opacity: 0;
  animation: fadeIn 1s ease forwards;
  animation-delay: 0.3s;
}

/* === Buttons === */
button, .button {
  background: #ffbfa3;
  border: none;
  border-radius: 10px;
  color: #3a2a20;
  font-size: 1rem;
  font-weight: bold;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

button:hover, .button:hover {
  background: #ff9f80;
  transform: scale(1.04);
}

/* === Upload Zone === */
.upload-area {
  border: 2px dashed #ff9f6e;
  border-radius: 14px;
  padding: 20px;
  margin: 12px auto;
  width: 80%;
  max-width: 500px;
  background: linear-gradient(180deg, #fff2e6 0%, #ffe5d1 100%);
  color: #a44b2f;
  text-align: center;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 15px rgba(255, 165, 120, 0.3);
}

.upload-area:hover {
  background: linear-gradient(180deg, #ffe3cb 0%, #ffd1a3 100%);
  border-color: #ff7a33;
  box-shadow: 0 0 15px rgba(255, 136, 64, 0.5);
}

.upload-area.dragover {
  background: linear-gradient(180deg, #ffdcb8 0%, #ffc799 100%);
  border-color: #ff6f00;
  color: #5a2c00;
  box-shadow: 0 0 20px rgba(255, 111, 0, 0.5);
}

/* -----------------------------------------------------
   Desktop Layout (≥1024 px) — Full 800×800 viewport
   ----------------------------------------------------- */
@media (min-width: 1024px) {
  html, body {
    height: 100vh;
    overflow: hidden;
  }

  #buttContainer {
    width: 800px;
    height: 800px;
  }

  #buttImage {
    width: 100%;
    height: auto;
  }

  header, footer {
    padding: 12px 0;
    font-size: 1rem;
  }
}

/* -----------------------------------------------------
   Mobile / Tablet (≤768 px)
   ----------------------------------------------------- */
@media (max-width: 768px) {

  html, body {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
  }

  header, footer {
    padding: 6px 10px;
    font-size: 0.9rem;
  }

  .tagline {
    display: none !important;
  }

  header img.logo {
    height: 50px;
  }

  /* Container relaxes so image can resize freely */
  #buttContainer {
    width: 100vw;
    height: auto;
    max-height: 85vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
    padding: 0;
  }

  /* Image auto-scales to fit viewport */
  #buttImage {
    max-width: 80vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
  }

  #caption {
    font-size: 0.95rem;
    padding: 0 8px;
    max-width: 90vw;
  }

  button, .button {
    font-size: 0.9rem;
    padding: 6px 14px;
  }

  textarea, input[type="text"] {
    font-size: 0.9rem;
    min-height: 2.5em;
    max-height: 3em;
    line-height: 1.2em;
    resize: vertical;
  }

  .upload-area {
    width: 90%;
    padding: 10px;
  }
}
