/* ════════════════════════════════════════════════════════════════
   ROBOTICS ADDITIONS
   ════════════════════════════════════════════════════════════════ */
.hero-title .hero-sub {
  font-size: 0.62em;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Video panel */
.video-card {
  width: 360px;
  cursor: pointer;
}

.video-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--bg-elevated);
}

.carousel-track { animation-duration: 90s; }
.carousel-track.reverse { animation-duration: 100s; }

.carousel-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 1.25rem;
}

/* Four pipeline steps */
.steps-grid.steps-4 { grid-template-columns: repeat(4, 1fr); }

/* RoboWorld grid */
.sim-grid { grid-template-columns: repeat(5, 1fr); }

.sim-card {
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.sim-card:hover, .sim-card:focus-visible {
  transform: translateY(-2px);
  outline: none;
  border-color: var(--accent);
}

.sim-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
}

.sim-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.sim-card .explore-card-info span {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}

/* Leaderboard, as on the Gym-Anything-RT site */
.leaderboard-table { min-width: 620px; }
.leaderboard-table .num { font-family: var(--font-mono); font-weight: 500; }

/* Viewer */
#viewer {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  background: var(--bg-card);
  color: var(--text);
  width: min(1100px, 92vw);
  margin: auto;  /* the page reset removes the centring a modal dialog gets by default */
  overflow: hidden;
}

#viewer::backdrop { background: rgba(0, 0, 0, 0.7); }

#viewer video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #000;
}

.viewer-text { padding: 1rem 1.25rem 1.25rem; }

.viewer-text h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.viewer-text p { font-size: 0.9rem; color: var(--text-muted); }

.viewer-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 1;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .sim-grid { grid-template-columns: repeat(4, 1fr); }
  .steps-grid.steps-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .sim-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .video-card { width: 260px; }
  .sim-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid.steps-4 { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════
   TASKS
   ════════════════════════════════════════════════════════════════ */
.tx { margin-top: 2.5rem; }

/* Simulation strip */
.tx-sims-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tx-sims {
  position: relative;
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.35rem 2rem;
  mask-image: linear-gradient(to right, transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
}

.tx-sims::-webkit-scrollbar { display: none; }

.tx-sim {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.85rem 0.3rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.tx-sim img {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  object-fit: cover;
}

.tx-sim:hover { color: var(--text); border-color: var(--text-dim); }

.tx-sim[aria-selected="true"] {
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.tx-arrow {
  flex-shrink: 0;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.tx-arrow:hover { border-color: var(--accent); color: var(--accent); }

/* Panel */
.tx-panel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06), var(--shadow-card);
  overflow: hidden;
}

.tx-progress {
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 1;
}

.tx-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--purple));
}

@keyframes tx-fill { from { width: 0; } to { width: 100%; } }

.tx-top {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
}

.tx-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
}

.tx-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tx-side {
  padding: 1.4rem 1.4rem 1rem;
  display: flex;
  flex-direction: column;
}

.tx-sim-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.tx-report {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.tx-report:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.tx-report[hidden] { display: none; }
.task-group-head .tx-report { margin-left: auto; }
#viewer-report { margin-top: 0.75rem; }

.tx-sim-head h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tx-sim-head span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
}

.tx-ladder {
  list-style: none;
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tx-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: none;
  border-radius: 8px;
  background: none;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tx-step:hover { background: var(--bg-card-hover); color: var(--text); }
.tx-step.active { background: var(--accent-dim); color: var(--text); font-weight: 600; }
.tx-step .tx-name { flex: 1; }
.tx-step .task-badge { margin-left: 0; }

/* Four bars, filled up to the task's level */
.tx-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 0.85rem;
  vertical-align: middle;
}

.tx-bars i {
  width: 4px;
  border-radius: 1px;
  background: var(--border);
}

.tx-bars i:nth-child(1) { height: 35%; }
.tx-bars i:nth-child(2) { height: 55%; }
.tx-bars i:nth-child(3) { height: 78%; }
.tx-bars i:nth-child(4) { height: 100%; }

.tx-bars[data-level="1"] i:nth-child(-n+1) { background: var(--green); }
.tx-bars[data-level="2"] i:nth-child(-n+2) { background: var(--accent); }
.tx-bars[data-level="3"] i:nth-child(-n+3) { background: var(--amber); }
.tx-bars[data-level="4"] i:nth-child(-n+4) { background: var(--red); }

.tx-legend {
  margin-top: auto;
  padding-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Instruction */
.tx-order {
  border-top: 1px solid var(--border);
  padding: 1.4rem 1.6rem 1.6rem;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-card) 100%);
}

.tx-order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.tx-label {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.tx-order h4 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.tx-instruction {
  position: relative;
  padding-left: 1.1rem;
  border-left: 3px solid var(--accent);
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text);
}


.task-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.3rem;
  white-space: nowrap;
}

.task-badge.entry { color: var(--green); background: rgba(22, 163, 74, 0.1); }
.task-badge.medium { color: var(--accent); background: var(--accent-dim); }
.task-badge.hard { color: var(--amber); background: rgba(217, 119, 6, 0.1); }
.task-badge.hardest { color: var(--red); background: rgba(220, 38, 38, 0.1); }
.task-badge.test { color: #fff; background: var(--purple); }

/* Full task browser */
.task-page-header { padding: 3rem 0 1rem; }
.task-page-header a.back { font-size: 0.85rem; color: var(--text-dim); }

.task-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 1.5rem 0 0.5rem;
}

.task-controls input, .task-controls select {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
}

.task-controls input { flex: 1; min-width: 220px; }

.chip-group { display: flex; gap: 0.35rem; }

.chip {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
}

.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.task-count { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 1.5rem; }

.task-group { margin-bottom: 2.5rem; }

.task-group-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.task-group-head img {
  width: 96px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.task-group-head h3 { font-family: var(--font-display); font-size: 1.2rem; }
.task-group-head span { font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent); }

.task-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem 1rem;
}

.task-card.is-test { border-color: var(--purple); }

.task-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.task-card h4 { font-family: var(--font-display); font-size: 0.95rem; }
.task-card p { font-size: 0.85rem; line-height: 1.6; color: var(--text-muted); }


@media (max-width: 900px) {
  .tx-top { grid-template-columns: 1fr; }
  .task-cards { grid-template-columns: 1fr; }
}

/* Shown on assisted clips only */
.assist-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(217, 119, 6, 0.92);
  cursor: help;
}

.sim-media .assist-badge, .tx-media .assist-badge {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

#viewer-assist { margin-bottom: 0.4rem; }
#viewer-assist:empty { display: none; }
