@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
  --paper: #fff7eb;
  --paper-2: #fef2de;
  --card: rgba(255, 255, 255, 0.92);
  --card-border: rgba(116, 76, 32, 0.2);
  --ink: #2f2720;
  --muted: #786a5d;
  --accent-red: #d13f2b;
  --accent-gold: #f6ba52;
  --accent-blue: #2e82c8;
  --focus: rgba(46, 130, 200, 0.26);
  --ok: #1f8a57;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  font-family: "Source Sans 3", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(1200px 620px at 8% -6%, rgba(255, 203, 109, 0.42), transparent 70%),
    radial-gradient(980px 540px at 92% 4%, rgba(255, 141, 90, 0.28), transparent 68%),
    radial-gradient(1200px 860px at 50% 118%, rgba(232, 118, 79, 0.2), transparent 68%),
    linear-gradient(160deg, var(--paper) 0%, #fff4df 42%, var(--paper-2) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(116, 59, 17, 0.08) 0 6px, transparent 6px),
    radial-gradient(circle at 5% 10%, rgba(255, 255, 255, 0.65), transparent 26%),
    radial-gradient(circle at 96% 12%, rgba(255, 255, 255, 0.45), transparent 28%);
  mix-blend-mode: multiply;
  opacity: 0.46;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 0, rgba(246, 186, 82, 0.32) 0 6px, transparent 6px) 0 0 / 48px 40px repeat-x,
    radial-gradient(circle at 12% 100%, rgba(209, 63, 43, 0.26) 0 5px, transparent 5px) 0 100% / 48px 36px repeat-x;
  opacity: 0.44;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.hero {
  margin-bottom: 18px;
}

.kicker {
  margin: 0 0 8px;
  color: #bf5126;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.84rem;
}

.hero h1 {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(3rem, 6vw, 5rem);
  letter-spacing: 0.03em;
  line-height: 0.92;
  color: #261d16;
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.55);
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.16rem;
  max-width: 760px;
}

.hero-actions {
  margin-top: 14px;
}

.panel {
  display: none;
  position: relative;
  margin-bottom: 16px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(255, 245, 230, 0.92)),
    linear-gradient(130deg, rgba(255, 197, 108, 0.2), rgba(255, 255, 255, 0));
  box-shadow:
    0 12px 32px rgba(109, 66, 24, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(110deg, rgba(255, 200, 124, 0.18), transparent 48%);
}

.panel h2,
.panel h3,
.panel p,
.panel form,
.panel .row,
.panel .grid,
.panel pre,
.panel img {
  position: relative;
  z-index: 1;
}

.panel.active {
  display: block;
  animation: panel-in 220ms ease-out;
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#generation-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 0;
}

#generation-form .grid {
  margin-bottom: 14px;
}

#generation-form::after {
  content: none;
}

#generation-form > * {
  position: relative;
  z-index: 1;
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.98rem;
  font-weight: 600;
  color: #624d3a;
}

input,
select,
textarea,
button {
  border-radius: 10px;
  font-size: 1rem;
  padding: 10px 12px;
}

input,
select,
textarea {
  border: 1px solid rgba(122, 88, 47, 0.33);
  background: rgba(255, 255, 255, 0.88);
  color: #251d16;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #96795c;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(46, 130, 200, 0.74);
  box-shadow: 0 0 0 3px var(--focus);
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 112px;
}

button {
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.04em;
  font-size: 1.4rem;
  line-height: 1;
  padding: 11px 18px;
  background: linear-gradient(130deg, #2f8de0 0%, #4ab4ff 30%, #f4b14a 62%, #d13f2b 100%);
  box-shadow: 0 8px 18px rgba(158, 74, 33, 0.25);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: saturate(1.05) brightness(1.04);
  box-shadow: 0 12px 22px rgba(158, 74, 33, 0.28);
}

button:active {
  transform: translateY(0);
}

#btn-generate {
  align-self: flex-start;
  margin-top: 10px;
}

#btn-generate,
#btn-redeem {
  padding: 12px 24px;
  border-radius: 12px;
  font-family: "Source Sans 3", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  background: linear-gradient(135deg, #c72a2a 0%, #e24f2c 46%, #f4b54a 100%);
  box-shadow: 0 10px 20px rgba(169, 66, 24, 0.26);
}

#btn-generate:hover,
#btn-redeem:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 12px 24px rgba(160, 61, 23, 0.3);
}

.btn-secondary {
  background: rgba(255, 250, 242, 0.88);
  color: #4f3e2e;
  border: 1px solid rgba(120, 87, 49, 0.35);
  box-shadow: none;
}

.btn-secondary:hover {
  background: #fff;
  box-shadow: 0 8px 16px rgba(103, 72, 37, 0.14);
  filter: none;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hint {
  margin: 0;
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(125, 90, 52, 0.3);
  background: linear-gradient(120deg, rgba(255, 244, 228, 0.95), rgba(255, 235, 206, 0.95));
}

.progress-bar {
  height: 100%;
  width: 0%;
  transition: width 240ms ease;
  background:
    linear-gradient(90deg, #2f8de0 0%, #49c4ed 34%, #89cc59 62%, #f1b54c 82%, #d95037 100%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.24) 8px, transparent 8px, transparent 14px);
}

#step-result {
  text-align: center;
}

#step-result .row {
  justify-content: center;
}

#result-poster {
  display: block;
  width: min(92vw, 560px);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  margin: 18px auto 20px;
  border-radius: 16px;
  border: 1px solid rgba(129, 89, 47, 0.4);
  background: linear-gradient(160deg, #fff9ef, #fdebcf);
  box-shadow:
    0 16px 32px rgba(122, 72, 26, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.75) inset;
}

.tagline {
  margin-top: 2px;
  color: #5d4f41;
  font-size: 1.26rem;
}

.synopsis {
  max-width: 860px;
  margin: 0 auto 18px;
  padding: 16px 18px;
  border-radius: 13px;
  border: 1px solid rgba(126, 89, 47, 0.24);
  background: rgba(255, 251, 244, 0.88);
  color: #2f2720;
  text-align: left;
  line-height: 1.58;
}

#log {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(126, 90, 50, 0.22);
  background: rgba(255, 251, 245, 0.9);
  color: #56412f;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

@media (max-width: 860px) {
  .container {
    padding: 22px 14px 32px;
  }

  .panel {
    padding: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  #btn-generate {
    width: 100%;
    justify-content: center;
  }
}
