/* Each line carries goods from its factory, along the conveyor, into its warehouse. */
.cc-production-lane {
  --line-accent: #829876;
  --line-floor: #edf2e3;
  --line-motion: running;
  --cargo-duration: 4s;
  /* Transparent pixels below the product base at its rendered 36px height. */
  --cargo-bottom-padding: 3.75px;
  --line-background: url('../public/art/production/handcraft-background-v1.webp');
  background: var(--line-background) center / cover no-repeat var(--line-floor);
}
.lane-food { --line-accent: #b88d6d; --line-floor: #f4ede1; --cargo-bottom-padding: 3.375px; --line-background: url('../public/art/production/food-background-v1.webp'); }
.lane-electronics { --line-accent: #7d9f9c; --line-floor: #e9f1ec; --line-background: url('../public/art/production/electronics-background-v1.webp'); }
.lane-precision { --line-accent: #879499; --line-floor: #eef0ea; --cargo-bottom-padding: 5.625px; --line-background: url('../public/art/production/precision-background-v1.webp'); }
.lane-textiles { --line-accent: #b58c79; --line-floor: #f3ece5; --cargo-bottom-padding: 5.625px; --line-background: url('../public/art/production/textiles-background-v1.webp'); }
.lane-energy { --line-accent: #8a9a68; --line-floor: #eff2df; --cargo-bottom-padding: 5.625px; --line-background: url('../public/art/production/energy-background-v1.webp'); }
.lane-power { --line-accent: #78966b; --line-floor: #eff2df; --line-background: url('../public/art/production/energy-background-v1.webp'); }
.cc-power-world { grid-template-columns: 96px minmax(0,1fr) 150px; align-items: center; }
.cc-power-generator { position: relative; width: 96px; height: 96px; }
.cc-power-generator .machine-art { display: block; width: 100%; height: 100%; }
.cc-power-generator img { filter: drop-shadow(0 2px 1px #34281752) drop-shadow(2px 4px 3px #34281740); }
.cc-power-grid { align-self: center; min-width: 0; color: #304d39; text-shadow: 0 1px #fff9; }
.cc-power-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 8px; font-size: 12px; }
.cc-power-caption strong { font-variant-numeric: tabular-nums; }
.cc-power-cable { height: 10px; margin-block: 12px; border: 1px solid #736c3d; border-radius: 2px; background: linear-gradient(#d4bd68,#8b8249 45%,#e4cd83 55%,#93834c); box-shadow: 0 2px 3px #34281740; }
.cc-power-status { display: block; font-size: 11px; line-height: 1.5; }
.cc-power-storage { display: grid; justify-items: center; grid-template-rows: 96px 28px; gap: 6px; padding: 0; color: #304d39; }
.power-storage-art { display: block; width: 96px; height: 96px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 1px #34281752) drop-shadow(2px 4px 3px #34281740); }
.cc-power-storage strong { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 3px; height: 100%; white-space: nowrap; font-size: 11px; font-variant-numeric: tabular-nums; }
.cc-power-charge { position: relative; width: 100%; height: 28px; overflow: hidden; border: 1px solid #a9b99b; border-radius: 5px; background: #e4eadb; box-shadow: inset 0 1px 2px #415c3c1a; }
.cc-power-charge i { position: absolute; inset: 0 auto 0 0; display: block; height: 100%; opacity: .65; background: linear-gradient(#94b372,#6d8c52); }
.cc-power-generator:focus-visible,.cc-power-storage:focus-visible { outline: 2px solid #8a632a; outline-offset: 3px; }
.lane-team { --line-background: url('../public/art/production/team-background-v1.webp'); --line-floor: #e4c59b; }
.cc-team-scene { height: 100%; min-height: 0; padding: 8px 14px; overflow: hidden; }
.cc-team-scene:focus-visible { outline: 2px solid #8a632a; outline-offset: -3px; }
.cc-team-members { display: flex; align-items: end; height: 100%; padding-inline: 26px; }
.cc-team-member { position: relative; z-index: 2; display: block; flex: 1 1 48px; min-width: 0; max-width: 48px; height: 96px; }
.cc-team-member:nth-child(even) { z-index: 1; transform: translateY(-24px); }
.cc-team-member .machine-art { position: absolute; bottom: 0; left: 50%; width: 96px; height: 96px; transform: translateX(-50%); }
.cc-team-member .machine-art > img { filter: drop-shadow(0 2px 1px #34281752) drop-shadow(2px 4px 3px #34281740); }
.cc-lane-caption { padding: 0; }
/* A compact paper ribbon keeps each title readable over its workshop scenery. */
.cc-lane-caption h3 {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0 9px;
  min-width: min(176px, 100%);
  max-width: 100%;
  min-height: 32px;
  padding: 5px 24px 5px 14px;
  color: var(--cc-ink);
  font-size: 14px;
  line-height: 1.5;
  text-shadow: 0 1px 0 #fff8e5;
  filter: drop-shadow(0 2px 2px #3b2c1b26);
}
.cc-lane-caption h3::before,
.cc-lane-caption h3::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.cc-lane-caption h3::before {
  z-index: -2;
  inset: 0;
  border-top: 1px solid #c6ac70;
  border-bottom: 1px solid #ad915c;
  background: linear-gradient(#fff7df, #e9dbb5 55%, #d8c594);
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%);
}
.cc-lane-caption h3::after {
  z-index: -1;
  inset: 4px 18px 4px 8px;
  border-top: 1px solid #b19b674d;
  border-bottom: 1px solid #b19b674d;
}
.cc-lane-caption h3 > span { color: #46563b; font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-lane-caption h3 > .cc-scale-capsule {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 20px; padding: 0 7px; flex-shrink: 0;
  border: 1px solid #95a17b; border-radius: 999px;
  background: linear-gradient(#f6f8e9, #dce5c7); color: #314b32;
  box-shadow: inset 0 1px 0 #fffff0, 0 1px 2px #46392026;
  font-size: 11px; font-weight: 700; line-height: 1; text-shadow: none;
}
.cc-material-warning[hidden], .cc-storage-warning[hidden] { display: none; }
.cc-production-lane.paused { --line-motion: paused; }
.cc-production-lane.paused.draining { --line-motion: running; }
.cc-production-lane.paused.draining :is(.cc-lane-conveyor > span, .cc-conveyor-tread, .cc-conveyor-wheel) { animation-play-state: running !important; }
.cc-production-lane.cargo-empty .cc-lane-conveyor > span,
.cc-lane-conveyor > .cargo-retired { visibility: hidden !important; }
.cc-lane-conveyor > .cargo-waiting { visibility: hidden; }
.production-hidden .cc-production-lane,
.production-hidden .cc-production-lane.paused.draining { --line-motion: paused; }
.production-hidden .cc-production-lane.paused.draining :is(.cc-lane-conveyor > span, .cc-conveyor-tread, .cc-conveyor-wheel) { animation-play-state: paused !important; }
.cc-lane-world {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 110px;
  align-items: start;
  gap: 10px;
  min-height: 146px;
  padding: 8px 14px;
  isolation: isolate;
  overflow: visible;
  background: transparent;
}
.cc-lane-factory { position: relative; grid-column: 1; display: grid; grid-template-rows: 96px auto; gap: 6px; min-width: 0; }
.cc-lane-factory .cc-factory-supply { display: grid; place-items: center; width: 100%; min-width: 0; height: 96px; padding: 0; margin: 0; }
.cc-material-stock { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 28px; }
.material-art { display: block; flex: 0 0 22px; width: 22px; height: 22px; object-fit: contain; pointer-events: none; }
.material-art > .icon { display: block; width: 100%; height: 100%; }
.cc-material-quantity { display: flex; justify-content: center; min-width: 0; padding: 4px 7px; border: 1px solid #c3cfaf; border-radius: 999px; color: #405a3b; background: #f1f5e7; font-size: 11px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cc-material-stock.is-empty .cc-material-quantity { color: #985b3b; border-color: #dec8ad; background: #fbf0df; }
.cc-material-warning, .cc-storage-warning { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid #fff2df; border-radius: 50%; color: #fff; background: #bd402d; box-shadow: 0 2px 5px #91312444; font-size: 20px; font-weight: 800; line-height: 1; }
.cc-storage-warning { top: 0; right: 0; z-index: 1; }
.cc-material-warning { z-index: 2; }
.cc-material-warning, .cc-storage-warning { cursor: help; }
.cc-material-warning:focus-visible, .cc-storage-warning:focus-visible { outline: 2px solid #8a632a; outline-offset: 3px; }
.cc-lane-machines {
  display: flex;
  align-items: end;
  gap: 2px;
  height: 96px;
  padding: 0;
  margin: 0;
  width: 100%;
}
.cc-lane-machine {
  display: block;
  flex: 1 1 0;
  max-width: 96px;
  min-width: 0;
  height: 96px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.machine-art, .machine-art > img { display: block; width: 100%; height: 100%; }
.machine-art > img { object-fit: contain; pointer-events: none; }
.cc-lane-factory .machine-art > img,
.cc-line-loading .warehouse-art {
  filter: drop-shadow(0 2px 1px #34281752) drop-shadow(3px 6px 4px #34281740);
}
.cc-lane-machine .cc-machine-light {
  top: auto;
  right: 19%;
  bottom: 21%;
  width: 4px;
  height: 4px;
  background: #b6d485;
  box-shadow: 0 0 0 1px #49604570, 0 0 5px #b6d48570;
  animation: cc-machine-light 2.8s ease-in-out infinite;
  animation-delay: var(--machine-phase, 0s);
  animation-play-state: var(--line-motion);
}
.cc-production-lane.paused .cc-machine-light {
  animation-play-state: paused;
  background: #c3a178;
  box-shadow: 0 0 0 1px #80674755;
}
.cc-lane-conveyor {
  position: relative;
  grid-column: 2;
  display: block;
  left: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  margin-top: 48px;
  height: 49px;
  border: 0;
  background: transparent;
  isolation: isolate;
  overflow: visible;
}
.cc-conveyor-belt {
  position: absolute;
  inset: auto 0 1px;
  height: 17px;
  overflow: hidden;
  border: 1px solid #62745b;
  border-radius: 8px;
  background: linear-gradient(#a5b698 0 7px, #819371 7px 9px, #c3ceaf 9px);
  box-shadow: 0 2px 0 #c4ccb760;
}
.cc-conveyor-tread {
  position: absolute;
  top: 1px;
  left: -18px;
  width: calc(100% + 18px);
  height: 6px;
  background: repeating-linear-gradient(90deg, #56694f 0 2px, #8d9e7c 2px 18px);
  animation: cc-belt-flow var(--belt-duration, 1.2s) linear infinite;
  animation-play-state: var(--line-motion);
}
.cc-conveyor-wheel {
  position: absolute;
  bottom: 1px;
  width: 13px;
  height: 13px;
  border: 2px solid #667653;
  border-radius: 50%;
  background: conic-gradient(#dbe1c9 0 25%, #8e9c78 25% 50%, #dbe1c9 50% 75%, #8e9c78 75%);
  animation: cc-roller-spin var(--roller-duration, 2.4s) linear infinite;
  animation-play-state: var(--line-motion);
}
.cc-conveyor-wheel-start { left: 2px; }
.cc-conveyor-wheel-end { right: 2px; }
.cc-lane-conveyor > span {
  position: absolute;
  top: auto;
  /* The visible product base rests at the center of the 6px moving tread. */
  bottom: calc(13px - var(--cargo-bottom-padding));
  left: 0;
  display: flex;
  align-items: end;
  justify-content: start;
  width: 40px;
  height: 36px;
  animation: cc-cargo var(--cargo-duration) linear infinite;
  animation-delay: 0s;
  animation-play-state: var(--line-motion);
}
.cargo-art {
  display: block;
  width: 40px;
  max-width: none;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
}
.cc-board-note { color: #617253; }
.cc-line-loading { position: relative; grid-column: 3; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; background: transparent; border: 0; }
.cc-feed .cc-line-loading { padding: 0; }
.cc-line-loading .cc-load-button { position: relative; display: grid; place-items: center; width: 100%; min-width: 0; height: 96px; min-height: 96px; margin: 0; padding: 0; white-space: normal; }
.warehouse-art { display: block; width: 96px; max-width: 100%; height: 96px; object-fit: contain; pointer-events: none; }
.cc-load-capacity { display: grid; text-align: center; color: #667654; font-size: 11px; }
.cc-load-caption { position: relative; z-index: 1; display: grid; place-content: center; height: 100%; padding: 3px; color: #263e21; line-height: 1.35; text-shadow: 0 1px 0 #ffffff80; }
.cc-load-count { display: block; font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cc-load-count > span:last-child { font-size: 11px; font-weight: 400; }
.cc-line-loading.is-full .cc-load-caption { color: #512f22; }
.cc-load-capacity-track { position: relative; display: block; width: 100%; height: 28px; overflow: hidden; border: 1px solid #a9b99b; border-radius: 5px; background: #e4eadb; box-shadow: inset 0 1px 2px #415c3c1a; }
.cc-load-capacity-track > i { position: absolute; inset: 0 auto 0 0; display: block; opacity: .65; height: 100%; border-radius: inherit; background: linear-gradient(#94b372,#6d8c52); }
.cc-load-capacity-track > .content-is-full { background: #bd694a; }

@keyframes cc-cargo {
  from { transform: translateX(0); }
  to { transform: translateX(var(--cargo-travel, 0px)); }
}
@keyframes cc-belt-flow { to { transform: translateX(18px); } }
@keyframes cc-roller-spin { to { transform: rotate(1turn); } }
@keyframes cc-machine-light { 50% { opacity: .45; } }
@container game-shell (max-width: 700px) {
  .cc-lane-world { grid-template-columns: 64px minmax(0, 1fr) 88px; gap: 10px; padding-left: 12px; padding-right: 12px; }
  .cc-line-loading { grid-column: 3; }
  .material-art { flex-basis: 18px; width: 18px; height: 18px; }
  .cc-material-quantity { padding: 4px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .cc-lane-conveyor > span { left: calc(var(--cargo-phase) / 5 * (100% - 40px)); width: 40px; }
  .cc-lane-conveyor > span:nth-of-type(n+7) { display: none; }
  .cc-lane-conveyor > span, .cc-conveyor-tread, .cc-conveyor-wheel,
  .cc-lane-machine .cc-machine-light { animation: none; }
}
