:root {
  --pastel-yellow: #FFF4C4;
  --pastel-yellow-deep: #FFE9A0;
  --pastel-pink: #FFD6E8;
  --pastel-pink-deep: #FFB3D1;
  --accent-pink: #FF8FB8;
  --accent-yellow: #FFD65C;
  --text-dark: #6b4a4a;
  --white-soft: #FFFDF8;
  --shadow: 0 6px 18px rgba(180, 120, 140, 0.18);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(160deg, var(--pastel-yellow) 0%, var(--pastel-pink) 100%);
  background-attachment: fixed;
  color: var(--text-dark);
  min-height: 100vh;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.hero {
  text-align: center;
  padding: 24px 12px 16px;
}

.hero h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.5px;
}

.subtitle {
  margin: 8px 0 4px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent-pink);
}

.hint {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.85;
}

.upload-card {
  background: var(--white-soft);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

.upload-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  border: none;
  border-radius: 18px;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.12s ease, filter 0.12s ease;
  color: var(--text-dark);
}

.btn:active {
  transform: scale(0.97);
}

.btn .icon {
  font-size: 1.3rem;
}

.btn-pink {
  background: var(--pastel-pink-deep);
}

.btn-yellow {
  background: var(--pastel-yellow-deep);
}

.btn-solid {
  width: 100%;
  margin-top: 16px;
  background: linear-gradient(135deg, var(--accent-yellow), var(--accent-pink));
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.challenge-hint {
  text-align: center;
  font-size: 0.9rem;
  margin: 14px 0 0;
  opacity: 0.8;
}

.preview {
  margin-top: 18px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.preview-item {
  position: relative;
}

.preview-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid var(--pastel-yellow-deep);
  display: block;
}

.preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--accent-pink);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.status {
  margin-top: 14px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.status.success {
  color: #4a8a5f;
}

.status.error {
  color: #c0506a;
}

.gallery-section h2 {
  text-align: center;
  margin-bottom: 14px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  background: var(--white-soft);
}

.empty-state {
  text-align: center;
  opacity: 0.75;
  padding: 20px 0;
}

footer {
  text-align: center;
  margin-top: 32px;
  font-size: 0.85rem;
  opacity: 0.7;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(30, 15, 20, 0.9);
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox:not([hidden]) {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 14px;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--white-soft);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
}

.confetti-piece {
  position: fixed;
  top: -20px;
  width: 8px;
  height: 14px;
  z-index: 200;
  pointer-events: none;
  border-radius: 2px;
  animation-name: confetti-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(540deg);
    opacity: 0.9;
  }
}

.easter-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(20px);
  background: var(--white-soft);
  color: var(--text-dark);
  padding: 14px 22px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  font-weight: 700;
  text-align: center;
  z-index: 201;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 90vw;
}

.easter-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#easterEggTrigger {
  cursor: default;
  user-select: none;
}

@media (min-width: 420px) {
  .upload-buttons {
    flex-direction: row;
  }
}

@media (min-width: 600px) {
  .gallery,
  .preview-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
