* { box-sizing: border-box; }

:root {
  --c1: #7c3aed;
  --c2: #ec4899;
  --c3: #f59e0b;
  --ink: #1f2937;
  --paper: #ffffff;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}

body {
  min-height: 100dvh;
  background: linear-gradient(125deg, var(--c1), var(--c2), var(--c3), var(--c1));
  background-size: 400% 400%;
  animation: gradient-shift 18s ease infinite;
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.app {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.screen {
  width: 100%;
  max-width: 540px;
  text-align: center;
  color: var(--paper);
  display: none;
  animation: fade-in .4s ease both;
}

body.state-intro      .screen-intro      { display: block; }
body.state-processing .screen-processing { display: block; }
body.state-done       .screen-done       { display: block; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.title {
  font-size: clamp(2.5rem, 10vw, 4rem);
  margin: 0 0 .5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 20px rgba(0,0,0,.15);
}

.tagline {
  margin: 0 0 2.5rem;
  font-size: 1.1rem;
  opacity: .92;
}

.big-btn {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  padding: 1.15rem 2rem;
  font-size: 1.25rem;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  color: var(--c1);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.big-btn:hover  { transform: translateY(-2px) scale(1.02); box-shadow: 0 14px 36px rgba(0,0,0,.25); }
.big-btn:active { transform: translateY(0) scale(.99); }
.big-btn-emoji  { font-size: 1.5rem; }
.big-btn-secondary { background: rgba(255,255,255,.18); color: var(--paper); backdrop-filter: blur(6px); }

.ghost-btn {
  display: inline-block;
  margin-top: 1.5rem;
  padding: .6rem 1rem;
  background: transparent;
  border: 0;
  color: var(--paper);
  font-size: 1rem;
  text-decoration: underline;
  cursor: pointer;
  opacity: .9;
}
.ghost-btn:hover { opacity: 1; }

.spinner {
  font-size: 5rem;
  animation: bounce 1s infinite ease-in-out;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50%      { transform: translateY(-20px) rotate(5deg); }
}
.processing-text {
  font-size: 1.25rem;
  margin-top: 1.5rem;
}

.preview-wrap {
  margin: 0 auto 1.5rem;
  background: rgba(255,255,255,.15);
  padding: .75rem;
  border-radius: 1.25rem;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  backdrop-filter: blur(6px);
  display: inline-block;
}
#preview-img {
  max-width: min(70vw, 360px);
  max-height: 60vh;
  display: block;
  border-radius: .75rem;
}

.button-row {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.85);
  color: white;
  padding: .75rem 1.25rem;
  border-radius: .75rem;
  font-size: .95rem;
  max-width: 90vw;
  z-index: 10;
  animation: fade-in .2s ease both;
}
