.home-page #time .section-grid {
  grid-template-columns: minmax(0, 1.32fr) minmax(300px, 0.68fr);
  gap: var(--section-gap-compact);
}

.time-world-lab {
  --time-tone: #287e67;
  --time-coral: #df604a;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-media);
  background: #f8f9f6;
  box-shadow: var(--shadow-panel);
  container-name: time-world;
  container-type: inline-size;
}

.time-world-header {
  display: flex;
  height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3-5);
  padding: 0 var(--space-3-5);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--type-dense-compact);
  font-weight: 650;
}

.time-world-run {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--time-tone);
  white-space: nowrap;
}

.time-world-run[data-time-direction="rewinding"] {
  color: var(--time-coral);
}

.time-world-run[data-time-direction="paused"] {
  color: var(--muted);
}

.time-world-run i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 12%, transparent);
}

.time-world-run b {
  font: inherit;
}

.time-world-stage {
  position: relative;
  height: 474px;
  overflow: hidden;
  background:
    linear-gradient(rgba(19, 35, 31, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 35, 31, 0.035) 1px, transparent 1px),
    #f3f5f1;
  background-size: 26px 26px;
}

.time-world-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.time-world-state {
  position: absolute;
  top: 14px;
  left: 14px;
  display: grid;
  min-width: 152px;
  gap: var(--space-1);
  padding: var(--space-2-5) var(--space-3);
  border: 1px solid rgba(19, 35, 31, 0.14);
  border-left: 3px solid var(--time-tone);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 7px 20px rgba(19, 35, 31, 0.07);
}

.time-world-lab[data-direction="rewinding"] .time-world-state {
  border-left-color: var(--time-coral);
}

.time-world-state small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--type-dense-micro);
  font-weight: 700;
}

.time-world-state strong {
  color: var(--ink);
  font-size: var(--type-lede);
  line-height: 1.05;
}

.time-world-state span {
  color: var(--time-tone);
  font-family: var(--mono);
  font-size: var(--type-dense-compact);
  font-weight: 700;
}

.time-world-state code {
  margin-top: var(--space-half);
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--type-dense-micro);
}

.time-world-timeline {
  display: grid;
  height: 74px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2-5) var(--space-3-5) var(--space-2);
  border-top: 1px solid var(--line);
  background: #e9ede8;
}

.time-world-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1-5);
}

.time-world-actions button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.time-world-actions button:hover,
.time-world-actions button:focus-visible {
  border-color: var(--ink);
}

.time-world-actions svg {
  width: 11px;
  height: 11px;
}

.time-world-play {
  width: 34px !important;
  height: 34px !important;
}

.time-world-play[aria-pressed="true"] .time-icon-play,
.time-world-play[aria-pressed="false"] .time-icon-pause {
  display: none;
}

.time-world-slider {
  min-width: 0;
}

.time-world-slider input[type="range"] {
  width: 100%;
  height: 14px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
}

.time-world-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(to right, var(--time-coral), var(--time-tone));
}

.time-world-slider input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: calc(-1 * var(--space-1-5));
  appearance: none;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.time-world-slider input[type="range"]::-moz-range-track {
  height: 2px;
  border: 0;
  background: var(--line-strong);
}

.time-world-slider input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--ink);
}

.time-world-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-1-5);
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--type-dense-micro);
  font-weight: 700;
}

@container time-world (max-width: 500px) {
  .time-world-stage {
    height: 390px;
  }

  .time-world-timeline {
    height: 96px;
    grid-template-columns: 1fr;
    gap: var(--space-1-5);
  }

  .time-world-actions {
    justify-content: center;
  }

  .time-world-labels span:nth-child(2),
  .time-world-labels span:nth-child(4) {
    display: none;
  }
}

@media (max-width: 980px) {
  .home-page #time .section-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .time-world-lab * {
    animation: none !important;
  }
}
