/* Block Views */
#stage canvas{cursor:grab;touch-action:none}
#stage canvas:active{cursor:grabbing}
.bv-hint{position:absolute;left:.6em;bottom:.6em;max-width:calc(100% - 1.2em);margin:0;padding:.3em .6em;border-radius:.5em;background:rgba(255,255,255,.88);font-weight:600;font-size:.9em;line-height:1.25;color:var(--soft);pointer-events:none}
.bv-tools{position:absolute;right:.6em;top:.6em;display:flex;gap:.4em}
.bv-tools .btn.icon{font-size:1.3em;min-height:max(1.95em,42px);width:max(1.95em,42px)}
.bv-nogl{position:absolute;inset:0;display:grid;place-items:center;margin:0;padding:2em;text-align:center;font-weight:600;line-height:1.4}

#side{width:min(50%,40em);gap:.55em;padding:.6em}
.bv-row{display:flex;flex-wrap:wrap;align-items:center;gap:.45em;flex:none}
.bv-views{flex:1;min-height:0;display:grid;--cols:2;grid-template-columns:repeat(var(--cols),minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:.5em}
.bv-views[data-n="3"],.bv-views[data-n="6"]{--cols:3}
.bv-card{display:flex;flex-direction:column;min-height:0;min-width:0;border:2px solid var(--ink);border-left:.5em solid var(--c);border-radius:.7em;background:#fff;overflow:hidden}
.bv-card header{flex:none;display:flex;align-items:center;gap:.4em;padding:.2em .25em .2em .5em;border-bottom:2px solid var(--grid)}
.bv-name{flex:1;min-width:0;font-weight:700;font-size:.95em;line-height:1.15}
.bv-icon{width:1.25em;height:1.25em;flex:none}
.bv-eye{min-height:max(2em,40px);min-width:40px;padding:0 .55em;gap:.35em;font-size:.85em}
.bv-mark{flex:none;display:inline-flex;align-items:center;gap:.25em;padding:.2em .55em .2em .4em;border-radius:1em;font-size:.82em;font-weight:700;color:#fff}
.bv-mark .bv-icon{width:1.1em;height:1.1em}
.bv-mark.ok{background:var(--green)}
.bv-mark.no{background:var(--red)}
.bv-pic{flex:1;min-height:0;position:relative;container-type:size;cursor:pointer;display:grid;place-items:center}
.bv-pic:focus-visible{outline:3px solid var(--blue);outline-offset:-3px}
.bv-pic svg{position:absolute;inset:.35em;width:calc(100% - .7em);height:calc(100% - .7em)}
.bv-q{font-weight:700;font-size:min(55cqh,40cqw);line-height:1;color:var(--grid-strong)}
.bv-num{cursor:default}
.bv-num>span:not(.bv-q){font-weight:700;font-size:min(62cqh,46cqw);line-height:1;font-variant-numeric:tabular-nums}

.bv-task,.bv-ask,.bv-fb{flex:none;margin:0;font-weight:600;line-height:1.3}
.bv-task.ok,.bv-fb.ok{color:var(--green)}
.bv-fb.no{color:var(--red)}
.bv-ask{font-size:1.25em;font-weight:700}
.bv-ask b{color:var(--blue)}
.bv-opts{flex:1;min-height:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:.5em}
.bv-opt{position:relative;min-height:0;min-width:0;padding:0;border:2px solid var(--ink);border-radius:.7em;background:#fff;cursor:pointer;-webkit-tap-highlight-color:transparent}
.bv-opt:hover:not(:disabled){background:var(--blue-tint)}
.bv-opt:disabled{cursor:default;color:inherit}
.bv-opt svg{position:absolute;inset:.4em .4em .4em 2.2em;width:calc(100% - 2.6em);height:calc(100% - .8em)}
.bv-letter{position:absolute;left:.35em;top:.35em;display:grid;place-items:center;width:1.6em;height:1.6em;border-radius:50%;background:var(--ink);color:#fff;font-weight:700;font-size:1.1em}
.bv-opt.right{border-color:var(--green);box-shadow:0 0 0 3px var(--green);background:var(--green-tint)}
.bv-opt.right .bv-letter{background:var(--green)}
.bv-opt.wrong{border-color:var(--red);box-shadow:0 0 0 3px var(--red);background:var(--red-tint)}
.bv-opt.wrong .bv-letter{background:var(--red)}

.bv-short{display:none}
/* challenge modes: plain space between the lowest control and the bottom edge of the frame (an advertisement is below it) */
#side[data-mode=match],#side[data-mode=which]{padding-bottom:1.6em}

/* narrow or tall tool (phone, tablet held upright): the views go under the 3D stage */
@container (max-width:680px) or (orientation:portrait){
  .tool-body{flex-direction:column}
  #side{width:auto;height:50%;flex:none;border-left:0;border-top:2px solid var(--ink);padding:.45em}
  .bv-views{--cols:4}
  .bv-views[data-n="3"],.bv-views[data-n="6"]{--cols:3}
  .bv-opts{grid-template-columns:repeat(4,minmax(0,1fr))}
  .bv-opt svg{inset:2.1em .25em .25em .25em;width:calc(100% - .5em);height:calc(100% - 2.35em)}
  .bv-hint{font-size:.8em}
}
@container (max-width:520px){
  #side{height:56%}
  .bv-long{display:none}
  .bv-short{display:inline}
  .bv-card header{flex-wrap:wrap;padding:.25em .3em;gap:.2em}
  .bv-name{flex-basis:100%;font-size:.9em}
  .bv-eye{padding:0;width:40px}
  .bv-mark{padding:.25em}
}
