:root {
  --green: #2e7d32;
  --green-dark: #1b5e20;
  --ink: #333;
  --muted: #777;
  --bg: #fffdf7;
  --card: #ffffff;
  --line: #e8e2d4;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.5;
}
.hero {
  text-align: center; padding: 3rem 1rem 2rem;
  background: linear-gradient(180deg, #e8f5e9, var(--bg));
}
.hero h1 { margin: 0 0 .5rem; font-size: 2.2rem; color: var(--green-dark); }
.hero p { max-width: 560px; margin: 0 auto; font-size: 1.1rem; }
main { max-width: 900px; margin: 0 auto; padding: 0 1rem 3rem; }
.step { margin-top: 2.5rem; }
.stepnum {
  display: inline-block; width: 2rem; height: 2rem; line-height: 2rem;
  background: var(--green); color: #fff; border-radius: 50%;
  text-align: center; margin-right: .5rem; font-size: 1.1rem;
}
.theme-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-top: 1rem;
}
.theme-wrap { display: flex; flex-direction: column; }
.preview-link {
  text-align: center; font-size: .85rem; font-weight: 600;
  color: var(--green); padding: .45rem 0 .1rem; text-decoration: none;
}
.preview-link:hover { text-decoration: underline; }
.theme-card {
  background: var(--card); border: 3px solid var(--line); border-radius: 16px;
  overflow: hidden; cursor: pointer; transition: transform .15s, border-color .15s;
  padding: 0; text-align: left; font: inherit; color: inherit;
}
.theme-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.theme-card .tname { font-weight: 700; padding: .6rem .8rem 0; }
.theme-card .ttag { padding: 0 .8rem .8rem; color: var(--muted); font-size: .9rem; }
.theme-card:hover { transform: translateY(-3px); }
.theme-card.selected { border-color: var(--green); box-shadow: 0 0 0 3px #c8e6c9; }
.theme-card:disabled { cursor: not-allowed; opacity: .75; }
.theme-card .soon {
  display: inline-block; margin: 0 .8rem .8rem; font-size: .75rem; font-weight: 700;
  background: #fff3e0; color: #e65100; border-radius: 999px; padding: .15rem .6rem;
}
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-top: 1rem; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.span2 { grid-column: span 2; }
@media (max-width: 600px) { .span2 { grid-column: span 1; } }
label { display: flex; flex-direction: column; font-weight: 600; font-size: .95rem; gap: .3rem; }
input, select, textarea {
  font: inherit; font-weight: 400; padding: .65rem .8rem;
  border: 2px solid var(--line); border-radius: 10px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); }
textarea { resize: vertical; }
.counter { align-self: flex-end; }
.upgrade {
  background: #fff8e1; border: 2px dashed #f9a825; border-radius: 14px;
  padding: 1rem 1.2rem; margin-top: 1.4rem;
}
.checkrow { flex-direction: row; align-items: flex-start; gap: .7rem; cursor: pointer; }
.checkrow input { width: 1.4rem; height: 1.4rem; margin-top: .15rem; accent-color: var(--green); }
h3 { margin-top: 1.8rem; color: var(--green-dark); }
.summary {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: #f1f8e9; border: 2px dashed var(--green); border-radius: 14px;
  padding: 1rem 1.2rem; margin: 1.6rem 0 1rem;
}
.price { font-size: 1.8rem; font-weight: 800; color: var(--green-dark); }
.cta {
  display: block; width: 100%; font-size: 1.2rem; font-weight: 700;
  background: var(--green); color: #fff; border: none; border-radius: 14px;
  padding: 1rem; cursor: pointer; margin-top: .4rem;
}
.cta:hover { background: var(--green-dark); }
.cta:disabled { opacity: .6; cursor: wait; }
.error {
  background: #ffebee; color: #b71c1c; border-radius: 10px;
  padding: .7rem 1rem; font-weight: 600;
}
footer { text-align: center; padding: 1.5rem; border-top: 1px solid var(--line); }
.center { text-align: center; padding: 4rem 1rem; }
.big { font-size: 3rem; }
/* Cartoon Me instant preview */
#cartoonUpload { margin-top: .8rem; border-top: 1px dashed #f9a825; padding-top: .8rem; }
.photo-pick { display: flex; gap: .8rem; }
.photo-slot {
  width: 110px; height: 110px; border: 2px dashed #d7c58a; border-radius: 12px;
  background: #fff; cursor: pointer; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.photo-slot input { display: none; }
.photo-ph { color: var(--muted); font-size: .85rem; font-weight: 600; padding: .4rem; }
.photo-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-slot.done { border-style: solid; border-color: var(--green); }
.portrait {
  width: 220px; max-width: 100%; border-radius: 12px; border: 3px solid var(--line);
  background: #fff; display: block; margin: .4rem 0;
}
.linklike {
  background: none; border: none; color: var(--green-dark); font: inherit;
  font-weight: 700; cursor: pointer; padding: .3rem 0; text-decoration: underline;
}
.spinner {
  display: inline-block; width: 1rem; height: 1rem; margin-right: .4rem;
  border: 2px solid #d7c58a; border-top-color: var(--green-dark);
  border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
