:root {
  --primary: #2ecc71;
  --primary-dark: #27ae60;
  --bg: #f0fdf4;
  --text: #1f2937;
  --muted: #6b7280;
  --card: #ffffff;
  --shadow: 0 16px 40px rgba(22, 163, 74, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Hind Siliguri", sans-serif;
}

body {
  background: #f0fdf4;
  color: var(--text);
}

.container {
  max-width: 700px;
  margin: 32px auto 64px;
  padding: 24px 18px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: var(--shadow);
}
:root {
  --primary: #2ecc71;
  --primary-dark: #27ae60;
  --bg: #f0fdf4;
  --text: #1f2937;
  --muted: #6b7280;
  --shadow: 0 18px 40px rgba(22, 163, 74, 0.14);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Hind Siliguri", sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 650px;
  margin: 20px auto;
  padding: 24px 20px 30px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero {
  text-align: center;
}

.hero h1 {
  font-size: clamp(22px, 3.2vw, 30px);
  font-weight: 700;
  margin-bottom: 8px;
  animation: floatText 3.6s ease-in-out infinite;
  will-change: transform;
}

.hero p {
  font-size: 15px;
  color: var(--muted);
  animation: floatText 4.2s ease-in-out infinite;
  will-change: transform;
}

.canvas-section {
  display: grid;
  place-items: center;
}

.canvas-wrapper {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  background: #1f9f5c;
  transition: transform 0.2s ease;
}

canvas {
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: #ffffff;
  display: block;
  box-shadow: inset 0 0 0 1px #e5e7eb;
  touch-action: none;
}

.section-title {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  animation: floatText 4.8s ease-in-out infinite;
  will-change: transform;
}

.carousel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.nav-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: var(--primary-dark);
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 10px 16px rgba(15, 23, 42, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: floaty 2.8s ease-in-out infinite;
}

.nav-arrow:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 20px rgba(15, 23, 42, 0.18);
}

.thumb-viewport {
  flex: 1;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.thumb-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px;
  scroll-behavior: smooth;
  justify-content: center;
}

.thumb-list::-webkit-scrollbar {
  height: 0;
}

.thumb {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: #ecfdf3;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px #d1fae5;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.thumb:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 16px rgba(16, 185, 129, 0.18);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb.active {
  border: 3px solid var(--primary);
}

.thumb.active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(16, 185, 129, 0.15);
}

.controls {
  display: grid;
  gap: 14px;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.button-row.center {
  justify-items: center;
}

.ghost-btn {
  width: 100%;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #111827;
  border-radius: 12px;
  padding: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  animation: breathe 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.ghost-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 16px rgba(15, 23, 42, 0.12);
}

.ghost-btn.copied {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.upload-btn {
  width: 100%;
  border: 1px solid var(--primary);
  background: #ecfdf3;
  color: var(--primary-dark);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  animation: breathe 2.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 16px rgba(16, 185, 129, 0.18);
}

.slider-block {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  color: #0f172a;
}

.slider-block input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.download-btn {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 14px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 25px rgba(46, 204, 113, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: pulseColor 2.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.15);
  }
}

@keyframes pulseColor {
  0%,
  100% {
    background: #2ecc71;
    box-shadow: 0 12px 25px rgba(46, 204, 113, 0.25);
  }
  50% {
    background: #1f9f5c;
    box-shadow: 0 18px 34px rgba(31, 159, 92, 0.45);
  }
}

@keyframes floatText {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(46, 204, 113, 0.28);
}

.hashtags {
  display: grid;
  gap: 10px;
}

.hashtag-card {
  display: grid;
  gap: 10px;
  background: #f9fffb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
}

#captionText {
  width: 100%;
  border: none;
  resize: none;
  background: transparent;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}

#captionText:focus {
  outline: none;
}

@media (max-width: 720px) {
  .container {
    margin: 16px auto;
    padding: 20px 14px 26px;
  }

  .button-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
