[hidden] { display: none !important; }

:root {
  --ink: #202020;
  --blue: #1556d8;
  --red: #df3340;
  --yellow: #ffd526;
  --paper: #fffdf7;
  --white: #ffffff;
  --muted: #646464;
  --line: #202020;
  --soft-blue: #edf3ff;
  --soft-yellow: #fff8d2;
  --shadow: 8px 9px 0 rgba(32, 32, 32, .96);
  --small-shadow: 4px 5px 0 rgba(32, 32, 32, .96);
  --font-main: "Segoe UI", Arial, Helvetica, sans-serif;
  --font-hand: "Segoe Print", "Bradley Hand", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-main);
  background: var(--paper);
}
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 3vw, 42px);
}

/* STARTSEITE */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: 1060px;
  margin: 1.5vh auto;
  padding: clamp(30px, 6vw, 76px);
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: 30px;
  box-shadow: var(--shadow);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 14px;
  background: linear-gradient(90deg, var(--blue) 0 43%, var(--yellow) 43% 73%, var(--red) 73% 100%);
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -92px;
  bottom: -88px;
  border: 26px solid var(--yellow);
  border-radius: 50%;
  z-index: -1;
}
.hero-banner {
  position: relative;
  width: min(830px, 100%);
  margin: 0 auto 34px;
  text-align: center;
}
.banner-kicker {
  display: inline-block;
  margin-bottom: 15px;
  padding: 7px 17px 8px;
  color: var(--white);
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 4px 0 var(--ink);
  font-family: var(--font-hand);
  font-size: clamp(.96rem, 2vw, 1.18rem);
  font-weight: 700;
}
h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(3rem, 8vw, 6.7rem);
  line-height: .92;
  letter-spacing: -.055em;
  font-weight: 900;
}
h1 em {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-family: inherit;
  font-size: .58em;
  font-style: normal;
  letter-spacing: -.04em;
}
.hero-card {
  font-family: var(--font-hand);
  position: relative;
  max-width: 790px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 42px);
  background: var(--white);
  border: 2px solid var(--ink);
  border-left: 12px solid var(--yellow);
  border-radius: 5px 20px 20px 5px;
  box-shadow: 0 16px 42px rgba(32, 32, 32, .11);
  font-size: clamp(1rem, 1.9vw, 1.15rem);
  line-height: 1.7;
}
.hero-card p { margin: 0 0 1.05em; }
.hero-card p:last-child { margin-bottom: 0; }
.hero-card strong { font-weight: 800; }
.hero-signoff {
  padding-top: 6px;
  font-family: var(--font-hand);
  font-size: 1.05em;
}
.primary.big {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(650px, 100%);
  margin: 34px auto 0;
  padding: 17px 28px;
  color: var(--white);
  background: var(--blue);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--small-shadow);
  font-weight: 850;
  font-size: clamp(1.05rem, 2.4vw, 1.34rem);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.primary.big small {
  margin-top: 3px;
  font-family: var(--font-hand);
  font-size: .76em;
  font-weight: 700;
}
.primary.big:hover { transform: translate(-2px, -2px); box-shadow: 7px 8px 0 var(--ink); }
.primary.big:active { transform: translate(3px, 3px); box-shadow: 1px 2px 0 var(--ink); }
.hero-footnote {
  margin: 18px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: .95rem;
  font-weight: 650;
}
.paint-dot, .comic-cloud { position: absolute; z-index: -1; }
.paint-dot { border-radius: 50%; }
.dot-red { width: 18px; height: 18px; background: var(--red); top: 112px; left: 8%; }
.dot-yellow { width: 42px; height: 42px; background: var(--yellow); right: 8%; top: 105px; }
.dot-blue { width: 24px; height: 24px; background: var(--blue); right: 7%; bottom: 150px; }
.comic-cloud { border: 3px solid var(--ink); background: var(--white); opacity: .9; }
.cloud-one { width: 82px; height: 20px; left: 38px; bottom: 48px; border-width: 0 0 3px; transform: rotate(-8deg); }
.cloud-two { width: 55px; height: 16px; right: 54px; top: 50px; border-width: 3px 0 0; transform: rotate(8deg); }

/* EDITOR */
.editor {
  overflow: hidden;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.editor-head {
  display: grid;
  grid-template-columns: 150px 1fr 72px;
  align-items: center;
  gap: 18px;
  padding: 19px 24px;
  background: var(--white);
  border-bottom: 3px solid var(--ink);
  text-align: center;
}
.editor-head::after {
  content: "";
  position: absolute;
}
.editor-head h2 {
  margin: 2px 0 0;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  line-height: 1.1;
  letter-spacing: -.025em;
}
.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.version {
  justify-self: end;
  padding: 6px 10px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
}
.text-button {
  justify-self: start;
  padding: 9px;
  border: 0;
  background: transparent;
  font-weight: 750;
  cursor: pointer;
}
.text-button:hover { color: var(--blue); }
.workspace {
  display: grid;
  grid-template-columns: minmax(430px, 1fr) minmax(390px, .86fr);
  gap: 28px;
  align-items: start;
  padding: 28px;
  background: #fafafa;
}
.controls-panel { display: flex; flex-direction: column; gap: 16px; }
.preview-panel {
  position: sticky;
  top: 18px;
  padding: 20px;
  background: var(--soft-blue);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--small-shadow);
}
.preview-label { margin: -5px 0 13px; text-align: center; }
.preview-label span {
  display: inline-block;
  padding: 6px 15px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-hand);
  font-weight: 700;
}
.canvas-wrap {
  position: relative;
  width: min(100%, 520px);
  margin: auto;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: #eeeeee;
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(32, 32, 32, .18);
  touch-action: none;
}
canvas { display: block; width: 100%; height: 100%; }
.canvas-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, .95);
  border: 0;
  text-align: center;
  cursor: pointer;
}
.camera-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 3px 4px 0 var(--ink);
  font-size: 2.35rem;
  font-weight: 900;
}
.canvas-empty strong { font-size: 1.25rem; }
.canvas-empty small { max-width: 240px; color: var(--muted); line-height: 1.45; }
.gesture-help { margin: 12px 0 0; color: var(--ink); text-align: center; font-size: .88rem; font-weight: 650; }
.zoom-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  color: var(--ink);
  font-weight: 700;
}
.zoom-row input { accent-color: var(--blue); }

.step-block {
  padding: 19px;
  background: var(--white);
  border: 2px solid #d7d7d7;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(32, 32, 32, .06);
}
.step-block:focus-within { border-color: var(--blue); }
.step-title { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.step-title span {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  height: 36px;
  color: var(--white);
  background: var(--blue);
  border-radius: 50%;
  font-weight: 850;
}
.step-title h3 { margin: 0; font-size: 1.08rem; letter-spacing: -.01em; }
.upload-button, .camera-button, .primary, .secondary, .baba-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 18px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upload-button {
  width: 100%;
  color: var(--white);
  background: var(--red);
  box-shadow: 3px 4px 0 var(--ink);
}
#photoInput { position: absolute; opacity: 0; pointer-events: none; }
.camera-button { color: var(--white); background: var(--blue); box-shadow: 3px 4px 0 var(--ink); }
.upload-button:hover, .camera-button:hover, .primary:hover, .secondary:hover, .baba-button:hover { transform: translate(-1px, -1px); }
label { display: block; margin-bottom: 8px; font-weight: 700; }
.hint { margin: 12px 0 0; color: var(--muted); font-size: .91rem; line-height: 1.5; }
input[type=text], textarea {
  width: 100%;
  padding: 12px 13px;
  background: var(--white);
  border: 2px solid #8e8e8e;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
}
input[type=text]:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(21, 86, 216, .13); }
textarea { resize: vertical; }
.choice-grid { display: grid; gap: 10px; }
.templates { grid-template-columns: repeat(5, 1fr); }
.choice, .font-choice {
  min-width: 0;
  padding: 10px;
  background: var(--white);
  border: 2px solid #8d8d8d;
  border-radius: 9px;
  cursor: pointer;
}
.choice.active, .font-choice.active {
  background: var(--soft-yellow);
  border-color: var(--ink);
  box-shadow: 3px 4px 0 var(--ink);
  transform: translate(-1px, -1px);
}
.choice b { display: block; margin-top: 7px; font-size: .76rem; }
.mini-card { display: block; position: relative; width: 42px; height: 62px; margin: auto; background: #ddd; border: 2px solid var(--ink); }
.mini-card.classic { border: 5px solid var(--blue); }
.mini-card.polaroid { background: linear-gradient(#bbb 0 72%, #fff 72%); border: 5px solid #fff; outline: 2px solid var(--ink); }
.mini-card.gallery { background: #f6e7cc; border: 2px double var(--red); }
.mini-card.modern { background: linear-gradient(#bbb 0 78%, var(--blue) 78%); }
.mini-card.creative { border: 3px dashed var(--red); border-radius: 7px; }
.color-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.color {
  width: 43px;
  height: 43px;
  background: var(--swatch);
  border: 3px solid var(--white);
  border-radius: 50%;
  outline: 2px solid var(--ink);
  cursor: pointer;
}
.color.active { transform: scale(1.12); box-shadow: 0 0 0 4px var(--yellow); }
.fonts { grid-template-columns: repeat(2, 1fr); }
.font-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; }
.font-choice span { width: 100%; overflow: hidden; font-size: 1.16rem; text-overflow: ellipsis; white-space: nowrap; }
.font-choice small { color: var(--muted); font-weight: 700; }
.font-choice[data-font=system] span { font-family: Arial, sans-serif; }
.font-choice[data-font=serif] span { font-family: Georgia, serif; }
.font-choice[data-font=rounded] span { font-family: "Trebuchet MS", sans-serif; }
.font-choice[data-font=hand] span { font-family: "Segoe Print", cursive; }
.font-choice[data-font=mono] span { font-family: "Courier New", monospace; }
.counter { margin-top: 5px; text-align: right; font-size: .8rem; font-weight: 700; }
.check-row { display: flex; gap: 12px; align-items: flex-start; margin: 0; line-height: 1.5; }
.check-row input { flex: 0 0 auto; width: 22px; height: 22px; accent-color: var(--blue); }
.consent-block { background: var(--soft-yellow); border-color: var(--yellow); }
.honeypot { position: absolute !important; left: -9999px !important; }
.actions { display: flex; gap: 12px; justify-content: flex-end; padding-top: 4px; }
.primary { color: var(--white); background: var(--blue); box-shadow: 3px 4px 0 var(--ink); }
.secondary { color: var(--ink); background: var(--yellow); box-shadow: 3px 4px 0 var(--ink); }
.secondary.compact { min-height: 38px; padding: 7px 11px; box-shadow: none; font-size: .83rem; }
.primary:disabled, .secondary:disabled { opacity: .42; box-shadow: none; transform: none; cursor: not-allowed; }
.status { min-height: 24px; margin: 0; font-weight: 750; }
.status.ok { color: #08734f; }
.status.error { color: #b01825; }

/* KAMERA */
.camera-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 20, 20, .82);
}
.camera-dialog[hidden] { display: none; }
.camera-card {
  width: min(720px, 100%);
  padding: 18px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.camera-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.camera-head h2 { margin: 0; font-size: clamp(1.4rem, 4vw, 2rem); }
.camera-close { width: 44px; height: 44px; padding: 0; background: var(--yellow); border: 2px solid var(--ink); border-radius: 50%; font-size: 1.8rem; font-weight: 800; cursor: pointer; }
#cameraVideo { display: block; width: 100%; max-height: 68vh; background: #111; border: 2px solid var(--ink); border-radius: 10px; object-fit: cover; }
.camera-status { min-height: 24px; margin: 10px 0 0; color: var(--muted); font-weight: 700; }
.camera-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 14px; }

/* ABSCHLUSS */
.success, .goodbye {
  position: relative;
  overflow: hidden;
  max-width: 760px;
  margin: 8vh auto;
  padding: clamp(32px, 7vw, 68px);
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.success::before, .goodbye::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 12px;
  background: linear-gradient(90deg, var(--blue) 0 43%, var(--yellow) 43% 73%, var(--red) 73% 100%);
}
.success-star {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
  color: var(--white);
  background: var(--red);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 4px 5px 0 var(--ink);
  font-size: 2.7rem;
}
.success h2, .goodbye h2 {
  margin: 10px 0 18px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.04;
  letter-spacing: -.045em;
}
.success p { font-size: 1.08rem; line-height: 1.6; }
.success-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.baba-button { color: var(--ink); background: var(--white); box-shadow: 3px 4px 0 var(--ink); }
.goodbye { background: var(--blue); color: var(--white); }
.goodbye-card span { color: var(--yellow); font-size: 4rem; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 1fr; }
  .preview-panel { position: relative; top: auto; grid-row: 1; }
  .controls-panel { grid-row: 2; }
  .templates { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 720px) {
  .app-shell { padding: 10px; }
  .hero { padding: 30px 16px 24px; border-width: 3px; border-radius: 20px; box-shadow: 5px 6px 0 var(--ink); }
  .hero::before { height: 10px; }
  h1 { font-size: clamp(2.55rem, 14vw, 4.8rem); }
  h1 em { font-size: .55em; }
  .hero-card { padding: 21px 18px; border-left-width: 8px; border-radius: 4px 14px 14px 4px; }
  .hero-card p { line-height: 1.58; }
  .paint-dot, .comic-cloud { opacity: .45; }
  .dot-red { left: 10px; top: 95px; }
  .dot-yellow { right: 12px; top: 105px; }
  .editor { border-width: 3px; border-radius: 18px; box-shadow: 5px 6px 0 var(--ink); }
  .editor-head { grid-template-columns: auto 1fr auto; gap: 6px; padding: 13px 10px; border-bottom-width: 3px; }
  .editor-head h2 { font-size: 1.02rem; }
  .editor-head .eyebrow { display: none; }
  .version { padding: 5px 7px; font-size: .7rem; }
  .text-button { font-size: .82rem; }
  .workspace { gap: 16px; padding: 12px; }
  .preview-panel { padding: 12px; border-radius: 14px; }
  .canvas-wrap { border-width: 2px; border-radius: 5px; }
  .zoom-row { grid-template-columns: 1fr; }
  .zoom-row label { display: none; }
  .secondary.compact { width: 100%; }
  .step-block { padding: 15px; border-radius: 11px; }
  .templates { grid-template-columns: repeat(3, 1fr); }
  .fonts { grid-template-columns: 1fr; }
  .photo-actions { grid-template-columns: 1fr; }
  .camera-actions { flex-direction: column; }
  .camera-actions button { width: 100%; }
  .actions, .success-actions { flex-direction: column; }
  .actions button, .success-actions button { width: 100%; }
  .success, .goodbye { margin: 3vh auto; padding: 32px 20px; border-radius: 20px; box-shadow: 5px 6px 0 var(--ink); }
}

/* V0.4.3 – Gittis Wandmalereien und beweglicher Name */
.gitti-art {
  position: absolute;
  z-index: 0;
  margin: 0;
  overflow: hidden;
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: 4px 5px 0 var(--ink);
  pointer-events: none;
}
.gitti-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gaston-art {
  width: 138px;
  height: 210px;
  left: -34px;
  top: 182px;
  border-radius: 0 18px 18px 0;
  transform: rotate(-2deg);
}
.gaston-art img {
  object-position: 31% center;
}
.marsu-art {
  width: 150px;
  height: 150px;
  right: -32px;
  bottom: 102px;
  border-radius: 50%;
  transform: rotate(3deg);
}
.marsu-art img {
  object-position: 68% 44%;
  transform: scale(1.55);
}
.hero-banner,
.hero-card,
.hero > .primary,
.hero-footnote {
  position: relative;
  z-index: 2;
}
.name-tools {
  margin-top: 14px;
  padding: 14px;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 10px;
}
.name-tools-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}
.name-tools-head span {
  color: var(--muted);
  font-size: .84rem;
}
.name-rotate-row {
  display: grid;
  grid-template-columns: auto 1fr 42px;
  gap: 10px;
  align-items: center;
}
.name-rotate-row label {
  margin: 0;
}
.name-rotate-row input {
  width: 100%;
  accent-color: var(--blue);
}
.name-rotate-row output {
  text-align: right;
  font-weight: 800;
}
#resetName {
  width: 100%;
  margin-top: 10px;
}
.canvas-wrap.moving-name {
  cursor: grabbing;
}

@media (max-width: 980px) {
  .gaston-art {
    width: 112px;
    height: 170px;
    left: -26px;
    top: 210px;
    opacity: .92;
  }
  .marsu-art {
    width: 126px;
    height: 126px;
    right: -27px;
    bottom: 88px;
  }
}

@media (max-width: 720px) {
  .gitti-art {
    box-shadow: 3px 4px 0 var(--ink);
  }
  .gaston-art {
    width: 82px;
    height: 124px;
    left: -24px;
    top: 155px;
    opacity: .72;
  }
  .marsu-art {
    width: 92px;
    height: 92px;
    right: -24px;
    bottom: 116px;
    opacity: .8;
  }
  .hero-card {
    margin-left: 28px;
    margin-right: 22px;
  }
  .name-tools-head {
    display: block;
  }
  .name-tools-head span {
    display: block;
    margin-top: 3px;
  }
  .name-rotate-row {
    grid-template-columns: 1fr 44px;
  }
  .name-rotate-row label {
    grid-column: 1 / -1;
  }
}

/* V0.4.4 – Detailkorrekturen ohne Änderung des Grundlayouts */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.editor,
.editor-head,
.workspace,
.controls-panel,
.preview-panel,
.step-block,
.canvas-wrap,
.name-tools,
.zoom-row,
.photo-actions,
.actions {
  min-width: 0;
  max-width: 100%;
}

.editor-head > *,
.workspace > *,
.name-tools-head > * {
  min-width: 0;
}

input,
textarea,
button,
label,
output {
  max-width: 100%;
}

input[type="range"] {
  min-width: 0;
}

/* Die Wandbilder wirken jetzt wie bewusst gesetzte, ausgeschnittene Malereien. */
.gitti-art {
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  filter: drop-shadow(3px 4px 0 rgba(32,32,32,.88));
}
.gitti-art img {
  object-fit: cover;
  filter: saturate(1.08) contrast(1.04);
}
.gaston-art {
  width: 170px;
  height: 260px;
  left: -48px;
  top: 168px;
  border-radius: 0;
  clip-path: polygon(7% 0, 100% 0, 100% 100%, 16% 100%, 0 89%, 9% 73%, 0 56%, 8% 35%, 0 17%);
  transform: rotate(-3deg);
}
.gaston-art img {
  object-position: 44% center;
}
.marsu-art {
  width: 190px;
  height: 215px;
  right: -54px;
  bottom: 72px;
  border-radius: 0;
  clip-path: polygon(14% 8%, 78% 0, 100% 17%, 93% 39%, 100% 58%, 87% 80%, 61% 100%, 35% 92%, 12% 100%, 0 75%, 8% 48%, 0 25%);
  transform: rotate(7deg);
  animation: marsu-hop 4.6s ease-in-out infinite;
  transform-origin: 70% 80%;
}
.marsu-art img {
  object-position: 69% 47%;
  transform: scale(1.08);
}
@keyframes marsu-hop {
  0%, 78%, 100% { transform: translateY(0) rotate(7deg); }
  84% { transform: translateY(-9px) rotate(2deg); }
  90% { transform: translateY(0) rotate(9deg); }
}

@media (prefers-reduced-motion: reduce) {
  .marsu-art { animation: none; }
}

@media (max-width: 980px) {
  .gaston-art {
    width: 132px;
    height: 202px;
    left: -39px;
    top: 195px;
    opacity: .96;
  }
  .marsu-art {
    width: 148px;
    height: 168px;
    right: -42px;
    bottom: 76px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
  }
  .editor {
    width: 100%;
    max-width: calc(100vw - 20px);
  }
  .editor-head {
    grid-template-columns: minmax(54px, auto) minmax(0, 1fr) auto;
  }
  .editor-head h2,
  .text-button,
  .version {
    overflow-wrap: anywhere;
  }
  .workspace {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
  }
  .preview-panel,
  .controls-panel {
    width: 100%;
  }
  .canvas-wrap {
    width: 100%;
  }
  .name-rotate-row {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 44px;
  }
  .hero-card {
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.62;
    letter-spacing: 0;
  }
  .hero-signoff {
    font-family: var(--font-hand);
    font-size: 1rem;
  }
  .gaston-art {
    width: 88px;
    height: 136px;
    left: -27px;
    top: 150px;
    opacity: .86;
  }
  .marsu-art {
    width: 104px;
    height: 118px;
    right: -31px;
    bottom: 103px;
    opacity: .92;
  }
}

/* V0.4.4 final – freigestellte Wandmalereien und stabiler mobiler Editor */
.gitti-art {
  clip-path: none;
}
.gitti-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.gaston-art,
.marsu-art {
  clip-path: none;
}
.gaston-art img,
.marsu-art img {
  transform: none;
}

/* Kein Element des Editors darf den mobilen Viewport verbreitern. */
.editor,
.editor * {
  box-sizing: border-box;
}
.editor {
  contain: inline-size;
}
.controls-panel,
.preview-panel,
.step-block,
.photo-actions,
.name-tools,
.name-rotate-row,
.zoom-row,
.actions {
  overflow-wrap: anywhere;
}
canvas,
img,
svg {
  max-width: 100%;
}

@media (max-width: 720px) {
  body {
    width: 100%;
    overflow-x: hidden;
  }
  .app-shell,
  .editor,
  .workspace,
  .controls-panel,
  .preview-panel,
  .step-block,
  .canvas-wrap {
    min-width: 0;
    max-width: 100%;
  }
  .editor {
    margin-inline: auto;
  }
  .hero-card {
    font-family: var(--font-main);
    font-weight: 500;
    font-size: clamp(.98rem, 4.2vw, 1.08rem);
    line-height: 1.62;
  }
  .hero-signoff {
    font-family: var(--font-hand);
    font-weight: 700;
    font-size: 1.08rem;
  }
}

/* V0.4.5 – Umsetzung des freigegebenen Layoutentwurfs */
:root {
  --comic-blue: #1763b8;
  --comic-red: #ef3028;
  --comic-yellow: #ffd328;
  --comic-paper: #fffaf0;
  --comic-ink: #101820;
  --comic-line: #1763b8;
}

html, body { width: 100%; max-width: 100%; overflow-x: clip; }
body {
  background:
    radial-gradient(circle at 14% 8%, rgba(23,99,184,.12), transparent 20rem),
    radial-gradient(circle at 88% 88%, rgba(255,211,40,.12), transparent 22rem),
    #f6f0e7;
}
.app-shell { width: 100%; max-width: 1180px; overflow: clip; }

/* Startseite wie ein bemaltes Blatt */
.hero {
  max-width: 1020px;
  padding: clamp(150px, 18vw, 210px) clamp(28px, 7vw, 88px) clamp(52px, 7vw, 82px);
  border: 0;
  border-radius: 0;
  box-shadow: 0 20px 55px rgba(16,24,32,.18);
  background:
    linear-gradient(90deg, var(--comic-blue) 0 18px, transparent 18px calc(100% - 18px), var(--comic-blue) calc(100% - 18px)),
    linear-gradient(var(--comic-blue) 0 18px, transparent 18px calc(100% - 18px), var(--comic-blue) calc(100% - 18px)),
    var(--comic-paper);
}
.hero::before {
  height: 120px;
  background:
    radial-gradient(circle at 8% 35%, var(--comic-yellow) 0 7px, transparent 8px),
    radial-gradient(circle at 91% 23%, var(--comic-yellow) 0 9px, transparent 10px),
    linear-gradient(176deg, var(--comic-blue) 0 72%, transparent 73%);
  z-index: 0;
}
.hero::after {
  width: 230px; height: 230px; right: -95px; bottom: -120px;
  border: 0; background: var(--comic-blue); opacity: .12;
}
.hero-figure { position: absolute; z-index: 4; pointer-events: none; object-fit: contain; }
.hero-gaston { width: clamp(170px, 26vw, 285px); left: -4px; top: 12px; }
.hero-marsus { width: clamp(150px, 23vw, 250px); right: 8px; top: 30px; }
.hero-flower { position:absolute; z-index:3; width:120px; left:80px; top:245px; pointer-events:none; }
.hero-banner { z-index: 5; margin-bottom: 28px; }
.banner-kicker {
  margin: 0;
  padding: 0;
  color: var(--comic-blue);
  background: none;
  border: 0;
  box-shadow: none;
  font-family: var(--font-hand);
  font-size: clamp(2.4rem, 7vw, 5.3rem);
  line-height: .9;
  transform: rotate(-2deg);
}
h1 { font-family: var(--font-hand); line-height: .82; letter-spacing: -.06em; }
h1 span { color: var(--comic-red); font-size: clamp(4.4rem, 12vw, 8.5rem); text-shadow: 2px 3px 0 rgba(16,24,32,.08); }
.hero-subtitle {
  margin: 20px auto 0;
  font-family: var(--font-hand);
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 800;
  transform: rotate(-1deg);
}
.hero-card {
  max-width: 760px;
  border: 2px solid rgba(23,99,184,.35);
  border-left: 0;
  border-radius: 4px;
  box-shadow: 0 9px 25px rgba(16,24,32,.08);
  background: rgba(255,255,255,.78);
  font-family: var(--font-hand);
}
.primary.big {
  background: var(--comic-yellow);
  color: var(--comic-ink);
  border-color: var(--comic-ink);
  border-radius: 5px;
  box-shadow: 5px 7px 0 rgba(16,24,32,.88);
  font-family: var(--font-hand);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}

/* Editor als tatsächliche Version des freigegebenen Entwurfs */
.editor {
  position: relative;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  overflow: clip;
  border: 0;
  border-radius: 0;
  box-shadow: 0 20px 55px rgba(16,24,32,.18);
  background:
    linear-gradient(90deg, rgba(23,99,184,.9) 0 14px, transparent 14px calc(100% - 14px), rgba(23,99,184,.9) calc(100% - 14px)),
    var(--comic-paper);
}
.editor::before {
  content:""; position:absolute; z-index:0; inset:0 0 auto; height:190px;
  background: linear-gradient(176deg, var(--comic-blue) 0 70%, transparent 71%);
  pointer-events:none;
}
.editor-artboard { position:absolute; inset:0; z-index:1; pointer-events:none; overflow:hidden; }
.editor-gaston { position:absolute; width:220px; left:-5px; top:20px; }
.editor-marsus { position:absolute; width:210px; right:10px; top:35px; }
.editor-head {
  position: relative; z-index: 3;
  min-height: 185px;
  grid-template-columns: 120px minmax(0,1fr) 64px;
  padding: 35px 24px 30px;
  color: white;
  background: transparent;
  border: 0;
}
.editor-head > div { max-width: 560px; margin: 0 auto; }
.editor-head .eyebrow { color: var(--comic-yellow); font-size:.9rem; }
.editor-head h2 { font-family:var(--font-hand); font-size:clamp(2.2rem,5.3vw,4.5rem); line-height:.9; text-shadow:2px 3px 0 rgba(0,0,0,.14); }
.editor-head .text-button { color:white; z-index:4; }
.version { background:var(--comic-yellow); color:var(--comic-ink); border:0; }
.process-ribbon {
  position:relative; z-index:4;
  display:grid; grid-template-columns:1.1fr 1fr 1fr;
  width:calc(100% - 70px); max-width:900px; margin:-12px auto 20px;
  filter:drop-shadow(0 4px 2px rgba(16,24,32,.25));
}
.process-ribbon span { position:relative; padding:15px 20px; text-align:center; font-weight:900; text-transform:uppercase; letter-spacing:.02em; }
.ribbon-red { color:white; background:var(--comic-red); clip-path:polygon(0 0,94% 0,100% 50%,94% 100%,0 100%); }
.ribbon-yellow { color:var(--comic-ink); background:var(--comic-yellow); margin-left:-5px; clip-path:polygon(0 0,94% 0,100% 50%,94% 100%,0 100%,6% 50%); }
.workspace {
  position:relative; z-index:3;
  grid-template-columns:minmax(250px, 31%) minmax(0, 1fr);
  gap:22px;
  padding:0 38px 185px;
  background:transparent;
}
.controls-panel { gap:8px; }
.step-block {
  padding:12px 14px;
  border:1.5px solid var(--comic-line);
  border-radius:7px;
  box-shadow:none;
  background:rgba(255,255,255,.88);
}
.step-title { margin-bottom:8px; }
.step-title span { width:30px; height:30px; flex-basis:30px; background:white; color:var(--comic-blue); border:2px solid var(--comic-blue); border-radius:4px; }
.step-title h3 { font-family:var(--font-hand); font-size:1.15rem; }
.photo-actions { gap:8px; }
.upload-button,.camera-button { min-height:62px; border-color:var(--comic-blue); border-style:dashed; border-radius:6px; box-shadow:none; }
.upload-button { background:white; color:var(--comic-blue); }
.camera-button { background:white; color:var(--comic-blue); }
.choice-grid { gap:7px; }
.templates { grid-template-columns:repeat(2,minmax(0,1fr)); }
.fonts { grid-template-columns:1fr; }
.choice,.font-choice { padding:8px; border-color:rgba(23,99,184,.55); border-radius:5px; }
.choice.active,.font-choice.active { background:#fff8cb; border-color:var(--comic-blue); box-shadow:2px 2px 0 var(--comic-blue); }
.color-grid { gap:9px; }
.controls-panel .actions { display:grid; grid-template-columns:1fr; }
.controls-panel .actions .secondary { order:1; background:var(--comic-yellow); }
.controls-panel .actions .primary { order:2; background:var(--comic-blue); }
.preview-panel {
  position:sticky; top:10px;
  padding:20px;
  border:1.5px solid var(--comic-line);
  border-radius:8px;
  box-shadow:none;
  background:rgba(255,255,255,.9);
}
.preview-label span { background:transparent; border:0; font-size:1.35rem; }
.canvas-wrap { width:min(100%,560px); border:1.5px solid var(--comic-blue); border-radius:0; box-shadow:0 8px 16px rgba(16,24,32,.15); }
.name-tools { border-color:rgba(23,99,184,.55); border-radius:6px; }
.primary,.secondary,.baba-button { border-radius:5px; }
.primary { background:var(--comic-blue); }
.secondary { background:var(--comic-yellow); }
.editor-flowers-left,.editor-flowers-right { position:absolute; z-index:2; pointer-events:none; bottom:0; object-fit:contain; }
.editor-flowers-left { left:4px; width:210px; }
.editor-flowers-right { right:10px; width:190px; }

/* Harte Sicherung gegen horizontales Schwimmen */
.editor, .editor *, .workspace, .workspace > *, .controls-panel, .preview-panel { min-width:0; }
.editor img { max-width:100%; }
.editor-head h2, .editor-head .eyebrow, .step-title h3, label, p { overflow-wrap:anywhere; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns:minmax(0,1fr); padding-left:24px; padding-right:24px; }
  .preview-panel { position:relative; top:auto; }
  .controls-panel { grid-row:2; }
  .preview-panel { grid-row:1; }
}

@media (max-width: 720px) {
  .app-shell { padding:0; }
  .hero { margin:0; padding:120px 18px 36px; box-shadow:none; background:var(--comic-paper); }
  .hero::before { height:90px; }
  .hero-gaston { width:135px; top:5px; left:-7px; }
  .hero-marsus { width:120px; top:14px; right:-2px; }
  .hero-flower { width:64px; left:82px; top:95px; }
  .banner-kicker { font-size:clamp(2.1rem,12vw,3.5rem); }
  h1 span { font-size:clamp(4.2rem,23vw,6.3rem); }
  .hero-subtitle { font-size:1.25rem; }
  .hero-card { margin:0; padding:20px 16px; font-family:var(--font-main); font-size:1rem; line-height:1.6; }
  .hero-signoff { font-family:var(--font-hand); }
  .editor { margin:0; width:100%; box-shadow:none; }
  .editor::before { height:125px; }
  .editor-gaston { width:110px; left:-10px; top:10px; }
  .editor-marsus { width:105px; right:-2px; top:12px; }
  .editor-head { min-height:128px; grid-template-columns:55px minmax(0,1fr) 38px; padding:24px 7px 18px; gap:3px; }
  .editor-head h2 { font-size:clamp(1.35rem,7.3vw,2rem); line-height:1; }
  .editor-head .eyebrow { display:none; }
  .version { font-size:.6rem; padding:4px; }
  .text-button { padding:3px; font-size:.72rem; }
  .process-ribbon { width:calc(100% - 20px); margin:-4px auto 14px; grid-template-columns:1fr; filter:none; }
  .process-ribbon span { padding:9px 12px; font-size:.75rem; clip-path:none; margin:0; }
  .process-ribbon span:not(:first-child) { display:none; }
  .workspace { width:100%; padding:0 10px 125px; gap:12px; }
  .preview-panel,.step-block { width:100%; max-width:100%; }
  .preview-panel { padding:10px; }
  .controls-panel { width:100%; }
  .photo-actions { grid-template-columns:1fr 1fr; }
  .upload-button,.camera-button { min-height:54px; padding:8px 5px; font-size:.82rem; }
  .templates { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .editor-flowers-left { width:125px; }
  .editor-flowers-right { width:115px; }
}

/* Mobile Feinschliff nach Praxistest */
.name-size-tools {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.name-size-tools > span { font-weight: 800; }
.name-size-tools .compact { min-width: 46px; }
.name-drag-hint { margin-top: 12px; }
.continue-editing,
.show-card-button { display: none; }

@media (max-width: 720px) {
  .workspace {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  .controls-panel { display: contents; }
  .photo-step { order: 1; }
  .preview-panel { order: 2; }
  .controls-panel > .step-block:nth-of-type(2) { order: 3; }
  .controls-panel > .step-block:nth-of-type(3) { order: 4; }
  .name-step { order: 5; }
  .controls-panel > .step-block:nth-of-type(5) { order: 6; }
  .consent-block { order: 7; }
  .actions { order: 8; }
  .status { order: 9; }

  .photo-step {
    margin-bottom: 0;
  }
  .preview-panel {
    margin: 0;
  }
  .preview-label { margin-bottom: 8px; }
  .preview-label span { font-size: 1.05rem; }
  .canvas-wrap {
    max-height: calc(100vh - 150px);
    width: min(100%, 430px);
  }
  .gesture-help {
    padding: 0 4px;
    line-height: 1.4;
  }
  .zoom-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 8px;
  }
  .zoom-row label {
    display: block;
    grid-column: 1 / -1;
    margin: 0;
    font-size: .86rem;
  }
  .zoom-row .compact { width: auto; }
  .continue-editing {
    display: block;
    width: 100%;
    margin-top: 12px;
    min-height: 44px;
    border: 2px solid var(--comic-blue);
    border-radius: 5px;
    background: var(--comic-yellow);
    color: var(--comic-ink);
    font-weight: 850;
  }
  .name-size-tools {
    grid-template-columns: 1fr auto auto;
  }
  .name-size-tools #resetName {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
  }
  .show-card-button {
    display: block;
    position: fixed;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 80;
    min-height: 44px;
    padding: 10px 15px;
    color: white;
    background: var(--comic-blue);
    border: 2px solid var(--comic-ink);
    border-radius: 999px;
    box-shadow: 3px 4px 0 var(--comic-ink);
    font-weight: 850;
  }
  .editor[hidden] .show-card-button { display: none; }
  .font-choice span { font-size: 1.05rem; }
  .step-block textarea { min-height: 110px; }
}
@media (max-width: 720px) {
  .canvas-wrap {
    width: min(100%, 430px, calc((100vh - 150px) * 2 / 3));
  }
}
