/* The playing area: the markup editor on the left, the 3D view on the right, and one divider to drag between them.
   Nothing is boxed inside anything else: plain rows above and below the editor, and every control of the view
   floats over it. On a narrow screen the view goes under the editor and the whole area scrolls. */
#view{flex:1;min-height:0;position:relative;display:flex;overflow:hidden}
#left{flex:0 0 var(--left,46%);min-width:0;min-height:0;display:flex;flex-direction:column;background:var(--panel)}
#stage{flex:1 1 0;min-width:0;min-height:0;position:relative;background:#fff;overflow:hidden}
#gutter{flex:0 0 9px;cursor:col-resize;position:relative;touch-action:none;background:var(--panel)}
#gutter::before{content:"";position:absolute;left:4px;top:0;bottom:0;width:1px;background:var(--line)}
#gutter::after{content:"";position:absolute;left:2px;top:50%;width:5px;height:44px;margin-top:-22px;background:var(--mute)}
#gutter:hover::before,#gutter:focus-visible::before,body.dragging #gutter::before{left:3px;width:3px;background:var(--accent)}
#gutter:focus-visible{outline:none}
body.dragging{user-select:none;-webkit-user-select:none;cursor:col-resize}
.p0{color:var(--p0)}
.p1{color:var(--p1)}

/* ---- orders: what the player has to do now ---- */
#action{min-height:56px;display:flex;flex-direction:column;justify-content:center;gap:3px;padding:5px 8px;border-bottom:1px solid var(--line)}
.atext{font:600 12px var(--display);letter-spacing:.06em}
.ahint{font:400 12px/1.35 var(--body);color:var(--mute)}
.ahint code,#verdict code{font:500 11px var(--display)}

/* ---- the editor: line numbers, the locked A, the text being written ---- */
.editor{flex:1 1 auto;min-height:120px;overflow:auto;cursor:text;background:var(--bg);border-bottom:1px solid var(--line)}
.edinner{display:flex;min-height:100%}
.ln{flex:0 0 auto;position:sticky;left:0;z-index:1;background:var(--bg);padding:6px 5px 6px 8px;text-align:right;color:var(--mute);font:400 13px/19px var(--display);white-space:pre;user-select:none;-webkit-user-select:none;border-right:1px solid var(--line);cursor:default}
.codecol{flex:1 0 auto;padding:6px 8px}
#locked{margin:0;font:400 13px/19px var(--display);white-space:pre;opacity:.45;user-select:none;-webkit-user-select:none;pointer-events:none;cursor:default}
#src{display:block;min-width:100%;margin:0;padding:0;border:0;resize:none;background:transparent;color:var(--ink);overflow:hidden;white-space:pre;font:400 13px/19px var(--display);font-size:13px!important}
#src:focus{outline:none}
#src.ro{color:var(--mute)}

/* ---- the referee's answer, the buttons, the line about what the editor holds ---- */
#verdict{padding:5px 8px;border-bottom:1px solid var(--line);font:400 12px/1.4 var(--body);box-shadow:inset 3px 0 0 var(--mute);max-height:34%;overflow:auto}
#verdict.ok{box-shadow:inset 3px 0 0 var(--good)}
#verdict.err{box-shadow:inset 3px 0 0 var(--bad)}
#verdict strong{display:block;font:600 12px var(--display);letter-spacing:.03em}
#verdict.ok strong{color:var(--good)}
#verdict.err strong{color:var(--bad)}
#verdict ul{margin:2px 0 0;padding-left:18px}
.acts{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:5px 8px}
.acts label{display:inline-flex;align-items:center;gap:6px;font:500 9px var(--display);letter-spacing:.12em;color:var(--mute);text-transform:uppercase}
.acts select{max-width:220px}
#keys{font:500 10px var(--display);letter-spacing:.08em;color:var(--mute)}
#edmsg{padding:3px 8px;min-height:21px;border-top:1px solid var(--line);font:500 11px/15px var(--display);color:var(--mute)}
#edmsg.err{color:var(--bad)}

/* ---- the view: the render and nothing else; its controls float over it ---- */
#glwrap{position:absolute;inset:0}
#glwrap canvas{display:block;width:100%;height:100%;touch-action:none;cursor:grab}
#glwrap.grabbing canvas{cursor:grabbing}
#glwrap canvas.axes{position:absolute;left:0;top:0;pointer-events:none}
.pills{position:absolute;left:10px;top:10px;right:120px;z-index:2;display:flex;flex-wrap:wrap;gap:6px}
#bpills{display:contents}
.pill{min-width:46px;height:46px;padding:0 12px;font-size:18px;font-weight:600;letter-spacing:0;border:2px solid #0f1f2b;background:#0f1f2b;color:#fff}
.pill[aria-pressed="false"]{background:#fff;color:#0f1f2b}
.pill:hover:not(:disabled){border-color:#c7400a}
.pill:disabled{opacity:.3}
#resetview{position:absolute;right:10px;top:10px;z-index:2;background:#fff;color:#0f1f2b;border-color:#0f1f2b}
.float{position:absolute;left:10px;right:10px;bottom:8px;z-index:2;pointer-events:none;color:#0f1f2b}
.legend{display:flex;flex-wrap:wrap;gap:2px 10px;font:500 11px var(--display)}
.legend span{display:inline-flex;align-items:center;gap:5px}
.legend i{width:11px;height:11px;display:inline-block;border:1px solid #0f1f2b}
#hlnote{margin:2px 0 0;font:400 11px var(--body)}
#hlnote:empty{display:none}

/* How to play sits in the row of buttons here, not over the view */
#help{position:static;margin-left:auto}
#tut{left:auto;right:8px;top:auto;bottom:46px;transform-origin:right bottom}
#tutC{min-height:104px}

@media (max-width:760px){
  #view{flex-direction:column;overflow:auto;-webkit-overflow-scrolling:touch}
  #left{flex:none}
  #gutter{display:none}
  .editor{flex:none;height:46vh;min-height:220px}
  #stage{flex:none;height:92vw;border-top:1px solid var(--line)}
  .pill{min-width:40px;height:40px;font-size:16px}
}
