/* Vollbild für Canvas / keine Ränder */
body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden; /* scrollbars verhindern */
}

:root {
  --top-ui-bar-height: max(12vh, 76px);
  --left-nav-width: 220px;
  --right-panel-width: 270px;
  --ui-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

canvas {
  display: block; /* entfernt inline-block whitespace */
}

.left-navigation {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--left-nav-width);
  padding: 1rem 0.8rem 1rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background: rgba(9, 16, 27, 0.72);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 24;
}

.nav-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.nav-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 2.25rem;
}

.nav-section-title {
  color: #d9e7f7;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  padding: 0.15rem 0.25rem;
  flex: 1;
}

.chapter-row,
.level-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.level-row {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 0.8rem;
  margin-top: 0.15rem;
}

.level-section-title {
  color: #d9e7f7;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
  --enter-opacity: 0.7;
  padding: 0.1rem 0.25rem 0.35rem;
}

.level-subsection-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  margin: 0.55rem 0 0.15rem;
}

.dynamic-figure-point-wrap {
  border-left: 3px solid rgba(255, 255, 255, 0.28);
  padding-left: 0.45rem;
}

.dynamic-figure-beat-point {
  border-left-color: rgba(255, 196, 92, 0.95);
}

.dynamic-figure-between-point {
  border-left-color: rgba(92, 190, 255, 0.9);
}

.dynamic-figure-beat-label {
  color: #ffc45c;
}

.dynamic-figure-between-label {
  color: #5cbeff;
}

.dynamic-figure-preset-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.3rem;
}

.dynamic-figure-preset-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  color: #edf2ff;
  font-size: 0.75rem;
}

.dynamic-figure-preset-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.hand-independence-navigation-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.hand-independence-preset-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.hand-independence-shape-control-hidden {
  display: none !important;
}

.hand-independence-figure-motion-control-hidden {
  display: none !important;
}

.hand-independence-preset-header .figure-panel-section-title {
  margin-top: 0;
}

.hand-independence-preset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
  margin: 0.5rem 0 0.2rem;
}

.hand-independence-preset-select,
.hand-independence-tempo-ratio,
.hand-independence-panel select,
.hand-independence-preset-row .dynamic-figure-preset-action {
  min-width: 0;
  min-height: 2rem;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: #edf2ff;
  font-family: var(--ui-font-family);
  font-size: 0.72rem;
}

.hand-independence-panel select {
  width: 100%;
  min-height: 2rem;
  padding: 0.35rem 0.45rem;
  margin-top: 0.45rem;
  margin-bottom: 0.45rem;
}

.hand-independence-panel .figure-mode-group {
  flex-direction: row;
  gap: 0.35rem;
}

.hand-independence-figure-variation-group {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.hand-independence-taktgebung-title {
  margin-top: 0.35rem;
  margin-bottom: 0.2rem;
}

.hand-independence-figure-variation-hidden {
  display: none !important;
}

.hand-independence-panel .figure-mode-option {
  flex: 1;
  padding: 0.45rem 0.5rem;
  justify-content: center;
}

.hand-independence-preset-select {
  padding: 0.35rem 0.45rem;
}

.hand-independence-preset-row .dynamic-figure-preset-action {
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hand-independence-reset-button {
  flex: 0 0 auto;
  width: 1.65rem;
  min-width: 1.65rem;
  min-height: 1.65rem;
  padding: 0.1rem;
  font-size: 0.85rem;
}

.hand-independence-preset-row .dynamic-figure-preset-action:hover {
  background: rgba(255, 255, 255, 0.14);
}

.dynamic-figure-preset-action {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: #edf2ff;
  cursor: pointer;
}

.dynamic-figure-preset-action:hover {
  background: rgba(255, 255, 255, 0.14);
}

.figure-corner-reset-controls {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.figure-corner-reset-button {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: #edf2ff;
  font-family: var(--ui-font-family);
  font-size: 0.72rem;
  cursor: pointer;
}

.figure-corner-reset-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.level-row:not(.active) {
  opacity: 0.9;
}

.left-navigation button {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #edf2ff;
  font-family: var(--ui-font-family);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-align: left;
}

.left-navigation button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.left-navigation button:focus-visible {
  outline: 2px solid rgba(79, 182, 127, 0.85);
  outline-offset: 2px;
}

.left-navigation button.selected-btn {
  background: #3fb67f;
  border-color: #59d195;
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(79, 182, 127, 0.28);
  transform: translateY(-1px);
}

.level-enter {
  animation: level-enter 0.28s ease-out both;
  animation-delay: var(--enter-delay, 0ms);
}

@keyframes level-enter {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: var(--enter-opacity, 1);
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .level-enter {
    animation: none;
  }
}

.level-row.active button {
  border-color: rgba(63, 182, 127, 0.4);
}

.level-row.active button:hover {
  border-color: rgba(63, 182, 127, 0.6);
}

@property --stage-left {
  syntax: '<length>';
  inherits: true;
  initial-value: 220px;
}

@property --stage-right {
  syntax: '<length>';
  inherits: true;
  initial-value: 270px;
}

@property --stage-pad-x {
  syntax: '<length>';
  inherits: true;
  initial-value: 24px;
}

@property --stage-pad-y {
  syntax: '<length>';
  inherits: true;
  initial-value: 16px;
}

.video-stage-shell {
  --stage-left: var(--left-nav-width);
  --stage-right: var(--right-panel-width);
  --stage-pad-x: 1.5rem;
  --stage-pad-y: 1rem;
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: calc(var(--stage-left) + var(--stage-pad-x));
  padding-right: calc(var(--stage-right) + var(--stage-pad-x));
  padding-top: var(--stage-pad-y);
  padding-bottom: var(--stage-pad-y);
  box-sizing: border-box;
  z-index: 5;
  transition: --stage-left 0.35s ease, --stage-right 0.35s ease, --stage-pad-x 0.35s ease, --stage-pad-y 0.35s ease;
}

.video-stage-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(
    calc(100vw - var(--stage-left) - var(--stage-right) - 2 * var(--stage-pad-x)),
    calc((100vh - 2 * var(--stage-pad-y)) * var(--video-aspect-num, 1.7778))
  );
  max-width: 100%;
  max-height: calc(100vh - 2 * var(--stage-pad-y));
  aspect-ratio: var(--video-aspect-ratio, 16 / 9);
  overflow: hidden;
  border-radius: 18px;
  background: rgba(4, 8, 15, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.24);
  transition: border-radius 0.35s ease;
}

/* Test/exam running: the stage fills the window and all other UI fades out. */
body.exam-running .video-stage-shell,
body.stage-fullscreen .video-stage-shell {
  --stage-left: 0px;
  --stage-right: 0px;
  --stage-pad-x: 0.75rem;
  --stage-pad-y: 0.75rem;
}

body.exam-running > :not(.video-stage-shell),
body.stage-fullscreen > :not(.video-stage-shell) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.exam-floating-controls {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 43;
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

body.exam-running .exam-floating-controls {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.3s ease 0.15s;
}

.exam-floating-controls button {
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(8, 18, 30, 0.72);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.exam-floating-controls .exam-floating-stop {
  border-color: rgba(233, 86, 86, 0.9);
  color: #ffd2d2;
}

.video-loading-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 220px;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  background: rgba(5, 12, 20, 0.66);
  border: 1px solid rgba(173, 205, 255, 0.32);
  color: #ebf3ff;
  text-align: center;
  font-family: var(--ui-font-family);
  z-index: 40;
  pointer-events: none;
}

.video-loading-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.video-loading-subtitle {
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(228, 237, 250, 0.82);
}

#canvas {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.level-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 18;
}

.hover-description {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  width: min(88vw, 560px);
  padding: 0.75rem 1rem;
  background: rgba(6, 10, 20, 0.92);
  color: #f1f5fb;
  font-family: var(--ui-font-family);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  font-size: 0.9rem;
  line-height: 1.4rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 25;
}

.tracking-controls-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 100%;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 24, 38, 0.7);
  backdrop-filter: blur(10px);
  font-family: var(--ui-font-family);
  box-sizing: border-box;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.setup-menu-toggle {
  position: relative;
  z-index: 4;
  width: 2.2rem;
  min-width: 2.2rem;
  height: 2.2rem;
  min-height: 2.2rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #edf2ff;
  font-family: var(--ui-font-family);
  font-size: 0;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  aspect-ratio: 1;
}

.setup-menu-toggle-icon {
  display: inline-block;
  font-size: 1.45rem;
  line-height: 1;
  transform: translateY(-0.02em);
}

.setup-menu-toggle.active {
  background: rgba(79, 182, 127, 0.75);
  border-color: rgba(130, 230, 170, 0.95);
  color: #052414;
}

.setup-menu-toggle:hover {
  background: rgba(79, 182, 127, 0.75);
  border-color: rgba(130, 230, 170, 0.95);
  color: #052414;
}

.setup-menu-toggle:focus-visible {
  outline: 2px solid rgba(79, 182, 127, 0.95);
  outline-offset: 2px;
}

.tracking-controls-overlay.collapsed .tracking-controls-label,
.tracking-controls-overlay.collapsed .tracking-controls-select,
.tracking-controls-overlay.collapsed .tracking-controls-radio-group,
.tracking-controls-overlay.collapsed .tracking-controls-button,
.tracking-controls-overlay.collapsed .tracking-controls-range,
.tracking-controls-overlay.collapsed .tracking-controls-inline-value {
  display: none;
}

.settings-navigation {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  z-index: 30;
}

.settings-navigation > * {
  pointer-events: auto;
}

.settings-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.8rem 0.8rem 0.9rem;
  background: rgba(8, 17, 29, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  backdrop-filter: blur(12px);
}

.settings-panel.collapsed {
  display: none;
}

.settings-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.05rem 0.1rem 0.2rem;
}

.settings-section-title {
  color: #d9e7f7;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.settings-close-button {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #edf2ff;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  aspect-ratio: 1;
}

.settings-close-icon {
  display: inline-block;
  font-size: 1.35rem;
  line-height: 1;
}

.settings-close-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.tracking-controls-label {
  color: #dce6ef;
  font-family: var(--ui-font-family);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tracking-controls-select,
.tracking-controls-button {
  padding: 0.62rem 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(15, 30, 48, 0.95);
  color: #f8fcff;
  font-family: var(--ui-font-family);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.16s ease;
}

.tracking-controls-range {
  width: 100%;
  accent-color: #65d79d;
}

.tracking-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.tracking-controls-inline-value {
  color: #dce6ef;
  font-family: var(--ui-font-family);
  font-size: 0.78rem;
  font-weight: 700;
}

.tracking-controls-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tracking-controls-radio-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #f8fcff;
  font-family: var(--ui-font-family);
  font-size: 0.78rem;
  font-weight: 600;
}

.tracking-controls-radio-option input {
  accent-color: #4fb67f;
}

.tracking-controls-select:disabled,
.tracking-controls-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tracking-controls-button:hover,
.tracking-controls-select:hover {
  background: rgba(80, 180, 130, 0.18);
}

.tracking-controls-button:focus-visible,
.tracking-controls-select:focus-visible {
  outline: 2px solid rgba(79, 182, 127, 0.9);
  outline-offset: 2px;
}

.hover-description.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.exam-panel {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.exam-toggle-button,
.exam-mini-button,
.exam-add-button,
.exam-task-row button,
.exam-history-select {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #edf7ff;
  font-family: var(--ui-font-family);
  font-size: 0.74rem;
  cursor: pointer;
}

.exam-toggle-button {
  padding: 0.42rem 0.75rem;
  background: rgba(79, 182, 127, 0.12);
  border-color: rgba(79, 182, 127, 0.8);
  color: #d9ffe9;
}

.exam-toggle-button.active {
  background: rgba(233, 86, 86, 0.15);
  border-color: rgba(233, 86, 86, 0.9);
  color: #ffd2d2;
}

.exam-nav-row {
  display: flex;
  gap: 0.45rem;
}

.exam-mini-button,
.exam-add-button,
.exam-task-row button {
  padding: 0.42rem 0.55rem;
}

.exam-task-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.exam-tasks-section {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.exam-task-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    'chapter level'
    'preset delete';
  gap: 0.32rem;
  align-items: stretch;
  padding: 0.42rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.exam-task-select-chapter { grid-area: chapter; }
.exam-task-select-level { grid-area: level; }
.exam-task-select-preset { grid-area: preset; }
.exam-task-actions {
  grid-area: delete;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
}

.exam-task-select,
.exam-history-select {
  width: 100%;
  min-height: 1.9rem;
  padding: 0.28rem 0.38rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #edf7ff;
  font-family: var(--ui-font-family);
  font-size: 0.68rem;
  line-height: 1.2;
}

.exam-task-row button {
  min-width: 0;
  min-height: 1.9rem;
  padding: 0.28rem 0.2rem;
}

.exam-task-row button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.exam-task-delete {
  justify-self: stretch;
  align-self: stretch;
}

.exam-add-button {
  width: 100%;
  background: rgba(79, 182, 127, 0.12);
  border-color: rgba(79, 182, 127, 0.8);
  color: #d9ffe9;
  font-weight: 700;
}

.exam-history-label {
  color: rgba(217, 231, 247, 0.72);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.exam-history-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.exam-progress-shell {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  height: 10px;
  display: flex;
  gap: 6px;
  z-index: 36;
}

.exam-progress-segment {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  border-radius: 999px;
  background: rgba(9, 16, 27, 0.9);
  border: 1px solid rgba(79, 182, 127, 0.4);
  box-shadow: 0 0 0 1px rgba(79, 182, 127, 0.15);
  overflow: hidden;
  box-sizing: border-box;
}

.exam-progress-shell.hidden {
  display: none;
}

.exam-settle-counter {
  position: absolute;
  left: 12px;
  bottom: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(9, 16, 27, 0.85);
  border: 1px solid rgba(79, 182, 127, 0.4);
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 36;
}

.exam-settle-counter.hidden {
  display: none;
}

.exam-calibration-card {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  width: min(19rem, calc(100% - 7rem));
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 197, 255, 0.35);
  background: rgba(8, 18, 30, 0.88);
  color: #edf7ff;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 36;
  transition: border-color 0.25s ease;
}

.exam-calibration-card.is-saved {
  border-color: rgba(79, 182, 127, 0.8);
}

.exam-calibration-intro .exam-overlay-description {
  margin-block: auto;
}

.exam-calibration-skip {
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  color: rgba(217, 231, 247, 0.65);
  margin-top: 1rem;
}

.exam-calibration-intro .exam-overlay-pause {
  margin-top: 1.5rem;
}

.exam-calibration-card.hidden {
  display: none;
}

.exam-calibration-title {
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.exam-calibration-card.is-saved .exam-calibration-title {
  color: rgba(130, 230, 170, 1);
}

.exam-calibration-text {
  font-size: 0.85rem;
  line-height: 1.35;
  opacity: 0.92;
}

.exam-progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(79, 182, 127, 0.9), rgba(130, 230, 170, 1));
  border-radius: inherit;
  transition: width 0.08s linear;
}

.exam-progress-segment-2 .exam-progress-fill {
  background: linear-gradient(90deg, rgba(60, 176, 160, 0.9), rgba(110, 226, 204, 1));
}

.exam-progress-segment-3 .exam-progress-fill {
  background: linear-gradient(90deg, rgba(140, 196, 80, 0.9), rgba(196, 238, 120, 1));
}

.exam-overlay,
.exam-result-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 42;
  background: rgba(4, 8, 14, 0.34);
}

.exam-overlay.hidden,
.exam-result-modal.hidden {
  display: none;
}

.exam-overlay-card,
.exam-result-card {
  width: min(21rem, calc(100vw - 4rem));
  border-radius: 16px;
  border: 1px solid rgba(148, 197, 255, 0.35);
  background: rgba(8, 18, 30, 0.9);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
  color: #edf7ff;
  padding: 1rem 1.05rem;
  box-sizing: border-box;
}

.exam-name-modal {
  position: fixed;
  z-index: 10000;
  background: rgba(10, 14, 20, 0.92);
}

/* Matches the login/registration form. */
.exam-name-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, 90%);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(28, 35, 46, 0.98);
  box-shadow: none;
  color: #fff;
  font: 14px system-ui, sans-serif;
}

.exam-name-card .exam-result-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  color: #fff;
}

.exam-name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 14px;
}

.exam-name-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}

.exam-name-consent input {
  margin-top: 2px;
}

.exam-name-privacy-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #9ec1ff;
  cursor: pointer;
  text-decoration: underline;
  font: inherit;
}

.exam-name-error {
  min-height: 18px;
  color: #ffb4b4;
  font-size: 14px;
}

.exam-name-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exam-name-submit {
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: #2f7bf5;
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.exam-name-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.exam-name-cancel {
  padding: 6px;
  border: 0;
  background: transparent;
  color: #9ec1ff;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.exam-overlay-card {
  width: min(70rem, calc(100% - 2rem));
  max-width: calc(100% - 2rem);
  min-height: min(32rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  overflow-y: auto;
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.exam-overlay-kicker {
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(217, 231, 247, 0.7);
  margin-bottom: 0.8rem;
}

.exam-overlay-title {
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: 800;
  line-height: 1.2;
}

.exam-overlay-subtitle {
  margin-top: 0.7rem;
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  color: rgba(237, 247, 255, 0.78);
}

.exam-overlay-description {
  margin-top: 1.5rem;
  font-size: clamp(1.5rem, 2.8vw, 2.5rem);
  line-height: 1.5;
  color: rgba(237, 247, 255, 0.95);
}

.exam-overlay-pause {
  margin: 2rem auto 0;
  padding: 1rem 2.8rem;
  border: 2px solid rgba(237, 247, 255, 0.6);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: inherit;
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  font-weight: 700;
  cursor: pointer;
}

.exam-overlay-description.hidden,
.exam-overlay-pause.hidden {
  display: none;
}

.exam-overlay-gesture {
  margin-top: 1.2rem;
  font-size: clamp(1.1rem, 1.8vw, 1.6rem);
  line-height: 1.4;
  color: rgba(217, 231, 247, 0.75);
}

.exam-overlay-gesture.is-counting {
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #82e6aa;
}

/* Task preview: card at the right edge, the scaled-down stage stays visible on the left. */
.exam-overlay.is-preview {
  justify-content: flex-end;
  padding: 0.75rem;
  background: transparent;
  cursor: pointer;
}

.exam-overlay.is-preview .exam-overlay-card {
  width: min(58rem, 55%);
  max-width: 55%;
  min-height: 0;
  max-height: calc(100% - 7rem);
}

.exam-preview-title {
  position: absolute;
  z-index: 43;
  text-align: center;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0b1626;
  pointer-events: none;
}

.exam-preview-title.hidden {
  display: none;
}

.exam-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.exam-result-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(217, 231, 247, 0.7);
}

.exam-result-close {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #edf7ff;
  font-family: var(--ui-font-family);
  font-size: 0.72rem;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.exam-result-total {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 0.7rem;
}

.exam-result-card.exam-result-card-wide {
  width: min(38rem, calc(100vw - 4rem));
}

.exam-result-summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: rgba(237, 247, 255, 0.9);
}

.figure-side-panel {
  position: fixed;
  top: 18px;
  right: 12px;
  z-index: 33;
  width: min(18rem, calc(var(--right-panel-width) - 0.8rem));
  padding: 1rem 1rem 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 197, 255, 0.35);
  background: rgba(8, 18, 30, 0.82);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
  box-sizing: border-box;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  color: #eef7ff;
  font-family: var(--ui-font-family);
}

.exercise-field-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.exercise-field-info {
  margin-top: 0.15rem;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(235, 243, 255, 0.8);
  font-size: 0.8rem;
  line-height: 1.45;
}

.figure-side-panel.hidden {
  display: none;
}

.figure-side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.figure-side-panel-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(217, 231, 247, 0.7);
}

.figure-side-panel-settings-button {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #edf7ff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
}

.figure-side-panel-settings-button.active {
  background: rgba(79, 182, 127, 0.75);
  border-color: rgba(130, 230, 170, 0.95);
  color: #052414;
}

.figure-side-panel-settings-button:not(.active):hover,
.figure-side-panel-settings-button:not(.active):focus-visible {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(130, 230, 170, 0.95);
  box-shadow: inset 0 0 0 1px rgba(130, 230, 170, 0.3);
  color: #edf7ff;
  outline: none;
}

.figure-side-panel-settings-button.active:hover,
.figure-side-panel-settings-button.active:focus-visible {
  background: rgba(79, 182, 127, 0.75);
  border-color: rgba(130, 230, 170, 0.95);
  box-shadow: inset 0 0 0 1px rgba(130, 230, 170, 0.35);
  color: #052414;
  outline: none;
}

.figure-mode-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.figure-side-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.figure-radio-divider {
  height: 1px;
  margin-top: 0.8rem;
  background: rgba(255, 255, 255, 0.2);
}

.figure-panel-divider {
  height: 1px;
  margin-top: 0.9rem;
  background: rgba(255, 255, 255, 0.2);
}

.figure-panel-section-title {
  margin-top: 0.85rem;
  color: rgba(217, 231, 247, 0.82);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dynamic-figure-presets {
  margin-top: 1.1rem;
  padding-top: 0.35rem;
  padding-bottom: 0.45rem;
}

.dynamic-figure-presets > .figure-size-label {
  margin-bottom: 0.65rem;
}

.basic-figure-dynamics-toggle,
.basic-figure-count-times-toggle,
.dynamic-figure-dynamics-toggle,
.dynamic-figure-count-times-toggle,
.hand-independence-toggle,
.hand-independence-dynamics-toggle,
.hand-independence-count-toggle,
.motion-trail-toggle,
.motion-distance-toggle,
.dynamic-range-guide-toggle,
.square-palindrom-toggle,
.point-edit-toggle,
.point-symmetry-toggle,
.point-palindrom-toggle,
.consistency-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.5rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: #edf7ff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.dynamic-range-guide-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.5rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: #edf7ff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.basic-figure-dynamics-toggle.is-active,
.dynamic-figure-dynamics-toggle.is-active,
.hand-independence-dynamics-toggle.is-active,
.motion-distance-toggle.is-active,
.dynamic-range-guide-toggle.is-active,
.square-palindrom-toggle.is-active,
.point-edit-toggle.is-active,
.point-symmetry-toggle.is-active,
.point-palindrom-toggle.is-active {
  border-color: rgba(91, 216, 156, 0.8);
  background: rgba(91, 216, 156, 0.12);
  box-shadow: inset 0 0 0 1px rgba(91, 216, 156, 0.25);
}

.basic-figure-dynamics-toggle input,
.basic-figure-count-times-toggle input,
.dynamic-figure-dynamics-toggle input,
.dynamic-figure-count-times-toggle input,
.hand-independence-toggle input,
.hand-independence-dynamics-toggle input,
.hand-independence-count-toggle input,
.motion-trail-toggle input,
.motion-distance-toggle input,
.dynamic-range-guide-toggle input,
.square-palindrom-toggle input,
.point-edit-toggle input,
.point-symmetry-toggle input,
.point-palindrom-toggle input,
.consistency-toggle-row input {
  accent-color: #5bd89c;
}

.figure-point-slot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.figure-point-preset-info {
  margin-top: 0.5rem;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(237, 247, 255, 0.9);
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: pre-line;
  box-sizing: border-box;
}

.figure-point-group-label {
  margin: 0.8rem 0 0.1rem;
  color: rgba(217, 231, 247, 0.82);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.figure-point-hand-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-top: 0.2rem;
  padding: 0.55rem;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.02);
  box-sizing: border-box;
}

.figure-point-hand-row .figure-point-group-label {
  margin-bottom: 0;
}

.figure-point-hand-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  min-height: 3rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #edf7ff;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.1;
  box-sizing: border-box;
  overflow: hidden;
}

.figure-point-hand-option input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: #5bd89c;
}

.figure-point-hand-option span {
  display: inline-block;
  min-width: 3.2rem;
  text-align: center;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  flex: 1;
}

.figure-point-slot-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.25rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: #edf7ff;
  font-size: 0.8rem;
  font-weight: 700;
}

.figure-point-slot-option[hidden] {
  display: none !important;
}

.figure-point-slot-option input {
  accent-color: #5bd89c;
}

.figure-point-slot-dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(5, 13, 22, 0.65);
  z-index: 2000;
}

.figure-point-slot-dialog.hidden {
  display: none;
}

.figure-point-slot-dialog-card {
  width: min(100%, 23rem);
  padding: 1rem 1.05rem 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 3px solid rgba(79, 182, 127, 0.9);
  background: rgba(8, 17, 29, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.figure-point-slot-dialog-title {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #d9e7f7;
  opacity: 0.8;
}

.figure-point-slot-dialog-text {
  margin-top: 0.8rem;
  color: rgba(237, 247, 255, 0.9);
  font-size: 0.82rem;
  line-height: 1.5;
}

.figure-point-slot-dialog-input {
  width: 100%;
  margin-top: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #edf7ff;
  font: inherit;
  font-size: 0.85rem;
  box-sizing: border-box;
}

.figure-point-slot-dialog-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.95rem;
}

.figure-point-slot-dialog-actions .figure-point-action {
  flex: 1;
}

.figure-point-action-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.figure-point-action {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: #edf2ff;
  font-family: var(--ui-font-family);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.16s ease;
}

.figure-point-action:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.figure-point-action.primary {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.figure-point-action.primary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.figure-point-list {
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
  margin-top: 0.8rem;
  max-height: min(15rem, calc(10 * 2.05rem + 9 * 0.36rem));
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.2rem;
  scrollbar-width: thin;
}

.figure-point-item,
.figure-point-empty {
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(237, 247, 255, 0.85);
  font-size: 0.74rem;
}

.figure-point-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.figure-point-remove {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(237, 247, 255, 0.85);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.figure-point-remove:hover {
  background: rgba(255, 99, 99, 0.25);
  border-color: rgba(255, 99, 99, 0.6);
}

.figure-point-empty {
  color: rgba(215, 228, 241, 0.7);
}

.figure-size-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.6rem;
  margin-top: 0.55rem;
}

.motion-distance-metrics {
  margin-top: 0.55rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.motion-distance-metric-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.3rem;
  color: rgba(237, 247, 255, 0.82);
  font-size: 0.7rem;
}

.motion-distance-metric-row span:last-child {
  color: rgba(255, 255, 255, 0.96);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.figure-size-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(217, 231, 247, 0.7);
}

/* Checkbox toggles in the exercise panels share the look of "Dynamiklinien"/"Zählzeiten". */
.figure-size-wrap.exercise-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.5rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: #edf7ff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.figure-size-wrap.exercise-toggle[hidden] {
  display: none;
}

.figure-size-wrap .exercise-select-input {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-height: 1.9rem;
  padding: 0.28rem 0.38rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #edf7ff;
  font-family: var(--ui-font-family);
  font-size: 0.74rem;
  cursor: pointer;
}

.figure-size-wrap.exercise-toggle:has(input:checked) {
  border-color: rgba(91, 216, 156, 0.8);
  background: rgba(91, 216, 156, 0.12);
  box-shadow: inset 0 0 0 1px rgba(91, 216, 156, 0.25);
}

.figure-size-wrap.exercise-toggle input {
  order: -1;
  accent-color: #5bd89c;
}

.figure-size-wrap.exercise-toggle .figure-size-label {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
}

.figure-size-wrap.exercise-toggle .figure-size-value {
  display: none;
}

.figure-size-wrap input[type="range"] {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  accent-color: #5bd89c;
}

.figure-size-value {
  grid-column: 2;
  grid-row: 1;
  color: #dff9e8;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* The weighting text is too long for the label row, so it gets its own line above the slider. */
.figure-size-wrap.trail-exam-weight-wrap .figure-size-value {
  grid-column: 1 / -1;
  grid-row: 2;
}

.figure-size-wrap.trail-exam-weight-wrap input[type="range"] {
  grid-row: 3;
}

.figure-mode-option,
.figure-side-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.62rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #edf7ff;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.figure-mode-option input,
.figure-side-option input {
  accent-color: #5bd89c;
}

video {
  display: none;
}

.calibration-info-panel {
  position: fixed;
  top: 18px;
  right: 12px;
  width: min(22rem, calc(var(--right-panel-width) - 1.2rem));
  max-height: calc(100vh - 36px);
  z-index: 31;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(144, 212, 255, 0.4);
  background: rgba(8, 22, 38, 0.76);
  backdrop-filter: blur(10px);
  color: #e8f4ff;
  font-family: var(--ui-font-family);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  box-sizing: border-box;
  border-left: 3px solid rgba(116, 196, 255, 0.8);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.calibration-info-panel::-webkit-scrollbar {
  width: 8px;
}

.calibration-info-panel::-webkit-scrollbar-thumb {
  background: rgba(146, 205, 255, 0.52);
  border-radius: 999px;
}

.calibration-info-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.calibration-info-panel h3 {
  margin: 0 0 0.6rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.calibration-info-panel p {
  margin: 0.45rem 0;
  font-size: 1.02rem;
  line-height: 1.45rem;
}

.calibration-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(214, 237, 255, 0.24);
  font-size: 1rem;
}

.calibration-score-row strong {
  font-size: 1.5rem;
  color: #a9ffca;
}

.calibration-status {
  font-weight: 700;
  font-size: 1.08rem;
  color: #ffe8a7;
}

.calibration-hint {
  opacity: 0.92;
}

.calibration-feedback {
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(166, 245, 198, 0.45);
  color: #9cffc7;
  font-weight: 700;
}

.calibration-info-panel.success {
  border-color: rgba(113, 242, 157, 0.7);
  background: rgba(9, 38, 28, 0.78);
}

.calibration-info-panel.success .calibration-status {
  color: #90ffbc;
}

.pose-alignment-info-panel {
  position: fixed;
  left: calc(var(--left-nav-width) + (100vw - var(--left-nav-width) - var(--right-panel-width)) / 2);
  bottom: 28px;
  transform: translateX(-50%);
  width: min(22rem, 28vw);
  z-index: 31;
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(255, 136, 136, 0.5);
  background: rgba(42, 14, 14, 0.82);
  backdrop-filter: blur(9px);
  color: #ffe3e3;
  font-family: var(--ui-font-family);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  box-sizing: border-box;
}

.pose-warning-header {
  margin-bottom: 0.3rem;
}

.pose-alignment-info-panel h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pose-warning-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pose-warning-body p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.2rem;
}

.pose-warning-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  font-size: 0.8rem;
  line-height: 1.1rem;
}

.pose-warning-row span {
  opacity: 0.84;
}

.pose-warning-row strong {
  font-weight: 700;
}

.consistency-info-panel {
  position: fixed;
  top: 18px;
  right: 12px;
  width: min(22rem, calc(var(--right-panel-width) - 1.2rem));
  z-index: 31;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(148, 197, 255, 0.35);
  background: rgba(8, 18, 30, 0.82);
  backdrop-filter: blur(10px);
  color: #eef7ff;
  font-family: var(--ui-font-family);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  box-sizing: border-box;
  border-left: 3px solid rgba(117, 165, 255, 0.85);
}

.consistency-info-panel h3 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(217, 231, 247, 0.82);
}

.consistency-title-row {
  margin-bottom: 0.45rem;
}

.consistency-title {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(217, 231, 247, 0.82);
}

.consistency-preset-panel {
  margin-bottom: 0.7rem;
}

.consistency-preset-label {
  margin-bottom: 0.45rem;
}

.consistency-preset-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.3rem;
  margin-bottom: 0.45rem;
}

.consistency-preset-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.25rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #edf2ff;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.consistency-preset-option input {
  accent-color: #5bd89c;
}

.consistency-preset-option span {
  display: inline-block;
  min-width: 1.2rem;
  text-align: center;
}

.consistency-preset-actions {
  margin-top: 0;
}

.consistency-info-panel p {
  margin: 0.45rem 0;
  font-size: 0.92rem;
  line-height: 1.45rem;
  color: rgba(237, 247, 255, 0.9);
}

.consistency-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.86rem;
  color: rgba(217, 231, 247, 0.8);
}

.consistency-score-row strong {
  font-size: 1.3rem;
  color: #dff9e8;
}

.consistency-status {
  font-weight: 700;
  font-size: 0.98rem;
  color: #dff9e8;
}

.consistency-slider-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  margin-top: 0.7rem;
}

.consistency-slider-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.consistency-slider-row label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(217, 231, 247, 0.7);
}

.consistency-slider-row input[type='range'] {
  width: 100%;
  accent-color: #5bd89c;
}

.consistency-toggle-row[hidden],
.consistency-hand-mode-row[hidden] {
  display: none !important;
}

.consistency-slider-value {
  font-size: 0.75rem;
  font-weight: 700;
  color: #dff9e8;
  min-width: 48px;
  text-align: right;
}


.hand-independence-field-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.hand-independence-field-controls .hand-independence-toggle {
  margin-top: 0;
}

.hand-independence-field-beats {
  margin: 0.15rem 0 0.25rem;
}

.hand-independence-field-sound-toggle {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.hand-independence-panel .motion-distance-weight-row {
  margin-top: 0.75rem;
}

/* Fixed two-line label and fixed value width so the row does not reflow while dragging the slider. */
.bimanual-activity-row .figure-size-label {
  white-space: pre-line;
}

.bimanual-activity-row .figure-size-value {
  min-width: 3.2em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Plain text link below the last level button (e.g. "Bewertungsmetriken" in the Prüfungen chapter). */
.left-navigation .level-row button.level-text-link {
  width: auto;
  align-self: flex-start;
  margin-top: 0.35rem;
  padding: 0.1rem 0.25rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(217, 231, 247, 0.75);
  font-size: 0.74rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.left-navigation .level-row button.level-text-link:hover {
  background: transparent;
  color: #ffffff;
}

.motion-distance-mode-group {
  margin-top: 0.5rem;
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

.motion-distance-mode-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
  margin-top: 0.3rem;
  max-width: 100%;
}

.motion-distance-mode-options .figure-side-option {
  box-sizing: border-box;
  min-width: 0;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.5rem 0.3rem;
  font-size: 0.78rem;
}

.motion-distance-mode-options .figure-side-option input {
  flex: 0 0 auto;
  margin: 0;
}

.motion-distance-mode-options .figure-side-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Fullscreen toggle and floating preset buttons in the top right corner of the stage. */
.stage-fullscreen-controls {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 42;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.exam-running .stage-fullscreen-controls {
  display: none !important;
}

.stage-fullscreen-presets {
  display: none;
  gap: 0.4rem;
}

body.stage-fullscreen .stage-fullscreen-presets:not(:empty) {
  display: flex;
}

.stage-fullscreen-controls button {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(8, 18, 30, 0.72);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.stage-fullscreen-controls button:hover {
  background: rgba(24, 44, 68, 0.85);
}

.stage-fullscreen-controls .stage-fullscreen-preset.active {
  border-color: #5bd89c;
  background: rgba(91, 216, 156, 0.28);
}

body.stage-fullscreen .stage-fullscreen-controls .stage-fullscreen-button {
  border-color: rgba(233, 86, 86, 0.9);
  color: #ffd2d2;
}
