/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

html {
  width: 100%;
  /* No height here to avoid clipping */
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: #f5f5f5;
  min-height: 100dvh; /* Dynamic viewport height for Chrome mobile */
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto; /* Enable vertical scrolling */
  font-size: clamp(0.9375rem, 1.5vw, 1.125rem); /* Responsive font size */
  line-height: 1.6;
  scroll-behavior: smooth;
  padding-top: env(safe-area-inset-top, 0px); /* Safe area for notches/status bar with fallback 0 */
  margin: 0; /* Reset default margin */
}

.container {
  max-width: 1000px;
  width: 90%;
  margin: 40px auto;
  background: #c1e899;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
  text-align: center;
}

/* Headings */
h1 {
  margin-bottom: 10px;
  color: #004b24;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
}

h5 {
  margin-bottom: 20px;
  font-size: clamp(1rem, 3vw, 1.5rem);
}

/* Input */
input[type="text"] {
  width: 70%;
  padding: 12px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

/* Buttons */
.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.color-button {
  font-family: 'Roboto', sans-serif;
  padding: 12px;
  font-size: clamp(1rem, 2vw, 1.2rem);
  border: none;
  border-radius: 8px;
  background: #4CAF50;
  color: white;
  cursor: pointer;
  transition: background 0.3s ease;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

#dc {font-family:Arial, sans-serif;}
#facebook{color:#ff7f50;}

.color-button.active {
  background-color: red !important;
}

.color-button:hover {
  background: blue;
}

/* RESPONSE BOX - Scrollable with internal top button */
#responseBox {
  margin-top: 20px;
  padding: 12px;
  background-color: black;
  border: 1px solid #ccc;
  border-radius: 10px;
  text-align: left;
  color: white;
  font-size: clamp(0.9rem, 1vw, 1.1rem);
  font-family: 'Roboto', sans-serif;
  white-space: normal;
  overflow-y: auto;
  max-height: 500px;
  position: relative; /* for positioning the internal top button */
}

/* Internal scroll-to-top button inside responseBox */
#responseTopButton {
  position: sticky;
  bottom: 10px;
  right: 10px;
  z-index: 100;
  padding: 8px 12px;
  font-size: 16px;
  border: none;
  border-radius: 50%;
  background-color: #4CAF50;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

#responseBox::-webkit-scrollbar {
  width: 10px;
}

#responseBox::-webkit-scrollbar-track {
  background: #333; /* Dark track */
  border-radius: 10px;
}

#responseBox::-webkit-scrollbar-thumb {
  background-color: yellow; /* Yellow scrollbar */
  border-radius: 10px;
  border: 2px solid #333; /* Padding around thumb */
}

/* Firefox support */
#responseBox {
  scrollbar-width: thin;
  scrollbar-color: yellow #46f087;
}

#responseBox::-webkit-scrollbar-thumb:hover {
  background-color: gold;
}

/* Show button when visible */
#responseTopButton.visible {
  opacity: 1;
  visibility: visible;
}

/* FOOTER */
.footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #ccc;
  background-color: #f9f9f9;
  text-align: center;
}

.footer p {
  margin-bottom: 10px;
  color: #444;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

/* AD CONTAINER */
.ad-container {
  width: 100%;
  max-width: 728px;
  margin: 0 auto;
}

ins.adsbygoogle {
  display: block !important;
  margin: 0 auto !important;
  float: none !important;
}

/* FLOATING TOP BUTTON for whole page */
#pageTopButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  padding: 12px 16px;
  font-size: 20px;
  border: none;
  border-radius: 50%;
  background-color: #4CAF50;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease, transform 0.2s ease;
  pointer-events: auto;
}

#pageTopButton:hover {
  background-color: #3e8e41;
  transform: scale(1.1);
}
