/* Artigo: processamento distribuído. Estilos restritos ao artigo e ao jogo. */
.pd-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.pd-flow > *,
.pd-lab {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid #9fcddd;
  border-radius: 1rem;
  background: #effaff;
  color: #163b52;
  overflow-wrap: anywhere;
}

.pd-flow > :nth-child(2) { background: #e8f9fc; }
.pd-lab { margin: 1.5rem 0; border-left: 5px solid #086b83; }

.pd-lab pre,
pre.pd-example,
.pd-example pre {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pd-lab pre code,
pre.pd-example code,
.pd-example pre code {
  min-width: 0;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#pd-game {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  margin: 2rem 0;
  padding: clamp(1rem, 4vw, 2rem);
  border: 2px solid #87bfda;
  border-radius: 1.25rem;
  background: #f0faff;
  color: #163b52;
  overflow-wrap: anywhere;
}

#pd-game *,
#pd-game *::before,
#pd-game *::after { box-sizing: border-box; min-width: 0; }

#pd-game h3,
#pd-game h4,
#pd-game p,
#pd-game output {
  color: #163b52;
  line-height: 1.65;
}

#pd-game #pd-progress {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #dceff9;
  color: #173c55;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#pd-game #pd-task {
  margin: 1rem 0;
  padding: 1rem;
  border-left: 4px solid #086b83;
  background: #fff;
  font-weight: 600;
}

#pd-game #pd-board,
#pd-game #pd-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

#pd-game .pd-sales { grid-column: 1 / -1; }
#pd-game .pd-part {
  padding: 1rem;
  border: 1px solid #87bfda;
  border-radius: 0.75rem;
  background: #fff;
}
#pd-game .pd-part h4 { margin: 0 0 0.5rem; }
#pd-game .pd-part p { margin: 0.5rem 0; }
#pd-game .pd-part-status,
#pd-game .pd-subtotal { font-weight: 700; }
#pd-game .pd-part[data-status="ready"] { border: 2px solid #12634d; background: #e1f5ed; }
#pd-game .pd-part[data-status="failed"] { border: 2px dashed #985118; background: #fff2e5; }

#pd-game button {
  min-height: 48px;
  max-width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid #337c9c;
  border-radius: 0.75rem;
  background: #e4f5fc;
  color: #163b52;
  font: inherit;
  font-weight: 700;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  touch-action: manipulation;
}

#pd-game button:hover { background: #cdeaf8; border-color: #164965; }
#pd-game button:focus-visible,
#pd-game #pd-task:focus { outline: 3px solid #193d80; outline-offset: 4px; }
#pd-game #pd-reset { background: #fff; }
#pd-game #pd-feedback { margin: 1rem 0; min-height: 3rem; line-height: 1.65; }
#pd-game #pd-feedback.pd-error,
#pd-game #pd-feedback.pd-success {
  padding: 1rem;
  border: 1px solid #985118;
  border-radius: 0.75rem;
  background: #fff2e5;
  color: #713c13;
}
#pd-game #pd-feedback.pd-success { border-color: #12634d; background: #e1f5ed; color: #14523f; }
#pd-game #pd-total { font-weight: 700; font-variant-numeric: tabular-nums; }
#pd-game [hidden] { display: none !important; }

@media (max-width: 640px) {
  .pd-flow,
  #pd-game #pd-board,
  #pd-game #pd-controls { grid-template-columns: 1fr; }
  #pd-game button { width: 100%; }
}
