.race-page {
  overflow: hidden;
}
.race-content {
  margin-left: var(--admin-sidebar);
  padding: 25px 28px 22px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.race-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 16px;
  align-items: center;
  flex-shrink: 0;
}
.race-heading {
  min-width: 0;
}
.header-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.camera-zoom {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: var(--dim);
  font-size: 11px;
}
.camera-zoom button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
}
.camera-zoom button:hover {
  background: #e8f1e9;
  border-color: #a5bfae;
}
.camera-zoom input {
  width: 100px;
  min-width: 0;
  margin: 0;
  padding: 0;
  accent-color: #28725b;
  cursor: pointer;
}
.camera-zoom output {
  width: 36px;
  text-align: right;
  font: 11px var(--mono);
  color: var(--text);
}
.camera-zoom .zoom-reset {
  width: auto;
  padding: 0 8px;
  font-size: 10px;
}
.race-header h1 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.7px;
  margin: 6px 0;
}
.race-header p {
  color: var(--dim);
  font-size: 12px;
}
.header-sep {
  color: #b8c2ba;
  margin: 0 12px;
}
.state-label {
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  background: #e9f0e9;
  color: #64856c;
  border-radius: 5px;
}
.state-label[data-state='RUNNING'] {
  background: #e4f2e9;
  color: #28725b;
}
.state-label[data-state='PAUSED'] {
  background: #f7e9cd;
  color: #997432;
}
.session-clock {
  text-align: right;
  display: grid;
}
.session-clock span {
  font-size: 11px;
  color: var(--dim);
}
.session-clock strong {
  font: 500 30px/1.4 var(--mono);
  letter-spacing: -1.5px;
}
.session-clock small {
  font-size: 9px;
  color: #91a094;
}
.arena-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 16px;
  flex: 1;
  min-height: 260px;
}
.arena {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
#stage,
#stage canvas,
.runners {
  position: absolute;
  inset: 0;
}
#stage canvas {
  display: block;
}
#track {
  z-index: 1;
}
.runners {
  z-index: 3;
  pointer-events: none;
}
#fx {
  z-index: 4;
  pointer-events: none;
}
.camera-toolbar {
  position: absolute;
  left: 16px;
  top: 16px;
  display: flex;
  gap: 3px;
  padding: 4px;
  background: #fffefaeb;
  border: 1px solid #ffffffe0;
  border-radius: 8px;
  z-index: 5;
}
.camera-toolbar button {
  border: 0;
  background: transparent;
  color: #6b7b6e;
  font-size: 11px;
  padding: 7px 11px;
  border-radius: 5px;
}
.camera-toolbar button.active {
  background: #28725b;
  color: #fff;
}
.arena-meta {
  position: absolute;
  top: 25px;
  right: 18px;
  z-index: 5;
  display: flex;
  gap: 6px;
  align-items: center;
  color: #53736a;
  font-size: 10px;
}
.arena-weather {
  border-left: 1px solid #7b9a8855;
  margin-left: 6px;
  padding-left: 10px;
}
.live-dot {
  background: #28725b;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.live-dot.idle {
  background: #a7763f;
}
.scene-caption {
  position: absolute;
  bottom: 21px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  color: #fff4e7c9;
  font-size: 10px;
  z-index: 5;
  pointer-events: none;
}
.scene-caption button {
  color: inherit;
  background: #623f3140;
  border: 1px solid #ffffff35;
  border-radius: 4px;
  padding: 3px 7px;
  pointer-events: auto;
}
.scene-empty {
  position: absolute;
  top: 34%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 22px 27px;
  text-align: center;
  z-index: 6;
  background: #fffff7dd;
  border-radius: 12px;
  width: max-content;
  max-width: 90%;
  backdrop-filter: blur(5px);
}
.scene-empty h2 {
  font-size: 18px;
  font-weight: 500;
  margin: 8px 0;
}
.scene-empty p {
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 14px;
}
.scene-empty .btn {
  font-size: 11px;
  padding: 7px 12px;
}
.monitor {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.monitor-heading {
  display: flex;
  justify-content: space-between;
  padding: 18px 18px 12px;
  align-items: center;
}
.monitor-heading h2 {
  font-size: 13px;
  font-weight: 600;
}
.monitor-heading > span {
  font-size: 10px;
  color: var(--dim);
}
.monitor-stats {
  display: flex;
  gap: 28px;
  margin: 0 18px 17px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}
.monitor-stats > div {
  display: flex;
  flex-direction: column;
}
.monitor-stats strong {
  font: 500 27px var(--mono);
}
.monitor-stats span {
  color: var(--dim);
  font-size: 10px;
  margin-top: 4px;
}
.monitor-subhead {
  display: flex;
  justify-content: space-between;
  padding: 0 18px 10px;
  font-size: 10px;
  color: var(--dim);
}
.monitor-subhead a {
  font-size: 10px;
}
.board-list {
  overflow: auto;
  flex: 1;
  padding: 0 10px;
  min-height: 50px;
}
.rank-row {
  display: flex;
  gap: 9px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 8px;
  width: 100%;
  border-radius: 6px;
  color: var(--text);
  text-align: left;
}
.rank-row:hover,
.rank-row.active {
  background: #edf3ec;
}
.rank-row .no {
  width: 14px;
  font: 11px var(--mono);
  color: #98a297;
  flex-shrink: 0;
}
.rank-row:first-child .no {
  color: #ae8535;
}
.rank-row .ava {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  flex-shrink: 0;
}
.rank-row .nm {
  font-size: 11px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-row .pg {
  font: 10px var(--mono);
  color: #819180;
}
.rank-row.off {
  opacity: 0.45;
}
.off-tag {
  font-size: 9px;
  color: #9b8244;
}
.board-empty {
  font-size: 12px;
  text-align: center;
  color: var(--dim);
  padding: 35px 10px;
}
.monitor-foot {
  margin: 10px 18px 0;
  padding: 12px 0;
  font-size: 9px;
  color: #94a090;
  border-top: 1px solid var(--line-soft);
}
.monitor-foot span {
  margin-left: 9px;
}
.selection {
  margin: 8px 10px 0;
  background: #edf3ec;
  border-radius: 8px;
  padding: 11px;
}
.selection > div {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.selection > div button {
  background: none;
  border: 0;
  color: var(--dim);
  font-size: 19px;
  line-height: 1;
}
.selection > span {
  font-size: 10px;
  color: var(--dim);
}
.selection code {
  display: block;
  margin: 9px 0;
  font: 11px/1.6 var(--mono);
  overflow-wrap: anywhere;
  max-height: 100px;
  overflow-y: auto;
}
.course-map {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  padding: 0 3px;
  color: #96a18e;
  font: 8px var(--mono);
  letter-spacing: 1px;
}
#mapRail {
  position: relative;
  height: 18px;
  flex: 1;
  background: #e6ece2;
  border-radius: 4px;
  cursor: pointer;
}
#mapRail > i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #ccd8c6;
}
#mapViewport {
  position: absolute;
  height: 100%;
  top: 0;
  border: 1px solid #93ad88;
  background: #abc49f25;
  border-radius: 4px;
}
#mapPlayers i {
  position: absolute;
  top: 7px;
  height: 4px;
  width: 4px;
  border-radius: 50%;
  background: #28725b;
}
#mapPlayers i.selected {
  background: #c18a2f;
  height: 6px;
  width: 6px;
  top: 6px;
}
.lesson-deck {
  flex-shrink: 0;
  padding: 14px 18px 0;
}
.deck-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
#stageHelp {
  font-size: 10px;
  color: var(--dim2);
}
#stagePills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.stage-pill {
  padding: 9px 11px;
  border-radius: 7px;
  background: #f6f8f4;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}
.stage-pill:hover {
  border-color: #c8d9bd;
}
.stage-pill.current {
  border-color: #9bb491;
  background: #eef4e8;
}
.stage-pill.unlocked .stage-number {
  background: #e5eedc;
  color: #69824c;
}
.stage-number {
  display: grid;
  place-items: center;
  font: 500 16px var(--mono);
  color: #a4af9b;
  width: 30px;
  height: 34px;
  flex-shrink: 0;
}
.stage-pill.current .stage-number {
  color: #55743c;
}
.stage-pill strong {
  font-size: 11px;
  font-weight: 500;
  display: block;
}
.stage-pill small {
  display: block;
  color: #91a085;
  font-size: 9px;
  margin-top: 2px;
}
.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
  gap: 10px;
}
#stageProgress {
  font-size: 11px;
  color: var(--dim);
}
.control-actions {
  display: flex;
  gap: 7px;
}
.control-actions .btn {
  font-size: 11px;
  padding: 8px 12px;
}
.more {
  position: relative;
}
.more summary {
  list-style: none;
  cursor: pointer;
}
.more summary::-webkit-details-marker {
  display: none;
}
.more > div {
  position: absolute;
  right: 0;
  bottom: 44px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 25px #243b3217;
  background: #fff;
  border-radius: 9px;
  width: 168px;
  padding: 5px;
  z-index: 10;
}
.more button,
.more a {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 10px;
  color: var(--dim);
  font-size: 11px;
  border-radius: 5px;
}
.more button:hover,
.more a:hover {
  background: var(--bg-soft);
}
/* The foot is the single anchor. Labels never affect runner geometry. */
.runner {
  position: absolute;
  width: 76px;
  height: 92px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: auto;
  transform-origin: 50% 100%;
  will-change: transform, left, top;
  color: #354e3d;
}
.runner .body {
  position: absolute;
  bottom: 0;
  left: 12px;
  width: 52px;
  height: 76px;
}
.runner .sprite {
  width: 100%;
  height: 100%;
}
.runner .name {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  color: #fff9ed;
  font-size: 11px;
  font-weight: 500;
  max-width: 82px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 1px 6px;
  border-radius: 4px;
  background: #714b3b;
  margin-top: 3px;
  border: 1px solid #fff0;
}
.runner:hover .name,
.runner:focus-visible .name {
  width: max-content;
  font-size: 14px;
  font-weight: 700;
  max-width: min(360px, 70vw);
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  padding: 5px 10px;
  color: #fffdf1;
  background: #284f3e;
  border-color: #fff3cb;
  box-shadow: 0 3px 12px #18392f38;
  transform: translateX(-50%) scale(var(--name-scale, 1));
  transform-origin: 50% 0;
}
.runner[data-finish='turning'] .body {
  transform: none;
  animation: runner-turn 650ms ease-in-out both;
}
.runner[data-finish='dance'] .body {
  transform: none;
}
/* Podium crowns: only for the top three while they celebrate past the finish line. */
.runner .podium-hat {
  display: none;
  position: absolute;
  top: -9px;
  left: 50%;
  width: 24px;
  height: 18px;
  margin-left: -11px;
  pointer-events: none;
  /* Bounce with the dancing sprite: same animation, pivoting on the body's bottom centre. */
  transform-origin: 11px 85px;
  animation: dance-bounce 1.2s ease-in-out infinite;
  animation-delay: var(--stride-delay, 0s);
}
.runner[data-finish='dance'][data-podium='1'] .podium-hat,
.runner[data-finish='dance'][data-podium='2'] .podium-hat,
.runner[data-finish='dance'][data-podium='3'] .podium-hat {
  display: block;
}
.runner[data-podium='1'] {
  --hat-main: #ffd34d;
  --hat-dark: #c98a12;
  --hat-glow: #ffe27a;
  --hat-gem: #e2433b;
}
.runner[data-podium='2'] {
  --hat-main: #e9eef4;
  --hat-dark: #8d9aa8;
  --hat-glow: #ffffff;
  --hat-gem: #3f7ee0;
}
.runner[data-podium='3'] {
  --hat-main: #eaa46b;
  --hat-dark: #9c5626;
  --hat-glow: #ffd2a8;
  --hat-gem: #2f9a6a;
}
.podium-hat svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: hat-glow 1.6s ease-in-out infinite;
}
.podium-hat .hat-crown,
.podium-hat .hat-band {
  fill: var(--hat-main);
  stroke: var(--hat-dark);
  stroke-width: 1;
  stroke-linejoin: round;
}
.podium-hat .hat-tip {
  fill: var(--hat-glow);
  stroke: var(--hat-dark);
  stroke-width: 0.8;
}
.podium-hat .hat-gem {
  fill: var(--hat-gem);
}
.podium-hat .hat-shine {
  fill: none;
  stroke: #fffbe9;
  stroke-width: 1.3;
  stroke-linecap: round;
  opacity: 0.85;
}
.podium-hat .spark {
  position: absolute;
  color: var(--hat-glow);
  font-style: normal;
  line-height: 1;
  text-shadow: 0 0 4px var(--hat-glow);
  opacity: 0;
  animation: hat-twinkle 1.8s ease-in-out infinite;
}
.podium-hat .s1 {
  top: -7px;
  left: -6px;
  font-size: 8px;
}
.podium-hat .s2 {
  top: -10px;
  right: -7px;
  font-size: 10px;
  animation-delay: 0.6s;
}
.podium-hat .s3 {
  top: 6px;
  right: -10px;
  font-size: 7px;
  animation-delay: 1.2s;
}
@keyframes hat-glow {
  0%,
  100% {
    filter: drop-shadow(0 1px 1px #0005) drop-shadow(0 0 1px var(--hat-glow));
  }
  50% {
    filter: drop-shadow(0 1px 1px #0005) drop-shadow(0 0 5px var(--hat-glow));
  }
}
@keyframes hat-twinkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.4) rotate(0deg);
  }
  40% {
    opacity: 1;
    transform: scale(1) rotate(45deg);
  }
  70% {
    opacity: 0;
    transform: scale(0.6) rotate(90deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .runner .podium-hat,
  .podium-hat svg,
  .podium-hat .spark {
    animation: none;
  }
  .podium-hat .spark {
    opacity: 1;
  }
}
@keyframes runner-turn {
  0% {
    transform: perspective(260px) rotateY(78deg);
  }
  100% {
    transform: perspective(260px) rotateY(0deg);
  }
}
.task-markers {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.task-marker {
  position: absolute;
  width: 132px;
  padding: 8px 10px;
  border: 1px solid #d4d9c3;
  border-bottom: 3px solid #a7b88b;
  border-radius: 7px;
  background: #fffdf0;
  color: #354e3d;
  box-shadow: 0 3px 10px #263d3214;
  pointer-events: auto;
  transform-origin: 50% 100%;
}
.task-marker span {
  display: block;
  font: 10px var(--mono);
  color: #76846a;
  margin-bottom: 3px;
}
.task-marker strong {
  font-size: 12px;
  font-weight: 600;
}
.task-marker .task-done {
  display: block;
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px dashed #d4d9c3;
  font: 600 11px var(--mono);
  font-style: normal;
  color: #4f7a45;
}
.task-marker.all-done .task-done {
  color: #2f6b3a;
}
.task-marker.all-done .task-done::before {
  content: '✓ ';
}
.task-marker:hover,
.task-marker:focus-visible {
  background: #fff8d7;
  border-color: #94a876;
}
.detail-link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--green);
  font-size: 11px;
  text-align: left;
}

.detail-intro {
  border-radius: 10px;
  padding: 20px;
  background: #f0f5e9;
  margin-bottom: 24px;
}
.detail-dialog p {
  font-size: 13px;
  margin: 8px 0 0;
  line-height: 1.7;
}
.detail-goals {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.detail-goals li {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.goal-number {
  background: #edf3e5;
  color: #617c47;
  border-radius: 7px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  font-family: var(--mono);
}
.detail-hints {
  background: #f7f8f4;
  border-radius: 9px;
  padding: 14px 16px;
}
.detail-hints summary {
  font-size: 12px;
  cursor: pointer;
}
.detail-hints code {
  display: block;
  padding: 10px 0 0;
  font: 12px var(--mono);
  overflow-wrap: anywhere;
}
.detail-note {
  font-size: 11px;
  color: var(--dim2);
  margin-top: 20px;
}
.student-overview {
  display: flex;
  align-items: center;
  gap: 12px;
}
.student-overview h3 {
  font-size: 20px;
  margin: 0 0 4px;
}
.student-overview span {
  font-size: 12px;
  color: var(--dim);
}
.student-overview .btn {
  margin-left: auto;
}
.detail-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}
.student-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
  padding: 12px 0;
  margin: 12px 0 18px;
  border-block: 1px solid var(--line-soft);
  font-size: 11px;
  color: var(--dim2);
  flex-shrink: 0;
}
.student-metrics strong {
  font: 14px var(--mono);
  color: var(--text);
  margin-left: 7px;
}
.detail-input {
  padding: 14px 16px;
  border-radius: 8px;
  background: #f3f6ef;
  margin-bottom: 22px;
}
.detail-input pre {
  font: 12px/1.7 var(--mono);
  margin: 8px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.student-detail-grid {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
}
.student-dialog {
  width: min(1120px, calc(100vw - 32px));
  height: min(820px, calc(100dvh - 40px));
}
.student-dialog .modal-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.student-dialog .student-overview,
.student-dialog .detail-input {
  flex-shrink: 0;
}
.student-dialog .detail-input {
  margin-bottom: 16px;
  padding: 10px 14px;
}
.student-dialog .detail-input pre {
  max-height: 60px;
  overflow: auto;
}
.student-dialog .student-detail-grid {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.task-navigation {
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
}
.detail-dialog .task-nav-help {
  font-size: 11px;
  margin: -4px 0 14px;
  color: var(--dim2);
}
.task-jump {
  display: block;
  text-align: left;
  width: 100%;
  padding: 13px 12px;
  border: 1px solid var(--line-soft);
  background: #fff;
  border-radius: 9px;
  margin-bottom: 9px;
  color: var(--text);
}
.task-jump:hover {
  background: #f5f8f0;
}
.task-jump[aria-pressed='true'] {
  background: #eef4e7;
  border-color: #9cb38b;
}
.task-jump-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
}
.task-record-count {
  display: block;
  color: var(--dim2);
  font-size: 10px;
  margin: 6px 0;
}
.task-duration {
  display: block;
  margin-top: 6px;
  color: var(--dim);
  font-size: 11px;
}
.task-duration b {
  margin-left: 2px;
  color: var(--green);
  font: 600 13px var(--mono);
}
.task-duration.pending {
  color: var(--dim2);
}
.task-goal {
  display: none;
  font-size: 10px;
  line-height: 1.8;
  color: var(--dim);
}
.task-jump[aria-pressed='true'] .task-goal {
  display: block;
}
.task-goal.goal-done {
  color: #3c7752;
}
.command-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.timeline-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.timeline-status {
  font-size: 11px;
  color: #65814e;
  padding-top: 2px;
  text-align: right;
}
.command-scroll {
  position: relative;
  overflow: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  flex: 1;
  min-height: 0;
  padding-right: 7px;
}
.timeline-task {
  margin-bottom: 20px;
}
.timeline-task h4 {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  padding: 10px 0;
  margin: 0 0 10px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.timeline-task h4 span {
  font-size: 10px;
  color: var(--dim2);
  font-weight: 400;
}
.command-label {
  display: block;
  color: var(--dim2);
  font-size: 10px;
  margin-top: 10px;
}
.command-entry .command-input {
  background: #eaf1e3;
  color: #2d5a42;
}
.command-entry .command-silent {
  color: var(--dim2);
  font-size: 11px;
  margin: 6px 0;
}
.command-task-tag {
  color: #66844f;
  background: #edf3e5;
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: auto;
}
.command-entry header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 10px;
}
.command-entry .command-result {
  color: #4c875d;
}
.command-entry.bad .command-result {
  color: #b95743;
}
.command-entry .command-error {
  color: #b95743;
  background: #fff0ea;
}
.command-entry time {
  color: var(--dim2);
}
.command-entry pre {
  font: 12px/1.7 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 5px 0 0;
  padding: 10px 12px;
  background: #f5f7f2;
  border-radius: 5px;
}
.command-entry small {
  display: block;
  margin-top: 10px;
  color: var(--dim2);
  font: 10px/1.6 var(--mono);
  overflow-wrap: anywhere;
}
.command-entry.bad {
  border-color: #e1b6aa;
}
.command-entry {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 12px;
}
.detail-empty {
  padding: 30px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--dim2);
}
@media (max-width: 650px) {
  .student-detail-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
  }
  .task-navigation {
    display: flex;
    gap: 8px;
    padding: 0 0 6px;
  }
  .task-navigation > h3,
  .task-navigation .task-nav-help,
  .task-jump[aria-pressed='true'] .task-goal {
    display: none;
  }
  .task-jump {
    flex: 0 0 190px;
    margin: 0;
    padding: 10px;
  }
  .modal-head,
  .modal-body {
    padding: 16px;
  }
  .student-overview {
    flex-wrap: wrap;
  }
  .student-overview .btn {
    margin-left: auto;
    font-size: 10px;
    padding: 6px;
  }
  .student-overview h3 {
    font-size: 16px;
  }
}
.runner.selected .name {
  border-color: #fff5d5;
  background: #315c46;
}
.runner.lead .name::before {
  content: '· ';
  color: #ffdf8e;
}
.runner .bubble {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #e2dfd1;
  border-radius: 6px;
  background: #fffdf5;
  color: #4c6554;
  font: 11px var(--mono);
  padding: 6px 9px;
  opacity: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  width: max-content;
  max-width: 360px;
  box-shadow: 0 2px 7px #263d3212;
  pointer-events: none;
}
.runner .bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: var(--bubble-tail, 50%);
  border: 4px solid transparent;
  border-top-color: #fffdf5;
}
.runner .bubble.on {
  opacity: 1;
}
@media (max-width: 1200px) {
  .race-header {
    grid-template-columns: minmax(0, 1fr) 215px;
    gap: 12px;
  }
  .race-content {
    padding: 20px;
  }
  .arena-grid {
    grid-template-columns: minmax(0, 1fr) 215px;
    gap: 12px;
  }
  .arena-weather {
    display: none;
  }
  .race-header h1 {
    font-size: 21px;
  }
  #stageProgress {
    max-width: 210px;
    font-size: 10px;
  }
}
@media (max-width: 850px) {
  .race-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .camera-zoom {
    margin-left: 0;
  }
  .camera-zoom input {
    width: 80px;
  }
  .race-page {
    overflow: auto;
  }
  .race-content {
    height: auto;
    min-height: 100dvh;
    padding: 16px;
  }
  .arena-grid {
    grid-template-columns: minmax(0, 1fr);
    height: 460px;
    flex: none;
  }
  .monitor {
    display: none;
  }
  .control-row {
    flex-wrap: wrap;
  }
  #stagePills {
    grid-template-columns: repeat(2, 1fr);
  }
  .race-header h1 {
    font-size: 18px;
  }
  .session-clock strong {
    font-size: 22px;
  }
  .session-clock small {
    display: none;
  }
  .control-actions {
    flex-wrap: wrap;
  }
  .state-label {
    display: none;
  }
}
