@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700&family=Fredoka:wght@400;500;600&display=swap');

:root {
  color-scheme: light;
  font-family: 'Fredoka', 'Baloo 2', 'Segoe UI', sans-serif;
  --clr-bg: #fff7fb;
  --clr-bg-accent: #f3f8ff;
  --clr-card: #ffffff;
  --clr-primary: #ff7ab8;
  --clr-primary-dark: #ff4da0;
  --clr-secondary: #5cc8ff;
  --clr-secondary-dark: #36adff;
  --clr-text: #2b2250;
  --clr-muted: #7c6fa6;
  --clr-border: #f4e8ff;
  --clr-shadow: rgba(129, 92, 246, 0.18);
  --clr-success: #38d997;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 3rem 1rem;
  background: radial-gradient(circle at 15% 20%, rgba(255, 214, 102, 0.38) 0, transparent 60%),
    radial-gradient(circle at 85% 15%, rgba(92, 200, 255, 0.35) 0, transparent 58%),
    radial-gradient(circle at 20% 80%, rgba(161, 255, 246, 0.4) 0, transparent 54%),
    var(--clr-bg);
  color: var(--clr-text);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at 10% 10%, rgba(255, 122, 184, 0.12) 0, rgba(255, 122, 184, 0) 60%),
    radial-gradient(circle at 90% 65%, rgba(92, 200, 255, 0.12) 0, rgba(92, 200, 255, 0) 60%);
  pointer-events: none;
  z-index: -1;
}

.container {
  position: relative;
  max-width: 960px;
  width: 100%;
  background: var(--clr-card);
  border: 3px solid var(--clr-border);
  border-radius: 32px;
  padding: 2.75rem 2.5rem;
  box-shadow: 0 25px 60px -25px var(--clr-shadow);
  overflow: hidden;
}

.floating-bubble {
  position: absolute;
  border-radius: 50%;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.floating-bubble--one {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 122, 184, 0.45) 0, rgba(255, 122, 184, 0) 70%);
  top: -80px;
  right: -60px;
}

.floating-bubble--two {
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(92, 200, 255, 0.45) 0, rgba(92, 200, 255, 0) 70%);
  bottom: -90px;
  left: -40px;
}

.app-header {
  position: relative;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  z-index: 1;
}

.app-header__badge {
  align-self: flex-start;
  background: linear-gradient(135deg, #ff9acb, #ffd166);
  color: #5a1a5d;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  box-shadow: 0 12px 20px -10px rgba(255, 122, 184, 0.4);
}

.app-header__meta {
  flex: 1;
}

.app-header h1 {
  margin: 0 0 0.5rem;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  font-size: clamp(2.1rem, 4vw, 2.8rem);
  letter-spacing: 0.01em;
}

.app-header p {
  margin: 0 0 1.25rem;
  line-height: 1.6;
  color: var(--clr-muted);
  font-size: 1rem;
}

.app-header__steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

.app-header__steps li {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background: rgba(92, 200, 255, 0.12);
  border-radius: 16px;
  padding: 0.65rem 1rem;
  font-weight: 500;
}

.step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffd166;
  color: #5a1a5d;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.app-header button.secondary {
  align-self: center;
  white-space: nowrap;
}

button {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  padding: 0.7rem 1.65rem;
  background: linear-gradient(135deg, var(--clr-secondary), var(--clr-secondary-dark));
  color: #0b2d4d;
  box-shadow: 0 12px 24px -16px rgba(92, 200, 255, 0.65);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -16px rgba(92, 200, 255, 0.7);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

button:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid rgba(92, 200, 255, 0.6);
  outline-offset: 2px;
}

#browse-btn {
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-dark));
  color: #fff;
  box-shadow: 0 14px 30px -16px rgba(255, 122, 184, 0.65);
}

#browse-btn:hover {
  box-shadow: 0 20px 32px -18px rgba(255, 122, 184, 0.7);
}

.primary {
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-dark));
  color: #fff;
  padding: 0.75rem 1.8rem;
  box-shadow: 0 12px 24px -12px rgba(255, 122, 184, 0.6);
}

.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -12px rgba(255, 122, 184, 0.65);
}

.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.secondary {
  background: rgba(92, 200, 255, 0.18);
  color: var(--clr-secondary-dark);
  padding: 0.65rem 1.5rem;
  box-shadow: 0 8px 18px -12px rgba(92, 200, 255, 0.55);
}

.secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(92, 200, 255, 0.28);
}

.input-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  z-index: 1;
}

.drop-zone {
  background: rgba(243, 248, 255, 0.85);
  border: 3px dashed rgba(92, 200, 255, 0.45);
  border-radius: 22px;
  padding: 2.25rem 2rem;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.drop-zone.active {
  transform: translateY(-3px);
  border-color: rgba(255, 122, 184, 0.7);
  box-shadow: 0 14px 28px -18px rgba(255, 122, 184, 0.6);
}

.drop-zone__title {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--clr-primary-dark);
}

.drop-zone__subtitle {
  margin: 0 0 1.4rem;
  line-height: 1.6;
  color: var(--clr-muted);
}

.drop-zone__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
}

.tips {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--clr-muted);
  font-size: 0.98rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tips strong {
  color: var(--clr-primary-dark);
}

.previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.1rem;
}

.previews .status-message {
  grid-column: 1 / -1;
  text-align: center;
  font-weight: 600;
  color: var(--clr-muted);
}

.preview-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(255, 122, 184, 0.2);
  box-shadow: 0 12px 24px -18px rgba(90, 26, 93, 0.35);
}

.preview-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.preview-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  color: var(--clr-text);
  background: rgba(243, 248, 255, 0.92);
}

.preview-card footer button {
  background: rgba(255, 122, 184, 0.16);
  color: var(--clr-primary-dark);
  border-radius: 12px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.preview-card footer button:hover {
  background: rgba(255, 122, 184, 0.28);
}

.prompt-playground {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.prompt-playground__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.prompt-playground__header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  color: var(--clr-primary-dark);
}

.prompt-playground__header p {
  margin: 0;
  flex: 1 1 240px;
  color: var(--clr-muted);
  font-size: 0.95rem;
}

.prompt-playground__nav {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.prompt-nav {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(92, 200, 255, 0.6);
  background: rgba(243, 248, 255, 0.9);
  color: var(--clr-primary-dark);
  font-size: 1.1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.prompt-nav:hover {
  background: rgba(255, 122, 184, 0.18);
  transform: translateY(-1px);
}

.prompt-carousel {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.prompt-carousel::-webkit-scrollbar {
  height: 8px;
}

.prompt-carousel::-webkit-scrollbar-thumb {
  background: rgba(92, 200, 255, 0.45);
  border-radius: 999px;
}

.prompt-carousel.is-locked {
  pointer-events: none;
  touch-action: none;
}

.prompt-carousel.is-locked .prompt-card {
  cursor: default;
}

.prompt-card[disabled] {
  cursor: default;
}

.prompt-card {
  flex: 0 0 170px;
  border: none;
  border-radius: 22px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 24px -18px rgba(42, 31, 104, 0.55);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
  color: var(--clr-text);
}

.prompt-card:hover,
.prompt-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 12px 34px -16px rgba(255, 122, 184, 0.55);
  outline: none;
}

.prompt-card.is-selected {
  box-shadow: 0 12px 34px -16px rgba(255, 122, 184, 0.55);
  border: 2px solid rgba(255, 122, 184, 0.55);
  transform: translateY(-4px);
}

.prompt-card__art {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--prompt-card-start, rgba(255, 227, 252, 0.9)), var(--prompt-card-end, rgba(210, 235, 255, 0.9)));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(255, 255, 255, 0.75);
}

.prompt-card__badge {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--clr-primary-dark);
}

.prompt-card__badge-image {
  width: 72%;
  height: 72%;
  object-fit: contain;
  display: block;
}

.prompt-card__label {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--clr-primary-dark);
}

.prompt-card__hint {
  font-size: 0.85rem;
  color: var(--clr-muted);
  line-height: 1.4;
}


.prompt-label {
  font-weight: 600;
  color: var(--clr-primary-dark);
}

textarea {
  resize: vertical;
  min-height: 110px;
  border-radius: 18px;
  border: 2px solid rgba(92, 200, 255, 0.35);
  padding: 1rem 1.1rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6;
  background: rgba(243, 248, 255, 0.85);
  color: var(--clr-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea::placeholder {
  color: rgba(124, 111, 166, 0.7);
}

textarea:focus {
  outline: none;
  border-color: rgba(255, 122, 184, 0.6);
  box-shadow: 0 0 0 4px rgba(255, 122, 184, 0.16);
}

.results {
  margin-top: 2.75rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 26px;
  border: 2px solid rgba(92, 200, 255, 0.2);
  padding: 2rem;
  box-shadow: 0 10px 30px -25px rgba(42, 31, 104, 0.35);
  position: relative;
  z-index: 1;
}

.results h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
}

.results__caption {
  margin: 0 0 1.5rem;
  color: var(--clr-muted);
  line-height: 1.6;
}

#result-text p {
  background: rgba(255, 122, 184, 0.12);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  margin: 0 0 0.75rem;
  color: var(--clr-text);
}

.result-images {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.result-images figure {
  margin: 0;
  background: rgba(243, 248, 255, 0.92);
  border-radius: 22px;
  border: 2px solid rgba(92, 200, 255, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 12px 24px -20px rgba(41, 30, 90, 0.45);
}

.result-images img {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.result-images figcaption {
  padding: 0.85rem 1rem 1.1rem;
  font-weight: 600;
  color: var(--clr-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
}
.result-caption__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-save {
  appearance: none;
  border: none;
  background: var(--clr-primary);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 22px -16px rgba(255, 63, 132, 0.8);
  line-height: 1.2;
}

.result-save:hover,
.result-save:focus-visible {
  background: var(--clr-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -16px rgba(255, 63, 132, 0.9);
}

.result-save:focus-visible {
  outline: 3px solid rgba(92, 200, 255, 0.4);
  outline-offset: 2px;
}
.result-card {
  position: relative;
}

.result-card img,
.result-card figcaption {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.result-card[data-state="wrapped"] img,
.result-card[data-state="wrapped"] figcaption {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.result-card[data-state="revealed"] img,
.result-card[data-state="revealed"] figcaption {
  opacity: 1;
  transform: translateY(0);
}

.present-cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  border: none;
  border-radius: 20px;
  background: linear-gradient(130deg, #ff7cc4, #ff487d);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 2;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.present-cover:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.7);
  outline-offset: -6px;
}

.present-cover__text {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.present-cover__bow {
  position: relative;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  z-index: 1;
  box-shadow: 0 10px 22px -14px rgba(0, 0, 0, 0.4);
}

.present-cover__bow::before,
.present-cover__bow::after {
  content: '';
  position: absolute;
  width: 2.6rem;
  height: 1.3rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 8px 18px -14px rgba(0, 0, 0, 0.4);
}

.present-cover__bow::before {
  right: 100%;
  transform: translate(-0.4rem, -50%) rotate(-10deg);
}

.present-cover__bow::after {
  left: 100%;
  transform: translate(0.4rem, -50%) rotate(10deg);
}

.present-cover__ribbon {
  position: absolute;
  background: rgba(255, 255, 255, 0.4);
  mix-blend-mode: screen;
  pointer-events: none;
}

.present-cover__ribbon--vertical {
  width: 18%;
  height: 100%;
  left: 50%;
  transform: translateX(-50%);
}

.present-cover__ribbon--horizontal {
  height: 18%;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
}

.present-cover--hidden {
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
}

.status-message {
  margin: 0;
  color: #ff3f64;
  font-weight: 600;
}

.loading {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 3px solid rgba(255, 122, 184, 0.35);
  border-top-color: var(--clr-primary-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.camera-modal {
  position: fixed;
  inset: 0;
  background: rgba(43, 34, 80, 0.55);
  display: grid;
  place-items: center;
  padding: 2rem;
  z-index: 10;
}

.camera-modal[hidden] {
  display: none;
}

.camera-modal__content {
  width: min(520px, 100%);
  background: var(--clr-card);
  border-radius: 28px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 25px 60px -35px rgba(28, 21, 60, 0.65);
}

.camera-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.camera-modal__header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(92, 200, 255, 0.22);
  border: none;
  color: var(--clr-secondary-dark);
  font-size: 1.6rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.icon-button:hover {
  background: rgba(92, 200, 255, 0.32);
}

.camera-modal__content video {
  width: 100%;
  border-radius: 20px;
  background: #0d0b1f;
}

.camera-modal__controls {
  display: flex;
  gap: 1rem;
}

.camera-modal__controls button {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 18px;
  border: none;
  background: linear-gradient(135deg, #6dfcc6, var(--clr-success));
  color: #153832;
  font-weight: 700;
}

.camera-modal__controls .secondary {
  background: rgba(92, 200, 255, 0.2);
  color: var(--clr-secondary-dark);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(circle at 30% 20%, rgba(255, 122, 184, 0.25), transparent 55%),
    radial-gradient(circle at 80% 75%, rgba(92, 200, 255, 0.35), transparent 60%),
    var(--clr-bg-accent);
}

.login-card {
  width: min(380px, 90vw);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  border: 3px solid rgba(255, 122, 184, 0.18);
  padding: 2.5rem 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  box-shadow: 0 30px 70px -35px rgba(57, 30, 89, 0.45);
}

.login-ribbon {
  align-self: flex-start;
  background: linear-gradient(135deg, #ffd166, #ff7ab8);
  color: #5a1a5d;
  font-weight: 700;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: 0 12px 22px -16px rgba(255, 122, 184, 0.55);
}

.login-card h1 {
  margin: 0;
  font-size: 2rem;
  font-family: 'Baloo 2', 'Fredoka', sans-serif;
  color: var(--clr-text);
}

.login-subtitle {
  margin: 0;
  color: var(--clr-muted);
  line-height: 1.6;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-form label {
  font-weight: 600;
  color: var(--clr-text);
}

.login-form input {
  border-radius: 16px;
  border: 2px solid rgba(92, 200, 255, 0.3);
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  background: rgba(243, 248, 255, 0.85);
  color: var(--clr-text);
}

.login-form input:focus {
  outline: none;
  border-color: rgba(255, 122, 184, 0.6);
  box-shadow: 0 0 0 4px rgba(255, 122, 184, 0.16);
}

.login-card .status-message {
  min-height: 1.2rem;
  color: #ff3f64;
}

@media (max-width: 860px) {
  .prompt-playground__header {
    align-items: flex-start;
  }

  .prompt-playground__nav {
    margin-left: 0;
  }

  body {
    padding: 2rem 1rem;
  }

  .container {
    padding: 2.25rem 1.75rem;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
  }

  .app-header button.secondary {
    align-self: flex-start;
  }
}

@media (max-width: 640px) {
  .prompt-playground {
    margin-top: 1.4rem;
  }

  .prompt-playground__nav {
    width: 100%;
    justify-content: flex-start;
  }

  .prompt-card {
    flex: 0 0 150px;
  }

  .prompt-card__hint {
    font-size: 0.8rem;
  }

  .drop-zone {
    padding: 1.75rem 1.5rem;
  }

  textarea {
    min-height: 100px;
  }

  .results {
    padding: 1.75rem;
  }
}

