/* The look that is the 3D atlases' own (Bone, Muscle, Organ, Brain, Joint, Nerve, Heart, Lymph, Tooth, Engine, Bone
   Landmarks): the stage the model turns on, the name on the model, the presentation's labels, Name it's answer box, the
   view card's buttons, Find, and the loading card. Each atlas page loads ../shell/shell.css first (the shell every
   tool shares: the brand, the name card, the score, the list, the settings, the windows, the result, the phone
   layout), then this file; a change here changes all eleven.

   Where one atlas differs from the rest:
   - in a value (a colour, a size): the atlas sets a variable in a small <style> in its own page, after this file.
     The variables meant for that are --miss, --tip-width and --tip-height (in shell.css).
   - in a rule: its version is written here, and starts with :where([data-atlas="…"]). That matches the page's
     <html data-atlas="…"> without making the rule any stronger, so the shell's rules for short windows and phones
     still override it exactly as they override the usual one.
   - in having something the others don't (the Engine's stroke labels): those styles are in that atlas's own page. */

#stage {
  position: fixed; inset: 0;
  background: radial-gradient(120% 80% at 50% 38%, #16222c 0%, #0e151b 45%, var(--bg) 78%);
}
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
#stage.hovering canvas { cursor: pointer; }

/* on-model name callout (Study, and the reveal in Practice) */
#leader { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
#leader line { stroke: var(--scan); stroke-width: 1.5; }
#leader circle { fill: var(--scan); }
.callout {
  position: fixed; left: 0; top: 0; pointer-events: none; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--scan); border-radius: 6px;
  color: var(--bone); font-weight: 700; font-stretch: 106%; font-size: 14px; padding: 5px 10px;
}
/* Bone: one line when it fits; long names (Latin phalanges) wrap within the screen */
:where([data-atlas="bone"]) .callout { white-space: normal; width: max-content; text-wrap: balance; box-sizing: border-box; }

/* The presentation (hidden: S in Study; the engine's "presentation"): the model alone, turning, and with L a name on
   every piece. The names are drawn by the engine at each piece's place on the screen. */
body.present .prompt { display: none; }
.labels { position: fixed; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; font: 600 10px/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.labels svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.labels span, .labels polyline, .labels circle { opacity: 0; transition: opacity .3s, color .2s, stroke-opacity .2s; }
.labels .in { opacity: 1; }
.labels polyline { fill: none; stroke: var(--scan); stroke-opacity: .32; stroke-width: 1; }
.labels circle { fill: var(--bg, #0a0f14); stroke: var(--scan); stroke-opacity: .7; stroke-width: 1; }
/* a label sits on the model's own left or right of its point, in every language: physical sides here */
.labels span { position: absolute; transform: translate(0, -50%); padding: 2px 0 2px 8px; white-space: nowrap; border-left: 2px solid var(--scan); text-shadow: 0 0 5px #000, 0 0 2px #000; }
.labels span.left { transform: translate(-100%, -50%); padding: 2px 8px 2px 0; border-left: 0; border-right: 2px solid var(--scan); }
/* (the one the display is "reading": brighter, with its trace) */
.labels span.lit { color: #fff; text-shadow: 0 0 9px var(--scan), 0 0 2px #000; }
.labels polyline.lit { stroke-opacity: 1; }
.labels circle.lit { stroke-opacity: 1; fill: var(--scan); }

/* Name it (an atlas with settings.nameIt): the answer is typed in the name's place. Once a hint has said how long the
   name is, each letter has its own place behind the box (.slots), so the type is monospaced and the line is as many
   characters wide as the name (--n letters, and --w full-width ones a square each). */
.answer { display: flex; justify-content: center; align-items: center; margin: 0; min-width: 0; padding: 3px 0 5px; }
/* (larger than a name in the other questions: the card grows into the room Study's notes take under it. Its own
   typeface, JetBrains Mono, the main site's: an atlas page with the answer box loads it) */
.answer-line { position: relative; flex: none; width: max(20ch, calc(var(--n, 0) * 1ch + var(--w, 0) * 1em)); height: 1.35em; font-family: "JetBrains Mono", var(--f-mono); font-weight: 700; font-size: calc(clamp(26px, 2.8vw, 40px) * var(--card-scale, 1)); line-height: 1.35; transform-origin: center; }
.answer-line.has-slots { width: calc(var(--n) * 1ch + var(--w, 0) * 1em); }
/* The empty box is blank but for the cursor: no line under it (it read as a second progress bar) and no words in it.
   Where the box hasn't the cursor yet (a phone, until it is tapped), a cursor is drawn in its place, to say where to type. */
.answer-line.is-empty:not(:focus-within)::after { content: ""; position: absolute; left: 50%; top: 14%; width: 2px; height: 72%; background: var(--scan); animation: answer-caret 1.1s steps(1) infinite; pointer-events: none; }   /* (a tap on it reaches the box) */
@keyframes answer-caret { 50% { opacity: 0; } }
#answerBox { display: block; width: calc(100% + 1ch); height: 100%; box-sizing: border-box; margin: 0 -0.5ch; padding: 0; border: 0; border-radius: 0; background: none; outline: none; font: inherit; color: var(--bone); text-align: center; caret-color: var(--scan); }
.has-slots #answerBox { text-align: start; margin-inline-start: 0; }   /* (the box is a letter wider than the line, for the cursor after the last letter) */
.slots { position: absolute; inset: 0; display: flex; pointer-events: none; color: var(--muted); white-space: pre; }
.slots i { flex: none; width: 1ch; font-style: normal; text-align: center; }
.slots i.wide { width: 1em; }   /* (a Chinese, Japanese or Korean character: as wide as it is tall) */
.slots i.blank { background: linear-gradient(var(--line-strong), var(--line-strong)) center bottom / calc(100% - 4px) 3px no-repeat; }
.answer-line.has-slots:focus-within .slots i.blank { background-image: linear-gradient(var(--muted), var(--muted)); }
/* A name in a script whose letters join or differ in width (Arabic, Persian, Hebrew, Hindi: .flow) is one run of text,
   its hidden letters see-through, with a line under each run of letters */
.answer-line.flow .slots { display: block; text-align: start; }
.answer-line.flow .slots i { width: auto; }
.answer-line.flow .slots i.hid { color: transparent; }
.answer-line.flow .slots i.blank { background-size: 100% 3px; }
.btn.answer-help { position: absolute; top: 9px; inset-inline-end: 11px; padding: 5px 14px; font-size: 13px; border-radius: 999px; color: var(--fg); background: transparent; }
.prompt.has-note .pmeta { color: var(--bad); }   /* what was typed, after a wrong answer */
.prompt.is-right .eyebrow, .prompt.is-right #answerBox { color: var(--ok); }
.prompt.is-wrong .eyebrow, .prompt.is-wrong #answerBox { color: var(--bad); }
.views { display: flex; gap: 5px; }
.views .btn { flex: 1 1 0; white-space: nowrap; padding: 6px 4px; font-size: 12px; }
/* Brain, Engine and Bone Landmarks keep the two views a quarter turn (Ctrl) can't reach: from above and from below */
:where([data-atlas="brain"], [data-atlas="engine"], [data-atlas="landmarks"]) .views { display: grid; grid-template-columns: repeat(2, 1fr); }
:where([data-atlas="engine"]) .views .btn { flex: 0 1 auto; padding: 6px 2px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#search { width: 100%; font: inherit; font-size: 13px; color: var(--fg); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 7px; padding: 8px 10px; }
#search:focus { outline: none; border-color: var(--scan); }
.results-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; max-height: 190px; overflow-y: auto; }
.results-list button { width: 100%; text-align: start; font: inherit; font-size: 12.5px; color: var(--fg); background: transparent; border: 0; border-radius: 6px; padding: 6px 8px; cursor: pointer; }
.results-list button:hover { background: var(--bg-lift); }
#search:disabled { border-style: dashed; opacity: .5; }
:where([data-atlas="engine"]) .vc-tools .btn { flex: 1 1 calc(50% - 3px); min-width: 0; }
#unhideBtn { flex-basis: 100%; }
@media (min-width: 901px) and (max-height: 940px) {
  .views .btn, .vc-tools .btn { padding-block: 5px; }
}
#loading .card { text-align: center; }
#loading progress { width: 100%; height: 6px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 3px; background: var(--line); }
#loading progress::-webkit-progress-bar { background: var(--line); border-radius: 3px; }
#loading progress::-webkit-progress-value { background: var(--scan); border-radius: 3px; }
#loading progress::-moz-progress-bar { background: var(--scan); }

/* phones */
@media (max-width: 900px) {
  .answer-line { font-size: max(16px, calc(21px * var(--card-scale, 1))); }   /* (16px or more: a phone zooms the page in on a box with smaller text) */
  .slots i.blank { background-size: calc(100% - 3px) 2px; }
  .answer-line.flow .slots i.blank { background-size: 100% 2px; }
  .btn.answer-help { top: 7px; inset-inline-end: 9px; padding: 4px 12px; font-size: 12px; }
  .callout { font-size: 13px; }
}