*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:#fde8ef;font-family:ui-rounded,"SF Pro Rounded","Nunito","Segoe UI",system-ui,-apple-system,sans-serif;color:#5b3550;user-select:none;-webkit-user-select:none;touch-action:none;overscroll-behavior:none}
button{font:inherit;color:inherit;border:0;cursor:pointer;touch-action:manipulation;background:none}
#app{position:fixed;inset:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;background:linear-gradient(#fff3f7,#fde3ee)}
#top{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px 6px;padding-top:max(8px,env(safe-area-inset-top));z-index:3}
#modes{display:flex;gap:3px;background:#fff;padding:4px;border-radius:999px;box-shadow:0 3px 12px rgba(170,60,110,.15);min-width:0}
#modes button{padding:9px 14px;border-radius:999px;font-weight:800;font-size:15px;color:#9a5a7c;white-space:nowrap}
#modes button.on{background:linear-gradient(#ff7fb0,#ff4f91);color:#fff;box-shadow:0 3px 8px rgba(255,70,140,.35)}
#icons{display:flex;gap:6px;flex:0 0 auto}
.ic{width:42px;height:42px;border-radius:50%;background:#fff;display:grid;place-items:center;box-shadow:0 3px 12px rgba(170,60,110,.15);color:#d4407f}
.ic svg{width:23px;height:23px}
.ic .x{display:none}
.ic.off{color:#bba2b0}.ic.off .x{display:block}.ic.off .w{display:none}
.ic:active{transform:scale(.92)}
#stage{position:relative;min-height:0;overflow:hidden}
#cv{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}
#theme{position:absolute;left:50%;top:8px;transform:translateX(-50%);background:rgba(255,255,255,.93);border-radius:18px;padding:7px 16px 8px;text-align:center;box-shadow:0 4px 16px rgba(120,40,90,.2);max-width:92%;pointer-events:none}
#theme b{display:block;font-size:19px;color:#e0408a;font-weight:900;white-space:nowrap}
#theme span{display:block;font-size:13px;color:#7a5068;font-weight:700}
#theme .best{color:#c88a10}
#bWalk{position:absolute;left:50%;bottom:12px;transform:translateX(-50%)}
#bWalk:active{transform:translate(-50%,3px)}
.hide{display:none!important}
#panel{min-width:0;overflow:hidden;display:flex;flex-direction:column;gap:6px;padding:6px 8px;padding-bottom:max(8px,env(safe-area-inset-bottom));background:#fff;border-radius:22px 22px 0 0;box-shadow:0 -4px 18px rgba(170,60,110,.12);min-height:0;z-index:2}
#cats{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;touch-action:pan-x;padding:2px 2px 4px;flex:0 0 auto}
#cats::-webkit-scrollbar,#items::-webkit-scrollbar,#colors::-webkit-scrollbar{display:none}
.cat{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;gap:1px;width:64px;padding:4px 2px 3px;border-radius:14px;background:#fdf0f5;font-size:11px;font-weight:800;color:#9a5a7c}
.cat i{width:36px;height:36px;background-size:contain;background-position:center;background-repeat:no-repeat;display:block}
.cat.on{background:linear-gradient(#ff9cc3,#ff5f9c);color:#fff;box-shadow:0 3px 8px rgba(255,70,140,.3)}
#items{display:grid;grid-auto-flow:column;grid-template-rows:repeat(2,74px);grid-auto-columns:74px;gap:6px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;touch-action:pan-x;padding:2px;flex:0 0 auto}
.it{position:relative;width:74px;height:74px;border-radius:16px;background:#fdf3f7;background-size:contain;background-position:center;background-repeat:no-repeat;box-shadow:inset 0 0 0 2px #f6dbe7;padding:0}
.it.on{box-shadow:inset 0 0 0 3px #ff4f91;background-color:#fff}
.it.on::after{content:"";position:absolute;right:4px;top:4px;width:16px;height:16px;border-radius:50%;background:#ff4f91 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.5L12 5.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat}
.it.none{display:grid;place-items:center;font-size:12px;font-weight:800;color:#b07a96}
.it.none svg{width:30px;height:30px}
.it .nm{position:absolute;left:0;right:0;bottom:2px;font-size:10px;font-weight:800;color:#8a4a6a;text-align:center;text-shadow:0 0 3px #fff,0 0 3px #fff}
#colors{display:flex;gap:7px;overflow-x:auto;scrollbar-width:none;touch-action:pan-x;padding:3px 2px 2px;align-items:center;min-height:40px;flex:0 0 auto}
#colors .lbl{font-size:12px;font-weight:800;color:#b07a96;flex:0 0 auto;margin-right:2px}
.co{flex:0 0 auto;width:34px;height:34px;border-radius:50%;border:3px solid #fff;box-shadow:0 1px 5px rgba(120,40,90,.3);padding:0}
.co.on{outline:3px solid #ff4f91;outline-offset:1px}
.co.orig{background:conic-gradient(#ff6b6b,#ffd93b,#6bd96b,#5bc8ff,#b57bff,#ff6b6b)}
#toast{position:fixed;left:50%;top:64px;transform:translate(-50%,-10px);background:#fff;color:#d4407f;font-weight:900;padding:10px 18px;border-radius:999px;box-shadow:0 6px 20px rgba(150,60,110,.25);opacity:0;transition:opacity .25s,transform .25s;pointer-events:none;white-space:nowrap;max-width:94vw;overflow:hidden;text-overflow:ellipsis;font-size:15px;z-index:9}
#toast.show{opacity:1;transform:translate(-50%,0)}
#modal{position:fixed;inset:0;display:grid;place-items:center;background:rgba(90,30,70,.32);padding:14px;z-index:8}
.card{background:#fff;border-radius:26px;padding:18px 18px 18px;max-width:430px;width:100%;text-align:center;box-shadow:0 18px 50px rgba(120,40,90,.35);max-height:100%;overflow:auto}
.card h2{margin:0 0 4px;font-size:24px;color:#e0408a}
.card p{margin:4px 0 10px;font-size:15px;line-height:1.35;color:#7a5068}
.judges{display:flex;justify-content:center;gap:8px;margin:6px 0 8px}
.judge{flex:1;max-width:120px;background:#fff3f8;border-radius:16px;padding:6px 4px 8px;opacity:0;transform:translateY(12px) scale(.9);transition:opacity .3s,transform .35s cubic-bezier(.3,1.6,.5,1)}
.judge.show{opacity:1;transform:none}
.judge canvas{width:84px;height:84px;display:block;margin:0 auto}
.judge .jn{font-size:12px;font-weight:800;color:#9a5a7c}
.judge .js{font-size:28px;font-weight:900;color:#e0408a;line-height:1.1}
.judge .jc{font-size:11px;font-weight:700;color:#7a5068;min-height:28px}
.total{font-size:20px;font-weight:900;color:#5b3550;margin:4px 0}
.total b{font-size:30px;color:#e0408a}
.stars{font-size:34px;letter-spacing:4px;color:#e9d6df;height:42px}
.stars .s{display:inline-block;transition:color .2s,transform .3s}
.stars .s.on{color:#ffbf1f;transform:scale(1.15)}
.newrec{color:#e88a00;font-weight:900;min-height:20px}
.btns{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:8px}
.big{background:linear-gradient(#ff8dbc,#ff4f91);color:#fff;font-weight:900;font-size:19px;padding:13px 26px;border-radius:999px;box-shadow:0 5px 0 #c9306f,0 10px 20px rgba(255,70,140,.3);min-width:150px}
.big.alt{background:linear-gradient(#a9e4ff,#4fb2f5);box-shadow:0 5px 0 #2f86c6,0 10px 20px rgba(60,140,220,.3)}
.big:active{transform:translateY(3px)}
.photo{max-width:100%;max-height:52vh;border-radius:10px;box-shadow:0 6px 18px rgba(0,0,0,.18);display:block;margin:6px auto 8px;-webkit-touch-callout:default;user-select:auto;-webkit-user-select:auto}
a.big{display:inline-block;text-decoration:none}
@media (min-aspect-ratio:1/1) and (min-width:760px){
  #app{grid-template-columns:minmax(0,1fr) 430px;grid-template-rows:auto minmax(0,1fr)}
  #top{grid-column:1/3}
  #stage{grid-row:2}
  #panel{grid-row:2;grid-column:2;border-radius:24px 0 0 0;padding:10px 12px}
  #cats{flex-wrap:wrap;overflow:visible}
  #items{grid-auto-flow:row;grid-template-rows:none;grid-template-columns:repeat(auto-fill,88px);grid-auto-rows:88px;overflow-y:auto;overflow-x:hidden;touch-action:pan-y;flex:1 1 auto;align-content:start}
  .it{width:88px;height:88px}
  #colors{flex-wrap:wrap;overflow:visible}
}
@media (max-width:440px){#modes .lg{display:none}#modes button{padding:8px 10px;font-size:14px}.ic{width:38px;height:38px}.ic svg{width:21px;height:21px}#icons{gap:4px}}
@media (max-width:360px){#modes button{padding:8px 7px;font-size:13px}}
@media (max-height:640px) and (max-aspect-ratio:1/1){#items{grid-template-rows:repeat(2,62px);grid-auto-columns:62px}.it{width:62px;height:62px}}
