/* Mundo da Flor V6.1 — Editor de personagem (pessoas e cães) */
.ed61{position:fixed;inset:0;z-index:100000;background:radial-gradient(120% 120% at 20% 0%,#5B3A8E 0%,#2B1B3D 70%);color:var(--ink,#2B1B3D);font-family:var(--f2,'Nunito',system-ui,sans-serif);padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));animation:ed61in .25s ease-out;touch-action:manipulation;-webkit-user-select:none;user-select:none}
.ed61.out{opacity:0;transform:scale(.98);transition:opacity .2s,transform .2s}
@keyframes ed61in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
.ed61 *{box-sizing:border-box}
.ed61 button{font-family:var(--f1,'Fredoka',system-ui,sans-serif);cursor:pointer;border:0;color:inherit;-webkit-tap-highlight-color:transparent}
.ed-wrap{position:relative;height:100%;display:grid;grid-template-columns:minmax(210px,36%) 1fr;gap:10px;min-height:0}
/* palco */
.ed-stage{position:relative;border-radius:24px;background:linear-gradient(180deg,#FFD9EC 0%,#E6D8FF 55%,#CFE9FF 100%);overflow:hidden;box-shadow:inset 0 0 0 3px rgba(255,255,255,.7),0 5px 0 rgba(0,0,0,.25);min-height:0}
.ed-stage canvas{position:absolute;inset:0;width:100%;height:100%;image-rendering:pixelated;touch-action:pan-y;cursor:grab}
.ed-glow{position:absolute;left:50%;top:50%;width:90%;aspect-ratio:1;transform:translate(-50%,-50%);background:radial-gradient(circle,rgba(255,255,255,.95),rgba(255,255,255,0) 66%);pointer-events:none}
.ed-name{position:absolute;left:50%;top:8px;transform:translateX(-50%);max-width:92%;background:#fff;border-radius:99px;padding:3px 18px;font:600 clamp(16px,2.6vw,22px) var(--f1);color:#7B5CFF;box-shadow:0 3px 0 #E0D4F5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;z-index:2}
.ed-ctl{position:absolute;left:0;right:0;bottom:8px;display:flex;justify-content:center;gap:8px;z-index:2}
.ed-ctl button{width:46px;height:46px;border-radius:50%;background:#fff;font-size:22px;line-height:1;box-shadow:0 3px 0 #D7CBEE;color:#2B1B3D}
.ed-ctl button.on{background:#19B5A5;color:#fff;box-shadow:0 3px 0 #0F8B7E}
.ed-ctl button:active{transform:translateY(2px);box-shadow:0 1px 0 #D7CBEE}
/* lado direito */
.ed-side{display:flex;flex-direction:column;min-height:0;min-width:0;background:#FFF8EC;border-radius:24px;padding:8px 10px 10px;box-shadow:0 5px 0 rgba(0,0,0,.25)}
.ed-top{display:flex;align-items:center;gap:8px;flex:none}
.ed-top h2{margin:0;flex:1;font:600 clamp(18px,3vw,26px) var(--f1);color:#FF4F9A;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ed-x{width:40px;height:40px;border-radius:50%;background:#fff;font-size:18px;box-shadow:0 3px 0 #D7CBEE;color:#2B1B3D;flex:none}
.ed-tabs{display:flex;gap:5px;overflow-x:auto;padding:6px 2px 8px;scrollbar-width:none;flex:none}
.ed-tabs::-webkit-scrollbar{display:none}
.ed-tab{flex:1 0 auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;background:#fff;border-radius:15px;padding:3px 7px;min-height:52px;font:600 clamp(12px,1.9vw,15px)/1.1 var(--f1);color:#2B1B3D;box-shadow:0 3px 0 #D7CBEE;text-align:center}
.ed-tab span{font-size:21px;line-height:1.1}
.ed-tab.on{background:linear-gradient(135deg,#FF4F9A,#FF8E5A);color:#fff;box-shadow:0 3px 0 #C23878}
.ed-body{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:2px 4px 8px;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#C9B8EE transparent}
.ed-sec{margin:0 0 12px}
.ed-sec h3{margin:2px 0 6px;font:600 clamp(15px,2.3vw,18px) var(--f1);color:#7B5CFF}
.ed-hint{margin:-2px 0 6px;font:700 13px var(--f2);color:#5B4A74}
/* cores */
.ed-sws{display:flex;flex-wrap:wrap;gap:8px}
.ed-sw{position:relative;width:44px;height:44px;border-radius:50%;background:var(--c);box-shadow:inset 0 0 0 2px rgba(43,27,61,.28),0 2px 0 rgba(43,27,61,.18);display:flex;align-items:center;justify-content:center;padding:0;flex:none}
.ed-sw.on{box-shadow:0 0 0 3px #fff,0 0 0 6px #FF4F9A;transform:scale(1.04)}
.ed-sw i{font-style:normal;font-weight:800;font-size:20px;color:#fff;text-shadow:0 0 3px #000,0 0 2px #000,0 1px 2px #000}
.ed-sw .ed-bar{font-size:22px;color:#2B1B3D;text-shadow:0 0 3px #fff,0 0 3px #fff}
.ed-sw.none b{font-size:20px;color:#5B4A74}
.ed-sw.custom{background:conic-gradient(#f44,#fc4,#4d4,#4cf,#74f,#f4c,#f44);overflow:hidden;cursor:pointer}
.ed-sw.custom b{font-size:18px;pointer-events:none;text-shadow:0 0 3px #fff}
.ed-sw.custom input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;border:0;padding:0}
/* cartões de opção (miniaturas) */
.ed-opts{display:grid;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:8px}
.ed-opt{position:relative;background:#fff;border:3px solid transparent;border-radius:18px;padding:6px 3px 5px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:3px;box-shadow:0 3px 0 #E3D8F3;min-height:44px;color:#2B1B3D}
.ed-opt img{width:56px;height:68px;object-fit:contain;image-rendering:pixelated;display:block}
.ed-opt.tall img{width:64px;height:96px}
.ed-opt.sm{min-height:50px;justify-content:center}
.ed-opt em{font:700 13px/1.15 var(--f2);font-style:normal;text-align:center;color:#2B1B3D}
.ed-opt.on{border-color:#FF4F9A;background:#FFEAF4}
.ed-opt i{position:absolute;top:-6px;right:-6px;width:24px;height:24px;border-radius:50%;background:#FF4F9A;color:#fff;font:800 14px/24px var(--f1);font-style:normal;text-align:center}
.ed-opt .ed-no{width:56px;height:68px;display:flex;align-items:center;justify-content:center;font-size:30px;color:#9a8cb8}
.ed-opt.wide{grid-column:span 1;min-height:76px;justify-content:center}
.ed-opt .ed-em{font-size:34px;line-height:1}
.ed-opt.wide em{font:600 17px var(--f1)}
/* interruptores */
.ed-tgs{display:flex;flex-wrap:wrap;gap:8px}
.ed-tg{display:flex;align-items:center;gap:7px;min-height:48px;padding:0 6px 0 12px;border-radius:16px;background:#fff;font:600 16px var(--f1);color:#2B1B3D;box-shadow:0 3px 0 #E3D8F3;border:3px solid transparent}
.ed-tg span{font-size:20px}
.ed-tg i{font-style:normal;font-size:13px;min-width:38px;text-align:center;padding:5px 8px;border-radius:99px;background:#E9E3F5;color:#5B4A74;margin-left:2px}
.ed-tg.on{border-color:#19B5A5;background:#E4FAF6}
.ed-tg.on i{background:#19B5A5;color:#fff}
.ed-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}
.ed-mini{min-height:44px;padding:0 14px;border-radius:14px;background:#fff;font:600 15px var(--f1);color:#7B5CFF;box-shadow:0 3px 0 #D7CBEE;border:2px solid #E3D8F3}
/* campos */
.ed-in{width:100%;height:54px;border-radius:16px;border:3px solid #D7CBEE;background:#fff;padding:0 16px;font:600 24px var(--f1);color:#2B1B3D;-webkit-user-select:text;user-select:text;outline:none}
.ed-in:focus{border-color:#7B5CFF}.ed-in.bad{border-color:#E8374F;animation:edshake .35s}
@keyframes edshake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
.ed-bd{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.ed-bd select{height:50px;border-radius:14px;border:3px solid #D7CBEE;background:#fff;padding:0 12px;font:600 19px var(--f1);color:#2B1B3D;min-width:90px}
/* rodapé */
.ed-foot{display:flex;gap:8px;flex:none;padding-top:8px}
.ed-b{flex:1;min-height:54px;border-radius:18px;font:600 clamp(16px,2.6vw,21px) var(--f1);padding:0 10px;white-space:nowrap;box-shadow:0 4px 0 rgba(43,27,61,.25)}
.ed-b:active{transform:translateY(3px);box-shadow:0 1px 0 rgba(43,27,61,.25)}
.ed-b.ok{background:linear-gradient(135deg,#19B5A5,#2BC98A);color:#fff;box-shadow:0 4px 0 #0F8B7E;flex:1.35}
.ed-b.cancel{background:#fff;color:#2B1B3D;box-shadow:0 4px 0 #D7CBEE}
.ed-b.dice{background:linear-gradient(135deg,#FFC83D,#FF9F43);color:#2B1B3D;box-shadow:0 4px 0 #C98A1E}
.ed-b.dice.roll{animation:edroll .5s}
@keyframes edroll{0%{transform:rotate(0)}60%{transform:rotate(-8deg) scale(1.06)}100%{transform:none}}
/* pergunta e aviso */
.ed-ask{position:absolute;inset:0;z-index:5;background:rgba(43,27,61,.7);display:flex;align-items:center;justify-content:center;border-radius:24px}
.ed-ask[hidden]{display:none}
.ed-askbox{background:#fff;border-radius:26px;padding:18px 20px;width:min(440px,92%);text-align:center;box-shadow:0 12px 40px rgba(0,0,0,.4);border:4px solid #FF4F9A}
.ed-askbox h3{margin:0 0 4px;font:600 24px var(--f1);color:#FF4F9A}.ed-askbox p{margin:0 0 12px;font:700 16px var(--f2);color:#2B1B3D}
.ed-askbox div{display:flex;gap:8px}
.ed-toast{position:absolute;left:50%;bottom:90px;transform:translate(-50%,10px);background:#2B1B3D;color:#fff;padding:10px 18px;border-radius:99px;font:600 17px var(--f1);opacity:0;pointer-events:none;z-index:6;white-space:nowrap}
.ed-toast.show{animation:edtoast 2.2s forwards}
@keyframes edtoast{10%,80%{opacity:1;transform:translate(-50%,0)}100%{opacity:0}}
/* ecrãs baixos (telemóvel na horizontal) */
@media (max-height:430px){
  .ed61{padding:6px max(8px,env(safe-area-inset-right)) 6px max(8px,env(safe-area-inset-left))}
  .ed-wrap{gap:8px;grid-template-columns:minmax(190px,34%) 1fr}
  .ed-side{padding:6px 8px 8px;border-radius:20px}.ed-stage{border-radius:20px}
  .ed-top h2{font-size:18px}.ed-x{width:36px;height:36px}
  .ed-tabs{padding:4px 2px 6px}.ed-tab{min-height:48px;padding:2px 5px;font-size:12.5px;border-radius:14px}.ed-tab span{font-size:19px}
  .ed-sw{width:42px;height:42px}.ed-sws{gap:7px}
  .ed-opts{grid-template-columns:repeat(auto-fill,minmax(80px,1fr));gap:7px}
  .ed-opt img,.ed-opt .ed-no{width:48px;height:58px}.ed-opt.tall img{width:54px;height:80px}
  .ed-foot{padding-top:6px}.ed-b{min-height:50px;border-radius:16px}
  .ed-sec{margin-bottom:8px}.ed-ctl button{width:42px;height:42px;font-size:20px}
  .ed-name{top:6px}
  .ed-toast{bottom:70px}
}
/* vertical (telemóvel em pé) */
@media (max-aspect-ratio:1/1){
  .ed-wrap{grid-template-columns:1fr;grid-template-rows:minmax(150px,38%) 1fr;gap:8px}
  .ed-opts{grid-template-columns:repeat(auto-fill,minmax(84px,1fr))}
  .ed-tabs{flex-wrap:wrap;overflow:visible}.ed-tab{flex:1 0 30%}.ed-tabs.n4 .ed-tab{flex:1 0 22%}
}
@media (max-aspect-ratio:1/1) and (min-height:431px){.ed-sw{width:44px;height:44px}}
@media (prefers-reduced-motion:reduce){.ed61,.ed-b.dice.roll,.ed-toast.show,.ed-in.bad{animation:none}}
/* ===== V7.4.1-K5: peles com nome, maquilhagem, estúdio de fotos ===== */
.ed-grp{margin:8px 2px 5px;font:700 12px var(--f1);letter-spacing:.4px;text-transform:uppercase;color:#8A7AA6}
.ed-grp:first-child{margin-top:0}
.ed-sws2{margin-top:8px}
.ed-bgs{display:grid;grid-template-columns:repeat(auto-fill,minmax(54px,1fr));gap:9px}
.ed-bg{position:relative;height:54px;border-radius:16px;background:var(--c);box-shadow:inset 0 0 0 2px rgba(43,27,61,.18),0 3px 0 rgba(43,27,61,.14);padding:0}
.ed-bg.on{box-shadow:0 0 0 3px #fff,0 0 0 6px #FF4F9A;transform:scale(1.04)}
.ed-bg i{position:absolute;right:-5px;top:-6px;width:22px;height:22px;border-radius:50%;background:#FF4F9A;color:#fff;font:800 13px/22px var(--f1);font-style:normal;text-align:center}
.ed-pcard{display:flex;align-items:center;gap:12px;background:#fff;border-radius:20px;padding:10px 12px;box-shadow:0 3px 0 #E3D8F3}
.ed-ph{flex:none;width:76px;height:76px;border-radius:50%;overflow:hidden;box-shadow:0 0 0 4px #FFC83D,0 3px 0 4px #C98A1E;display:block}
.ed-ph img{width:100%;height:100%;object-fit:cover;image-rendering:pixelated;display:block}
.ed-pcard b{display:block;font:600 20px var(--f1);color:#2B1B3D}.ed-pcard small{font:700 13px var(--f2);color:#5B4A74}
.ed-snap{flex:none;width:100%;max-width:280px}
.ed-sparks{position:absolute;inset:0;pointer-events:none;overflow:hidden;opacity:0;transition:opacity .4s;z-index:1}
.ed-stage[data-pose=dance] .ed-sparks,.ed-stage[data-pose=jump] .ed-sparks{opacity:1}
.ed-sparks i{position:absolute;bottom:18%;width:10px;height:10px;background:#fff;clip-path:polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%);opacity:0;animation:edspark 2.4s ease-in infinite;filter:drop-shadow(0 0 4px #fff)}
.ed-sparks i:nth-child(1){left:18%;animation-delay:0s}.ed-sparks i:nth-child(2){left:32%;animation-delay:.5s;width:7px;height:7px}.ed-sparks i:nth-child(3){left:46%;animation-delay:1.1s}
.ed-sparks i:nth-child(4){left:60%;animation-delay:.3s;width:8px;height:8px}.ed-sparks i:nth-child(5){left:74%;animation-delay:.9s}.ed-sparks i:nth-child(6){left:84%;animation-delay:1.6s;width:7px;height:7px}
@keyframes edspark{0%{transform:translateY(0) scale(.4) rotate(0);opacity:0}15%{opacity:1}100%{transform:translateY(-190px) scale(1.15) rotate(160deg);opacity:0}}
.ed-flash{position:absolute;inset:0;background:#fff;opacity:0;pointer-events:none;z-index:4}
.ed-flash.go{animation:edflash .55s ease-out}
@keyframes edflash{0%{opacity:.95}100%{opacity:0}}
.ed-stage.dark .ed-glow{background:radial-gradient(circle,rgba(190,170,255,.55),rgba(190,170,255,0) 66%)}
.ed-tabs.n7 .ed-tab{flex:1 0 22%}
@media (max-width:520px) and (min-height:431px){.ed-tabs.n7 .ed-tab{flex:1 0 22%}}
@media (prefers-reduced-motion:reduce){.ed-sparks i,.ed-flash.go{animation:none}}
