/* Subtwine styles — the caption on the picture (R6): source and translation
   over the bottom of the stage, at the size, height and background the
   subtitle settings chose; and the definition card the closed lookup entry
   would open.
   Loaded from index.html in the order web_manifest.py declares. */
.learning-captions {
  --caption-size:22px;
  --caption-pos:6%;
  position:absolute;
  left:4%;
  right:4%;
  bottom:var(--caption-pos);
  z-index:5;
  display:flex;
  justify-content:center;
  pointer-events:none;
  /* The picture sets the ceiling: a caption never outgrows a narrow stage. */
  font-size:min(var(--caption-size),5.4cqw);
  line-height:1.3;
  text-align:center;
}
.learning-caption {
  pointer-events:auto;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:.2em;
  max-width:100%;
  cursor:pointer;
  border-radius:6px;
  overflow-wrap:anywhere;
}
.learning-caption:focus-visible {
  outline:2px solid var(--accent-on-dark);
  outline-offset:3px;
}
.learning-caption > * {
  display:inline-block;
  max-width:100%;
  padding:.05em .35em;
  border-radius:.2em;
  color:#fff;
  text-shadow:0 1px 3px rgba(0,0,0,.9),0 0 2px rgba(0,0,0,.8);
  white-space:pre-line;
}
.caption-source {
  font-weight:600;
}
.caption-translation {
  font-size:.82em;
  font-weight:500;
  color:#f1f1f1;
}
.learning-captions[data-background=box] .learning-caption > * {
  background:rgba(0,0,0,.62);
  text-shadow:none;
}
.stage.expanded .learning-captions {
  font-size:min(calc(var(--caption-size) * 1.6),4.2cqw);
}
.mode-dictation .learning-captions {
  display:none;
}

/* ---- the definition card (no caption opens it while lookup is closed) ---- */
.definition-card {
  position:fixed;
  right:24px;
  bottom:24px;
  z-index:70;
  width:min(340px,calc(100vw - 32px));
  padding:14px 16px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface);
  box-shadow:var(--shadow-menu);
  display:grid;
  gap:8px;
}
.definition-card header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}
.definition-card p {
  margin:0;
  font-size:13px;
  color:var(--ink-2);
}
