:root {
  --bg-1: #071613;
  --bg-2: #123c31;
  --accent: #16b978;
  --accent-2: #c8a64a;
  --ink: #101614;
  --muted: #38564c;
  --panel: #fbfff9;
  --panel-soft: #eef8ef;
  --text-strong: #13241f;
  --frame-light: #7a5838;
  --frame-mid: #66492f;
  --frame-dark: #3e2b1d;
  --font-display: "Bangers", "Roboto", cursive;
  --font-body: "Roboto", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(200, 166, 74, 0.22) 0 12%, transparent 12% 100%),
    radial-gradient(circle at 50% -10%, rgba(22, 185, 120, 0.34), transparent 40%),
    linear-gradient(180deg, var(--bg-2), var(--bg-1) 76%);
  color: var(--muted);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

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

.container {
  width: min(100%, 720px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.topbar {
  width: min(100%, 500px);
  display: grid;
  grid-template-columns: minmax(70px, max-content) max-content minmax(70px, max-content);
  align-items: center;
  justify-content: center;
  column-gap: 8px;
  row-gap: 6px;
  margin-bottom: 18px;
  padding: 12px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    #10241f;
  border: 1px solid rgba(221, 194, 100, 0.72);
  border-radius: 8px;
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.brand,
.subtitle {
  color: #f8f4d7;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-shadow: 0 5px 16px rgba(0, 0, 0, 0.42);
  text-transform: uppercase;
}

.brand {
  padding: 6px;
  font-size: 1.7rem;
}

.brand.left {
  justify-self: end;
}

.brand.right {
  justify-self: start;
}

.top-center {
  display: contents;
}

.top-avatar {
  width: 118px;
  height: 82px;
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  object-fit: cover;
  background: #08110f;
  border: 3px solid rgba(200, 166, 74, 0.74);
  border-radius: 8px;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.34),
    0 0 0 5px rgba(22, 185, 120, 0.14);
}

.subtitle {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: center;
  padding: 5px 6px 2px;
  color: #80f0bd;
  font-size: 1rem;
}

.inner {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 8px;
}

.card {
  width: min(100%, 600px);
  padding: 24px 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(238, 248, 239, 0.96)),
    var(--panel);
  border: 1px solid rgba(200, 166, 74, 0.62);
  border-radius: 8px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  color: var(--text-strong);
  text-align: center;
}

.action-panel {
  display: grid;
  gap: 18px;
}

.painting-frame {
  width: min(100%, 400px);
  justify-self: center;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.22));
}

.frame-bevel {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 22%) top left / 50% 50% no-repeat,
    linear-gradient(225deg, rgba(255, 255, 255, 0.1), transparent 22%) top right / 50% 50% no-repeat,
    linear-gradient(45deg, rgba(0, 0, 0, 0.18), transparent 24%) bottom left / 50% 50% no-repeat,
    linear-gradient(315deg, rgba(0, 0, 0, 0.2), transparent 24%) bottom right / 50% 50% no-repeat,
    linear-gradient(180deg, var(--frame-light), var(--frame-mid));
  border-radius: 8px;
}

.frame-bevel::before,
.frame-bevel::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.frame-bevel::before {
  inset: 0;
  border: 3px solid rgba(40, 26, 17, 0.22);
  border-radius: 8px;
}

.frame-bevel::after {
  inset: 28px;
  border: 3px solid rgba(33, 20, 12, 0.62);
}

.canvas-panel {
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
  background:
    radial-gradient(circle at top, rgba(22, 185, 120, 0.18), transparent 45%),
    #030604;
}

.canvas-panel p {
  max-width: 280px;
  margin: 0;
  color: #f7f7f7;
  font-size: clamp(1.55rem, 5vw, 2.05rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
}

#description-input {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 14px 18px;
  background: #fff;
  border: 2px solid rgba(19, 36, 31, 0.1);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 5px rgba(0, 0, 0, 0.12),
    0 8px 26px rgba(22, 185, 120, 0.08);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1.4;
  transition:
    border-color 0.12s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
}

#description-input::placeholder {
  color: rgba(56, 86, 76, 0.48);
}

#description-input:focus {
  border-color: rgba(22, 185, 120, 0.7);
  box-shadow: 0 8px 26px rgba(22, 185, 120, 0.16);
  outline: none;
  transform: translateY(-1px);
}

.create-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 10px;
  min-width: 220px;
  overflow: hidden;
  padding: 14px 26px;
  background: linear-gradient(90deg, #0b7c55, #18bd7b 55%, #c8a64a);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(13, 141, 94, 0.22);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  transition:
    box-shadow 0.14s ease,
    transform 0.14s ease;
  margin-bottom: 14px;
}

.reset-btn {
  justify-self: center;
  min-width: 160px;
  padding: 10px 14px;
  background: #fff;
  border: 2px solid rgba(200, 166, 74, 0.56);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(13, 141, 94, 0.1);
  color: #0b7c55;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  transition:
    box-shadow 0.14s ease,
    transform 0.14s ease;
}

.reset-btn:hover {
  box-shadow: 0 12px 28px rgba(13, 141, 94, 0.14);
  transform: translateY(-2px);
}

.create-btn:hover:not(:disabled) {
  box-shadow: 0 26px 60px rgba(13, 141, 94, 0.24);
  transform: translateY(-4px);
}

.create-btn:disabled {
  cursor: wait;
  opacity: 0.86;
}

.cta-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.create-btn.is-loading .cta-spinner {
  display: inline-block;
}

.create-btn::after {
  position: absolute;
  top: -60%;
  left: -40%;
  width: 40%;
  height: 220%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.82),
    rgba(255, 255, 255, 0.16),
    rgba(255, 255, 255, 0)
  );
  content: "";
  transform: rotate(25deg);
  transition: transform 0.9s ease;
}

.create-btn:hover:not(:disabled)::after {
  transform: translateX(260%) rotate(25deg);
}

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

.disclaimer {
  margin: 0;
  color: #5e6944;
  font-size: 0.92rem;
}

.report-content {
  width: 100%;
  max-height: 100%;
  overflow: auto;
  padding: 14px;
  color: #f7f7f7;
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: left;
}

.report-content > *:first-child {
  margin-top: 0;
}

.report-content > *:last-child {
  margin-bottom: 0;
}

.report-content h1,
.report-content h2,
.report-content h3,
.report-content h4 {
  margin: 18px 0 10px;
  color: #80f0bd;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
}

.report-content h1 {
  font-size: 2rem;
}

.report-content h2 {
  font-size: 1.7rem;
}

.report-content h3 {
  font-size: 1.45rem;
}

.report-content h4 {
  font-size: 1.25rem;
}

.report-content p {
  margin: 10px 0;
}

.report-content strong {
  color: #c8a64a;
  font-weight: 900;
}

.report-content ul,
.report-content ol {
  margin: 12px 0;
  padding-left: 24px;
  list-style-position: outside;
}

.report-content li {
  margin: 8px 0;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(22, 185, 120, 0.28);
  border-radius: 8px;
  text-align: left;
}

.report-content li::marker {
  color: var(--accent);
}

.generated-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #030604;
}

.footer {
  color: #d8e7dc;
  font-size: 0.92rem;
  text-align: center;
}

.footer a {
  color: #93f0c2;
  font-weight: 800;
}

@media (max-width: 560px) {
  body {
    padding: 18px;
  }

  .topbar {
    grid-template-columns: 1fr max-content 1fr;
    padding-inline: 10px;
  }

  .brand {
    font-size: 1.35rem;
  }

  .top-avatar {
    width: 104px;
    height: 72px;
  }

  .card {
    padding: 20px 18px;
  }

  .frame-bevel {
    padding: 26px;
  }

  .frame-bevel::after {
    inset: 24px;
  }

  .canvas-panel p {
    font-size: 1.45rem;
  }

  .create-btn {
    width: 100%;
    min-width: 0;
  }

  .reset-btn {
    width: 100%;
  }
}
