/* Sign Language's own look, after the shell every tool shares (../shell/shell.css: the brand, the name card, the score,
   the list down the left, the settings and their "i", the windows, the result, the phone layout, and the wide middle
   column every trainer has). Only this tool's subject goes here: never restyle one of the shell's pieces (a change to
   one of them is made in shell.css, for every tool). Colours and fonts are the shell's variables (--fg, --muted, --ok…). */

/* the subject, in the middle column under the name card: up to two boxes side by side (a sign's clip, a handshape,
   the camera as a mirror), then what there is to say about the answer. Which boxes show is the drill's (data-drill). */
.board { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 2px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.show { flex: none; display: flex; justify-content: center; gap: 10px; width: 100%; }
.clipbox, .hand, .mirror { position: relative; flex: 1 1 0; min-width: 0; max-width: 430px; aspect-ratio: 4 / 3; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: #06090c; }
.board[data-drill="watch"] .clipbox, .board[data-drill="read"] .hand { max-width: 520px; }
.board[data-drill="watch"] :is(.hand, .mirror, .abc, .strip),
.board[data-drill="sign"] :is(.hand, .abc, .strip),
.board[data-drill="read"] :is(.clipbox, .mirror),
.board[data-drill="spell"] .clipbox { display: none; }

/* a sign's clip: YouTube's player fills the box; before a clip is shown, a question mark stands there */
.clip-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: none; }
.clipbox.is-on .clip-frame { display: block; }
.clip-cover { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 72px; color: var(--line-strong); }
.clipbox.is-on .clip-cover { display: none; }

/* a handshape of the manual alphabet: a black line drawing, so it stands on a light card */
.hand { background: var(--bone); display: grid; place-items: center; transition: box-shadow .15s; }
.hand img { position: absolute; inset: 5% 10%; width: 80%; height: 90%; object-fit: contain; user-select: none; -webkit-user-drag: none; transition: transform .08s; }
.hand.is-empty img { visibility: hidden; }
.hand.again img { transform: translateX(13%); }   /* (a letter said twice: the second slides to the side, as a signer's hand does) */
.hand.tick-a img { animation: hand-a .11s ease-out; }
.hand.tick-b img { animation: hand-b .11s ease-out; }
@keyframes hand-a { from { opacity: .3; } to { opacity: 1; } }
@keyframes hand-b { from { opacity: .3; } to { opacity: 1; } }
.hand b { position: absolute; top: 8px; inset-inline-start: 14px; font-weight: 800; font-stretch: 112%; font-size: 30px; line-height: 1; color: #1b1610; }
.hand.is-ok { box-shadow: inset 0 0 0 4px var(--ok); }

/* the camera, as a mirror: the picture and the hand's points over it are flipped the way a mirror flips them */
.mirror video, .mirror canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-msg { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 16px; text-align: center; background: rgba(6, 10, 14, 0.86); }
.cam-msg p { margin: 0; max-width: 34ch; font-size: 13px; line-height: 1.5; color: var(--muted); }
.cam-msg[hidden] { display: none; }
.cam-read { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font-family: var(--f-mono); font-weight: 600; font-size: 13px; color: var(--bone); text-shadow: 0 1px 6px #000, 0 0 2px #000; pointer-events: none; }
.hold { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255, 255, 255, 0.12); }
.hold i { display: block; height: 100%; width: 0; background: var(--ok); }

/* how a sign is made: ASL-LEX's description, two short columns */
.facts { flex: none; width: min(100%, 640px); }
.facts:empty, .strip:empty, .abc:empty { display: none; }
.facts dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.facts dl div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; line-height: 1.35; }
.facts dt { flex: none; font-family: var(--f-mono); font-weight: 600; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; min-width: 0; color: var(--fg); }
.facts .note { margin: 7px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: center; text-wrap: pretty; }
.facts .note.big { font-size: 14.5px; color: var(--fg); }
.facts .note b { color: var(--fg); font-weight: 600; }
.facts .note.small { font-size: 11px; }
.facts .note a { color: var(--muted); text-underline-offset: 2px; }
.facts .note a:hover { color: var(--fg); }

/* a word's handshapes in a row, each over its letter (once a word has been answered) */
.strip { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.strip figure { margin: 0; width: 60px; padding: 4px 2px 3px; border-radius: 8px; background: var(--bone); text-align: center; }
.strip img { display: block; height: 56px; max-width: 100%; margin: 0 auto; }
.strip figcaption { font-family: var(--f-mono); font-weight: 700; font-size: 12px; color: #1b1610; }

/* the manual alphabet, to pick a letter from (Explore) */
.abc { flex: none; display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 4px; width: min(100%, 700px); }
.abc button { display: grid; justify-items: center; padding: 3px 2px 2px; border: 2px solid transparent; border-radius: 8px; background: var(--bone); font-family: var(--f-mono); font-weight: 700; font-size: 11px; color: #1b1610; cursor: pointer; }
.abc button img { height: 36px; max-width: 100%; }
.abc button[aria-pressed="true"] { border-color: var(--scan); box-shadow: 0 0 0 2px var(--scan); }

/* the answers under it */
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: min(100%, 640px); }
.actions .btn { padding: 10px 16px; font-size: 14px; }
.actions .btn.primary { background: var(--bone); }   /* (under the subject the shell gives every button the panel's background: the main one keeps its own) */
.actions .choice { flex: 1 1 calc(50% - 8px); min-width: 0; overflow-wrap: anywhere; }
.actions .btn.is-ok { border-color: var(--ok); color: var(--ok); opacity: 1; }
.actions .btn.is-bad { border-color: var(--bad); color: var(--bad); opacity: 1; }
.pairbtn { display: inline-flex; gap: 8px; }
.typed { flex: 1 1 220px; min-width: 0; box-sizing: border-box; padding: 9px 12px; font-family: var(--f-mono); font-weight: 600; font-size: 16px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; }
.typed::placeholder { letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--muted); }
.typed:disabled { opacity: .6; }

/* the drills' two headings in the list down the left; the six sizes of the Signs row */
.rail-sub { margin: 8px 6px 2px; font-family: var(--f-mono); font-weight: 600; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.rail-sub:first-child { margin-top: 0; }
#setSeg button { padding-inline: 2px; }

/* How it works: wider than a settings window, as it is read */
.how { width: min(580px, 100%); }
.how .plain { list-style: none; padding: 0; }

@media (max-width: 900px) {
  .show { gap: 6px; }
  .clip-cover { font-size: 48px; }
  .cam-msg { gap: 8px; padding: 8px; }
  .cam-msg p { font-size: 12px; line-height: 1.4; }
  .cam-msg .btn { padding: 8px 10px; font-size: 12.5px; }
  .cam-read { font-size: 11.5px; bottom: 9px; }
  .facts dl { gap: 0 10px; }
  .facts dl div { font-size: 12px; gap: 0 6px; }
  .abc { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .abc button img { height: 30px; }
  .rail-sub { flex: none; margin: 0 2px 0 6px; align-self: center; }
  .rail-sub:first-child { margin-inline-start: 0; }
  .actions .btn { padding: 10px 12px; }
  .strip figure { width: 44px; }
  .strip img { height: 42px; }
}
