@font-face{font-family:'Jost';src:url(fonts/jost.woff2) format('woff2');font-weight:100 900;font-display:swap}
@font-face{font-family:'Permanent Marker';src:url(fonts/permanent-marker.woff2) format('woff2');font-display:swap}
@font-face{font-family:'Mountains of Christmas';src:url(fonts/mountains-of-christmas.woff2) format('woff2');font-display:swap}
@font-face{font-family:'Anton';src:url(fonts/anton.woff2) format('woff2');font-display:swap}
@font-face{font-family:'Bebas Neue';src:url(fonts/bebas-neue.woff2) format('woff2');font-display:swap}
@font-face{font-family:'Bungee';src:url(fonts/bungee.woff2) format('woff2');font-display:swap}
@font-face{font-family:'Shrikhand';src:url(fonts/shrikhand.woff2) format('woff2');font-display:swap}
@font-face{font-family:'Special Elite';src:url(fonts/special-elite.woff2) format('woff2');font-display:swap}

:root{
  --bg:#0a0a0a; --surface:#141414; --surface2:#1e1e1e; --border:#2a2a2a; --text:#f0f0f0; --text-dim:#9a9a9a;
  --violet:#ff90e8; --gold:#fcc700; --green:#54f595; --on-accent:#000; --danger:#ff7a7a;
  --stage-bg:#1a1a1a;
}
body.light-mode{
  --bg:#f5f5f5; --surface:#fff; --surface2:#f0f0f0; --border:#e0e0e0; --text:#1a1a1a; --text-dim:#666;
  --danger:#c62828; --stage-bg:#e9e9e9;
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%;overflow:hidden;overscroll-behavior:none;background:var(--bg);color:var(--text);font-family:'Jost',system-ui,sans-serif;font-size:16px;line-height:1.35}
button,input,label{font:inherit;color:inherit}
button{background:none;border:0;cursor:pointer;touch-action:manipulation}
:focus-visible{outline:2px solid var(--violet);outline-offset:2px}

#app{height:var(--app-h,100dvh);max-width:560px;margin:0 auto;position:relative;overflow:hidden}
.screen{display:none;position:absolute;inset:0;flex-direction:column;padding-bottom:env(safe-area-inset-bottom)}
.screen.active{display:flex}

.bar{display:flex;align-items:center;gap:6px;min-height:56px;padding:6px 10px;padding-top:max(6px,env(safe-area-inset-top));flex:none}
.barTitle{flex:1;min-width:0;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.logo{height:32px;width:auto;margin:0 6px}
.iconBtn{width:44px;height:44px;display:grid;place-items:center;border-radius:12px;flex:none}
.iconBtn:active{background:var(--surface2)}
.iconBtn:disabled{opacity:.3}
.iconBtn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

.cta{display:inline-flex;align-items:center;justify-content:center;min-height:52px;padding:0 20px;border-radius:14px;background:var(--violet);color:var(--on-accent);font-weight:700;cursor:pointer;touch-action:manipulation}
.cta:active{transform:translateY(1px)}
.cta.small{min-height:44px;padding:0 16px;flex:none}
.cta.wide{width:100%}
.cta:disabled,.cta.disabled{background:var(--surface2);color:var(--text-dim);cursor:default}
.hint{color:var(--text-dim);font-size:14px}

/* Start */
.startBody{flex:1;overflow-y:auto;padding:4px 16px 16px}
.hero{display:flex;justify-content:center;gap:6px;margin:4px 0 14px}
.hero svg{width:22%;max-width:84px;height:auto}
.hero svg:nth-child(1){transform:rotate(-7deg)}
.hero svg:nth-child(2){transform:translateY(-6px) scale(1.12)}
.hero svg:nth-child(3){transform:rotate(7deg)}
h1{font-size:34px;line-height:1.03;font-weight:800;letter-spacing:-.02em}
.lead{color:var(--text-dim);margin:8px 0 18px}
.tiles{display:grid;gap:10px}
.tile{display:flex;align-items:center;gap:14px;width:100%;min-height:76px;padding:8px 16px 8px 8px;border:1px solid var(--border);border-radius:16px;background:var(--surface);text-align:left}
.tile:active{border-color:var(--violet)}
.tile svg{width:60px;height:60px;flex:none}
.tile .body{fill:#f4f2ec;stroke:#999;stroke-width:.8}
.tile .detail{fill:none;stroke:#999;stroke-width:.7}
.tile b{display:block;font-size:19px}
.tile small{color:var(--text-dim);font-size:14px}
.tile .price{margin-left:auto;font-weight:700;font-size:19px;white-space:nowrap}
.calm{margin-top:16px;color:var(--text-dim);font-size:14px}
.legal{display:flex;gap:16px;padding:10px 16px;font-size:13px;color:var(--text-dim);flex:none}
.legal span{margin-right:auto}
.legal a{color:inherit;padding:4px 0}

/* Editor */
#area{flex:1;min-height:0;position:relative;container-type:size;display:grid;place-items:center;background:var(--stage-bg);touch-action:none;user-select:none;-webkit-user-select:none;overflow:hidden}
#canvas{position:relative;width:min(100cqw,100cqh);height:min(100cqw,100cqh)}
#garment{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
#garment .body{fill:var(--garment,#f4f2ec);stroke:var(--seam,#999);stroke-width:.6;stroke-linejoin:round}
#garment .detail{fill:none;stroke:var(--seam,#999);stroke-width:.5}
#stage,#selLayer{position:absolute}
#stage{overflow:hidden;outline:1px dashed var(--seam,#999);outline-offset:0}
#selLayer{pointer-events:none}
#paint{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.el{position:absolute;transform-origin:center;line-height:1}
.el svg,.el img{display:block;width:100%;height:100%;pointer-events:none;-webkit-user-drag:none}
.el.text{white-space:pre;width:max-content}
#sel{position:absolute;display:none;border:1.5px solid var(--violet);box-shadow:0 0 0 1px rgba(0,0,0,.35)}
#selHandle{position:absolute;right:-22px;bottom:-22px;width:44px;height:44px;pointer-events:auto;border-radius:50%}
#selHandle::after{content:'';position:absolute;inset:11px;border-radius:50%;background:var(--violet);border:2px solid #000}
#guide{position:absolute;display:none;left:50%;top:-6%;bottom:-6%;width:0;border-left:1.5px solid var(--green)}

.sides{position:absolute;top:8px;left:50%;transform:translateX(-50%);display:flex;background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:3px}
.sides button{min-height:38px;min-width:72px;padding:0 12px;border-radius:9px;font-size:15px;font-weight:600;color:var(--text-dim)}
.sides button.active{background:var(--text);color:var(--bg)}
/* Rechts neben der Druckfläche, damit die Leiste nie das Design verdeckt */
.elbar{position:absolute;right:6px;top:50%;transform:translateY(-50%);display:none;flex-direction:column;gap:0;background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:2px}
.elbar.show{display:flex}
.elbar button.danger{color:var(--danger)}
.toast{position:absolute;bottom:64px;left:50%;transform:translateX(-50%);max-width:88%;padding:9px 14px;border-radius:12px;background:var(--text);color:var(--bg);font-size:15px;font-weight:600;opacity:0;pointer-events:none;transition:opacity .2s;text-align:center}
.toast.show{opacity:1}

.panels{flex:none;height:186px;background:var(--surface);border-top:1px solid var(--border);position:relative}
.panel{display:none;position:absolute;inset:0;padding:10px 12px;overflow-y:auto;overscroll-behavior:contain}
.panel.active{display:block}
.motifGrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(68px,1fr));gap:6px}
.motifGrid button{aspect-ratio:1;padding:7px;border-radius:12px;background:#f4f2ec}
.motifGrid button:active{background:var(--violet)}
.motifGrid svg{width:100%;height:100%;display:block}
.textRow{display:flex;gap:8px;margin-bottom:8px}
#textInput{flex:1;min-width:0;height:44px;padding:0 12px;border:1px solid var(--border);border-radius:12px;background:var(--surface2);font-size:16px}
.scrollRow{display:flex;gap:6px;overflow-x:auto;padding:2px 0 6px;scrollbar-width:none;margin-bottom:2px}
.scrollRow::-webkit-scrollbar{display:none}
.chip{flex:none;min-height:40px;padding:0 12px;border:1px solid var(--border);border-radius:11px;background:var(--surface2);white-space:nowrap;font-size:15px}
.chip.active{border-color:var(--violet);box-shadow:inset 0 0 0 1px var(--violet)}
.dot{flex:none;width:40px;height:40px;border-radius:50%;border:2px solid var(--border)}
.dot.active{outline:2px solid var(--violet);outline-offset:2px}
.brushRow{display:flex;gap:6px;align-items:center;margin-top:6px;flex-wrap:wrap}
.brush{width:44px;height:44px;display:grid;place-items:center;border:1px solid var(--border);border-radius:11px;background:var(--surface2)}
.brush i{display:block;border-radius:50%;background:currentColor}
.brush.active{border-color:var(--violet);box-shadow:inset 0 0 0 1px var(--violet)}
.panel[data-panel=paint] .hint{margin-bottom:6px}
.consent{display:flex;gap:10px;align-items:flex-start;font-size:15px;margin-bottom:10px;min-height:44px}
.consent input{width:22px;height:22px;flex:none;accent-color:var(--violet);margin-top:1px}
.photoBtns{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.photoBtns .cta{padding:0 8px;text-align:center}
.panel[data-panel=photo] .hint{margin-top:8px}
.swatches{display:flex;flex-wrap:wrap;gap:10px;padding:4px 2px 8px}
.swatches .dot{width:44px;height:44px}

.tabs{flex:none;display:grid;grid-template-columns:repeat(5,1fr);background:var(--surface);border-top:1px solid var(--border)}
.tabs button{min-height:50px;font-size:15px;font-weight:600;color:var(--text-dim)}
.tabs button.active{color:var(--text);box-shadow:inset 0 2px 0 var(--violet)}

/* Tastatur offen: nur noch Eingabe und Vorschau */
body.kb .tabs,body.kb #presets,body.kb #fonts,body.kb #textColors,body.kb .sides,body.kb .elbar{display:none}
body.kb .panels{height:66px}

/* Bestellen */
.orderBody{flex:1;min-height:0;overflow-y:auto;padding:0 16px 12px}
.previews{display:flex;gap:10px;justify-content:center;margin-bottom:10px}
.mock{position:relative;flex:1;max-width:260px;aspect-ratio:1;background:var(--stage-bg);border-radius:14px;overflow:hidden}
.mock svg{position:absolute;inset:0;width:100%;height:100%}
.mock .body{stroke-width:.6;stroke-linejoin:round}
.mock .detail{fill:none;stroke-width:.5}
.mock img{position:absolute}
.mock span{position:absolute;left:8px;bottom:6px;font-size:13px;color:var(--text-dim)}
.orderInfo{font-weight:600;margin-bottom:8px}
.sizeRow{display:flex;align-items:center;justify-content:space-between;min-height:56px;border-top:1px solid var(--border)}
.sizeRow b{font-size:18px}
.stepper{display:flex;align-items:center;gap:4px}
.stepper button{width:44px;height:44px;border-radius:12px;background:var(--surface2);font-size:22px;line-height:1}
.stepper button:disabled{opacity:.35}
.stepper output{min-width:30px;text-align:center;font-weight:700;font-size:18px}
.orderFoot{flex:none;padding:10px 16px 12px;border-top:1px solid var(--border);background:var(--surface)}
.total{display:flex;justify-content:space-between;font-size:18px}
.total b{font-size:22px}
.orderFoot .hint{margin-bottom:8px}
.orderFoot .total{margin-bottom:6px}
.error{color:var(--danger);font-size:15px;margin-bottom:8px}
.error:empty{display:none}

/* Weihnachts-Trash */
#snow{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:5}
.lights{flex:none;display:flex;justify-content:space-between;padding:0 8px;height:18px;border-top:2px solid var(--border);margin:-4px 8px 4px;border-radius:50%/0}
.lights i{width:9px;height:13px;margin-top:1px;border-radius:50% 50% 50% 50%/40% 40% 60% 60%;animation:blink 1.2s steps(2,jump-none) infinite}
.lights i:nth-child(4n+1){background:#d81f2a}
.lights i:nth-child(4n+2){background:var(--gold);animation-delay:.3s}
.lights i:nth-child(4n+3){background:var(--green);animation-delay:.6s}
.lights i:nth-child(4n){background:var(--violet);animation-delay:.9s}
@keyframes blink{from{opacity:1;box-shadow:0 0 8px currentColor}to{opacity:.3}}
.heroWrap{position:relative}
.sticker{position:absolute;top:0;right:0;width:92px;height:92px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:var(--gold);color:#000;transform:rotate(12deg);line-height:1.02;padding:12px;
  clip-path:polygon(50% 0,60% 12%,75% 6%,78% 21%,94% 25%,88% 40%,100% 50%,88% 60%,94% 75%,78% 79%,75% 94%,60% 88%,50% 100%,40% 88%,25% 94%,22% 79%,6% 75%,12% 60%,0 50%,12% 40%,6% 25%,22% 21%,25% 6%,40% 12%);animation:wobble 2.4s ease-in-out infinite}
.sticker b{font-size:13px}
.sticker small{font-size:11px}
@keyframes wobble{50%{transform:rotate(5deg) scale(1.06)}}
.bubble{position:fixed;left:50%;top:calc(66px + env(safe-area-inset-top));transform:translateX(-50%);z-index:20;display:flex;gap:7px;align-items:center;max-width:min(88vw,420px);min-height:42px;padding:8px 14px;border:2px solid var(--gold);border-radius:16px;background:#d81f2a;color:#fff;font-family:'Permanent Marker','Jost',sans-serif;font-size:17px;pointer-events:none;animation:pop .22s cubic-bezier(.2,1.6,.4,1);transition:opacity .4s}
.bubble.out{opacity:0}
@keyframes pop{from{transform:translateX(-50%) scale(.6)}}
.dots{display:flex;gap:4px}
.dots i{width:7px;height:7px;border-radius:50%;background:#fff;animation:dot .9s infinite}
.dots i:nth-child(2){animation-delay:.15s}
.dots i:nth-child(3){animation-delay:.3s}
@keyframes dot{50%{transform:translateY(-4px);opacity:.5}}
.flake{position:fixed;z-index:19;pointer-events:none}
@media (prefers-reduced-motion:reduce){.lights i,.sticker,.dots i{animation:none}}

/* Ladebalken. scaleX statt width: läuft auch weiter, während der Browser die Druckdatei rechnet */
.progress{margin-bottom:10px}
.progressText{display:flex;justify-content:space-between;gap:10px;font-size:15px;font-weight:600;margin-bottom:5px}
.progressText span:last-child{white-space:nowrap;color:var(--text-dim);font-weight:500}
.progressTrack{height:12px;border-radius:6px;background:var(--surface2);overflow:hidden}
.progressTrack i{display:block;height:100%;transform:scaleX(0);transform-origin:left;transition:transform .35s ease-out;background:repeating-linear-gradient(-45deg,#d81f2a 0 12px,#f4f1e8 12px 24px)}

/* Memes */
.panelHead{font-size:14px;font-weight:700;color:var(--text-dim);margin:0 0 4px 2px}
.panelHead:not(:first-child){margin-top:6px}
.meme{flex:none;width:104px;height:112px;display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:4px;border-radius:12px;background:#f4f2ec;color:#111;font-family:'Anton',sans-serif;font-size:10px;line-height:1.08;text-align:center}
.meme svg{width:58px;height:58px;flex:none}
.meme:active{background:var(--violet)}
.inApp{margin:6px 0;font-size:14px;font-weight:600;color:var(--gold)}

/* Warenkorb */
[hidden]{display:none!important}
.deadline{margin-bottom:12px;padding:9px 12px;border-radius:12px;background:var(--gold);color:#000;font-weight:600;font-size:15px}
.orderFoot .deadline{margin:6px 0}
.note{margin-bottom:10px;padding:10px 12px;border-radius:12px;background:var(--surface2);font-weight:600}
.ghost{min-height:52px;margin-top:12px;border:1px solid var(--border);border-radius:14px;font-weight:700}
.ghost:disabled{color:var(--text-dim)}
.ghost.wide{width:100%}
.cartItem{display:flex;gap:12px;padding:10px 0;border-bottom:1px solid var(--border)}
.cartItem .mock{flex:0 0 104px;height:104px}
.cartItem .mock span{display:none}
.cartText{flex:1;min-width:0;display:flex;flex-direction:column}
.cartText span{color:var(--text-dim);font-size:15px}
.cartActions{display:flex;gap:4px;margin:4px 0 0 -8px;flex-wrap:wrap}
.cartActions button{min-height:44px;padding:0 8px;font-size:15px;text-decoration:underline;text-underline-offset:3px}
.cartActions button:disabled{opacity:.4}

@media (max-height:640px){.panels{height:150px}.heroWrap{display:none}}
