* {
  outline: 0;
  padding: 0;
  margin: 0;
  border: 0;
  box-sizing: border-box;
  user-select: none;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

html {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: "Inter", sans-serif;
  background-image: url("https://res.cloudinary.com/dliqaq40z/image/upload/v1753609285/pattern_fupftu.png");
  background-repeat: repeat;
  background-size: 250px 250px;
  margin: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  overflow-x: hidden;
  position: relative;
  justify-content: center;
}

/* ===== FONTS ===== */
@font-face {
  font-family: "Lazydog";
  font-style: normal;
  font-weight: normal;
  src: url("fonts/Lazydog.woff") format("woff");
}

a {
  text-decoration: none;
  color: inherit;
}

h1 {
  font-family: "Lazydog", sans-serif;
  font-weight: 800;
  font-size: 36px;
  color: #191d1b;
  margin-bottom: 16px;
  margin-top: 16px;
}

.img {
  max-width: 200px;
  height: auto;
  margin-bottom: 16px;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.button-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.social-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.social-icon {
  width: 40px;
  height: 40px;
  background: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.social-icon:hover {
  transform: translateY(-2px) scale(1.05);
  background: #ff8080;
}

.social-icon:active {
  background: #ff7373;
  transform: translateY(-1px) scale(1.05);
}

.background-fade {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    #eaeef2 100%
  );
}

/* Button Base Styles */
button,
.u-button,
.p-button {
  cursor: pointer;
  background: none;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  font-weight: 600;
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
}

/* Button ::before pseudo-element (combined) */
button::before,
.u-button::before,
.p-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 100%
  );
  opacity: 0.7;
  pointer-events: none;
  transition: left 0.5s;
}

button:hover:not(:disabled)::before,
.u-button:hover::before,
.p-button:hover::before {
  left: 130%;
  transition: left 0.7s cubic-bezier(0.4, 1, 0.7, 1);
}

/* Default Button */
button {
  background: #ff8d8d;
  color: #fff;
}

button:hover:not(:disabled) {
  background: #ff8080;
}

button:active:not(:disabled) {
  background: #ff7373;
  transform: translateY(1px);
}

/* Upload Button */
.u-button {
  background: #4a5568;
  color: #fff;
  display: inline-block;
}

.u-button:hover {
  background: #2d3748;
}

.u-button:active {
  background: #1a202c;
  transform: translateY(1px);
}

/* Pink Button */
.p-button {
  background: #ff8d8d;
  color: #fff;
  display: inline-block;
  text-decoration: none;
}

.p-button:hover {
  background: #ff8080;
  text-decoration: none;
}

.p-button:active {
  background: #ff7373;
  transform: translateY(1px);
}

/* Disabled state for all buttons */
button:disabled,
.u-button:disabled,
.p-button:disabled {
  background: #aab1bb;
  color: #6a7483;
  cursor: not-allowed;
}

/* Special button styles */
#startover-btn,
#resetstickers-btn {
  background: #4a5568;
}

#startover-btn:hover:not(:disabled),
#resetstickers-btn:hover:not(:disabled) {
  background: #2d3748;
}

#startover-btn:active:not(:disabled),
#resetstickers-btn:active:not(:disabled) {
  background: #1a202c;
  transform: translateY(1px);
}

#startover-btn:disabled,
#resetstickers-btn:disabled {
  background: #aab1bb;
  color: #6a7483;
  cursor: not-allowed;
}

/* Sticker Gallery */
.sticker-gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#sticker-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  max-width: 560px;
}

.sticker-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  object-position: center;
  background: #f7faff00;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border 0.2s;
  display: inline-block;
  transition: all 0.2s ease;
}

.sticker-thumb:hover {
  background: #fdfeff;
  border: 1px solid #d8d8d8;
  transform: scale(1.1);
  transform: translateY(-4px);
}

/* Canvas */
.canvas-container {
  background: #f7faff;
  border: 1px solid #dadfe4;
  border-radius: 28px;
  padding: 8px;
}

#canvas {
  display: block;
  background: #e2e6eb;
  max-width: 100%;
  border-radius: 20px;
  position: relative;
}

#canvas.loading {
  background: linear-gradient(90deg, #e2e6eb 25%, #f0f2f5 50%, #e2e6eb 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.sticker-control {
  position: absolute;
  pointer-events: none;
}

.sticker-handle,
.sticker-rotate,
.sticker-remove {
  position: absolute;
  width: 24px;
  height: 24px;
  background: #fff;
  border: 2px solid #2563ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  pointer-events: auto;
  z-index: 10;
}

.sticker-rotate {
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffe066;
}

.sticker-handle {
  right: -12px;
  bottom: -12px;
  background: #d1ffd6;
}

.sticker-remove {
  top: -12px;
  right: -12px;
  background: #ff6b6b;
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  border-radius: 50%;
}

/* Form Elements */
.border-box {
  background: #fdfeff48;
  border: 1px solid #d8d8d8;
  border-radius: 12px;
  padding: 8px;
  margin: 0;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 8px;
}

.border-box button:disabled {
  background: #aab1bb;
  color: #6a7483;
  cursor: not-allowed;
}

.twitter-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.border-box input[type="text"] {
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 500;
  border: 1px solid #d8d8d8;
  font-size: 14px;
  font-family: "Inter", sans-serif;
  width: 200px;
  color: #191d1b;
}

.border-box input[type="text"]:disabled {
  background: #aab1bb;
  color: #6a7483;
  cursor: not-allowed;
}

.border-box button {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: #ff8d8d;
  color: #fff;
  font-size: 14px;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.border-box button:hover:not(:disabled) {
  background: #ff8080;
}

.border-box button:active:not(:disabled) {
  background: #ff7373;
  transform: translateY(1px);
}

/* Text Elements */
.sticker-label {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 500;
  color: #5b5f5f;
  font-family: "Sour Gummy", sans-serif;
}

.disclaimer {
  text-align: center;
  color: #a9adaf;
  font-size: 14px;
  max-width: 550px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-family: "Inter", sans-serif;
}

.color-picker-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
  margin-bottom: 16px;
}

.color-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-sizing: border-box;
  cursor: pointer;
  opacity: 1;
  box-shadow: 0 0 0 2px transparent;
  transition: box-shadow 0.2s, border 0.2s;
}

.color-circle.selected {
  box-shadow: 0 0 0 2px #ff8d8d;
  z-index: 1;
}

/* Responsive Design */
@media (max-width: 570px) {
  .container {
    width: 100%;
  }

  h1 {
    text-align: center;
    width: 100%;
    font-size: 28px;
  }

  .img {
    max-width: 150px;
  }

  .button-row {
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .p-button {
    width: 100%;
  }

  .disclaimer {
    max-width: 80%;
  }

  .twitter-inputs {
    flex-direction: column;
    gap: 8px;
  }

  .twitter-inputs input[type="text"] {
    width: 100%;
  }

  .twitter-inputs button {
    width: 100%;
  }

  .u-button {
    width: 100%;
  }

  .border-box button {
    width: 100%;
  }

  #sticker-panel {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
  }

  .sticker-thumb {
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
  }
}
