:root {
  --primary-color: #FFFC00;
  --bg-dark: #131313;
  --bg-card: #1e1e1e;
  --bg-hover: #2a2a2a;
  --text-light: #e0e0e0;
  --border-radius: 16px;
  --transition: all 0.3s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  margin: 0;
  padding: 20px;
  text-align: center;
  color: var(--text-light);
  line-height: 1.6;
}

/* Heading */
h1 {
  text-align: center;
}

h1 span {
  color: var(--bg-dark);
  font-size: clamp(2rem, 5vw, 3.5rem);
  background-color: var(--primary-color);
  border-radius: 100px;
  display: inline-block;
  padding: 15px 30px;
  position: relative;
  box-shadow: 0 4px 15px rgba(255, 252, 0, 0.2);
  transition: var(--transition);
  max-width: min(90%, 600px);
  word-wrap: break-word;
  hyphens: auto;
  line-height: 1.2;
  width: fit-content;
}

h1 span::before {
  content: "";
  position: absolute;
  top: 0;
  left: -15px;
  right: -15px;
  height: 100%;
  background-color: #FFFC00;
  z-index: -1;
  border-radius: 100px;
  width: auto;
}

h1 span:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 252, 0, 0.3);
}

/* Upload Box */
.upload-box {
  border: 2px dashed rgba(255, 252, 0, 0.3);
  padding: 40px;
  margin: 30px auto;
  max-width: 600px;
  height: auto;
  border-radius: var(--border-radius);
  background: var(--bg-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: var(--transition);
}

.upload-box:hover {
  background-color: var(--bg-hover);
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

/* Buttons */
.button-73, .button-81, .download-btn {
  border: none;
  border-radius: 12px;
  cursor: pointer;
  padding: 12px 24px;
  font-weight: 600;
  transition: var(--transition);
  margin: 15px auto;
  display: inline-block;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.button-73 {
  background: linear-gradient(135deg, var(--primary-color), #FFE600);
  color: var(--bg-dark);
  box-shadow: 0 4px 15px rgba(255, 252, 0, 0.2);
}

.button-73:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 252, 0, 0.3);
}

.button-81, .download-btn {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.button-81:hover, .download-btn:hover {
  background-color: var(--primary-color);
  color: var(--bg-dark);
  transform: translateY(-2px);
}

/* ===== GALLERY FIXED VERSION ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin: 30px auto;
  padding: 0 10px;
  max-width: 1000px;
  justify-content: center;
}

.item {
  background-color: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  padding: 10px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
}

.item:hover {
  background-color: var(--bg-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.item img,
.item video {
  width: 100%;
  height: auto;
  max-height: 200px;
  border-radius: calc(var(--border-radius) - 4px);
  object-fit: cover;
  margin-bottom: 10px;
  display: block;
  box-sizing: border-box;
}

/* make download button slightly narrower so it never pokes out */
.download-btn {
  width: 90%;
  max-width: calc(100% - 12px);
  padding: 10px;
  font-size: 0.9rem;
  border-radius: 8px;
  text-align: center;
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-top: auto; /* push to bottom of the card when possible */
  box-sizing: border-box;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(8px);
  background-color: rgba(0,0,0,0.8);
}

.modal-content {
  background-color: var(--bg-card);
  color: var(--text-light);
  margin: 10% auto;
  padding: 30px;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 252, 0, 0.1);
}

.close {
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: var(--text-light);
  opacity: 0.7;
  transition: var(--transition);
}

.close:hover {
  color: var(--primary-color);
  opacity: 1;
}

/* Disclaimers */
.disclaimer {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  margin: 0;
  line-height: 1.5;
  max-width: 300px;
  width: 80%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 8px;
  z-index: 999;
  padding-right: 36px;
}

.disclaimer:first-of-type {
  bottom: 50px;
  margin-bottom: 30px;
}

.disclaimer:last-of-type {
  bottom: 15px;
}

.howto {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.howto:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.dismiss-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.2rem;
  line-height: 1;
  padding: 4px 8px;
  transition: var(--transition);
}

.dismiss-btn:hover {
  color: var(--primary-color);
}

/* Buy Me a Coffee */
#bmc-wbtn {
  transform: scale(1);
  transform-origin: bottom right;
  transition: var(--transition);
}

#bmc-wbtn:hover {
  transform: scale(1.1);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    max-width: 100%;
  }

  .item img,
  .item video {
    max-height: 160px;
  }

  .download-btn {
    font-size: 0.85rem;
    padding: 8px;
    width: 88%;
  }
}

@media (max-width: 480px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .item {
    padding: 8px;
  }

  .item img,
  .item video {
    max-height: 140px;
  }

  .download-btn {
    font-size: 0.8rem;
    padding: 8px;
    width: 85%;
  }
}

@media (max-width: 360px) {
  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }

  .item img,
  .item video {
    max-height: 120px;
  }

  .download-btn {
    font-size: 0.75rem;
    padding: 6px;
    width: 82%;
  }
}

/* iPhone notch fix */
@supports (padding: max(0px)) {
  body {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  .disclaimer {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
}
/* Disclaimers */
.disclaimer {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  margin: 0;
  line-height: 1.5;
  max-width: 300px;
  width: 80%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 8px;
  z-index: 99999; /* raised above Buy Me a Coffee widget */
  padding-right: 36px;
  pointer-events: auto; /* ensures clickability */
}

.disclaimer:first-of-type {
  bottom: 50px;
  margin-bottom: 30px;
}

.disclaimer:last-of-type {
  bottom: 15px;
}

/* Make sure the Buy Me a Coffee widget stays below */
#bmc-wbtn {
  position: fixed !important;
  bottom: 10px !important;
  right: 10px !important;
  z-index: 9990 !important; /* lower than disclaimer */
  transform: scale(1);
  transform-origin: bottom right;
  transition: var(--transition);
}

#bmc-wbtn:hover {
  transform: scale(1.1);
}