html,body{margin:0;height:100%;background:#000;overflow:hidden;touch-action:manipulation}
#vp{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#000}
#stage{position:relative;flex:none;width:720px;height:1505px;background:#000;overflow:hidden;transform-origin:center center;
  font-family:Roboto,Arial,Helvetica,sans-serif;color:#fff;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
#stage div{position:absolute;box-sizing:border-box}
.im{background-repeat:no-repeat;background-size:100% 100%}
.ct{background-repeat:no-repeat;background-size:contain;background-position:center}
.tx{white-space:pre;line-height:1.17}
.c{text-align:center}.r{text-align:right}.b{font-weight:700}
.st{-webkit-text-stroke:5px #2a1405;paint-order:stroke fill}
.btn{cursor:pointer}
.hide{display:none!important}

/* grid */
.cell{background:#130d0d;border:2px solid #5a3a1a;overflow:hidden;cursor:pointer}
.cell.off{cursor:default}
/* moving gold rectangle */
.hl{z-index:5;border:3px solid #fffbd8;border-radius:6px;pointer-events:none;
  box-shadow:0 0 0 1px rgba(255,226,120,.9),0 0 6px 2px rgba(255,205,50,.95),0 0 14px 5px rgba(255,170,20,.5),inset 0 0 0 1px rgba(255,226,120,.9),inset 0 0 10px 3px rgba(255,190,30,.85),inset 0 0 18px 4px rgba(230,140,10,.45)}
.hl.blink{animation:blink .32s ease-in-out 3}
@keyframes blink{50%{opacity:.3}}
/* win effect: big chest, flash, open lid, coins, light beam, sparkles */
.cell.opening>div{opacity:0}
.fx{z-index:8;pointer-events:none}
.chest{transform:scale(.55);opacity:.3;transition:transform .32s cubic-bezier(.3,1.6,.5,1),opacity .2s;filter:drop-shadow(0 6px 8px #000a)}
.chest.pop{transform:scale(1);opacity:1;animation:wob 1.1s ease-in-out .35s infinite}
.chest.open{animation:none}
@keyframes wob{0%,100%{transform:rotate(-1.6deg)}50%{transform:rotate(1.6deg)}}
.lid{transition:transform .38s cubic-bezier(.3,1.5,.5,1)}
.chest.lift{animation:none;transform:scale(1.06,.94)}
.chest.lift .lid{transform:perspective(520px) rotateX(62deg) translateY(-4%);filter:brightness(.8);transition:transform .32s cubic-bezier(.5,0,.4,1)}
.chest.lift .inlight{opacity:.95}
.chest.lift .pile{opacity:1}
.chest.open{transform:scale(1)}
.chest.open .lid{transform:perspective(520px) rotateX(72deg) translateY(-10%);filter:brightness(.75)}
.pile{opacity:0;transition:opacity .2s .1s}
.chest.open .pile{opacity:1}
.inlight{opacity:0;border-radius:50%;filter:blur(3px);background:radial-gradient(ellipse,#fff7b0 0,#ffcf3a 45%,rgba(255,200,60,0) 75%);transition:opacity .2s}
.chest.open .inlight{opacity:.95}
.beam{z-index:-1;background:linear-gradient(to top,rgba(255,246,185,.95),rgba(255,246,185,0));
  clip-path:polygon(26% 100%,74% 100%,100% 0,0 0);filter:blur(2px);animation:beamp .8s ease-in-out infinite alternate}
@keyframes beamp{from{opacity:.55}to{opacity:1}}
.flash{z-index:3;border-radius:50%;animation:flash .7s ease-out forwards;
  background:radial-gradient(circle,#fff 0,#fffbd0 28%,rgba(255,215,90,.9) 48%,rgba(255,200,60,0) 70%)}
@keyframes flash{0%{transform:scale(.2);opacity:1}60%{opacity:.9}100%{transform:scale(1.25);opacity:0}}
.star{z-index:4;background:#fff8c8;clip-path:polygon(50% 0,60% 40%,100% 50%,60% 60%,50% 100%,40% 60%,0 50%,40% 40%);
  animation:twinkle .9s ease-in-out infinite}
@keyframes twinkle{0%{transform:scale(0) rotate(0);opacity:0}50%{transform:scale(1) rotate(45deg);opacity:1}100%{transform:scale(0) rotate(90deg);opacity:0}}
.toss{z-index:2;opacity:0;animation:toss 1.3s cubic-bezier(.25,.7,.5,1) forwards,tossz 1.3s step-end forwards}
@keyframes tossz{0%{z-index:2}38%{z-index:5}100%{z-index:5}}
@keyframes toss{0%{transform:translate(0,0) scale(.5);opacity:0}10%{opacity:1}
  50%{transform:translate(calc(var(--dx)*.65),var(--up)) scale(1);opacity:1}
  100%{transform:translate(var(--dx),var(--dn)) scale(1) rotate(300deg);opacity:1}}
.chip{z-index:2}
.halo.on{opacity:1}
.track{will-change:transform}
.key.dis>div{opacity:.5;filter:grayscale(.5) brightness(.9)}
.halo{border-radius:50%;background:radial-gradient(circle,rgba(75,32,20,.6) 0,rgba(75,32,20,.55) 62%,rgba(75,32,20,0) 66%);box-shadow:0 0 0 1px rgba(190,205,225,.16),0 0 10px 5px rgba(165,185,218,.32);opacity:0;transition:opacity .15s}
#auto.on{box-shadow:0 0 22px 4px #ff5a3c;background:#b01818}
.coinfx{width:34px;height:34px;z-index:6;animation:fly 1.1s ease-out forwards}
@keyframes fly{0%{transform:translate(0,0) scale(.6);opacity:1}100%{transform:translate(var(--dx),var(--dy)) scale(1);opacity:0}}
.glow{border-radius:50%;background:radial-gradient(circle,#ffffffcc,#ffffff00 70%);z-index:5;pointer-events:none;animation:fade 1.2s ease-out forwards}
@keyframes fade{from{opacity:1;transform:scale(.4)}to{opacity:0;transform:scale(1.4)}}
#hist-rows{overflow-y:auto;overflow-x:hidden}
#hist-rows::-webkit-scrollbar{display:none}
.openchest{z-index:2;animation:openpop .38s cubic-bezier(.3,1.6,.5,1)}
@keyframes openpop{from{transform:scale(.9);filter:brightness(2);opacity:0}to{transform:scale(1);filter:none;opacity:1}}
.ring{z-index:1;border-radius:50%;animation:ringx 1.4s ease-out forwards;
  background:radial-gradient(circle,rgba(255,236,170,.28) 0,rgba(255,236,170,.16) 55%,rgba(255,236,170,.5) 62%,rgba(255,236,170,0) 68%)}
@keyframes ringx{from{transform:scale(.35);opacity:1}to{transform:scale(1.1);opacity:0}}
.star.big{filter:drop-shadow(0 0 8px #fff2a0);animation-duration:1.2s}

/* picture based scene */
@font-face{font-family:'Roboto';font-weight:100 900;font-style:normal;src:url(assets/fonts/roboto.woff2) format('woff2')}
.cell{background:none;border:0;overflow:visible}
.lt{font-weight:350}.lt2{font-weight:380}.l3{font-weight:300}.rg{font-weight:400}.md{font-weight:500}
.unit{font-size:.53em}
.serif{font-family:'Times New Roman',Times,serif;font-weight:700!important;letter-spacing:.3px}
.serif.st{-webkit-text-stroke:3px #3b2316}
#auto.on{box-shadow:0 0 22px 4px #ff5a3c;background:none}

/* boxes darken while the rectangle spins, only the box inside it stays bright */
.cell::before{content:'';position:absolute;left:0;top:0;right:0;bottom:0;background:rgba(0,0,0,.52);opacity:0;transition:opacity .06s;pointer-events:none;z-index:1}
.cell.dim::before{opacity:1}

/* waves behind the selected key: a brown disc, two misty rings turning against each other and ripples spreading out */
.wave{border-radius:50%;pointer-events:none}
.wave .hd{left:15px!important;top:15px!important;width:90px!important;height:90px!important;border-radius:50%;background:radial-gradient(circle at 38% 30%,rgba(176,98,68,.95) 0,rgba(138,72,50,.94) 55%,rgba(112,58,46,.92) 80%,rgba(104,54,46,.0) 82%);filter:url(#smoke)}
.wave .hr1,.wave .hr2{border-radius:50%;filter:url(#smoke) blur(1px);
  -webkit-mask:radial-gradient(circle,transparent 38px,#000 42px,#000 50px,transparent 57px);mask:radial-gradient(circle,transparent 38px,#000 42px,#000 50px,transparent 57px)}
.wave .hr1{background:conic-gradient(rgba(188,202,226,.6),rgba(188,202,226,.12) 14%,rgba(188,202,226,.55) 28%,rgba(188,202,226,.15) 44%,rgba(188,202,226,.72) 60%,rgba(188,202,226,.1) 78%,rgba(188,202,226,.6));animation:spin 5s linear infinite}
.wave .hr2{background:conic-gradient(rgba(180,195,222,.4),rgba(200,214,238,.08) 20%,rgba(180,195,222,.4) 40%,rgba(200,214,238,.08) 62%,rgba(180,195,222,.4));animation:spin 8s linear infinite reverse;transform:scale(1.04)}
.wave .hw{border-radius:50%;border:3px solid rgba(190,205,232,.55);filter:blur(1px);animation:ripple 2s ease-out infinite;opacity:0}
.wave .hw.w2{animation-delay:1s}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes ripple{0%{transform:scale(.62);opacity:.7}100%{transform:scale(1.12);opacity:0}}

