/* v7.6.6 Muse polish */
/* P1.1 hatch stage */
.dstage{background:radial-gradient(circle at 50% 45%,#FFE9F6 0%,rgba(255,233,246,0) 60%)}
.dstage .bun{position:relative;animation:bunwob 1.6s ease-in-out infinite!important;transform-origin:50% 90%;filter:drop-shadow(0 18px 14px rgba(122,75,156,.45))}
.dstage .bun::before{content:"";position:absolute;inset:8% 18% 12% 18%;border-radius:50% 50% 46% 46%/58% 58% 42% 42%;background:radial-gradient(circle at 35% 25%,rgba(255,255,255,.75),transparent 35%);box-shadow:inset -10px -14px 24px rgba(60,20,90,.22);pointer-events:none;z-index:1}
.dstage.wob .bun{animation:shakeb .4s ease-in-out infinite!important}
@keyframes bunwob{0%,100%{transform:rotate(-4deg)}50%{transform:rotate(4deg)}}
.dstage .spk6{position:absolute;border-radius:50%;pointer-events:none;animation:spk6 2.4s ease-in-out infinite;opacity:0}
@keyframes spk6{0%{opacity:0;transform:translateY(8px) scale(.6)}40%{opacity:1}100%{opacity:0;transform:translateY(-26px) scale(1)}}
/* P1.2 hint pill */
.dstage .dhint:not(.rcount):not(:empty){display:inline-flex;align-items:center;justify-content:center;min-height:56px!important;height:56px;padding:0 26px;border-radius:28px;background:#C2185B;color:#fff;font:800 22px system-ui,sans-serif!important;box-shadow:0 6px 0 #8E0F42,0 10px 20px rgba(194,24,91,.35);animation:hpulse 1.2s ease-in-out infinite}
@keyframes hpulse{0%,100%{transform:scale(1)}50%{transform:scale(1.06)}}
/* P1.3 reveal */
.reveal svg:not(.rspark){filter:drop-shadow(2px 0 0 rgba(255,255,255,.6)) drop-shadow(-2px 0 0 rgba(255,255,255,.6)) drop-shadow(0 2px 0 rgba(255,255,255,.6)) drop-shadow(0 -2px 0 rgba(255,255,255,.6))}
.reveal{position:relative}
.reveal::after{content:"";position:absolute;left:18%;right:18%;bottom:-2%;height:9%;border-radius:50%;background:rgba(122,75,156,.3);filter:blur(16px);z-index:-1}
.rrays{position:absolute;left:50%;top:50%;width:150%;height:150%;transform:translate(-50%,-50%);z-index:-1;pointer-events:none;background:repeating-conic-gradient(rgba(255,210,77,.35) 0 10deg,transparent 10deg 45deg);border-radius:50%;-webkit-mask:radial-gradient(circle,#000 30%,transparent 70%);mask:radial-gradient(circle,#000 30%,transparent 70%);animation:rays .3s ease-out both}
@keyframes rays{0%{opacity:0;transform:translate(-50%,-50%) scale(.4)}100%{opacity:1;transform:translate(-50%,-50%) scale(1)}}
/* P2.8 name card + pips */
.rname{background:rgba(255,255,255,.6);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border-radius:20px;padding:6px 18px;font:900 26px system-ui,sans-serif!important;color:#C2185B!important;margin:0}
.rpips{display:flex;gap:4px;justify-content:center;flex-wrap:wrap;max-width:220px}
.rpips i{width:12px;height:15px;border-radius:50% 50% 46% 46%/58% 58% 42% 42%;background:#e6daf2;box-shadow:inset 0 -2px 0 #0001}
.rpips i.got{background:linear-gradient(#ffd23f,#ff6fb5)}
.dstage .rcount.pipped{font-size:0!important;min-height:0!important}
/* P1.4 + P2.7 lit tool tiles */
.bar .ib,.bar .tool{box-sizing:border-box;background:linear-gradient(#FFFFFF,#F3ECFA)!important;border:1px solid #E6DAF2!important;box-shadow:0 3px 0 #DCCDEB,0 6px 12px rgba(80,40,120,.12)!important}
.bar .tool.on,.bar .ib.on{background:#FFE58A!important;box-shadow:0 3px 0 #E0B83C,0 6px 12px rgba(80,40,120,.12)!important}
#clear,#dClear{background:linear-gradient(#FFF1F1,#FFE3E3)!important}
@media (orientation:portrait){.bar.top .ib{min-width:44px!important;min-height:44px!important}}
/* P2.6 swatches */
.pal .sw{box-shadow:inset 0 3px 4px rgba(255,255,255,.55),inset 0 -3px 4px rgba(0,0,0,.15),0 0 0 1px #0002!important}
.pal .sw.on{box-shadow:inset 0 3px 4px rgba(255,255,255,.55),inset 0 -3px 4px rgba(0,0,0,.15),0 0 0 3px #fff,0 0 0 6px #2A1F3D!important;transform:none}
/* P2.9 book label */
.bklab{display:inline-block;vertical-align:middle;color:inherit}#dOk{display:inline-flex;align-items:center;gap:0;padding:0 18px}#dOk .bklab,.bookopen .bklab{font:700 16px system-ui,sans-serif;margin-left:8px}
/* P3.11 toast */
#saved{min-height:52px;display:flex;align-items:center;background:#fff!important;box-shadow:0 8px 24px rgba(80,40,120,.18)!important}
#saved.show{animation:toastup .22s ease-out}
@keyframes toastup{from{translate:0 14px}to{translate:0 0}}
/* P3.12 paper grain */
body::after{content:"";position:fixed;inset:0;pointer-events:none;z-index:1;opacity:.03;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}
body{background:linear-gradient(160deg,#FCE4F3,#C7DDFF)}
/* P2.10 landscape draw rail: Actions | Tools with a 12px divider gap */
@media (orientation:landscape) and (max-height:500px) and (min-aspect-ratio:5/4){
 body.v766dl #draw .bar.tools{row-gap:4px!important;grid-auto-rows:auto!important;grid-template-rows:none!important}
 body.v766dl #draw .bar.tools .grpdiv{grid-column:1/-1;height:1px;background:#E6DAF2;margin:4px 0;width:auto!important;min-width:0!important;border:0;box-shadow:none}
 body.v766dl #draw #dt-brush{grid-column:1/-1;width:auto!important}
 /* grouped rail: a spent undo/redo dims in place instead of leaving an empty row */
 body.v766dl #draw #dUndo:disabled,body.v766dl #draw #dRedo:disabled{visibility:visible!important;opacity:.35}
}
@media (prefers-reduced-motion:reduce){.dstage .bun,.dstage .dhint,.dstage .spk6,.rrays{animation:none!important}.dstage .spk6{opacity:.8}}

body:not(.v766dl) #v766div{display:none!important}
