:root {
  --toy-bg: #f7ebd7;
  --toy-bg-strong: #efe0c6;
  --toy-ink: #1d1e25;
  --toy-ink-soft: rgba(29, 30, 37, 0.72);
  --toy-line: rgba(26, 31, 40, 0.14);
  --toy-red: #c94935;
  --toy-red-deep: #8e2f23;
  --toy-gold: #f5b85a;
  --toy-navy: #1f3552;
  --toy-card: rgba(255, 250, 241, 0.88);
  --toy-shadow: 0 24px 70px rgba(48, 27, 11, 0.18);
  --toy-shadow-soft: 0 16px 36px rgba(48, 27, 11, 0.12);
  --toy-radius: 28px;
  --toy-display: Rockwell, "Bookman Old Style", Georgia, serif;
  --toy-body: "Trebuchet MS", "Gill Sans", Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--toy-body);
  color: var(--toy-ink);
  background:
    radial-gradient(circle at top left, rgba(245, 184, 90, 0.26), transparent 32%),
    radial-gradient(circle at bottom right, rgba(201, 73, 53, 0.18), transparent 28%),
    linear-gradient(180deg, #fff7ea 0%, var(--toy-bg) 46%, var(--toy-bg-strong) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    radial-gradient(circle, rgba(31, 53, 82, 0.09) 1px, transparent 1px),
    linear-gradient(120deg, rgba(255, 255, 255, 0.24), transparent 42%);
  background-size: 18px 18px, auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.toy-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 18px;
}

.toy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1200px, 100%);
  margin: 0 auto 20px;
  padding: 14px 18px;
  border: 1px solid rgba(31, 53, 82, 0.12);
  border-radius: 999px;
  background: rgba(255, 249, 240, 0.86);
  backdrop-filter: blur(14px);
  box-shadow: var(--toy-shadow-soft);
}

.toy-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.toy-brand-mark {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 7px;
  transform: rotate(45deg);
  background: linear-gradient(180deg, var(--toy-gold), var(--toy-red));
  box-shadow: 0 8px 16px rgba(201, 73, 53, 0.26);
}

.toy-brand-copy {
  display: grid;
  gap: 2px;
}

.toy-brand-name,
.toy-copy h1,
.toy-result-empty h2 {
  font-family: var(--toy-display);
}

.toy-brand-name {
  font-size: 1.1rem;
  letter-spacing: 0;
}

.toy-brand-tagline {
  color: var(--toy-ink-soft);
  font-size: 0.8rem;
}

.toy-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(31, 53, 82, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.toy-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.toy-account {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(31, 53, 82, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--toy-ink-soft);
  font-size: 0.82rem;
  white-space: nowrap;
}

.toy-signin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--toy-navy);
  color: #fffaf1;
  font-weight: 800;
}

.toy-credit-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(31, 53, 82, 0.12);
  border-radius: 999px;
  background: #fffaf1;
  color: var(--toy-navy);
  font-weight: 800;
}

.toy-main {
  width: min(1200px, 100%);
  margin: 0 auto;
}

.toy-hero {
  display: grid;
  gap: 24px;
}

.toy-banner {
  aspect-ratio: 3 / 1;
  width: 100%;
  max-height: 400px;
  overflow: hidden;
  border: 1px solid var(--toy-line);
  border-radius: var(--toy-radius);
  background: #f8ead3;
  box-shadow: var(--toy-shadow);
}

.toy-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.toy-copy {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.toy-kicker {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--toy-red-deep);
}

.toy-copy h1 {
  margin: 0;
  font-size: 4.4rem;
  line-height: 0.92;
  letter-spacing: 0;
  max-width: 10ch;
}

.toy-lede,
.toy-status,
.toy-loss-warning,
.toy-result-empty p,
#toy-upload-copy {
  margin: 0;
  color: var(--toy-ink-soft);
  line-height: 1.6;
}

.toy-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toy-steps span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(31, 53, 82, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.toy-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(320px, 1.04fr);
  gap: 20px;
  align-items: start;
}

.toy-form,
.toy-result-panel {
  border: 1px solid var(--toy-line);
  border-radius: var(--toy-radius);
  background: var(--toy-card);
  box-shadow: var(--toy-shadow);
  backdrop-filter: blur(10px);
}

.toy-form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.upload-panel,
.photo-preview-panel,
.toy-result-frame {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
}

.upload-panel {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border: 2px dashed rgba(31, 53, 82, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(247, 235, 215, 0.78));
  cursor: pointer;
}

.upload-panel strong {
  font-family: var(--toy-display);
  font-size: 1.5rem;
  line-height: 1;
}

.upload-kicker,
.toy-field span {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--toy-navy);
}

.photo-preview-panel {
  height: 132px;
  min-height: 0;
  border: 1px solid rgba(31, 53, 82, 0.12);
  background:
    linear-gradient(180deg, rgba(31, 53, 82, 0.08), rgba(31, 53, 82, 0.02)),
    #fffaf1;
}

.photo-preview-panel img,
#toy-result-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.photo-preview-empty,
.toy-result-empty,
.toy-result-loading {
  display: grid;
  place-items: center;
  text-align: center;
}

.photo-preview-empty {
  min-height: inherit;
  padding: 18px;
  color: var(--toy-ink-soft);
}

.toy-field {
  display: grid;
  gap: 8px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.toy-field input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(31, 53, 82, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--toy-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.toy-field input::placeholder {
  color: rgba(29, 30, 37, 0.46);
}

.field-count {
  min-width: 48px;
  text-align: right;
  font-size: 0.88rem;
  color: var(--toy-ink-soft);
  font-variant-numeric: tabular-nums;
}

.toy-accessories {
  display: grid;
  gap: 12px;
}

.toy-slider-field {
  padding: 14px;
  border: 1px solid rgba(31, 53, 82, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 250, 241, 0.72));
}

.toy-slider-value {
  font-family: var(--toy-display);
  font-size: 1.2rem;
  color: var(--toy-ink);
}

.toy-slider-field input[type="range"] {
  width: 100%;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  accent-color: var(--toy-red);
  cursor: pointer;
}

.toy-slider-scale {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--toy-ink-soft);
}

.toy-submit,
.toy-download,
.toy-home-link,
.toy-signin-link,
.toy-credit-pill {
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.toy-submit {
  min-height: 62px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--toy-red), var(--toy-red-deep));
  color: #fff6ea;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(142, 47, 35, 0.28);
}

.toy-submit:hover,
.toy-submit:focus-visible,
.toy-download[data-ready="true"]:hover,
.toy-download[data-ready="true"]:focus-visible,
.toy-home-link:hover,
.toy-home-link:focus-visible,
.toy-signin-link:hover,
.toy-signin-link:focus-visible,
.toy-credit-pill:hover,
.toy-credit-pill:focus-visible {
  transform: translateY(-1px);
}

.toy-submit:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.toy-status {
  min-height: 1.6em;
  padding: 12px 14px;
  border: 1px solid rgba(31, 53, 82, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.toy-status.is-error {
  border-color: rgba(177, 85, 85, 0.24);
  background: rgba(220, 130, 114, 0.14);
  color: #7e2418;
}

.toy-status.is-success {
  border-color: rgba(71, 142, 97, 0.22);
  background: rgba(134, 196, 154, 0.16);
  color: #1e5a33;
}

.toy-result-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.toy-result-frame {
  min-height: 780px;
  border: 1px solid rgba(31, 53, 82, 0.12);
  background:
    linear-gradient(180deg, rgba(31, 53, 82, 0.08), rgba(31, 53, 82, 0.02)),
    #fffaf1;
}

.toy-result-empty,
.toy-result-loading {
  position: absolute;
  inset: 0;
  padding: 28px;
}

.toy-result-empty h2 {
  margin: 0;
  font-size: 2.35rem;
  line-height: 0.96;
}

.toy-result-loading {
  gap: 14px;
  background: rgba(255, 250, 241, 0.86);
  backdrop-filter: blur(10px);
}

.toy-spinner {
  width: 58px;
  height: 58px;
  border: 6px solid rgba(31, 53, 82, 0.14);
  border-top-color: var(--toy-red);
  border-radius: 50%;
  animation: toy-spin 900ms linear infinite;
}

.toy-result-actions {
  display: grid;
  gap: 10px;
}

.toy-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  width: 100%;
  border: 1px solid rgba(31, 53, 82, 0.12);
  border-radius: 16px;
  background: var(--toy-navy);
  color: #fffaf1;
  cursor: pointer;
  font-weight: 800;
}

.toy-download[data-ready="false"] {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.toy-loss-warning {
  padding: 12px 14px;
  border: 1px solid rgba(142, 47, 35, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--toy-red-deep);
}

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

input:focus-visible,
.toy-submit:focus-visible,
.toy-download:focus-visible,
.toy-home-link:focus-visible,
.toy-signin-link:focus-visible,
.toy-credit-pill:focus-visible,
.upload-panel:focus-within {
  outline: 3px solid rgba(201, 73, 53, 0.3);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .toy-workspace {
    grid-template-columns: 1fr;
  }

  .toy-result-frame {
    min-height: 620px;
  }
}

@media (max-width: 640px) {
  .toy-shell {
    padding: 12px;
  }

  .toy-header {
    padding: 12px 14px;
    border-radius: 26px;
    flex-wrap: wrap;
  }

  .toy-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .toy-account {
    flex: 1;
    justify-content: space-between;
    min-width: 0;
    white-space: normal;
  }

  .toy-credit-pill {
    flex: 0 0 auto;
  }

  .toy-brand-tagline {
    display: none;
  }

  .toy-copy h1 {
    font-size: 2.65rem;
  }

  .toy-banner {
    max-height: 180px;
    border-radius: 22px;
  }

  .toy-form,
  .toy-result-panel {
    padding: 14px;
  }

  .photo-preview-panel {
    height: 86px;
  }

  .toy-result-frame {
    min-height: 460px;
  }
}
